summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/mv88e6352.c
diff options
context:
space:
mode:
authorAleksey S. Kazantsev <ioctl@yandex.ru>2015-07-07 20:38:15 -0700
committerDavid S. Miller <davem@davemloft.net>2015-07-09 14:34:23 -0700
commit7c3d0d67d5ddb2aeb3fdae540a567a56c2831d2a (patch)
tree5b538554eb5101bb8df84006c2e7d2bb9d0f15d7 /drivers/net/dsa/mv88e6352.c
parent986ca37eaedc9bc3045a91cc32e6e7427bd87b5d (diff)
dsa: mv88e6352/mv88e6xxx: Add support for Marvell 88E6320 and 88E6321
MV88E6320 and MV88E6321 are largely compatible to MV886352, but are members of a different chip family. Signed-off-by: Aleksey S. Kazantsev <ioctl@yandex.ru> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6352.c')
-rw-r--r--drivers/net/dsa/mv88e6352.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/net/dsa/mv88e6352.c b/drivers/net/dsa/mv88e6352.c
index 632815c10a40..cfece5ae9d5f 100644
--- a/drivers/net/dsa/mv88e6352.c
+++ b/drivers/net/dsa/mv88e6352.c
@@ -36,6 +36,18 @@ static char *mv88e6352_probe(struct device *host_dev, int sw_addr)
return "Marvell 88E6172";
if ((ret & 0xfff0) == PORT_SWITCH_ID_6176)
return "Marvell 88E6176";
+ if (ret == PORT_SWITCH_ID_6320_A1)
+ return "Marvell 88E6320 (A1)";
+ if (ret == PORT_SWITCH_ID_6320_A2)
+ return "Marvell 88e6320 (A2)";
+ if ((ret & 0xfff0) == PORT_SWITCH_ID_6320)
+ return "Marvell 88E6320";
+ if (ret == PORT_SWITCH_ID_6321_A1)
+ return "Marvell 88E6321 (A1)";
+ if (ret == PORT_SWITCH_ID_6321_A2)
+ return "Marvell 88e6321 (A2)";
+ if ((ret & 0xfff0) == PORT_SWITCH_ID_6321)
+ return "Marvell 88E6321";
if (ret == PORT_SWITCH_ID_6352_A0)
return "Marvell 88E6352 (A0)";
if (ret == PORT_SWITCH_ID_6352_A1)
@@ -84,11 +96,12 @@ static int mv88e6352_setup_global(struct dsa_switch *ds)
static int mv88e6352_get_temp(struct dsa_switch *ds, int *temp)
{
+ int phy = mv88e6xxx_6320_family(ds) ? 3 : 0;
int ret;
*temp = 0;
- ret = mv88e6xxx_phy_page_read(ds, 0, 6, 27);
+ ret = mv88e6xxx_phy_page_read(ds, phy, 6, 27);
if (ret < 0)
return ret;
@@ -99,11 +112,12 @@ static int mv88e6352_get_temp(struct dsa_switch *ds, int *temp)
static int mv88e6352_get_temp_limit(struct dsa_switch *ds, int *temp)
{
+ int phy = mv88e6xxx_6320_family(ds) ? 3 : 0;
int ret;
*temp = 0;
- ret = mv88e6xxx_phy_page_read(ds, 0, 6, 26);
+ ret = mv88e6xxx_phy_page_read(ds, phy, 6, 26);
if (ret < 0)
return ret;
@@ -114,23 +128,25 @@ static int mv88e6352_get_temp_limit(struct dsa_switch *ds, int *temp)
static int mv88e6352_set_temp_limit(struct dsa_switch *ds, int temp)
{
+ int phy = mv88e6xxx_6320_family(ds) ? 3 : 0;
int ret;
- ret = mv88e6xxx_phy_page_read(ds, 0, 6, 26);
+ ret = mv88e6xxx_phy_page_read(ds, phy, 6, 26);
if (ret < 0)
return ret;
temp = clamp_val(DIV_ROUND_CLOSEST(temp, 5) + 5, 0, 0x1f);
- return mv88e6xxx_phy_page_write(ds, 0, 6, 26,
+ return mv88e6xxx_phy_page_write(ds, phy, 6, 26,
(ret & 0xe0ff) | (temp << 8));
}
static int mv88e6352_get_temp_alarm(struct dsa_switch *ds, bool *alarm)
{
+ int phy = mv88e6xxx_6320_family(ds) ? 3 : 0;
int ret;
*alarm = false;
- ret = mv88e6xxx_phy_page_read(ds, 0, 6, 26);
+ ret = mv88e6xxx_phy_page_read(ds, phy, 6, 26);
if (ret < 0)
return ret;
@@ -394,5 +410,8 @@ struct dsa_switch_driver mv88e6352_switch_driver = {
.fdb_getnext = mv88e6xxx_port_fdb_getnext,
};
-MODULE_ALIAS("platform:mv88e6352");
MODULE_ALIAS("platform:mv88e6172");
+MODULE_ALIAS("platform:mv88e6176");
+MODULE_ALIAS("platform:mv88e6320");
+MODULE_ALIAS("platform:mv88e6321");
+MODULE_ALIAS("platform:mv88e6352");