misc: Add NPCM7xx LPC BPC driver support
Subsystems (4)
Tomer Maimon
maintainercover misc: Add NPCM7xx LPC BPC driver support
This patch set adds BIOS Post code (BPC) support for the Nuvoton NPCM7xx Baseboard Management Controller (BMC).
Nuvoton BMC NPCM7xx BIOS Post Code (BPC) monitoring two configurable I/O addresses written by the host on the Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO.
NPCM7xx BPC can support capture double words.
I have created new folder (bmc) in the documentation/devicetree/binding for BMC miscellaneous modules that are not represented in the binding folder.
The NPCM7xx BPC driver tested on NPCM750 evaluation board.
Tomer Maimon (2):
dt-binding: bmc: Add NPCM7xx LPC BPC documentation
misc: npcm7xx: add NPCM7xx LPC BPC driver
.../devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt | 26 ++ drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/npcm7xx-lpc-bpc.c | 348 +++++++++++++++++++++ 4 files changed, 383 insertions(+) create mode 100644 Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt create mode 100644 drivers/misc/npcm7xx-lpc-bpc.c
Signature · 1 line
2.14.1
Tomer Maimon
maintainerPATCH 1/2 dt-binding: bmc: Add NPCM7xx LPC BPC documentation
Added device tree binding documentation for Nuvoton BMC NPCM7xx BIOS Post Code (BPC).
The NPCM7xx BPC monitoring two configurable I/O addresses written by the host on Low Pin Count (LPC) bus.
--- .../devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt
Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +26 -0
@@ -0,0 +1,26 @@ +Nuvoton NPCM7xx LPC BPC interface + +Nuvoton BMC NPCM7xx BIOS Post Code (BPC) monitoring two +configurable I/O addresses written by the host on the +Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO. + +NPCM7xx BPC supports capture double words, when using capture +double word only I/O address 1 is monitored. + +Required properties for lpc_bpc node +- compatible : "nuvoton,npcm750-lpc-bpc" for Poleg NPCM7XX. +- reg : specifies physical base address and size of the registers. +- interrupts : contain the LPC BPC with flags for falling edge. +- monitor-ports : contain monitor I/O addresses, at least one monitor I/O + address required + +Optional property for lpc_bpc node +- bpc-en-dwcapture : enable capture double words support. + +Example: + lpc_bpc: lpc-bpc@f0007040 { + compatible = "nuvoton,npcm7xx-lpc-bpc"; + reg = <0xf0007040 0x14>; + monitor-ports = <0x80>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.14.1
Re: [PATCH v1 1/2] dt-binding: bmc: Add NPCM7xx LPC BPC documentation
Quoted 17 lines · Tomer Maimon
Added device tree binding documentation for Nuvoton BMC NPCM7xx BIOS Post Code (BPC).
The NPCM7xx BPC monitoring two configurable I/O addresses written by the host on Low Pin Count (LPC) bus.Signed-off-by Tomer Maimon <[email protected]>--- .../devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txtDocumentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +0
-0
Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt line 5
Quoted 5 lines
Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +5
-0@@ -0,0 +1,26 @@ +Nuvoton NPCM7xx LPC BPC interface + +Nuvoton BMC NPCM7xx BIOS Post Code (BPC) monitoring two +configurable I/O addresses written by the host on the +Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO.
s/capure/capture/
Otherwise,
Quoted 24 lines
Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +21
-0+ +NPCM7xx BPC supports capture double words, when using capture +double word only I/O address 1 is monitored. + +Required properties for lpc_bpc node +- compatible : "nuvoton,npcm750-lpc-bpc" for Poleg NPCM7XX. +- reg : specifies physical base address and size of the registers. +- interrupts : contain the LPC BPC with flags for falling edge. +- monitor-ports : contain monitor I/O addresses, at least one monitor I/O + address required + +Optional property for lpc_bpc node +- bpc-en-dwcapture : enable capture double words support. + +Example: + lpc_bpc: lpc-bpc@f0007040 { + compatible = "nuvoton,npcm7xx-lpc-bpc"; + reg = <0xf0007040 0x14>; + monitor-ports = <0x80>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + };Signature · 1 line
2.14.1
Re: [PATCH v1 1/2] dt-binding: bmc: Add NPCM7xx LPC BPC documentation
Quoted 26 lines · Rob Herring
Quoted 17 lines · Tomer Maimon
Added device tree binding documentation for Nuvoton BMC NPCM7xx BIOS Post Code (BPC).
The NPCM7xx BPC monitoring two configurable I/O addresses written by the host on Low Pin Count (LPC) bus.Signed-off-by Tomer Maimon <[email protected]>--- .../devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txtDocumentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +0
-0Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt line 5
Quoted 5 lines
Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +5
-0@@ -0,0 +1,26 @@ +Nuvoton NPCM7xx LPC BPC interface + +Nuvoton BMC NPCM7xx BIOS Post Code (BPC) monitoring two +configurable I/O addresses written by the host on the +Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO.s/capure/capture/
Quoted 3 lines
Otherwise,
Reviewed-by Rob Herring <[email protected]>
So uncovering a bit of a dirty secret here, we should probably consider this in the context of the ASPEED snoop function. A driver snuck into the misc tree without an associated bindings document:
(it wasn't me, I'm happy to discuss my proposed bindings, please don't shoot the messenger :))
The devicetree node looks something like:
lpc_snoop: lpc-snoop@0 {
compatible = "aspeed,ast2500-lpc-snoop";
reg = <0x0 0x80>;
interrupts = <8>;
status = "disabled";
};and also has a required "snoop-ports" property with at least one and up to two cells that describe the channels to snoop. Channel values are either 0 or 1. It's feasible that the double-word capture could also be supported as both supported channels have their data captured in different fields of the same register.
Do we go with what's already in the tree in supporting 'snoop-ports' or keep 'monitor-ports' as proposed by Tomer?
Andrew
Quoted 30 lines
Quoted 26 lines
Documentation/devicetree/bindings/bmc/npcm7xx-lpc-bpc.txt new file +21
-0+ +NPCM7xx BPC supports capture double words, when using capture +double word only I/O address 1 is monitored. + +Required properties for lpc_bpc node +- compatible : "nuvoton,npcm750-lpc-bpc" for Poleg NPCM7XX. +- reg : specifies physical base address and size of the registers. +- interrupts : contain the LPC BPC with flags for falling edge. +- monitor-ports : contain monitor I/O addresses, at least one monitor I/O + address required + +Optional property for lpc_bpc node +- bpc-en-dwcapture : enable capture double words support. + +Example: + lpc_bpc: lpc-bpc@f0007040 { + compatible = "nuvoton,npcm7xx-lpc-bpc"; + reg = <0xf0007040 0x14>; + monitor-ports = <0x80>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + };Signature · 1 line
2.14.1--
To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tomer Maimon
maintainerPATCH 2/2 misc: npcm7xx: add NPCM7xx LPC BPC driver
In reply to Tomer MaimonAdd Nuvoton BMC NPCM7xx BIOS post code (BPC) driver.
The NPCM7xx BPC monitoring two I/O address written by the host on the Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO.
--- drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/npcm7xx-lpc-bpc.c | 348 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 357 insertions(+) create mode 100644 drivers/misc/npcm7xx-lpc-bpc.c
drivers/misc/Kconfig +8 -0
@@ -513,6 +513,14 @@ config MISC_RTSX tristate default MISC_RTSX_PCI || MISC_RTSX_USB +config NPCM7XX_LPC_BPC + tristate "NPCM7xx LPC BIOS Post Code support" + depends on (ARCH_NPCM7XX || COMPILE_TEST) + help + Provides a NPCM7xx driver to control the LPC BIOS Post Code + interface which allows the BMC to monitoring and save + the data written by the host to an arbitrary LPC I/O port. + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig"
drivers/misc/Makefile +1 -0
@@ -58,3 +58,4 @@ obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o obj-$(CONFIG_PCI_ENDPOINT_TEST) += pci_endpoint_test.o obj-$(CONFIG_OCXL) += ocxl/ obj-$(CONFIG_MISC_RTSX) += cardreader/ +obj-$(CONFIG_NPCM7XX_LPC_BPC) += npcm7xx-lpc-bpc.o
drivers/misc/npcm7xx-lpc-bpc.c new file +348 -0
348 lines not on this page · raw message
Signature · 1 line
2.14.1
Greg KH
maintainerRe: [PATCH v1 2/2] misc: npcm7xx: add NPCM7xx LPC BPC driver
Quoted 7 lines · Tomer Maimon
Add Nuvoton BMC NPCM7xx BIOS post code (BPC) driver.
The NPCM7xx BPC monitoring two I/O address written by the host on the Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO.
Signed-off-by Tomer Maimon <[email protected]>
It would be great to get someone else who knows that this hardware is supposed to be doing to ack or sign-off on this patch, as I don't know if this really is providing the correct api for it or not.
Right now it's just reading data from the hardware, what good is that? Who uses this? What userspace tools connect up to it?
thanks,
greg k-h
Tomer Maimon
maintainerRe: [PATCH v1 2/2] misc: npcm7xx: add NPCM7xx LPC BPC driver
[+Benjamin Fair]
Hi Greg,
This hardware is working in the same manner that Aspeed lpc snooping driver (/drivers/misc/aspeed-lpc-snoop.c)
Quoted 7 lines · Greg KH
Quoted 6 lines · Tomer Maimon
Add Nuvoton BMC NPCM7xx BIOS post code (BPC) driver.
The NPCM7xx BPC monitoring two I/O address written by the host on the Low Pin Count (LPC) bus, the capure data stored in 128-word FIFO.
Quoted 6 lines
Quoted 1 line
Signed-off-by Tomer Maimon <[email protected]>It would be great to get someone else who knows that this hardware is supposed to be doing to ack or sign-off on this patch, as I don't know if this really is providing the correct api for it or not.
Joel could you sign-off this patch please.
Right now it's just reading data from the hardware, what good is that?
Quoted 2 lines
Who uses this? What userspace tools connect up to it?
BMC is logging a configurable I/O port (for example 0x80 port which is BIOS post code) and remote management can get.
about tools, the OpenBMC is using it.
https://github.com/openbmc/phosphor-host-postd
Quoted 4 lines
thanks,
greg k-h
thanks,
Tomer