Skip to content

Commit 13248b9

Browse files
Jerry0443davem330
authored andcommitted
net: dsa: LAN9303: Add basic support for LAN9354
Adding support for the LAN9354 device by allowing it to use the LAN9303 DSA driver. These devices have the same underlying access and control methods and from a feature set point of view the LAN9354 is a superset of the LAN9303. The MDIO access method has been tested on a SAMA5D3-EDS board with a LAN9354 RMII daughter card. While the SPI access method should also be the same, it has not been tested and as such is not included at this time. Signed-off-by: Jerry Ray <jerry.ray@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 732f374 commit 13248b9

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

drivers/net/dsa/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ config NET_DSA_SMSC_LAN9303
7676
select NET_DSA_TAG_LAN9303
7777
select REGMAP
7878
help
79-
This enables support for the SMSC/Microchip LAN9303 3 port ethernet
79+
This enables support for the Microchip LAN9303/LAN9354 3 port ethernet
8080
switch chips.
8181

8282
config NET_DSA_SMSC_LAN9303_I2C
@@ -90,11 +90,11 @@ config NET_DSA_SMSC_LAN9303_I2C
9090
for I2C managed mode.
9191

9292
config NET_DSA_SMSC_LAN9303_MDIO
93-
tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in MDIO managed mode"
93+
tristate "Microchip LAN9303/LAN9354 3-ports 10/100 ethernet switch in MDIO managed mode"
9494
select NET_DSA_SMSC_LAN9303
9595
depends on VLAN_8021Q || VLAN_8021Q=n
9696
help
97-
Enable access functions if the SMSC/Microchip LAN9303 is configured
97+
Enable access functions if the Microchip LAN9303/LAN9354 is configured
9898
for MDIO managed mode.
9999

100100
config NET_DSA_VITESSE_VSC73XX

drivers/net/dsa/lan9303-core.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
*/
2323
#define LAN9303_CHIP_REV 0x14
2424
# define LAN9303_CHIP_ID 0x9303
25+
# define LAN9352_CHIP_ID 0x9352
26+
# define LAN9353_CHIP_ID 0x9353
27+
# define LAN9354_CHIP_ID 0x9354
28+
# define LAN9355_CHIP_ID 0x9355
2529
#define LAN9303_IRQ_CFG 0x15
2630
# define LAN9303_IRQ_CFG_IRQ_ENABLE BIT(8)
2731
# define LAN9303_IRQ_CFG_IRQ_POL BIT(4)
@@ -855,8 +859,9 @@ static int lan9303_check_device(struct lan9303 *chip)
855859
return ret;
856860
}
857861

858-
if ((reg >> 16) != LAN9303_CHIP_ID) {
859-
dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n",
862+
if (((reg >> 16) != LAN9303_CHIP_ID) &&
863+
((reg >> 16) != LAN9354_CHIP_ID)) {
864+
dev_err(chip->dev, "unexpected device found: LAN%4.4X\n",
860865
reg >> 16);
861866
return -ENODEV;
862867
}
@@ -872,7 +877,7 @@ static int lan9303_check_device(struct lan9303 *chip)
872877
if (ret)
873878
dev_warn(chip->dev, "failed to disable switching %d\n", ret);
874879

875-
dev_info(chip->dev, "Found LAN9303 rev. %u\n", reg & 0xffff);
880+
dev_info(chip->dev, "Found LAN%4.4X rev. %u\n", (reg >> 16), reg & 0xffff);
876881

877882
ret = lan9303_detect_phy_setup(chip);
878883
if (ret) {

drivers/net/dsa/lan9303_mdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
158158

159159
static const struct of_device_id lan9303_mdio_of_match[] = {
160160
{ .compatible = "smsc,lan9303-mdio" },
161+
{ .compatible = "microchip,lan9354-mdio" },
161162
{ /* sentinel */ },
162163
};
163164
MODULE_DEVICE_TABLE(of, lan9303_mdio_of_match);

0 commit comments

Comments
 (0)