Skip to content

Commit cb85215

Browse files
shesselbadavem330
authored andcommitted
net: mv643xx_eth: proper initialization for Kirkwood SoCs
Ethernet controllers found on Kirkwood SoCs not only suffer from loosing MAC address register contents on clock gating but also some important registers are reset to values that would break ethernet. This patch clears the CLK125_BYPASS_EN bit for DT enabled Kirkwood only by using of_device_is_compatible() instead of #ifdefs. Non-DT Kirkwood is not affected as it installs a clock gating workaround because of the MAC address issue above. Other Orion SoCs do not suffer from register reset, do not have the bit in question, or do not have the register at all. Moreover, system controllers on PPC using this driver should also be protected from clearing that bit. Signed-off-by: Sebastian Hesselbarth <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cc9d459 commit cb85215

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/net/ethernet/marvell/mv643xx_eth.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ static char mv643xx_eth_driver_version[] = "1.4";
116116
#define LINK_UP 0x00000002
117117
#define TXQ_COMMAND 0x0048
118118
#define TXQ_FIX_PRIO_CONF 0x004c
119+
#define PORT_SERIAL_CONTROL1 0x004c
120+
#define CLK125_BYPASS_EN 0x00000010
119121
#define TX_BW_RATE 0x0050
120122
#define TX_BW_MTU 0x0058
121123
#define TX_BW_BURST 0x005c
@@ -2701,6 +2703,15 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
27012703

27022704
mp->dev = dev;
27032705

2706+
/* Kirkwood resets some registers on gated clocks. Especially
2707+
* CLK125_BYPASS_EN must be cleared but is not available on
2708+
* all other SoCs/System Controllers using this driver.
2709+
*/
2710+
if (of_device_is_compatible(pdev->dev.of_node,
2711+
"marvell,kirkwood-eth-port"))
2712+
wrlp(mp, PORT_SERIAL_CONTROL1,
2713+
rdlp(mp, PORT_SERIAL_CONTROL1) & ~CLK125_BYPASS_EN);
2714+
27042715
/*
27052716
* Start with a default rate, and if there is a clock, allow
27062717
* it to override the default.

0 commit comments

Comments
 (0)