realtek: Move GS1900 external GPIO to new DTSI
authorSander Vanheule <sander@svanheule.net>
Wed, 22 Jan 2025 11:16:00 +0000 (12:16 +0100)
committerSander Vanheule <sander@svanheule.net>
Sat, 25 Jan 2025 14:06:03 +0000 (15:06 +0100)
In order to be able to define the external GPIO controller on an
emulated MDIO bus, move the controller definition outside of the main
GS1900 include for RTL838x-based devices.

Additionally, a new DTSI is provided defining the RTL8231 on the
emulated MDIO bus.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
13 files changed:
target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts
target/linux/realtek/dts/rtl8380_zyxel_gs1900-8.dts
target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts
target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts
target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi
target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio.dtsi [new file with mode: 0644]
target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio_emulated.dtsi [new file with mode: 0644]
target/linux/realtek/dts/rtl8382_zyxel_gs1900-16.dts
target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-v1.dts
target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e.dts
target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep.dts
target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v1.dts
target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v2.dts

index 190a77b7ff7198742b89a671dbe3322f22990d28..d21b7483922246b88d0612e7cb7f150a394fbaff 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-10hp", "realtek,rtl838x-soc";
index 548e83ba7308eb81f6f37adccc8e0c990f9efec6..1d76f55d6a1640293aa37b0888c7336b1d8dee3a 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-8", "realtek,rtl838x-soc";
index 386edfb01595f2fa3a7c649136fdbaa01161e237..22c052f506f95b75d99fba921ec66b14af5b32ab 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-8hp-v1", "realtek,rtl838x-soc";
index 2702f2ba1cff8abefb75ca6ea95477d9a4980886..728342c22fa782a49bc228eca6a9a6e4b227977e 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-8hp-v2", "realtek,rtl838x-soc";
index 6ab3e4834a2e70f51d26d23255b7a695efdc1592..1411ea0f18a47a2f29ca1f5976344a74d8f3dde6 100644 (file)
        };
 };
 
-&mdio_aux {
-       status = "okay";
-
-       reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
-       reset-delay-us = <1000>;
-       reset-post-delay-us = <10000>;
-
-       gpio1: expander@0 {
-               compatible = "realtek,rtl8231";
-               reg = <0x0>;
-
-               gpio-controller;
-               #gpio-cells = <2>;
-               gpio-ranges = <&gpio1 0 0 37>;
-
-               poe_enable {
-                       gpio-hog;
-                       gpios = <13 GPIO_ACTIVE_HIGH>;
-                       output-high;
-               };
-
-               led-controller {
-                       compatible = "realtek,rtl8231-leds";
-                       status = "disabled";
-               };
-       };
-};
-
 &spi0 {
        status = "okay";
 
diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio.dtsi b/target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio.dtsi
new file mode 100644 (file)
index 0000000..93ec7e4
--- /dev/null
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include <dt-bindings/gpio/gpio.h>
+
+&mdio_aux {
+       status = "okay";
+
+       reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+       reset-delay-us = <1000>;
+       reset-post-delay-us = <10000>;
+
+       gpio1: expander@0 {
+               compatible = "realtek,rtl8231";
+               reg = <0x0>;
+
+               gpio-controller;
+               #gpio-cells = <2>;
+               gpio-ranges = <&gpio1 0 0 37>;
+
+               poe_enable {
+                       gpio-hog;
+                       gpios = <13 GPIO_ACTIVE_HIGH>;
+                       output-high;
+               };
+
+               led-controller {
+                       compatible = "realtek,rtl8231-leds";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio_emulated.dtsi b/target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio_emulated.dtsi
new file mode 100644 (file)
index 0000000..70969eb
--- /dev/null
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include <dt-bindings/gpio/gpio.h>
+
+&mdio_gpio {
+       status = "okay";
+
+       reset-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+       reset-delay-us = <1000>;
+       reset-post-delay-us = <10000>;
+
+       gpio1: expander@0 {
+               compatible = "realtek,rtl8231";
+               reg = <0x0>;
+
+               gpio-controller;
+               #gpio-cells = <2>;
+               gpio-ranges = <&gpio1 0 0 37>;
+
+               poe_enable {
+                       gpio-hog;
+                       gpios = <13 GPIO_ACTIVE_HIGH>;
+                       output-high;
+               };
+
+               led-controller {
+                       compatible = "realtek,rtl8231-leds";
+                       status = "disabled";
+               };
+       };
+};
index 6010da2e26c3f5843c00a92911b867abdbd35bcf..5b40f1ce097b726b3ef9f1115e43040cbc85e5a3 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-16", "realtek,rtl838x-soc";
index 6d98e7fae1dcd443284b9dcf12deeac6297d591f..87cff0022ef841db3b522c27fd3e8820830a1411 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-24-v1", "realtek,rtl838x-soc";
index b455ddf23a990dfef68d1fb41d178aa3a59bf19a..1eaf2090abaeb98aa5312826fa5a759ab37f1680 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-24e", "realtek,rtl838x-soc";
index 25c82f089eeaf6a6df2785834d47b16221acb8f7..fea2e77f3ecfbc61ab78a38a80db8d4de535a369 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-24ep", "realtek,rtl838x-soc";
index fa9bef89d6ba7ff00f6d847f53a167370bbdff53..59cd2082a8d5672e541d3c3209fba4cb85e188a1 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-24hp-v1", "realtek,rtl838x-soc";
index 93011cbdaadfabf92253008fdc16623e194aa81b..78c66507f172b7159c44fd5efcbe34f92d08c8b0 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 
 #include "rtl8380_zyxel_gs1900.dtsi"
+#include "rtl8380_zyxel_gs1900_gpio.dtsi"
 
 / {
        compatible = "zyxel,gs1900-24hp-v2", "realtek,rtl838x-soc";