Skip to contentSkip to conversation

ARM: dts: aspeed-g6: Add sgpiom/sgpios node

PATCH In review Billy Tsai 3 participants 7 messages Sep 30, 2020 – Oct 5, 2020

Subsystems (2)
lore
Share & tools
lore

Billy Tsai

author reviewer
#0 lore raw

PATCH 1/1 ARM: dts: aspeed-g6: Add sgpiom/sgpios node

This commit add two sgpiom and two sgpios node into aspeed-g6.dtsi and change the register range of gpio0 to fix the hardware design.

---
 arch/arm/boot/dts/aspeed-g6.dtsi | 51 +++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-g6.dtsi +50 -1
index 97ca743363d7..00237daec2a1 100644
@@ -357,7 +357,7 @@
 				#gpio-cells = <2>;
 				gpio-controller;
 				compatible = "aspeed,ast2600-gpio";
-				reg = <0x1e780000 0x800>;
+				reg = <0x1e780000 0x500>;
 				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
 				gpio-ranges = <&pinctrl 0 0 208>;
 				ngpios = <208>;
@@ -365,6 +365,55 @@
 				interrupt-controller;
 				#interrupt-cells = <2>;
 			};
+			sgpiom0: sgpiom at 1e780500 {
+				#gpio-cells = <2>;
+				gpio-controller;
+				compatible = "aspeed,ast2600-sgpiom";
+				reg = <0x1e780500 0x100>;
+				interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+				ngpios = <128>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+				interrupt-controller;
+				bus-frequency = <12000000>;
+
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_sgpm1_default>;
+				status = "disabled";
+			};
+
+			sgpiom1: sgpiom at 1e780600 {
+				#gpio-cells = <2>;
+				gpio-controller;
+				compatible = "aspeed,ast2600-sgpiom";
+				reg = <0x1e780600 0x100>;
+				interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+				ngpios = <80>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+				interrupt-controller;
+				bus-frequency = <12000000>;
+
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_sgpm2_default>;
+				status = "disabled";
+			};
+
+			sgpios0: sgpios at 1e780700 {
+				#gpio-cells = <2>;
+				gpio-controller;
+				compatible = "aspeed,ast2600-sgpios";
+				reg = <0x1e780700 0x40>;
+				interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+			};
+
+			sgpios1: sgpios at 1e780740 {
+				#gpio-cells = <2>;
+				gpio-controller;
+				compatible = "aspeed,ast2600-sgpios";
+				reg = <0x1e780740 0x40>;
+				interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+			};
 
 			gpio1: gpio at 1e780800 {
 				#gpio-cells = <2>;
Signature · 1 line
2.17.1
author reviewer
#1 lore raw

PATCH RESEND 1/1 ARM: dts: aspeed-g6: Fix gpio memory region

---
 arch/arm/boot/dts/aspeed-g6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-g6.dtsi +1 -1
index 97ca743363d7..b9ec8b579f73 100644
@@ -357,7 +357,7 @@
 				#gpio-cells = <2>;
 				gpio-controller;
 				compatible = "aspeed,ast2600-gpio";
-				reg = <0x1e780000 0x800>;
+				reg = <0x1e780000 0x500>;
 				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
 				gpio-ranges = <&pinctrl 0 0 208>;
 				ngpios = <208>;
Signature · 1 line
2.17.1
#2 lore raw

Re: [RESEND PATCH] ARM: dts: aspeed-g6: Fix gpio memory region

Hi Billy,

Quoted 10 lines · Billy Tsai
---
 arch/arm/boot/dts/aspeed-g6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-g6.dtsi +0 -0
index 97ca743363d7..b9ec8b579f73 100644

arch/arm/boot/dts/aspeed-g6.dtsi line 360

Quoted 5 lines
arch/arm/boot/dts/aspeed-g6.dtsi +1 -1
@@ -357,7 +357,7 @@
 				#gpio-cells = <2>;
 				gpio-controller;
 				compatible = "aspeed,ast2600-gpio";
-				reg = <0x1e780000 0x800>;
+				reg = <0x1e780000 0x500>;

We took the 0x800 value from the memory space layout table in the datasheet for the 2600. Should that be updated too? Or are you just limiting the region to the registers currently described rather than the allocated address space?

Cheers,

Andrew

#3 lore raw

Re: [RESEND PATCH] ARM: dts: aspeed-g6: Fix gpio memory region

Quoted 8 lines · Andrew Jeffery

Hi Billy,

Quoted 5 lines · Billy Tsai
---
 arch/arm/boot/dts/aspeed-g6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

arch/arm/boot/dts/aspeed-g6.dtsi line 360

Quoted 10 lines
arch/arm/boot/dts/aspeed-g6.dtsi +1 -1
index 97ca743363d7..b9ec8b579f73 100644
@@ -357,7 +357,7 @@
 				#gpio-cells = <2>;
 				gpio-controller;
 				compatible = "aspeed,ast2600-gpio";
-				reg = <0x1e780000 0x800>;
+				reg = <0x1e780000 0x500>;

We took the 0x800 value from the memory space layout table in the datasheet for the 2600. Should that be updated too? Or are you just limiting the region to the registers currently described rather than the allocated address space?

Ah, actually, I see what's going on. We really have this layout (taking some liberties):

0x1e785000 - 0x1e785500: PGPIO 3.3V
0x1e785500 - 0x1e785600: SGPM1
0x1e785600 - 0x1e785700: SGPM2
0x1e785700 - 0x1e785740: SPGS1
0x1e785740 - 0x1e785780: SPGS2
0x1e785800 - 0x1e786000: PGPIO 1.8V

Ryan: Can you change the address space layout table to reflect this? That way it still functions as a quick - but accurate - reference.

Andrew

reviewer
#4 lore raw

RE: [RESEND PATCH] ARM: dts: aspeed-g6: Fix gpio memory region

Quoted 48 lines

-----Original Message-----
From: Andrew Jeffery <[email protected]>
Sent: Thursday, October 1, 2020 8:32 AM
To: Billy Tsai <[email protected]>; Rob Herring <[email protected]>; Joel Stanley <[email protected]>; devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-aspeed at lists.ozlabs.org; linux-kernel at vger.kernel.org; Ryan Chen <[email protected]>
Cc: BMC-SW <[email protected]>
Subject: Re: [RESEND PATCH] ARM: dts: aspeed-g6: Fix gpio memory region

Quoted 8 lines · Andrew Jeffery

Hi Billy,

Quoted 5 lines · Billy Tsai
---
 arch/arm/boot/dts/aspeed-g6.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

arch/arm/boot/dts/aspeed-g6.dtsi line 360

Quoted 11 lines
arch/arm/boot/dts/aspeed-g6.dtsi +1 -1
index 97ca743363d7..b9ec8b579f73 100644
@@ -357,7 +357,7 @@
 				#gpio-cells = <2>;
 				gpio-controller;
 				compatible = "aspeed,ast2600-gpio";
-				reg = <0x1e780000 0x800>;
+				reg = <0x1e780000 0x500>;

We took the 0x800 value from the memory space layout table in the datasheet for the 2600. Should that be updated too? Or are you just limiting the region to the registers currently described rather than the

allocated address space?

Ah, actually, I see what's going on. We really have this layout (taking some liberties):

0x1e785000 - 0x1e785500: PGPIO 3.3V
0x1e785500 - 0x1e785600: SGPM1
0x1e785600 - 0x1e785700: SGPM2
0x1e785700 - 0x1e785740: SPGS1
0x1e785740 - 0x1e785780: SPGS2
0x1e785800 - 0x1e786000: PGPIO 1.8V

Quoted 2 lines

Ryan: Can you change the address space layout table to reflect this? That way it still functions as a quick - but accurate - reference.

Yes will resend the patch for update the table.
0x1e780000 ~ 0x1e780400 PGPIO 3.3V
0x1e780500 - 0x1e780600: SGPM1
0x1e780600 - 0x1e780700: SGPM2
0x1e780700 - 0x1e780740: SPGS1
0x1e780740 - 0x1e780780: SPGS2
0x1e780800 - 0x1e781000: PGPIO 1.8V

#5 lore raw
In reply to Billy Tsai

Hi Billy,

Quoted 44 lines · Billy Tsai

This commit add two sgpiom and two sgpios node into aspeed-g6.dtsi and change the register range of gpio0 to fix the hardware design.

---
 arch/arm/boot/dts/aspeed-g6.dtsi | 51 +++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)
