Message ID | 20190730100429.32479-2-h.feurstein@gmail.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | net: dsa: mv88e6xxx: add support for MV88E6220 | expand |
On Tue, Jul 30, 2019 at 12:04:26PM +0200, Hubert Feurstein wrote: > The MV88E6220 is almost the same as MV88E6250 except that the ports 2-4 are > not routed to pins. So the usable ports are 0, 1, 5 and 6. > > Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> > --- > drivers/net/dsa/mv88e6xxx/chip.c | 25 +++++++++++++++++++++++++ > drivers/net/dsa/mv88e6xxx/chip.h | 3 ++- > drivers/net/dsa/mv88e6xxx/port.h | 1 + > 3 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c > index 6b17cd961d06..c4982ced908e 100644 > --- a/drivers/net/dsa/mv88e6xxx/chip.c > +++ b/drivers/net/dsa/mv88e6xxx/chip.c > @@ -4283,6 +4283,31 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { > .ops = &mv88e6240_ops, > }, Hi Hubert We try to keep all these lists in strict numerical order. Please can you add 6220 before 6240, in all the places you have added it. Thanks Andrew
On Tue, Jul 30, 2019 at 12:04:26PM +0200, Hubert Feurstein wrote: > The MV88E6220 is almost the same as MV88E6250 except that the ports 2-4 are > not routed to pins. So the usable ports are 0, 1, 5 and 6. Hi Hubert Do the registers for the ports exist? > + [MV88E6220] = { > + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6220, > + .family = MV88E6XXX_FAMILY_6250, > + .name = "Marvell 88E6220", > + .num_databases = 64, > + > + /* Ports 2-4 are not routed to pins > + * => usable ports 0, 1, 5, 6 > + */ > + .num_ports = 7, I'm wondering if we should add something like .invalid_port_mask = BIT(2) | BIT(3) | BIT(4) and /* Setup Switch Port Registers */ for (i = 0; i < mv88e6xxx_num_ports(chip); i++) { + if (chip->info->invalid_port_mask & BIT(i) && + !dsa_is_unused_port(ds, i)) + return -EINVAL; if (dsa_is_unused_port(ds, i)) { err = mv88e6xxx_port_set_state(chip, i, BR_STATE_DISABLED); Andrew
Hi Andrew, [...] > Do the registers for the ports exist? Yes, they do and they return sane values. > > + [MV88E6220] = { > > + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6220, > > + .family = MV88E6XXX_FAMILY_6250, > > + .name = "Marvell 88E6220", > > + .num_databases = 64, > > + > > + /* Ports 2-4 are not routed to pins > > + * => usable ports 0, 1, 5, 6 > > + */ > > + .num_ports = 7, > > I'm wondering if we should add something like > > .invalid_port_mask = BIT(2) | BIT(3) | BIT(4) > Would make sense. I'll add it to the next series. > > and > > /* Setup Switch Port Registers */ > for (i = 0; i < mv88e6xxx_num_ports(chip); i++) { > + if (chip->info->invalid_port_mask & BIT(i) && > + !dsa_is_unused_port(ds, i)) > + return -EINVAL; > if (dsa_is_unused_port(ds, i)) { > err = mv88e6xxx_port_set_state(chip, i, > BR_STATE_DISABLED); > > Andrew Hubert
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 6b17cd961d06..c4982ced908e 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4283,6 +4283,31 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { .ops = &mv88e6240_ops, }, + [MV88E6220] = { + .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6220, + .family = MV88E6XXX_FAMILY_6250, + .name = "Marvell 88E6220", + .num_databases = 64, + + /* Ports 2-4 are not routed to pins + * => usable ports 0, 1, 5, 6 + */ + .num_ports = 7, + .num_internal_phys = 2, + .max_vid = 4095, + .port_base_addr = 0x08, + .phy_base_addr = 0x00, + .global1_addr = 0x0f, + .global2_addr = 0x07, + .age_time_coeff = 15000, + .g1_irqs = 9, + .g2_irqs = 10, + .atu_move_port_mask = 0xf, + .dual_chip = true, + .tag_protocol = DSA_TAG_PROTO_DSA, + .ops = &mv88e6250_ops, + }, + [MV88E6250] = { .prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6250, .family = MV88E6XXX_FAMILY_6250, diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index 4646e46d47f2..6eb13f269366 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.h +++ b/drivers/net/dsa/mv88e6xxx/chip.h @@ -58,6 +58,7 @@ enum mv88e6xxx_model { MV88E6190X, MV88E6191, MV88E6240, + MV88E6220, MV88E6250, MV88E6290, MV88E6320, @@ -77,7 +78,7 @@ enum mv88e6xxx_family { MV88E6XXX_FAMILY_6097, /* 6046 6085 6096 6097 */ MV88E6XXX_FAMILY_6165, /* 6123 6161 6165 */ MV88E6XXX_FAMILY_6185, /* 6108 6121 6122 6131 6152 6155 6182 6185 */ - MV88E6XXX_FAMILY_6250, /* 6250 */ + MV88E6XXX_FAMILY_6250, /* 6220, 6250 */ MV88E6XXX_FAMILY_6320, /* 6320 6321 */ MV88E6XXX_FAMILY_6341, /* 6141 6341 */ MV88E6XXX_FAMILY_6351, /* 6171 6175 6350 6351 */ diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h index 8d5a6cd6fb19..141df2988cd1 100644 --- a/drivers/net/dsa/mv88e6xxx/port.h +++ b/drivers/net/dsa/mv88e6xxx/port.h @@ -118,6 +118,7 @@ #define MV88E6XXX_PORT_SWITCH_ID_PROD_6191 0x1910 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6185 0x1a70 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6240 0x2400 +#define MV88E6XXX_PORT_SWITCH_ID_PROD_6220 0x2200 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6250 0x2500 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6290 0x2900 #define MV88E6XXX_PORT_SWITCH_ID_PROD_6321 0x3100
The MV88E6220 is almost the same as MV88E6250 except that the ports 2-4 are not routed to pins. So the usable ports are 0, 1, 5 and 6. Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com> --- drivers/net/dsa/mv88e6xxx/chip.c | 25 +++++++++++++++++++++++++ drivers/net/dsa/mv88e6xxx/chip.h | 3 ++- drivers/net/dsa/mv88e6xxx/port.h | 1 + 3 files changed, 28 insertions(+), 1 deletion(-)