diff options
| author | Tristram Ha <[email protected]> | 2025-07-25 00:17:51 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-26 00:01:56 +0000 |
| commit | 5bcdb1373a6c8ffbe2d139a9c7f1fa27d2525b10 (patch) | |
| tree | d1f1dd5b390f3dc2bdd78bd01d51895b595e0496 /drivers/net/dsa | |
| parent | net: dsa: microchip: Use different registers for KSZ8463 (diff) | |
| download | kernel-5bcdb1373a6c8ffbe2d139a9c7f1fa27d2525b10.tar.gz kernel-5bcdb1373a6c8ffbe2d139a9c7f1fa27d2525b10.zip | |
net: dsa: microchip: Write switch MAC address differently for KSZ8463
KSZ8463 uses 16-bit register definitions so it writes differently for
8-bit switch MAC address.
Signed-off-by: Tristram Ha <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/dsa')
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_common.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 552c993b6519..e47c4a5aad6f 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -4821,7 +4821,16 @@ int ksz_switch_macaddr_get(struct dsa_switch *ds, int port, /* Program the switch MAC address to hardware */ for (i = 0; i < ETH_ALEN; i++) { - ret = ksz_write8(dev, regs[REG_SW_MAC_ADDR] + i, addr[i]); + if (ksz_is_ksz8463(dev)) { + u16 addr16 = ((u16)addr[i] << 8) | addr[i + 1]; + + ret = ksz_write16(dev, regs[REG_SW_MAC_ADDR] + i, + addr16); + i++; + } else { + ret = ksz_write8(dev, regs[REG_SW_MAC_ADDR] + i, + addr[i]); + } if (ret) goto macaddr_drop; } |
