Skip to contentSkip to conversation

soc/aspeed: Add host side BMC device driver

PATCH In review Ninad Palsule 2 participants 4 messages Sep 12, 2023 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

v3 cover soc/aspeed: Add host side BMC device driver

Hello,
Please review a version 3 of patchset.
- Fixed warning reported by kernel test robot.
- Added MAINTAINER for new file.
- Fixed check patch warning.

Ninad Palsule (2):
soc/aspeed: Add host side BMC device driver
MAINTAINERS: Added maintainer for host bmc DD

 MAINTAINERS                              |   7 +
 drivers/soc/aspeed/Kconfig               |  11 +
 drivers/soc/aspeed/Makefile              |   1 +
 drivers/soc/aspeed/aspeed-host-bmc-dev.c | 250 +++++++++++++++++++++++
 4 files changed, 269 insertions(+)
 create mode 100644 drivers/soc/aspeed/aspeed-host-bmc-dev.c
Signature · 1 line
2.39.2
#1 lore raw

PATCH v3 1/2 soc/aspeed: Add host side BMC device driver

Taken from ASPEED's 5.15 SDK kernel.

The AST2600 supports 2 VUARTs over LPC bus and 2 over PCIe bus. This patch adds host side driver for PCIe based VUARTs.

Testing:
- This is tested on IBM rainier system with BMC. It requires BMC side BMC device driver which is available in the ASPEED's 5.15 SDK kernel. Also it is working only with legacy interrupt. TODO: MSI interrupt handling.

[    1.313775][  T985] ASPEED BMC DEVICE 0002:02:01.0: enabling device (0140 -> 0142)
[    1.314381][  T985] 0002:02:01.0: ttyS0 at MMIO 0x600c100100fe0 (irq = 91, base_baud = 115200) is a 16550A
[    1.314607][  T985] 0002:02:01.0: ttyS1 at MMIO 0x600c100100be0 (irq = 91, base_baud = 115200) is a 16550A

- The host is loaded through IBM openpower petitboot boot loaded.
- Character echoed from BMC tty device seen on the host side tty device and vice versa.
- BMC side
root at p10bmc:~# echo "123" > /dev/ttyPCIVUART0
root at p10bmc:~# echo "Hello" > /dev/ttyPCIVUART0

- Host side
# cat /dev/ttyS0
123
Hello

---
V2:
- Incorporated review comments from Andrew Lunn
- Fixed warning reported by kernel test robot.
- Fixed crashed in the error recovery path
---
V3:
- Add PCI dependency in the Kconfig to fix issue reported by kernel test robot.
- Fixed wanring indicated by checkpatch script.

---
 drivers/soc/aspeed/Kconfig               |  11 +
 drivers/soc/aspeed/Makefile              |   1 +
 drivers/soc/aspeed/aspeed-host-bmc-dev.c | 250 +++++++++++++++++++++++
 3 files changed, 262 insertions(+)
 create mode 100644 drivers/soc/aspeed/aspeed-host-bmc-dev.c
drivers/soc/aspeed/Kconfig +11 -0
index f579ee0b5afa..8a4f096d84cd 100644
@@ -52,6 +52,17 @@ config ASPEED_SOCINFO
 	help
 	  Say yes to support decoding of ASPEED BMC information.
 
+config ASPEED_HOST_BMC_DEV
+	bool "ASPEED SoC Host BMC device driver"
+	select SOC_BUS
+	default ARCH_ASPEED
+	depends on PCI
+	help
+	  Say yes to support PCIe based VUARTs from the host side. The end to
+          end VUART communication between host and BMC requires BMC side driver
+	  to activate VUART functionality. This is a driver for the BMC device
+          on host.
+
 endmenu
 
 endif
drivers/soc/aspeed/Makefile +1 -0
index b35d74592964..db6acff9fa52 100644
@@ -4,3 +4,4 @@ obj-$(CONFIG_ASPEED_LPC_SNOOP)		+= aspeed-lpc-snoop.o
 obj-$(CONFIG_ASPEED_UART_ROUTING)	+= aspeed-uart-routing.o
 obj-$(CONFIG_ASPEED_P2A_CTRL)		+= aspeed-p2a-ctrl.o
 obj-$(CONFIG_ASPEED_SOCINFO)		+= aspeed-socinfo.o
+obj-$(CONFIG_ASPEED_HOST_BMC_DEV)	+= aspeed-host-bmc-dev.o
drivers/soc/aspeed/aspeed-host-bmc-dev.c new file +250 -0

250 lines not on this page · raw message

Signature · 1 line
2.39.2
#3 lore raw

PATCH v3 2/2 MAINTAINERS: Added maintainer for host bmc DD

In reply to Ninad Palsule

Added maintainer for new driver file.

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index 3be1bdfe8ecc..471382a2fff5 100644
@@ -3100,6 +3100,13 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/media/aspeed-video.txt
 F:	drivers/media/platform/aspeed/
 
+ASPEED HOST BMC DEVICE DRIVER
+M:	Ninad Palsule <[email protected]>
+L:	linux-media at vger.kernel.org
+L:	openbmc at lists.ozlabs.org (moderated for non-subscribers)
+S:	Maintained
+F:	drivers/soc/aspeed/aspeed-host-bmc-dev.c
+
 ASUS EC HARDWARE MONITOR DRIVER
 M:	Eugene Shalygin <[email protected]>
 L:	linux-hwmon at vger.kernel.org
Signature · 1 line
2.39.2
#2 lore raw
In reply to Ninad Palsule

Hi,

drivers/soc/aspeed/Kconfig +10 -0
index f579ee0b5afa..8a4f096d84cd 100644
@@ -52,6 +52,17 @@ config ASPEED_SOCINFO
 	help
 	  Say yes to support decoding of ASPEED BMC information.
 
+config ASPEED_HOST_BMC_DEV
+	bool "ASPEED SoC Host BMC device driver"
+	select SOC_BUS
+	default ARCH_ASPEED
+	depends on PCI
+	help
+	  Say yes to support PCIe based VUARTs from the host side. The end to
+          end VUART communication between host and BMC requires BMC side driver
+	  to activate VUART functionality. This is a driver for the BMC device
+          on host.
 

~~~
Please clean up that indentation. Consistently use one tab + 2 spaces, as documented in coding-style.rst.

Also, can this be tristate instead of bool? If not, why not?

Thanks.

Signature · 1 line
~Randy