ipq806x: dts: ea8500: fix gpio based switch reset wip/ipq806x-ea8500-gpio-switch-reset-fix
authorPetr Štetiar <ynezz@true.cz>
Mon, 27 May 2019 10:27:37 +0000 (12:27 +0200)
committerPetr Štetiar <ynezz@true.cz>
Fri, 31 May 2019 07:12:33 +0000 (09:12 +0200)
Linksys EA8500 uses designated GPIO to reset the switch and if the
switch isn't reset properly before first access, it can lead to unusable
switch after soft reboot of the device:

 libphy: GPIO Bitbanged MDIO: probed
 mdio_bus gpio-0: MDIO device at address 0 is missing.
 mdio_bus gpio-0: MDIO device at address 4 is missing.

Working case:

 libphy: GPIO Bitbanged MDIO: probed
 switch0: Atheros AR8337 rev. 2 switch registered on gpio-0

So this patch sets reset GPIO to active low for 15ms as datasheet says,
that chip reset is active low and active low duration must be greater
than 10ms.

Tested-by: Your Real Name <424778940z@gmail.com>
Reported-by: Your Real Name <424778940z@gmail.com>
Ref: https://github.com/openwrt/openwrt/pull/2047
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2168
Signed-off-by: Petr Štetiar <ynezz@true.cz>
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts

index 1257535f48359a3a13dada525cc43c7a46dc5608..fa3369078ba9756685dd5752c502b2c59f240f6c 100644 (file)
@@ -40,9 +40,6 @@
        soc {
                pinmux@800000 {
 
-                       pinctrl-0 = <&switch_reset>;
-                       pinctrl-names = "default";
-
                        button_pins: button_pins {
                                mux {
                                        pins = "gpio65", "gpio67", "gpio68";
                        gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
+
                        switch0@18 {
                                compatible = "qca,qca8337";
                                reg = <0x18>;
+
+                               pinctrl-0 = <&switch_reset>;
+                               pinctrl-names = "reset";
+                               reset-gpio = <&qcom_pinmux 63 GPIO_ACTIVE_LOW>;
+
                                qca,ar8327-initvals = <
                                        0x00004 0x7600000   /* PAD0_MODE */
                                        0x00008 0x1000000   /* PAD5_MODE */