Skip to contentSkip to conversation

pinctrl: aspeed: Add AST2700 SoC0 support

PATCH Superseded Billy Tsai 2 participants 8 messages Mar 6 – Mar 20

Subsystems (8)

v4 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Billy Tsai

author reviewer
#0 lore raw

v4 cover pinctrl: aspeed: Add AST2700 SoC0 support

AST2700 is composed of two interconnected SoC instances, each providing its own pin control hardware. This series introduces bindings describing the AST2700 pinctrl architecture and adds pinctrl driver support for the SoC0 instance.

The bindings document the AST2700 dual-SoC design and follow common pinctrl conventions, while the SoC0 driver implementation builds upon the existing ASPEED pinctrl infrastructure.

A binding example is not yet provided as there were differing opinions during review about whether it should live in the SCU binding or the pinctrl binding. I can add one in a follow-up revision once the preferred location is agreed.

---
Changes in v4:
- Rename series title to "pinctrl: aspeed: Add AST2700 SoC0 support"
to make it specific to SoC0.
- Remove unnecessary SCU example from bindings.
- Fix Makefile newline to avoid patch warning.
- Make pinctrl data structures const and align with existing Aspeed drivers.
- Sort the arrays and enums alphabetically.
- Minor cleanups for consistency, no functional changes.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
dt-bindings: pinctrl: aspeed: AST2700 pinctrl improvements
- Improved binding descriptions for SoC0 and SoC1 to better explain the AST2700 dual-SoC architecture with independent pin control blocks
- Switched from additionalProperties to patternProperties using the '-state$' suffix to restrict child node naming
- Removed per-binding examples based on review feedback
- Added additionalProperties: false at the top level for stricter schema validation
- Dropped the aspeed,ast2700-soc1-pinctrl binding, as the SoC1 pinctrl registers follow a regular layout and can be described using an existing generic pinctrl binding
- Updated the function and group enum lists to match the definitions used by the AST2700 pinctrl driver

dt-bindings: mfd: aspeed: Add AST2700 SCU example with pinctrl
- Added a complete AST2700 SCU0 example demonstrating pinctrl integration
- Example covers both pin function/group configuration and pin drive-strength settings
- Updated child node naming to use the '-state' suffix, following common pinctrl conventions

pinctrl: aspeed: AST2700 SoC0 driver improvements
- Refactored pin and signal declarations to use common ASPEED pinmux macros (SIG_EXPR_LIST_DECL_SEMG, SIG_EXPR_LIST_DECL_SESG, PIN_DECL_*)
- Added SCU010 register definition for hardware strap control
- Reworked code structure to better align with existing ASPEED pinctrl drivers

- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Update pinctrl aspeed binding files.
- Update the commit message for pinctrl binding patch.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Billy Tsai (3):
dt-bindings: mfd: aspeed,ast2x00-scu: Support AST2700 SoC0 pinctrl
dt-bindings: pinctrl: Add aspeed,ast2700-soc0-pinctrl
pinctrl: aspeed: Add AST2700 SoC0 support

 .../bindings/mfd/aspeed,ast2x00-scu.yaml           |   1 +
 .../pinctrl/aspeed,ast2700-soc0-pinctrl.yaml       | 126 ++++
 drivers/pinctrl/aspeed/Kconfig                     |   9 +
 drivers/pinctrl/aspeed/Makefile                    |   1 +
 drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc0.c    | 710 +++++++++++++++++++++
 5 files changed, 847 insertions(+)

---
base-commit: af4e9ef3d78420feb8fe58cd9a1ab80c501b3c08
change-id: 20251215-upstream_pinctrl-8f195df0a975

Best regards,

Signature · 1 line
Billy Tsai <[email protected]>
author reviewer
#1 lore raw

PATCH v4 1/3 dt-bindings: mfd: aspeed,ast2x00-scu: Support AST2700 SoC0 pinctrl

