Skip to contentSkip to conversation

Add AST2600 LPC PCC support

PATCH NAK Kevin Chen 3 participants 7 messages Mar 14, 2025 – Mar 18, 2025

Subsystems (4)
lore
Share & tools
lore

Kevin Chen

author
#0 lore raw

v4 cover Add AST2600 LPC PCC support

--
v4
aspeed-lpc-pcc.c:
-- Remove the debug message in the aspeed_lpc_pcc_probe. -- Add pcc-ports in the aspeed-g6.dtsi.

v3
aspeed-lpc-pcc.c:
-- Add ida_free and fix the dev usage with removing some debug messages.
aspeed-lpc.yaml:
-- Add description about the pcc-ports usage.

v2:
-- Change driver path to drivers/misc

Kevin Chen (3):
dt-binding: aspeed: Add LPC PCC controller
ARM: dts: aspeed-g6: Add AST2600 LPC PCC support
soc: aspeed: lpc-pcc: Add PCC controller support

 .../devicetree/bindings/mfd/aspeed-lpc.yaml   |  38 ++
 arch/arm/boot/dts/aspeed/aspeed-g6.dtsi       |   8 +
 drivers/misc/Kconfig                          |  10 +
 drivers/misc/Makefile                         |   1 +
 drivers/misc/aspeed-lpc-pcc.c                 | 437 ++++++++++++++++++
 5 files changed, 494 insertions(+)
 create mode 100644 drivers/misc/aspeed-lpc-pcc.c
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v4 1/3 dt-binding: aspeed: Add LPC PCC controller

Add dt-bindings for Aspeed for Aspeed LPC POST code capture controller.

---
 .../devicetree/bindings/mfd/aspeed-lpc.yaml   | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
Documentation/devicetree/bindings/mfd/aspeed-lpc.yaml +38 -0
index 5dfe77aca167..178c151a19ba 100644
@@ -149,6 +149,37 @@ patternProperties:
       - interrupts
       - snoop-ports
 
+  "^lpc-pcc@[0-9a-f]+$":
+    type: object
+    additionalProperties: false
+
+    description:
+      The LPC pcc interface allows the BMC to listen on and record the data
+      bytes written by the Host to the targeted LPC I/O pots.
+
+    properties:
+      compatible:
+        items:
+          - enum:
+              - aspeed,ast2600-lpc-pcc
+
+      reg:
+        maxItems: 1
+
+      interrupts:
+        maxItems: 1
+
+      pcc-ports:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        description:
+          As a device handshake with a host using the port-mmaped I/O in x86
+          architecture, need to handle specific which port I/O address for use.
+
+    required:
+      - compatible
+      - interrupts
+      - pcc-ports
+
   "^uart-routing@[0-9a-f]+$":
     $ref: /schemas/soc/aspeed/uart-routing.yaml#
     description: The UART routing control under LPC register space
@@ -176,6 +207,13 @@ examples:
         #size-cells = <1>;
         ranges = <0x0 0x1e789000 0x1000>;
 
+        lpc_pcc: lpc-pcc@0 {
+            compatible = "aspeed,ast2600-lpc-pcc";
+            reg = <0x0 0x140>;
+            interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+            pcc-ports = <0x80>;
+        };
+
         lpc_ctrl: lpc-ctrl@80 {
             compatible = "aspeed,ast2600-lpc-ctrl";
             reg = <0x80 0x80>;
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v4 1/3] dt-binding: aspeed: Add LPC PCC controller

Quoted 7 lines · Kevin Chen

Add dt-bindings for Aspeed for Aspeed LPC POST code capture controller.

---
 .../devicetree/bindings/mfd/aspeed-lpc.yaml   | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)

Nothing improved. You already got comment that nothing improved and you... send the same.

NAK

Instead of selectively ignoring comments, go back to review and implement each of them.

Best regards,
Krzysztof

author
#3 lore raw

PATCH v4 2/3 ARM: dts: aspeed-g6: Add AST2600 LPC PCC support

In reply to Kevin Chen

The AST2600 has PCC controller in LPC, placed in LPC node.

---
 arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +8 -0
index 8ed715bd53aa..f238337e02da 100644
@@ -626,6 +626,14 @@ lpc_snoop: lpc-snoop@80 {
 					status = "disabled";
 				};
 
+				lpc_pcc: lpc-pcc@0 {
+					compatible = "aspeed,ast2600-lpc-pcc";
+					reg = <0x0 0x140>;
+					interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+					pcc-ports = <0x80>;
+					status = "disabled";
+				};
+
 				lhc: lhc@a0 {
 					compatible = "aspeed,ast2600-lhc";
 					reg = <0xa0 0x24 0xc8 0x8>;
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v4 2/3] ARM: dts: aspeed-g6: Add AST2600 LPC PCC support

