Skip to contentSkip to conversation

fpga: Lattice MachXO2 Slave SPI FPGA Manager support

PATCH New Alan Tull 1 participant 3 messages Apr 12, 2018

Subsystems (2)
lore
Share & tools
lore

Alan Tull

author
#0 lore raw

v11 cover fpga: Lattice MachXO2 Slave SPI FPGA Manager support

This is Paolo's v10 with a minor fixup. I had asked him to rebase his patch on a branch with a new FPGA manager API. That API change ended up not going upstream, so I've fixed it for the current API. This patch applies cleanly on the current linux-next.

Paolo Pisati (2):
dt: bindings: fpga: add lattice machxo2 slave spi binding description
fpga: lattice machxo2: Add Lattice MachXO2 support

 .../bindings/fpga/lattice-machxo2-spi.txt          |  29 ++
 drivers/fpga/Kconfig                               |   7 +
 drivers/fpga/Makefile                              |   1 +
 drivers/fpga/machxo2-spi.c                         | 403 +++++++++++++++++++++
 4 files changed, 440 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
 create mode 100644 drivers/fpga/machxo2-spi.c
Signature · 1 line
2.16.2
author
#1 lore raw

PATCH v11 1/2 dt: bindings: fpga: add lattice machxo2 slave spi binding description

From: Paolo Pisati <[email protected]>

Add dt binding documentation details for Lattice MachXO2 FPGA configuration over Slave SPI interface.

---
 .../bindings/fpga/lattice-machxo2-spi.txt          | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt
Documentation/devicetree/bindings/fpga/lattice-machxo2-spi.txt new file +29 -0
new file mode 100644
index 000000000000..a8c362eb160c
@@ -0,0 +1,29 @@
+Lattice MachXO2 Slave SPI FPGA Manager
+
+Lattice MachXO2 FPGAs support a method of loading the bitstream over
+'slave SPI' interface.
+
+See 'MachXO2ProgrammingandConfigurationUsageGuide.pdf' on www.latticesemi.com
+
+Required properties:
+- compatible: should contain "lattice,machxo2-slave-spi"
+- reg: spi chip select of the FPGA
+
+Example for full FPGA configuration:
+
+	fpga-region0 {
+		compatible = "fpga-region";
+		fpga-mgr = <&fpga_mgr_spi>;
+		#address-cells = <0x1>;
+		#size-cells = <0x1>;
+	};
+
+	spi1: spi@2000 {
+        ...
+
+		fpga_mgr_spi: fpga-mgr@0 {
+			compatible = "lattice,machxo2-slave-spi";
+			spi-max-frequency = <8000000>;
+			reg = <0>;
+		};
+	};
Signature · 1 line
2.16.2
author
#2 lore raw

PATCH v11 2/2 fpga: lattice machxo2: Add Lattice MachXO2 support

In reply to Alan Tull

From: Paolo Pisati <[email protected]>

This patch adds support to the FPGA manager for programming MachXO2 device’s internal flash memory, via slave SPI.

[[email protected]: use existing FPGA mgr API]
---
 drivers/fpga/Kconfig       |   7 +
 drivers/fpga/Makefile      |   1 +
 drivers/fpga/machxo2-spi.c | 403 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 411 insertions(+)
 create mode 100644 drivers/fpga/machxo2-spi.c
drivers/fpga/Kconfig +7 -0
index f47ef848bcd0..53d3f5514775 100644
@@ -70,6 +70,13 @@ config FPGA_MGR_ICE40_SPI
 	help
 	  FPGA manager driver support for Lattice iCE40 FPGAs over SPI.
 
+config FPGA_MGR_MACHXO2_SPI
+	tristate "Lattice MachXO2 SPI"
+	depends on SPI
+	help
+	  FPGA manager driver support for Lattice MachXO2 configuration
+	  over slave SPI interface.
+
 config FPGA_MGR_TS73XX
 	tristate "Technologic Systems TS-73xx SBC FPGA Manager"
 	depends on ARCH_EP93XX && MACH_TS72XX
drivers/fpga/Makefile +1 -0
index 3cb276a0f88d..f9803dad6919 100644
@@ -10,6 +10,7 @@ obj-$(CONFIG_FPGA)			+= fpga-mgr.o
 obj-$(CONFIG_FPGA_MGR_ALTERA_CVP)	+= altera-cvp.o
 obj-$(CONFIG_FPGA_MGR_ALTERA_PS_SPI)	+= altera-ps-spi.o
 obj-$(CONFIG_FPGA_MGR_ICE40_SPI)	+= ice40-spi.o
+obj-$(CONFIG_FPGA_MGR_MACHXO2_SPI)	+= machxo2-spi.o
 obj-$(CONFIG_FPGA_MGR_SOCFPGA)		+= socfpga.o
 obj-$(CONFIG_FPGA_MGR_SOCFPGA_A10)	+= socfpga-a10.o
 obj-$(CONFIG_FPGA_MGR_TS73XX)		+= ts73xx-fpga.o
drivers/fpga/machxo2-spi.c new file +403 -0

403 lines not on this page · raw message

Signature · 1 line
2.16.2