The AST2700 SoC integrates two interconnected SoC instances, each managed by its own System Control Unit (SCU).

Allow the AST2700 SoC0 pin controller to be described as a child node of the SCU by extending the compatible strings accepted by the SCU binding.

There are no functional changes to the SCU binding beyond permitting the AST2700 SoC0 pinctrl compatible string.

---
 Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml +1 -0
index a87f31fce019..685b1c77e729 100644
@@ -87,6 +87,7 @@ patternProperties:
             - aspeed,ast2400-pinctrl
             - aspeed,ast2500-pinctrl
             - aspeed,ast2600-pinctrl
+            - aspeed,ast2700-soc0-pinctrl
 
     required:
       - compatible
Signature · 1 line
2.34.1
Acked-by on v4 1/3
#2 lore raw

Re: [PATCH v4 1/3] dt-bindings: mfd: aspeed,ast2x00-scu: Support AST2700 SoC0 pinctrl

Quoted 7 lines · Billy Tsai

The AST2700 SoC integrates two interconnected SoC instances, each managed by its own System Control Unit (SCU).

Allow the AST2700 SoC0 pin controller to be described as a child node of the SCU by extending the compatible strings accepted by the SCU binding.

Quoted 7 lines

There are no functional changes to the SCU binding beyond permitting the AST2700 SoC0 pinctrl compatible string.

---
 Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml | 1 +
 1 file changed, 1 insertion(+)

Best regards,
Krzysztof

author reviewer
#3 lore raw

PATCH v4 2/3 dt-bindings: pinctrl: Add aspeed,ast2700-soc0-pinctrl

In reply to Billy Tsai

Add a device tree binding for the pin controller found in the ASPEED AST2700 SoC0.

The controller manages various peripheral functions such as eMMC, USB, VGA DDC, JTAG, and PCIe root complex signals.

Describe the AST2700 SoC0 pin controller using standard pin multiplexing and configuration properties.

---
 .../pinctrl/aspeed,ast2700-soc0-pinctrl.yaml       | 126 +++++++++++++++++++++
 1 file changed, 126 insertions(+)
Documentation/devicetree/bindings/pinctrl/aspeed,ast2700-soc0-pinctrl.yaml new file +126 -0
new file mode 100644
index 000000000000..caf8616c70e3
@@ -0,0 +1,126 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/aspeed,ast2700-soc0-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ASPEED AST2700 SoC0 Pin Controller
+
+maintainers:
+  - Billy Tsai <[email protected]>
+
+description:
+  The AST2700 features a dual-SoC architecture with two interconnected SoCs,
+  each having its own System Control Unit (SCU) for independent pin control.
+  This pin controller manages the pin multiplexing for SoC0.
+
+  The SoC0 pin controller manages pin functions including eMMC, VGA DDC,
+  dual USB3/USB2 ports (A and B), JTAG, and PCIe root complex interfaces.
+
+properties:
+  compatible:
+    const: aspeed,ast2700-soc0-pinctrl
+
+patternProperties:
+  '-state$':
+    type: object
+    allOf:
+      - $ref: pinmux-node.yaml#
+      - $ref: pincfg-node.yaml#
+    additionalProperties: false
+
+    properties:
+      function:
+        enum:
+          - EMMC
+          - JTAGDDR
+          - JTAGM0
+          - JTAGPCIEA
+          - JTAGPCIEB
+          - JTAGPSP
+          - JTAGSSP
+          - JTAGTSP
+          - JTAGUSB3A
+          - JTAGUSB3B
+          - PCIERC0PERST
+          - PCIERC1PERST
+          - TSPRSTN
+          - UFSCLKI
+          - USB2AD0
+          - USB2AD1
+          - USB2AH
+          - USB2AHP
+          - USB2AHPD0
+          - USB2AXH
+          - USB2AXH2B
+          - USB2AXHD1
+          - USB2AXHP
+          - USB2AXHP2B
+          - USB2AXHPD1
+          - USB2BD0
+          - USB2BD1
+          - USB2BH
+          - USB2BHP
+          - USB2BHPD0
+          - USB2BXH
+          - USB2BXH2A
+          - USB2BXHD1
+          - USB2BXHP
+          - USB2BXHP2A
+          - USB2BXHPD1
+          - USB3AXH
+          - USB3AXH2B
+          - USB3AXHD
+          - USB3AXHP
+          - USB3AXHP2B
+          - USB3AXHPD
+          - USB3BXH
+          - USB3BXH2A
+          - USB3BXHD
+          - USB3BXHP
+          - USB3BXHP2A
+          - USB3BXHPD
+          - VB
+          - VGADDC
+
+      groups:
+        enum:
+          - EMMCCDN
+          - EMMCG1
+          - EMMCG4
+          - EMMCG8
+          - EMMCWPN
+          - JTAG0
+          - PCIERC0PERST
+          - PCIERC1PERST
+          - TSPRSTN
+          - UFSCLKI
+          - USB2A
+          - USB2AAP
+          - USB2ABP
+          - USB2ADAP
+          - USB2AH
+          - USB2AHAP
+          - USB2B
+          - USB2BAP
+          - USB2BBP
+          - USB2BDBP
+          - USB2BH
+          - USB2BHBP
+          - USB3A
+          - USB3AAP
+          - USB3ABP
+          - USB3B
+          - USB3BAP
+          - USB3BBP
+          - VB0
+          - VB1
+          - VGADDC
+
+required:
+  - compatible
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+additionalProperties: false
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH v4 2/3] dt-bindings: pinctrl: Add aspeed,ast2700-soc0-pinctrl

