WIP: ipq806x: switch reset fix wip/ipq806x-ea8500-mdio-gpio-reset
authorPetr Štetiar <ynezz@true.cz>
Fri, 7 Jun 2019 11:29:41 +0000 (13:29 +0200)
committerPetr Štetiar <ynezz@true.cz>
Wed, 12 Jun 2019 12:12:43 +0000 (14:12 +0200)
Signed-off-by: Petr Štetiar <ynezz@true.cz>
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
target/linux/ipq806x/patches-4.14/999-mdio-bus-debug-printk.patch [new file with mode: 0644]

index 91c358d245641b8c48efb3634eddf62428da9ee6..e9a08693b184b559e7a936952f70544bee6652de 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";
                        compatible = "virtual,mdio-gpio";
                        #address-cells = <1>;
                        #size-cells = <0>;
+
                        gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
-                       pinctrl-0 = <&mdio0_pins>;
+
+                       pinctrl-0 = <&mdio0_pins &switch_reset>;
                        pinctrl-names = "default";
 
+                       reset-gpios = <&qcom_pinmux 63 GPIO_ACTIVE_LOW>;
+                       reset-delay-us = <12000>;
+
                        phy0: ethernet-phy@0 {
                                reg = <0>;
                                qca,ar8327-initvals = <
diff --git a/target/linux/ipq806x/patches-4.14/999-mdio-bus-debug-printk.patch b/target/linux/ipq806x/patches-4.14/999-mdio-bus-debug-printk.patch
new file mode 100644 (file)
index 0000000..66bc582
--- /dev/null
@@ -0,0 +1,37 @@
+From fe44d9abfeeb1607c674ae009f48f8279b5b83e0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz>
+Date: Mon, 10 Jun 2019 07:46:04 +0200
+Subject: [PATCH] mdio-bus: debug printk and usleep_range
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Štetiar <ynezz@true.cz>
+---
+ drivers/net/phy/mdio_bus.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
+index c545fb1f82bd..1676ac99e6fa 100644
+--- a/drivers/net/phy/mdio_bus.c
++++ b/drivers/net/phy/mdio_bus.c
+@@ -362,8 +362,15 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
+       } else  if (gpiod) {
+               bus->reset_gpiod = gpiod;
++              pr_info("toggling reset gpio\n");
++
+               gpiod_set_value_cansleep(gpiod, 1);
+-              udelay(bus->reset_delay_us);
++
++              if (bus->reset_delay_us < 10)
++                      udelay(bus->reset_delay_us);
++              else
++                      usleep_range(bus->reset_delay_us, bus->reset_delay_us + 1000);
++
+               gpiod_set_value_cansleep(gpiod, 0);
+       }
+-- 
+1.9.1
+