[PATCH v1 2/3] ARM: dts: ast2500: Add SGPIO to device tree

Billy Tsai billy_tsai at aspeedtech.com
Wed Oct 16 10:59:54 CEST 2024


Add SGPIO DTS node and enable it for AST2500 EVB.

Signed-off-by: Billy Tsai <billy_tsai at aspeedtech.com>
---
 arch/arm/dts/ast2500-evb.dts             |  5 +++++
 arch/arm/dts/ast2500.dtsi                | 20 ++++++++++++++++++++
 drivers/pinctrl/aspeed/pinctrl_ast2500.c |  1 +
 3 files changed, 26 insertions(+)

diff --git a/arch/arm/dts/ast2500-evb.dts b/arch/arm/dts/ast2500-evb.dts
index d481eadfeb0..9a5037deca2 100644
--- a/arch/arm/dts/ast2500-evb.dts
+++ b/arch/arm/dts/ast2500-evb.dts
@@ -129,3 +129,8 @@
                 reg = <0x4d>;
         };
 };
+
+&sgpio {
+	status = "okay";
+	ngpios = <80>;
+};
diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
index 320d2e5340a..d677705fe85 100644
--- a/arch/arm/dts/ast2500.dtsi
+++ b/arch/arm/dts/ast2500.dtsi
@@ -255,6 +255,21 @@
 				interrupt-controller;
 			};
 
+			sgpio: sgpio at 1e780200 {
+				compatible = "aspeed,ast2500-sgpio";
+				reg = <0x1e780200 0x100>;
+				interrupts = <40>;
+				clocks = <&scu ASPEED_CLK_APB>;
+				#gpio-cells = <2>;
+				gpio-controller;
+				#interrupt-cells = <2>;
+				interrupt-controller;
+				bus-frequency = <1000000>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_sgpm_default>;
+				status = "disabled";
+			};
+
 			timer: timer at 1e782000 {
 				/* This timer is a Faraday FTTMR010 derivative */
 				compatible = "aspeed,ast2400-timer";
@@ -1445,4 +1460,9 @@
 		function = "WDTRST2";
 		groups = "WDTRST2";
 	};
+
+	pinctrl_sgpm_default: sgpm_default {
+		function = "SGPM";
+		groups = "SGPM";
+	};
 };
diff --git a/drivers/pinctrl/aspeed/pinctrl_ast2500.c b/drivers/pinctrl/aspeed/pinctrl_ast2500.c
index 9e7c347caf8..5ecd3f262b9 100644
--- a/drivers/pinctrl/aspeed/pinctrl_ast2500.c
+++ b/drivers/pinctrl/aspeed/pinctrl_ast2500.c
@@ -62,6 +62,7 @@ static const struct ast2500_group_config ast2500_groups[] = {
 	{ "SD2", 5, (1 << 1) },
 	{ "FWSPICS1", 3, (1 << 24) },
 	{ "SPI1CS1", 1, (1 << 15) },
+	{ "SGPM", 2, (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) },
 };
 
 static int ast2500_pinctrl_get_groups_count(struct udevice *dev)
-- 
2.25.1



More information about the U-Boot mailing list