Quoted 10 lines · Billy Tsai
Documentation/devicetree/bindings/pinctrl/aspeed,ast2700-soc0-pinctrl.yaml new file +10 -0
+          - USB2BDBP
+          - USB2BH
+          - USB2BHBP
+          - USB3A
+          - USB3AAP
+          - USB3ABP
+          - USB3B
+          - USB3BAP
+          - USB3BBP
+          - VB0

Documentation/devicetree/bindings/pinctrl/aspeed,ast2700-soc0-pinctrl.yaml line 126

Quoted 10 lines
Documentation/devicetree/bindings/pinctrl/aspeed,ast2700-soc0-pinctrl.yaml new file +10 -0
+          - VB1
+          - VGADDC
+
+required:
+  - compatible
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+additionalProperties: false

I guess the mess with examples is partially my fault of imprecise feedback. Rob asked you to add the example to main MFD device, but:
1. maybe he assumed there will be separate binding for parent device?
2. you added it in wrong patch (pinctrl patch changing MFD!),
3. it was also incomplete that time.

The example - if you tested your v3 - was needed to actually validate and point errors. My bad I asked to drop it.

So now you have a mess - incorrect, non-validated (example-less) and maybe even incomplete binding.

Please post complete ast2700 SCU binding - what children do you have? If none of ones mentioned in the binding apply, then why the binding mentions them? why do you allow p2a if 2700 does not have it? And smp-ram?

And if 2700 has silicon-id, interrupt controller, pinctrl etc, then why none of them were present in the example you added?

But more importantly, none of this was actually built tested/checked against DTS thus I cannot accept it. We are back to basics... post your COMPLETE DTS somewhere and provide link to it.

Best regards,
Krzysztof

author reviewer
#5 lore raw

Re: [PATCH v4 2/3] dt-bindings: pinctrl: Add aspeed,ast2700-soc0-pinctrl

Quoted 4 lines

Please post complete ast2700 SCU binding - what children do you have? If none of ones mentioned in the binding apply, then why the binding mentions them? why do you allow p2a if 2700 does not have it? And smp-ram?

