Skip to contentSkip to conversation

mfd: intel-m10-bmc: add Intel MAX 10 BMC chip support for Intel FPGA PAC

PATCH Superseded Xu Yilun 2 participants 2 messages Sep 7, 2020 – Sep 8, 2020

Subsystems (2)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Xu Yilun

author maintainer
#0 lore raw

PATCH v5 1/1 mfd: intel-m10-bmc: add Intel MAX 10 BMC chip support for Intel FPGA PAC

This patch implements the basic functions of the BMC chip for some Intel FPGA PCIe Acceleration Cards (PAC). The BMC is implemented using the Intel MAX 10 CPLD.

This BMC chip is connected to the FPGA by a SPI bus. To provide direct register access from the FPGA, the "SPI slave to Avalon Master Bridge" (spi-avmm) IP is integrated in the chip. It converts encoded streams of bytes from the host to the internal register read/write on the Avalon bus. So This driver uses the regmap-spi-avmm for register accessing.

---
v2: Split out the regmap-spi-avmm part.
Rename the file intel-m10-bmc-main.c to intel-m10-bmc.c, cause
there is only one source file left for this module now.
v3: Add the sub devices in mfd_cell.
Some minor fixes.
v4: No change.
v5: Changes the names of mfd_cell.
Use ATTRIBUTE_GROUPS() to simplify the code.
Use the generic 'ddata' for the instance of struct intel_m10bmc. More comments to clarify the function check_m10bmc_version(). Some minor fixes.

---
 .../ABI/testing/sysfs-driver-intel-m10-bmc         |  15 ++
 drivers/mfd/Kconfig                                |  13 ++
 drivers/mfd/Makefile                               |   2 +
 drivers/mfd/intel-m10-bmc.c                        | 162 +++++++++++++++++++++
 include/linux/mfd/intel-m10-bmc.h                  |  56 +++++++
 5 files changed, 248 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc
 create mode 100644 drivers/mfd/intel-m10-bmc.c
 create mode 100644 include/linux/mfd/intel-m10-bmc.h
Documentation/ABI/testing/sysfs-driver-intel-m10-bmc new file +15 -0
new file mode 100644
index 0000000..979a2d6
@@ -0,0 +1,15 @@
+What:		/sys/bus/spi/devices/.../bmc_version
+Date:		June 2020
+KernelVersion:	5.10
+Contact:	Xu Yilun <[email protected]>
+Description:	Read only. Returns the hardware build version of Intel
+		MAX10 BMC chip.
+		Format: "0x%x".
+
+What:		/sys/bus/spi/devices/.../bmcfw_version
+Date:		June 2020
+KernelVersion:	5.10
+Contact:	Xu Yilun <[email protected]>
+Description:	Read only. Returns the firmware version of Intel MAX10
+		BMC chip.
+		Format: "0x%x".
drivers/mfd/Kconfig +13 -0
index 2310959..7b2252c 100644
@@ -2118,5 +2118,18 @@ config SGI_MFD_IOC3
 	  If you have an SGI Origin, Octane, or a PCI IOC3 card,
 	  then say Y. Otherwise say N.
 
+config MFD_INTEL_M10_BMC
+	tristate "Intel MAX 10 Board Management Controller"
+	depends on SPI_MASTER
+	select REGMAP_SPI_AVMM
+	select MFD_CORE
+	help
+	  Support for the Intel MAX 10 board management controller using the
+	  SPI interface.
+
+	  This driver provides common support for accessing the device,
+	  additional drivers must be enabled in order to use the functionality
+	  of the device.
+
 endmenu
 endif
drivers/mfd/Makefile +2 -0
index a60e5f8..dd2cc7b 100644
@@ -264,3 +264,5 @@ obj-$(CONFIG_MFD_STMFX) 	+= stmfx.o
 obj-$(CONFIG_MFD_KHADAS_MCU) 	+= khadas-mcu.o
 
 obj-$(CONFIG_SGI_MFD_IOC3)	+= ioc3.o
+
+obj-$(CONFIG_MFD_INTEL_M10_BMC)   += intel-m10-bmc.o
drivers/mfd/intel-m10-bmc.c new file +162 -0

162 lines not on this page · raw message

include/linux/mfd/intel-m10-bmc.h new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw
Quoted 27 lines · Xu Yilun

This patch implements the basic functions of the BMC chip for some Intel FPGA PCIe Acceleration Cards (PAC). The BMC is implemented using the Intel MAX 10 CPLD.

This BMC chip is connected to the FPGA by a SPI bus. To provide direct register access from the FPGA, the "SPI slave to Avalon Master Bridge" (spi-avmm) IP is integrated in the chip. It converts encoded streams of bytes from the host to the internal register read/write on the Avalon bus. So This driver uses the regmap-spi-avmm for register accessing.

---
v2: Split out the regmap-spi-avmm part.
Rename the file intel-m10-bmc-main.c to intel-m10-bmc.c, cause
there is only one source file left for this module now.
v3: Add the sub devices in mfd_cell.
Some minor fixes.
v4: No change.
v5: Changes the names of mfd_cell.
Use ATTRIBUTE_GROUPS() to simplify the code.
Use the generic 'ddata' for the instance of struct intel_m10bmc. More comments to clarify the function check_m10bmc_version(). Some minor fixes.

Quoted 10 lines
---
 .../ABI/testing/sysfs-driver-intel-m10-bmc         |  15 ++
 drivers/mfd/Kconfig                                |  13 ++
 drivers/mfd/Makefile                               |   2 +
 drivers/mfd/intel-m10-bmc.c                        | 162 +++++++++++++++++++++
 include/linux/mfd/intel-m10-bmc.h                  |  56 +++++++
 5 files changed, 248 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc
 create mode 100644 drivers/mfd/intel-m10-bmc.c
 create mode 100644 include/linux/mfd/intel-m10-bmc.h

Please see my replies for v4.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog