mirror of
https://github.com/FUjr/gl-infra-builder.git
synced 2025-12-19 02:27:09 +00:00
patches-19.x: fix mt7530 reset
Signed-off-by: Jianhui Zhao <jianhui.zhao@gl-inet.com>
This commit is contained in:
parent
b56f4ac93f
commit
3c428c0b3c
@ -29,27 +29,18 @@ index 5216cb5c66..61dfa98e85 100644
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,6 +640,26 @@ mt7530_apply_config(struct switch_dev *dev)
|
@@ -637,6 +640,17 @@ mt7530_apply_config(struct switch_dev *dev)
|
||||||
mt7530_w32(priv, REG_ESW_PORT_PPBV1(i), val);
|
mt7530_w32(priv, REG_ESW_PORT_PPBV1(i), val);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ if (priv->reset) {
|
+ if (priv->reset) {
|
||||||
+ priv->reset = 0;
|
+ priv->reset = 0;
|
||||||
+
|
+
|
||||||
+ /* turn off all PHYs */
|
+ /* reset all PHYs */
|
||||||
+ for (i = 0; i <= 4; i++) {
|
+ for (i = 0; i <= 4; i++) {
|
||||||
+ u32 val = mdiobus_read(priv->bus, i, 0x0);
|
+ u32 val = mdiobus_read(priv->bus, i, MII_BMCR);
|
||||||
+ val |= BIT(11);
|
+ val |= BMCR_RESET;
|
||||||
+ mdiobus_write(priv->bus, i, 0x0, val);
|
+ mdiobus_write(priv->bus, i, MII_BMCR, val);
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ usleep_range(10, 20);
|
|
||||||
+
|
|
||||||
+ /* turn on all PHYs */
|
|
||||||
+ for (i = 0; i <= 4; i++) {
|
|
||||||
+ u32 val = mdiobus_read(priv->bus, i, 0);
|
|
||||||
+ val &= ~BIT(11);
|
|
||||||
+ mdiobus_write(priv->bus, i, 0, val);
|
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user