Lines Matching +full:fpga +full:- +full:slave +full:- +full:serial

1 // SPDX-License-Identifier: GPL-2.0
3 * Lattice MachXO2 Slave SPI Driver
5 * Manage Lattice FPGA firmware that is loaded over SPI using
6 * the slave serial configuration interface.
12 #include <linux/fpga/fpga-mgr.h>
18 /* MachXO2 Programming Guide - sysCONFIG Programming Commands */
29 * Max CCLK in Slave SPI mode according to 'MachXO2 Family Data
30 * Sheet' sysCONFIG Port Timing Specifications (3-36)
112 pr_debug("machxo2 status: 0x%08lX - done=%d, cfgena=%d, busy=%d, fail=%d, devver=%d, err=%s\n", in dump_status_reg()
129 return -EBUSY; in wait_until_not_busy()
137 struct spi_device *spi = mgr->priv; in machxo2_cleanup()
169 dev_err(&mgr->dev, "Cleanup failed\n"); in machxo2_cleanup()
176 struct spi_device *spi = mgr->priv; in machxo2_spi_state()
191 struct spi_device *spi = mgr->priv; in machxo2_write_init()
200 if ((info->flags & FPGA_MGR_PARTIAL_RECONFIG)) { in machxo2_write_init()
201 dev_err(&mgr->dev, in machxo2_write_init()
203 return -ENOTSUPP; in machxo2_write_init()
229 ret = -EINVAL; in machxo2_write_init()
247 dev_err(&mgr->dev, "Error during FPGA init.\n"); in machxo2_write_init()
255 struct spi_device *spi = mgr->priv; in machxo2_write()
264 dev_err(&mgr->dev, "Malformed payload.\n"); in machxo2_write()
265 return -EINVAL; in machxo2_write()
281 dev_err(&mgr->dev, "Error loading the bitstream.\n"); in machxo2_write()
294 struct spi_device *spi = mgr->priv; in machxo2_write_complete()
318 ret = -EINVAL; in machxo2_write_complete()
341 ret = -EINVAL; in machxo2_write_complete()
351 dev_err(&mgr->dev, "Refresh failed.\n"); in machxo2_write_complete()
365 struct device *dev = &spi->dev; in machxo2_spi_probe()
368 if (spi->max_speed_hz > MACHXO2_MAX_SPEED) { in machxo2_spi_probe()
370 return -EINVAL; in machxo2_spi_probe()
373 mgr = devm_fpga_mgr_register(dev, "Lattice MachXO2 SPI FPGA Manager", in machxo2_spi_probe()
380 { .compatible = "lattice,machxo2-slave-spi", },
387 { "machxo2-slave-spi", 0 },
394 .name = "machxo2-slave-spi",
404 MODULE_DESCRIPTION("Load Lattice FPGA firmware over SPI");