Skip to contentSkip to conversation

mfd: Add support for UP board CPLD/FPGA

PATCH Superseded chengwei 1 participant 1 message Oct 4, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

chengwei

author
#0 lore raw

PATCH 1/1 mfd: Add support for UP board CPLD/FPGA

The UP Squared board <http://www.upboard.com> implements certain features (pin control, onboard LEDs or CEC) through an on-board CPLD/FPGA.

This mfd driver implements the line protocol to read and write registers from the FPGA through regmap. The register address map is also included.

The UP Boards provide a few I/O pin headers (for both GPIO and functions), including a 40-pin Raspberry Pi compatible header.

This patch implements support for the FPGA-based pin controller that manages direction and enable state for those header pins.

Partial support UP boards:
* UP core + CREX
* UP core + CRST02

---
 drivers/mfd/Kconfig              |  11 +
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/upboard-fpga.c       | 482 +++++++++++++++++++++++++++++++
 include/linux/mfd/upboard-fpga.h |  49 ++++
 4 files changed, 543 insertions(+)
 create mode 100644 drivers/mfd/upboard-fpga.c
 create mode 100644 include/linux/mfd/upboard-fpga.h
drivers/mfd/Kconfig +11 -0
index abb58ab1a1a4..f86e264eb4f3 100644
@@ -2104,6 +2104,17 @@ config MFD_QCOM_PM8008
 	  under it in the device tree. Additional drivers must be enabled in
 	  order to use the functionality of the device.
 
+config MFD_UPBOARD_FPGA
+	tristate "Support for the UP board FPGA"
+	select MFD_CORE
+	help
+	  Select this option to enable the UP and UP^2 on-board FPGA. The UP
+	  board implements certain features (pin control, onboard LEDs or CEC)
+	  through an on-board FPGA.
+
+	  To compile this driver as a module, choose M here: the module will be
+	  called upboard-fpga.
+
 menu "Multimedia Capabilities Port drivers"
 	depends on ARCH_SA1100
 
drivers/mfd/Makefile +1 -0
index 858cacf659d6..d9d10e3664f7 100644
@@ -250,6 +250,7 @@ obj-$(CONFIG_MFD_ALTERA_A10SR)	+= altera-a10sr.o
 obj-$(CONFIG_MFD_ALTERA_SYSMGR) += altera-sysmgr.o
 obj-$(CONFIG_MFD_STPMIC1)	+= stpmic1.o
 obj-$(CONFIG_MFD_SUN4I_GPADC)	+= sun4i-gpadc.o
+obj-$(CONFIG_MFD_UPBOARD_FPGA)	+= upboard-fpga.o
 
 obj-$(CONFIG_MFD_STM32_LPTIMER)	+= stm32-lptimer.o
 obj-$(CONFIG_MFD_STM32_TIMERS) 	+= stm32-timers.o
drivers/mfd/upboard-fpga.c new file +482 -0

482 lines not on this page · raw message

include/linux/mfd/upboard-fpga.h new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.17.1