Quoted 12 lines · Kevin Chen

The AST2600 has PCC controller in LPC, placed in LPC node.

---
 arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +0 -0
index 8ed715bd53aa..f238337e02da 100644

arch/arm/boot/dts/aspeed/aspeed-g6.dtsi lpc_snoop: lpc-snoop@80 { · line 633

Quoted 8 lines
arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +5 -0
@@ -626,6 +626,14 @@ lpc_snoop: lpc-snoop@80 {
 					status = "disabled";
 				};
 
+				lpc_pcc: lpc-pcc@0 {
+					compatible = "aspeed,ast2600-lpc-pcc";
+					reg = <0x0 0x140>;
+					interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+					pcc-ports = <0x80>;

So this is 0x80 for entire SoC, then it is implied by compatible, no?

arch/arm/boot/dts/aspeed/aspeed-g6.dtsi lpc_snoop: lpc-snoop@80 { · line 634

Quoted 1 line
arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +1 -0
+					status = "disabled";

Where is any DTS user of this device?

Best regards,
Krzysztof

author
#5 lore raw

PATCH v4 3/3 soc: aspeed: lpc-pcc: Add PCC controller support

In reply to Kevin Chen

Add LPC PCC controller driver to support POST code capture.

---
 drivers/misc/Kconfig          |  10 +
 drivers/misc/Makefile         |   1 +
 drivers/misc/aspeed-lpc-pcc.c | 437 ++++++++++++++++++++++++++++++++++
 3 files changed, 448 insertions(+)
 create mode 100644 drivers/misc/aspeed-lpc-pcc.c
drivers/misc/Kconfig +10 -0
index 56bc72c7ce4a..35c1d2e0c271 100644
@@ -50,6 +50,16 @@ config AD525X_DPOT_SPI
 	  To compile this driver as a module, choose M here: the
 	  module will be called ad525x_dpot-spi.
 
+config ASPEED_LPC_PCC
+	tristate "Aspeed Post Code Capture support"
+	select REGMAP
+	select MFD_SYSCON
+	default ARCH_ASPEED
+	help
+	  Provides a driver to control the LPC PCC interface,
+	  allowing the BMC to capture post code written by the
+	  the host to an arbitrary LPC I/O port.
+
 config DUMMY_IRQ
 	tristate "Dummy IRQ handler"
 	help
drivers/misc/Makefile +1 -0
index 545aad06d088..4762da7804bf 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_IBMVMC)		+= ibmvmc.o
 obj-$(CONFIG_AD525X_DPOT)	+= ad525x_dpot.o
 obj-$(CONFIG_AD525X_DPOT_I2C)	+= ad525x_dpot-i2c.o
 obj-$(CONFIG_AD525X_DPOT_SPI)	+= ad525x_dpot-spi.o
+obj-$(CONFIG_ASPEED_LPC_PCC)	+= aspeed-lpc-pcc.o
 obj-$(CONFIG_ATMEL_SSC)		+= atmel-ssc.o
 obj-$(CONFIG_DUMMY_IRQ)		+= dummy-irq.o
 obj-$(CONFIG_ICS932S401)	+= ics932s401.o
drivers/misc/aspeed-lpc-pcc.c new file +437 -0

437 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#6 lore raw

Re: [PATCH v4 3/3] soc: aspeed: lpc-pcc: Add PCC controller support

Quoted 11 lines · Kevin Chen

+       pcc->mdev.parent = dev;
+       pcc->mdev.minor = MISC_DYNAMIC_MINOR;
+       pcc->mdev.name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", DEVICE_NAME,
+                                       pcc->mdev_id); +       pcc->mdev.fops = &pcc_fops;
+       rc = misc_register(&pcc->mdev);
+       if (rc) {
+               dev_err(dev, "Couldn't register misc device\n"); +               goto err_free_ida;
+       }

Just a note that this still isn't accounting for discussion on the previous posting of the series putting the driver under drivers/soc/aspeed:

https://lore.kernel.org/all/f7369d6205e05c7aac3f3de7cbd08c3b08960d75.camel@codeconstruct.com.au/

If we're not going to try make a common userspace behaviour over the Aspeed snoop and PCC functions and the Nuvoton BPC function then I think the behaviour of the chardev should at least be documented. But I would rather that it were common to avoid headaches in userspace.

Andrew