Yes, on reflection the approach taken so far is not particularly helpful, as the binding has been extended incrementally without clearly defining which SCU capabilities should appear in devicetree.

Quoted 2 lines

And if 2700 has silicon-id, interrupt controller, pinctrl etc, then why none of them were present in the example you added?

You're right that the earlier example was incomplete. The example was added while extending the binding for pinctrl support, and it did not reflect the full set of SCU capabilities.

Quoted 3 lines

But more importantly, none of this was actually built tested/checked against DTS thus I cannot accept it. We are back to basics... post your COMPLETE DTS somewhere and provide link to it.

The AST2700 devicetree integrating the patches on the upstream lists is available here:

https://github.com/billy-tsai/linux/blob/integration/ast2700/arch/arm64/boot/dts/aspeed/aspeed-g7-common.dtsi

This isn't yet the complete description of the hardware you asked for, that's something we need to better develop. To address that, I think we can break the full set of SCU0 capabilities down into the following groups:

Providers:
- SCU interrupt controller (0x1c0-0x1c8)
- Host 0 interrupt controller (0x1d0-0x1d8)
- Host 1 interrupt controller (0x1e0-0x1e8)
- Resets (0x200-0x240, 0xf00-0xff8)
- Clocks (0x240-0x2f0, 0x300-0x3b0)
- Pinctrl (0x400-0x718)
- SW scratch registers (0x7b0-0x800)
- reg describes the scratch register region that might be useful elsewhere?

Consumers:
- SSP control (0x120-0x160)
- Reserved memory regions to map into SSP address space

- TSP control (0x160-0x1c0)
- Reserved memory regions to map into TSP address space

- SCU interrupt controller (0x1c0-0x1c8)
- Host 0 interrupt controller (0x1d0-0x1d8)
- Host 1 interrupt controller (0x1e0-0x1e8)
- PCI control (0x900-0xb00)
- Interrupt for VGA scratch register changes

Neither consumer or producer:
- Silicon revision ID (0x000-0x004)
- Hardware strapping (0x010-0x030)
- OTP strapping (0x030-0x038)
- System Reset Event Log (0x050-0x080)
- GPIO debug probe (0x0a0-0x0a8)
- Debug UART control (0x0a8-0x0b0)
- Misc reset / PCIe (0x0c0-0x0c4)
- SoC debug control (0x0c8-0x0cc)
- Free running counter (0x0e0-0x0e8)
- PSP control (0x100-0x120)
- PERST# interrupt log (0x1d8-0x1dc)
- RCRST# interrupt log (0x1e8-0x1ec)
- SMP scratch registers (0x780-0x7b0)
- EFUSE (0x800-0x870)
- PMU (0x880-0x8c0)
- Write control (0xb00-0xf00)

The SCU0 node itself already acts as the provider for clocks and resets, and the existing binding defines child nodes for the interrupt controllers and pinctrl.

The software-defined scratch registers are also exposed through the SCU register space, but it is likely sufficient for consumers to reference the SCU syscon node directly rather than introducing a separate child node.

What remains unclear is how best to model the secondary and tertiary service processor control blocks (SSP/TSP) and the PCI control region. The SSP and TSP controls consume reserved memory regions used to configure the processors' address spaces, while the PCI control region contains the VGA scratch registers used to communicate host display ownership.

The p2a and smp-ram features are supported on earlier generations but are not present on AST2700, and should be disabled in the binding for the AST2700 as you suggested.

In the next revision, I plan to restrict these nodes for AST2700 using schema conditionals so that they are no longer allowed when the compatible is "aspeed,ast2700-scu0" or "aspeed,ast2700-scu1".

allOf:
- if:
properties:
compatible:
contains:
enum:
- aspeed,ast2700-scu0
- aspeed,ast2700-scu1
then:
patternProperties:
'^p2a-control@[0-9a-f]+$': false
'^smp-memram@[0-9a-f]+$': false

