add Intel Max10 BMC chip support
Subsystems (2)
Xu Yilun
maintainercover add Intel Max10 BMC chip support
This patchset add basic functions for Intel Max10 BMC chip. Patch #1 implements the main feature.
Patch #2 is a fix for the HW issue lies in the "SPI Slave to Avalon Master bridge" IP block, which is used for communication between host and the BMC chip.
Matthew Gerlach (1):
mfd: intel-m10-bmc: start with the last SOP on phy rx buffer parsing
Xu Yilun (1):
mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC
.../ABI/testing/sysfs-driver-intel-m10-bmc | 15 + drivers/mfd/Kconfig | 13 + drivers/mfd/Makefile | 3 + drivers/mfd/intel-m10-bmc-main.c | 176 ++++ drivers/mfd/intel-spi-avmm.c | 904 +++++++++++++++++++++ drivers/mfd/intel-spi-avmm.h | 35 + include/linux/mfd/intel-m10-bmc.h | 57 ++ 7 files changed, 1203 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc create mode 100644 drivers/mfd/intel-m10-bmc-main.c create mode 100644 drivers/mfd/intel-spi-avmm.c create mode 100644 drivers/mfd/intel-spi-avmm.h create mode 100644 include/linux/mfd/intel-m10-bmc.h
Signature · 1 line
2.7.4
Xu Yilun
maintainerPATCH 1/2 mfd: intel-m10-bmc: add Max10 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 max10 CPLD.
This BMC chip is connected to FPGA by a SPI bus. To provide reliable register access from FPGA, an Avalon Memory-Mapped (Avmm) transaction protocol over the SPI bus is used between host and slave.
This driver implements the basic register access with the regmap framework. The mfd cells array is empty now as a placeholder.
--- .../ABI/testing/sysfs-driver-intel-m10-bmc | 15 + drivers/mfd/Kconfig | 13 + drivers/mfd/Makefile | 3 + drivers/mfd/intel-m10-bmc-main.c | 176 ++++ drivers/mfd/intel-spi-avmm.c | 904 +++++++++++++++++++++ drivers/mfd/intel-spi-avmm.h | 35 + include/linux/mfd/intel-m10-bmc.h | 57 ++ 7 files changed, 1203 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc create mode 100644 drivers/mfd/intel-m10-bmc-main.c create mode 100644 drivers/mfd/intel-spi-avmm.c create mode 100644 drivers/mfd/intel-spi-avmm.h create mode 100644 include/linux/mfd/intel-m10-bmc.h
Documentation/ABI/testing/sysfs-driver-intel-m10-bmc new file +15 -0
@@ -0,0 +1,15 @@ +What: /sys/bus/spi/devices/.../bmc_version +Date: June 2020 +KernelVersion: 5.9 +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.9 +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
@@ -2130,5 +2130,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 MAX10 board management controller" + depends on SPI_MASTER + select REGMAP + select MFD_CORE + help + Support for the Intel MAX10 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 +3 -0
@@ -265,3 +265,6 @@ obj-$(CONFIG_MFD_STMFX) += stmfx.o obj-$(CONFIG_MFD_KHADAS_MCU) += khadas-mcu.o obj-$(CONFIG_SGI_MFD_IOC3) += ioc3.o + +intel-m10-bmc-objs := intel-m10-bmc-main.o intel-spi-avmm.o +obj-$(CONFIG_MFD_INTEL_M10_BMC) += intel-m10-bmc.o
drivers/mfd/intel-m10-bmc-main.c new file +176 -0
176 lines not on this page · raw message
drivers/mfd/intel-spi-avmm.c new file +904 -0
904 lines not on this page · raw message
drivers/mfd/intel-spi-avmm.h new file +35 -0
@@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Driver Header File for Intel SPI Slave to AVMM Bus Bridge +* +* Copyright (C) 2018-2020 Intel Corporation. All rights reserved. +* +*/ + +#ifndef __INTEL_SPI_AVMM_H +#define __INTEL_SPI_AVMM_H + +#include <linux/spi/spi.h> +#include <linux/regmap.h> + +struct regmap *__devm_regmap_init_spi_avmm (struct spi_device *spi, +const struct regmap_config *config, +struct lock_class_key *lock_key, +const char *lock_name); + +/** +* devm_regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave +* to AVMM Bus Bridge +* +* @spi: Device that will be interacted with +* @config: Configuration for register map +* +* The return value will be an ERR_PTR() on error or a valid pointer +* to a struct regmap. The map will be automatically freed by the +* device management code. +*/ +#define devm_regmap_init_spi_avmm (spi, config) \ + __regmap_lockdep_wrapper(__devm_regmap_init_spi_avmm, #config, \ + spi, config) + +#endif /* __INTEL_SPI_AVMM_H */
include/linux/mfd/intel-m10-bmc.h new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
2.7.4
Re: [PATCH 1/2] mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC
Quoted 16 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 max10 CPLD.
This BMC chip is connected to FPGA by a SPI bus. To provide reliable register access from FPGA, an Avalon Memory-Mapped (Avmm) transaction protocol over the SPI bus is used between host and slave.
This driver implements the basic register access with the regmap framework. The mfd cells array is empty now as a placeholder.
Signed-off-by Xu Yilun <[email protected]>Signed-off-by Wu Hao <[email protected]>Signed-off-by Matthew Gerlach <[email protected]>Signed-off-by Russ Weight <[email protected]>Signed-off-by Tom Rix <[email protected]>
Quoted 7 lines
--- .../ABI/testing/sysfs-driver-intel-m10-bmc | 15 + drivers/mfd/Kconfig | 13 + drivers/mfd/Makefile | 3 + drivers/mfd/intel-m10-bmc-main.c | 176 ++++drivers/mfd/intel-spi-avmm.c | 904 +++++++++++++++++++++
This does not belong in MFD.
Please consider moving it to drivers/spi.
Quoted 8 lines
drivers/mfd/intel-spi-avmm.h | 35 + include/linux/mfd/intel-m10-bmc.h | 57 ++ 7 files changed, 1203 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc create mode 100644 drivers/mfd/intel-m10-bmc-main.c create mode 100644 drivers/mfd/intel-spi-avmm.c create mode 100644 drivers/mfd/intel-spi-avmm.h create mode 100644 include/linux/mfd/intel-m10-bmc.h
Signature · 4 lines
Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Xu Yilun
maintainerRe: [PATCH 1/2] mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC
Quoted 24 lines · Lee Jones
Quoted 21 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 max10 CPLD.
This BMC chip is connected to FPGA by a SPI bus. To provide reliable register access from FPGA, an Avalon Memory-Mapped (Avmm) transaction protocol over the SPI bus is used between host and slave.
This driver implements the basic register access with the regmap framework. The mfd cells array is empty now as a placeholder.
Signed-off-by Xu Yilun <[email protected]>Signed-off-by Wu Hao <[email protected]>Signed-off-by Matthew Gerlach <[email protected]>Signed-off-by Russ Weight <[email protected]>Signed-off-by Tom Rix <[email protected]>--- .../ABI/testing/sysfs-driver-intel-m10-bmc | 15 + drivers/mfd/Kconfig | 13 + drivers/mfd/Makefile | 3 + drivers/mfd/intel-m10-bmc-main.c | 176 ++++
Quoted 5 lines
Quoted 1 line
drivers/mfd/intel-spi-avmm.c | 904 +++++++++++++++++++++This does not belong in MFD.
Please consider moving it to
drivers/spi.
OK, I could make the intel-spi-avmm.c as a separate module in other folder.
Since it is an implementation of regmap, is it better we move it to drivers/base/regmap?
Quoted 15 lines
Quoted 9 lines
drivers/mfd/intel-spi-avmm.h | 35 + include/linux/mfd/intel-m10-bmc.h | 57 ++ 7 files changed, 1203 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc create mode 100644 drivers/mfd/intel-m10-bmc-main.c create mode 100644 drivers/mfd/intel-spi-avmm.c create mode 100644 drivers/mfd/intel-spi-avmm.h create mode 100644 include/linux/mfd/intel-m10-bmc.hSignature · 4 lines
Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Re: [PATCH 1/2] mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC
Quoted 29 lines · Xu Yilun
Quoted 28 lines · Lee Jones
Quoted 16 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 max10 CPLD.
This BMC chip is connected to FPGA by a SPI bus. To provide reliable register access from FPGA, an Avalon Memory-Mapped (Avmm) transaction protocol over the SPI bus is used between host and slave.
This driver implements the basic register access with the regmap framework. The mfd cells array is empty now as a placeholder.
Signed-off-by Xu Yilun <[email protected]>Signed-off-by Wu Hao <[email protected]>Signed-off-by Matthew Gerlach <[email protected]>Signed-off-by Russ Weight <[email protected]>Signed-off-by Tom Rix <[email protected]>Quoted 7 lines
--- .../ABI/testing/sysfs-driver-intel-m10-bmc | 15 + drivers/mfd/Kconfig | 13 + drivers/mfd/Makefile | 3 + drivers/mfd/intel-m10-bmc-main.c | 176 ++++drivers/mfd/intel-spi-avmm.c | 904 +++++++++++++++++++++This does not belong in MFD.
Quoted 7 lines
Quoted 1 line
Please consider moving it to
drivers/spi.OK, I could make the
intel-spi-avmm.cas a separate module in other folder.Since it is an implementation of regmap, is it better we move it to
drivers/base/regmap?
Either way, you need to speak to Mark Brown.
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
drivers/mfd/intel-spi-avmm.h | 35 + include/linux/mfd/intel-m10-bmc.h | 57 ++ 7 files changed, 1203 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc create mode 100644 drivers/mfd/intel-m10-bmc-main.c create mode 100644 drivers/mfd/intel-spi-avmm.c create mode 100644 drivers/mfd/intel-spi-avmm.h create mode 100644 include/linux/mfd/intel-m10-bmc.h
Signature · 4 lines
Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Xu Yilun
maintainerRe: [PATCH 1/2] mfd: intel-m10-bmc: add Max10 BMC chip support for Intel FPGA PAC
Quoted 33 lines · Lee Jones
Quoted 31 lines · Xu Yilun
Quoted 29 lines · Lee Jones
Quoted 16 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 max10 CPLD.
This BMC chip is connected to FPGA by a SPI bus. To provide reliable register access from FPGA, an Avalon Memory-Mapped (Avmm) transaction protocol over the SPI bus is used between host and slave.
This driver implements the basic register access with the regmap framework. The mfd cells array is empty now as a placeholder.
Signed-off-by Xu Yilun <[email protected]>Signed-off-by Wu Hao <[email protected]>Signed-off-by Matthew Gerlach <[email protected]>Signed-off-by Russ Weight <[email protected]>Signed-off-by Tom Rix <[email protected]>Quoted 7 lines
--- .../ABI/testing/sysfs-driver-intel-m10-bmc | 15 + drivers/mfd/Kconfig | 13 + drivers/mfd/Makefile | 3 + drivers/mfd/intel-m10-bmc-main.c | 176 ++++drivers/mfd/intel-spi-avmm.c | 904 +++++++++++++++++++++This does not belong in MFD.
Please consider moving it to
drivers/spi.
Quoted 7 lines
Quoted 5 lines
OK, I could make the
intel-spi-avmm.cas a separate module in other folder.Since it is an implementation of regmap, is it better we move it to
drivers/base/regmap?Either way, you need to speak to Mark Brown.
Thanks for your suggestion, I'll contact him.
Yilun.
Quoted 16 lines
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
drivers/mfd/intel-spi-avmm.h | 35 + include/linux/mfd/intel-m10-bmc.h | 57 ++ 7 files changed, 1203 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-driver-intel-m10-bmc create mode 100644 drivers/mfd/intel-m10-bmc-main.c create mode 100644 drivers/mfd/intel-spi-avmm.c create mode 100644 drivers/mfd/intel-spi-avmm.h create mode 100644 include/linux/mfd/intel-m10-bmc.hSignature · 4 lines
Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog
Xu Yilun
maintainerPATCH 2/2 mfd: intel-m10-bmc: start with the last SOP on phy rx buffer parsing
In reply to Xu YilunFrom: Matthew Gerlach <[email protected]>
This patch works around a bug in the SPI Slave to Avalon Master bridge. The SPI slave will send an unexpected extra SOP in the following case.
One in approximately one million read requests results in an apparant stall on the avalon bus where the SPI slave inserts IDLE characters. When the stall is over, the slave sends an extra SOP character instead of the 0x7c indicating channel. The other characters are correct.
To eliminate the impact of the bug, this patch changes to look for the last SOP as the start point of the valid phy rx data.
--- drivers/mfd/intel-spi-avmm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/mfd/intel-spi-avmm.c +5 -5
@@ -431,14 +431,14 @@ static int pkt_phy_rx_parse(struct device *dev, {char *b, *p; - b = phy_buf; p = trans_buf; -/* Find the SOP */ -while (b < phy_buf + phy_len && *b !=PKT_SOP ) - b++; +/* Find the last SOP */ + b = (phy_buf + phy_len) -1 ; +while (b >= phy_buf && *b !=PKT_SOP ) + b--; -if (b >= phy_buf + phy_len) { +if (b < phy_buf) {dev_err (dev,"%s no SOP\n" , __func__);return -EINVAL ; }
Signature · 1 line
2.7.4