Skip to content

Commit 5f15d39

Browse files
Ansueldavem330
authored andcommitted
net: dsa: qca8k: make sure PAD0 MAC06 exchange is disabled
Some device set MAC06 exchange in the bootloader. This cause some problem as we don't support this strange mode and we just set the port6 as the primary CPU port. With MAC06 exchange, PAD0 reg configure port6 instead of port0. Add an extra check and explicitly disable MAC06 exchange to correctly configure the port PAD config. Signed-off-by: Ansuel Smith <[email protected]> Fixes: 3fcf734 ("net: dsa: qca8k: add support for cpu port 6") Reviewed-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 563bcba commit 5f15d39

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/net/dsa/qca8k.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,14 @@ qca8k_setup(struct dsa_switch *ds)
11091109
if (ret)
11101110
return ret;
11111111

1112+
/* Make sure MAC06 is disabled */
1113+
ret = qca8k_reg_clear(priv, QCA8K_REG_PORT0_PAD_CTRL,
1114+
QCA8K_PORT0_PAD_MAC06_EXCHANGE_EN);
1115+
if (ret) {
1116+
dev_err(priv->dev, "failed disabling MAC06 exchange");
1117+
return ret;
1118+
}
1119+
11121120
/* Enable CPU Port */
11131121
ret = qca8k_reg_set(priv, QCA8K_REG_GLOBAL_FW_CTRL0,
11141122
QCA8K_GLOBAL_FW_CTRL0_CPU_PORT_EN);

drivers/net/dsa/qca8k.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define QCA8K_MASK_CTRL_DEVICE_ID_MASK GENMASK(15, 8)
3535
#define QCA8K_MASK_CTRL_DEVICE_ID(x) ((x) >> 8)
3636
#define QCA8K_REG_PORT0_PAD_CTRL 0x004
37+
#define QCA8K_PORT0_PAD_MAC06_EXCHANGE_EN BIT(31)
3738
#define QCA8K_PORT0_PAD_SGMII_RXCLK_FALLING_EDGE BIT(19)
3839
#define QCA8K_PORT0_PAD_SGMII_TXCLK_FALLING_EDGE BIT(18)
3940
#define QCA8K_REG_PORT5_PAD_CTRL 0x008

0 commit comments

Comments
 (0)