Thanks
Billy Tsai

author reviewer
#6 lore raw

Re: [PATCH v4 2/3] dt-bindings: pinctrl: Add aspeed,ast2700-soc0-pinctrl

...

Quoted 10 lines

What remains unclear is how best to model the secondary and tertiary service processor control blocks (SSP/TSP) and the PCI control region. The SSP and TSP controls consume reserved memory regions used to configure the processors' address spaces, while the PCI control region contains the VGA scratch registers used to communicate host display ownership.

The p2a and smp-ram features are supported on earlier generations but are not present on AST2700, and should be disabled in the binding for the AST2700 as you suggested.

Hi Krzysztof,

Following up on my previous email, I've reworked the AST2700 SCU0 binding to better reflect the hardware capabilities and address the issues discussed.

In particular:
- Restrict p2a-control and smp-memram for AST2700, as these features are not present.
- Add SSP/TSP address mapping support using memory-region and memory-region-names.
- Rework the example so it reflects the AST2700 SCU0 layout and validates against the binding schema.

I wanted to share the current binding update for feedback.

Below is the current SCU0 binding diff:

Documentation/devicetree/bindings/mfd/aspeed,ast2x00-scu.yaml +117 -0
index a87f31fce019..86e560876cf2 100644
@@ -46,6 +46,9 @@ properties:
   '#reset-cells':
     const: 1
 
+  memory-region: true
+  memory-region-names: true
+
 patternProperties:
   '^p2a-control@[0-9a-f]+$':
     description: >
@@ -87,6 +90,7 @@ patternProperties:
             - aspeed,ast2400-pinctrl
             - aspeed,ast2500-pinctrl
             - aspeed,ast2600-pinctrl
+            - aspeed,ast2700-soc0-pinctrl
 
     required:
       - compatible
@@ -156,6 +160,42 @@ required:
   - '#clock-cells'
   - '#reset-cells'
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            anyOf:
+              - const: aspeed,ast2700-scu0
+              - const: aspeed,ast2700-scu1
+    then:
+      patternProperties:
+        '^p2a-control@[0-9a-f]+$': false
+        '^smp-memram@[0-9a-f]+$': false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: aspeed,ast2700-scu0
+    then:
+      properties:
+        memory-region:
+          items:
+            - description: Region mapped through the first SSP address window.
+            - description: Region mapped through the second SSP address window.
+            - description: Region mapped through the TSP address window.
+
+        memory-region-names:
+          items:
+            - const: ssp-0
+            - const: ssp-1
+            - const: tsp
+    else:
+      properties:
+        memory-region: false
+        memory-region-names: false
+
 additionalProperties: false
 
 examples:
@@ -180,4 +220,81 @@ examples:
             reg = <0x7c 0x4>, <0x150 0x8>;
         };
     };
