From a6a77896f4cddd6e69bcf86d5a6dc190fa82d53d Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Wed, 22 Jan 2025 12:16:00 +0100 Subject: [PATCH] realtek: Move GS1900 external GPIO to new DTSI 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 --- .../realtek/dts/rtl8380_zyxel_gs1900-10hp.dts | 1 + .../realtek/dts/rtl8380_zyxel_gs1900-8.dts | 1 + .../dts/rtl8380_zyxel_gs1900-8hp-v1.dts | 1 + .../dts/rtl8380_zyxel_gs1900-8hp-v2.dts | 1 + .../realtek/dts/rtl8380_zyxel_gs1900.dtsi | 28 ----------------- .../dts/rtl8380_zyxel_gs1900_gpio.dtsi | 31 +++++++++++++++++++ .../rtl8380_zyxel_gs1900_gpio_emulated.dtsi | 31 +++++++++++++++++++ .../realtek/dts/rtl8382_zyxel_gs1900-16.dts | 1 + .../dts/rtl8382_zyxel_gs1900-24-v1.dts | 1 + .../realtek/dts/rtl8382_zyxel_gs1900-24e.dts | 1 + .../realtek/dts/rtl8382_zyxel_gs1900-24ep.dts | 1 + .../dts/rtl8382_zyxel_gs1900-24hp-v1.dts | 1 + .../dts/rtl8382_zyxel_gs1900-24hp-v2.dts | 1 + 13 files changed, 72 insertions(+), 28 deletions(-) create mode 100644 target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio.dtsi create mode 100644 target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio_emulated.dtsi diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts index 190a77b7ff..d21b748392 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-10hp.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8.dts index 548e83ba73..1d76f55d6a 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8.dts +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts index 386edfb015..22c052f506 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v1.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts index 2702f2ba1c..728342c22f 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900-8hp-v2.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi index 6ab3e4834a..1411ea0f18 100644 --- a/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900.dtsi @@ -42,34 +42,6 @@ }; }; -&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 index 0000000000..93ec7e4a1e --- /dev/null +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio.dtsi @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +&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 index 0000000000..70969eb00c --- /dev/null +++ b/target/linux/realtek/dts/rtl8380_zyxel_gs1900_gpio_emulated.dtsi @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include + +&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"; + }; + }; +}; diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16.dts index 6010da2e26..5b40f1ce09 100644 --- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16.dts +++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-16.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-v1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-v1.dts index 6d98e7fae1..87cff0022e 100644 --- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-v1.dts +++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24-v1.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e.dts index b455ddf23a..1eaf2090ab 100644 --- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e.dts +++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24e.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep.dts index 25c82f089e..fea2e77f3e 100644 --- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep.dts +++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24ep.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v1.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v1.dts index fa9bef89d6..59cd2082a8 100644 --- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v1.dts +++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v1.dts @@ -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"; diff --git a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v2.dts b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v2.dts index 93011cbdaa..78c66507f1 100644 --- a/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v2.dts +++ b/target/linux/realtek/dts/rtl8382_zyxel_gs1900-24hp-v2.dts @@ -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"; -- 2.30.2