Lines Matching +full:fpga +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Technologic Systems TS-73xx SBC FPGA loader
7 * FPGA Manager Driver for the on-board Altera Cyclone II FPGA found on
8 * TS-7300, heavily based on load_fpga.c in their vendor tree.
17 #include <linux/fpga/fpga-mgr.h>
39 struct ts73xx_fpga_priv *priv = mgr->priv; in ts73xx_fpga_write_init()
41 /* Reset the FPGA */ in ts73xx_fpga_write_init()
42 writeb(0, priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_init()
44 writeb(TS73XX_FPGA_RESET, priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_init()
53 struct ts73xx_fpga_priv *priv = mgr->priv; in ts73xx_fpga_write()
58 while (count--) { in ts73xx_fpga_write()
59 ret = readb_poll_timeout(priv->io_base + TS73XX_FPGA_CONFIG_REG, in ts73xx_fpga_write()
65 writeb(buf[i], priv->io_base + TS73XX_FPGA_DATA_REG); in ts73xx_fpga_write()
75 struct ts73xx_fpga_priv *priv = mgr->priv; in ts73xx_fpga_write_complete()
79 reg = readb(priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_complete()
81 writeb(reg, priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_complete()
84 reg = readb(priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_complete()
86 writeb(reg, priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_complete()
88 reg = readb(priv->io_base + TS73XX_FPGA_CONFIG_REG); in ts73xx_fpga_write_complete()
90 return -ETIMEDOUT; in ts73xx_fpga_write_complete()
103 struct device *kdev = &pdev->dev; in ts73xx_fpga_probe()
109 return -ENOMEM; in ts73xx_fpga_probe()
111 priv->dev = kdev; in ts73xx_fpga_probe()
113 priv->io_base = devm_platform_ioremap_resource(pdev, 0); in ts73xx_fpga_probe()
114 if (IS_ERR(priv->io_base)) in ts73xx_fpga_probe()
115 return PTR_ERR(priv->io_base); in ts73xx_fpga_probe()
117 mgr = devm_fpga_mgr_register(kdev, "TS-73xx FPGA Manager", in ts73xx_fpga_probe()
124 .name = "ts73xx-fpga-mgr",
131 MODULE_DESCRIPTION("TS-73xx FPGA Manager driver");