+
+  - |
+    / {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        reserved-memory {
+            #address-cells = <2>;
+            #size-cells = <2>;
+            ranges;
+
+            ssp_region_0: memory@90000000 {
+                reg = <0x4 0x00000000 0x0 0x01000000>;
+                no-map;
+            };
+
+            ssp_region_1: memory@91000000 {
+                reg = <0x4 0x01000000 0x0 0x01000000>;
+                no-map;
+            };
+
+            tsp_region: memory@92000000 {
+                reg = <0x4 0x02000000 0x0 0x01000000>;
+                no-map;
+            };
+        };
+
+        bus {
+            #address-cells = <2>;
+            #size-cells = <2>;
+
+            syscon@12c02000 {
+                compatible = "aspeed,ast2700-scu0", "syscon", "simple-mfd";
+                reg = <0 0x12c02000 0 0x1000>;
+                ranges = <0x0 0x0 0x12c02000 0x1000>;
+                #address-cells = <1>;
+                #size-cells = <1>;
+                #clock-cells = <1>;
+                #reset-cells = <1>;
+
+                memory-region = <&ssp_region_0>, <&ssp_region_1>,
+                                <&tsp_region>;
+                memory-region-names = "ssp-0", "ssp-1", "tsp";
+
+                silicon-id@0 {
+                    compatible = "aspeed,ast2700-silicon-id", "aspeed,silicon-id";
+                    reg = <0x0 0x4>;
+                };
+
+                interrupt-controller@1b0 {
+                    compatible = "aspeed,ast2700-scu-ic0";
+                    reg = <0x1b0 0x4>;
+                    #interrupt-cells = <1>;
+                    interrupts-extended = <&intc0 97>;
+                    interrupt-controller;
+                };
+
+                interrupt-controller@1e0 {
+                    compatible = "aspeed,ast2700-scu-ic1";
+                    reg = <0x1e0 0x4>;
+                    #interrupt-cells = <1>;
+                    interrupts-extended = <&intc0 98>;
+                    interrupt-controller;
+                };
+
+                pinctrl@400 {
+                    compatible = "aspeed,ast2700-soc0-pinctrl";
+                    reg = <0x400 0x318>;
+                    emmc-state {
+                        function = "EMMC";
+                        groups = "EMMCG1";
+                    };
+                };
+            };
+        };
+    };
+
 ...

One additional question regarding the example: Since the AST2700 SCU0 node is not significantly different from previous generations and the example mostly uses standard properties, do you think keeping this additional example is useful, or would you prefer to keep the binding minimal?

Thanks
Billy Tsai

author reviewer
#7 lore raw

PATCH v4 3/3 pinctrl: aspeed: Add AST2700 SoC0 support

In reply to Billy Tsai

Add pinctrl support for the SoC0 instance of the ASPEED AST2700.

AST2700 consists of two interconnected SoC instances, each with its own pinctrl register block.

The SoC0 pinctrl hardware closely follows the design found in previous ASPEED BMC generations, allowing the driver to build upon the common ASPEED pinctrl infrastructure.

---
 drivers/pinctrl/aspeed/Kconfig                  |   9 +
 drivers/pinctrl/aspeed/Makefile                 |   1 +
 drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc0.c | 710 ++++++++++++++++++++++++
 3 files changed, 720 insertions(+)
drivers/pinctrl/aspeed/Kconfig +9 -0
index 1a4e5b9ed471..f9672cca891e 100644
@@ -31,3 +31,12 @@ config PINCTRL_ASPEED_G6
 	help
 	  Say Y here to enable pin controller support for Aspeed's 6th
 	  generation SoCs. GPIO is provided by a separate GPIO driver.
+
+config PINCTRL_ASPEED_G7_SOC0
+	bool "Aspeed G7 SoC pin control"
+	depends on (ARCH_ASPEED || COMPILE_TEST) && OF
+	select PINCTRL_ASPEED
+	help
+	  Say Y here to enable pin controller support for the SoC0 instance
+	  of Aspeed's 7th generation SoCs. GPIO is provided by a separate
+	  GPIO driver.
drivers/pinctrl/aspeed/Makefile +1 -0
index db2a7600ae2b..0de524ca2c72 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_PINCTRL_ASPEED)	+= pinctrl-aspeed.o pinmux-aspeed.o
 obj-$(CONFIG_PINCTRL_ASPEED_G4)	+= pinctrl-aspeed-g4.o
 obj-$(CONFIG_PINCTRL_ASPEED_G5)	+= pinctrl-aspeed-g5.o
 obj-$(CONFIG_PINCTRL_ASPEED_G6)	+= pinctrl-aspeed-g6.o
+obj-$(CONFIG_PINCTRL_ASPEED_G7_SOC0) += pinctrl-aspeed-g7-soc0.o
drivers/pinctrl/aspeed/pinctrl-aspeed-g7-soc0.c new file +710 -0

710 lines not on this page · raw message

Signature · 1 line
2.34.1