arch/arm/boot/dts/aspeed-g6.dtsi +20 -1
index 97ca743363d7..00237daec2a1 100644
@@ -357,7 +357,7 @@
 				#gpio-cells = <2>;
 				gpio-controller;
 				compatible = "aspeed,ast2600-gpio";
-				reg = <0x1e780000 0x800>;
+				reg = <0x1e780000 0x500>;
 				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
 				gpio-ranges = <&pinctrl 0 0 208>;
 				ngpios = <208>;
@@ -365,6 +365,55 @@
 				interrupt-controller;
 				#interrupt-cells = <2>;
 			};
+			sgpiom0: sgpiom at 1e780500 {
+				#gpio-cells = <2>;
+				gpio-controller;
+				compatible = "aspeed,ast2600-sgpiom";
+				reg = <0x1e780500 0x100>;
+				interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
+				ngpios = <128>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+				interrupt-controller;
+				bus-frequency = <12000000>;
+
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_sgpm1_default>;
+				status = "disabled";
+			};
+
+			sgpiom1: sgpiom at 1e780600 {
+				#gpio-cells = <2>;
+				gpio-controller;

arch/arm/boot/dts/aspeed-g6.dtsi line 396

Quoted 10 lines
arch/arm/boot/dts/aspeed-g6.dtsi +10 -0
+				compatible = "aspeed,ast2600-sgpiom";
+				reg = <0x1e780600 0x100>;
+				interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+				ngpios = <80>;
+				clocks = <&syscon ASPEED_CLK_APB2>;
+				interrupt-controller;
+				bus-frequency = <12000000>;
+
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_sgpm2_default>;

Have you tried building this on top of upstream? Because neither sgpm2 nor sgps2 are supported by the pinctrl driver. If you have patches that implement both mux configurations, can you post them too?

Andrew

author reviewer
#6 lore raw

Hi Andrew,

?On 2020/10/1, 8:36 AM, Andrew Jeffery wrote:

    Hi Billy,
    
    On Wed, 30 Sep 2020, at 14:41, Billy Tsai wrote:
    > This commit add two sgpiom and two sgpios node into aspeed-g6.dtsi
    > and change the register range of gpio0 to fix the hardware design.
    > 
    > Signed-off-by: Billy Tsai <[email protected]>
    > ---
    >  arch/arm/boot/dts/aspeed-g6.dtsi | 51 +++++++++++++++++++++++++++++++-
    >  1 file changed, 50 insertions(+), 1 deletion(-)
    > 
    > diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
    > index 97ca743363d7..00237daec2a1 100644
    > --- a/arch/arm/boot/dts/aspeed-g6.dtsi
    > +++ b/arch/arm/boot/dts/aspeed-g6.dtsi
    > @@ -357,7 +357,7 @@
    >  				#gpio-cells = <2>;
    >  				gpio-controller;
    >  				compatible = "aspeed,ast2600-gpio";
    > -				reg = <0x1e780000 0x800>;
    > +				reg = <0x1e780000 0x500>;
    >  				interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
    >  				gpio-ranges = <&pinctrl 0 0 208>;
    >  				ngpios = <208>;
    > @@ -365,6 +365,55 @@
    >  				interrupt-controller;
    >  				#interrupt-cells = <2>;
    >  			};
    > +			sgpiom0: sgpiom at 1e780500 {
    > +				#gpio-cells = <2>;
    > +				gpio-controller;
    > +				compatible = "aspeed,ast2600-sgpiom";
    > +				reg = <0x1e780500 0x100>;
    > +				interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>;
    > +				ngpios = <128>;
    > +				clocks = <&syscon ASPEED_CLK_APB2>;
    > +				interrupt-controller;
    > +				bus-frequency = <12000000>;
    > +
    > +				pinctrl-names = "default";
    > +				pinctrl-0 = <&pinctrl_sgpm1_default>;
    > +				status = "disabled";
    > +			};
    > +
    > +			sgpiom1: sgpiom at 1e780600 {
    > +				#gpio-cells = <2>;
    > +				gpio-controller;
    > +				compatible = "aspeed,ast2600-sgpiom";
    > +				reg = <0x1e780600 0x100>;
    > +				interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
    > +				ngpios = <80>;
    > +				clocks = <&syscon ASPEED_CLK_APB2>;
    > +				interrupt-controller;
    > +				bus-frequency = <12000000>;
    > +
    > +				pinctrl-names = "default";
    > +				pinctrl-0 = <&pinctrl_sgpm2_default>;
Quoted 5 lines

Have you tried building this on top of upstream? Because neither sgpm2 nor sgps2 are supported by the pinctrl driver. If you have patches that implement both mux configurations, can you post them too?

Andrew

Sorry for that.

I will resend another patch which includes pinctrl information to fix this error.

Best Regards,
Billy Tsai