Commit 9255bacd authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: dsa: mv88e6xxx: Fix PHY interrupts by parameterising PHY base address

Most of the mv88e6xxx switches have the PHYs at address 0, 1, 2, ...
The 6341 however has the PHYs at 0x10, 0x11, 0x12. Add a parameter to
the info structure for this base address.

Testing of 6f88284f ("net: dsa: mv88e6xxx: Add MDIO interrupts for
internal PHYs") was performed on the 6341. So it works only on the
6341. Use this base information to correctly set the interrupt.

Fixes: 6f88284f ("net: dsa: mv88e6xxx: Add MDIO interrupts for internal PHYs")
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 98f0a395
...@@ -3370,6 +3370,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3370,6 +3370,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3391,6 +3392,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3391,6 +3392,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 0, .num_internal_phys = 0,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3410,6 +3412,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3410,6 +3412,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 8, .num_internal_phys = 8,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3431,6 +3434,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3431,6 +3434,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3452,6 +3456,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3452,6 +3456,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 0, .num_internal_phys = 0,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3472,6 +3477,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3472,6 +3477,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 11, .num_gpio = 11,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
...@@ -3493,6 +3499,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3493,6 +3499,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3514,6 +3521,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3514,6 +3521,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 0, .num_internal_phys = 0,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3535,6 +3543,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3535,6 +3543,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3557,6 +3566,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3557,6 +3566,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 15, .num_gpio = 15,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3578,6 +3588,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3578,6 +3588,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3600,6 +3611,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3600,6 +3611,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 15, .num_gpio = 15,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3621,6 +3633,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3621,6 +3633,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 0, .num_internal_phys = 0,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3641,6 +3654,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3641,6 +3654,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 16, .num_gpio = 16,
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.tag_protocol = DSA_TAG_PROTO_DSA, .tag_protocol = DSA_TAG_PROTO_DSA,
...@@ -3663,6 +3677,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3663,6 +3677,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 16, .num_gpio = 16,
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
...@@ -3684,6 +3699,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3684,6 +3699,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 11, .num_internal_phys = 11,
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
...@@ -3707,6 +3723,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3707,6 +3723,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 15, .num_gpio = 15,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3730,6 +3747,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3730,6 +3747,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 16, .num_gpio = 16,
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
...@@ -3753,6 +3771,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3753,6 +3771,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 15, .num_gpio = 15,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3776,6 +3795,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3776,6 +3795,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 15, .num_gpio = 15,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3798,6 +3818,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3798,6 +3818,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 11, .num_gpio = 11,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
...@@ -3820,6 +3841,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3820,6 +3841,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3841,6 +3863,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3841,6 +3863,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_internal_phys = 5, .num_internal_phys = 5,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3863,6 +3886,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3863,6 +3886,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 15, .num_gpio = 15,
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
...@@ -3885,6 +3909,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3885,6 +3909,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 16, .num_gpio = 16,
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
...@@ -3907,6 +3932,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3907,6 +3932,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.num_gpio = 16, .num_gpio = 16,
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.phy_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c, .global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
......
...@@ -114,6 +114,7 @@ struct mv88e6xxx_info { ...@@ -114,6 +114,7 @@ struct mv88e6xxx_info {
unsigned int num_gpio; unsigned int num_gpio;
unsigned int max_vid; unsigned int max_vid;
unsigned int port_base_addr; unsigned int port_base_addr;
unsigned int phy_base_addr;
unsigned int global1_addr; unsigned int global1_addr;
unsigned int global2_addr; unsigned int global2_addr;
unsigned int age_time_coeff; unsigned int age_time_coeff;
......
...@@ -1118,7 +1118,7 @@ int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip, ...@@ -1118,7 +1118,7 @@ int mv88e6xxx_g2_irq_mdio_setup(struct mv88e6xxx_chip *chip,
err = irq; err = irq;
goto out; goto out;
} }
bus->irq[chip->info->port_base_addr + phy] = irq; bus->irq[chip->info->phy_base_addr + phy] = irq;
} }
return 0; return 0;
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment