Commit 9069c13a authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: mv88e6xxx: add a global2_addr info flag

Similarly to global1_addr, add a global2_addr member in the info
structure to describe the presence of the Global 2 Registers.

This allows us to get rid of the MV88E6XXX_FLAG_GLOBAL2 flag.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9e907d73
...@@ -2132,7 +2132,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) ...@@ -2132,7 +2132,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
goto unlock; goto unlock;
/* Setup Switch Global 2 Registers */ /* Setup Switch Global 2 Registers */
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_GLOBAL2)) { if (chip->info->global2_addr) {
err = mv88e6xxx_g2_setup(chip); err = mv88e6xxx_g2_setup(chip);
if (err) if (err)
goto unlock; goto unlock;
...@@ -3240,6 +3240,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3240,6 +3240,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 8, .g1_irqs = 8,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3259,6 +3260,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3259,6 +3260,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 8, .g1_irqs = 8,
.atu_move_port_mask = 0xf, .atu_move_port_mask = 0xf,
...@@ -3276,6 +3278,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3276,6 +3278,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 8, .g1_irqs = 8,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3295,6 +3298,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3295,6 +3298,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3314,6 +3318,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3314,6 +3318,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.atu_move_port_mask = 0xf, .atu_move_port_mask = 0xf,
...@@ -3331,6 +3336,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3331,6 +3336,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.atu_move_port_mask = 0x1f, .atu_move_port_mask = 0x1f,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3349,6 +3355,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3349,6 +3355,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3368,6 +3375,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3368,6 +3375,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3387,6 +3395,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3387,6 +3395,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3406,6 +3415,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3406,6 +3415,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3425,6 +3435,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3425,6 +3435,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3444,6 +3455,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3444,6 +3455,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3463,6 +3475,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3463,6 +3475,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 8, .g1_irqs = 8,
.atu_move_port_mask = 0xf, .atu_move_port_mask = 0xf,
...@@ -3480,6 +3493,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3480,6 +3493,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.tag_protocol = DSA_TAG_PROTO_DSA, .tag_protocol = DSA_TAG_PROTO_DSA,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.g1_irqs = 9, .g1_irqs = 9,
...@@ -3499,6 +3513,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3499,6 +3513,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 14, .g2_irqs = 14,
...@@ -3518,6 +3533,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3518,6 +3533,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 14, .g2_irqs = 14,
...@@ -3537,6 +3553,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3537,6 +3553,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3556,6 +3573,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3556,6 +3573,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 14, .g2_irqs = 14,
...@@ -3575,6 +3593,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3575,6 +3593,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 8, .g1_irqs = 8,
.atu_move_port_mask = 0xf, .atu_move_port_mask = 0xf,
...@@ -3593,6 +3612,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3593,6 +3612,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 8, .g1_irqs = 8,
.atu_move_port_mask = 0xf, .atu_move_port_mask = 0xf,
...@@ -3610,6 +3630,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3610,6 +3630,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.atu_move_port_mask = 0x1f, .atu_move_port_mask = 0x1f,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3628,6 +3649,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3628,6 +3649,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3647,6 +3669,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3647,6 +3669,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3666,6 +3689,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3666,6 +3689,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 4095, .max_vid = 4095,
.port_base_addr = 0x10, .port_base_addr = 0x10,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 15000, .age_time_coeff = 15000,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 10, .g2_irqs = 10,
...@@ -3684,6 +3708,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3684,6 +3708,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 14, .g2_irqs = 14,
...@@ -3702,6 +3727,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = { ...@@ -3702,6 +3727,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.max_vid = 8191, .max_vid = 8191,
.port_base_addr = 0x0, .port_base_addr = 0x0,
.global1_addr = 0x1b, .global1_addr = 0x1b,
.global2_addr = 0x1c,
.age_time_coeff = 3750, .age_time_coeff = 3750,
.g1_irqs = 9, .g1_irqs = 9,
.g2_irqs = 14, .g2_irqs = 14,
......
...@@ -108,11 +108,6 @@ enum mv88e6xxx_cap { ...@@ -108,11 +108,6 @@ enum mv88e6xxx_cap {
*/ */
MV88E6XXX_CAP_SMI_CMD, /* (0x00) SMI Command */ MV88E6XXX_CAP_SMI_CMD, /* (0x00) SMI Command */
MV88E6XXX_CAP_SMI_DATA, /* (0x01) SMI Data */ MV88E6XXX_CAP_SMI_DATA, /* (0x01) SMI Data */
/* Switch Global 2 Registers.
* The device contains a second set of global 16-bit registers.
*/
MV88E6XXX_CAP_GLOBAL2,
}; };
/* Bitmask of capabilities */ /* Bitmask of capabilities */
...@@ -121,51 +116,40 @@ enum mv88e6xxx_cap { ...@@ -121,51 +116,40 @@ enum mv88e6xxx_cap {
#define MV88E6XXX_FLAG_SMI_CMD BIT_ULL(MV88E6XXX_CAP_SMI_CMD) #define MV88E6XXX_FLAG_SMI_CMD BIT_ULL(MV88E6XXX_CAP_SMI_CMD)
#define MV88E6XXX_FLAG_SMI_DATA BIT_ULL(MV88E6XXX_CAP_SMI_DATA) #define MV88E6XXX_FLAG_SMI_DATA BIT_ULL(MV88E6XXX_CAP_SMI_DATA)
#define MV88E6XXX_FLAG_GLOBAL2 BIT_ULL(MV88E6XXX_CAP_GLOBAL2)
/* Multi-chip Addressing Mode */ /* Multi-chip Addressing Mode */
#define MV88E6XXX_FLAGS_MULTI_CHIP \ #define MV88E6XXX_FLAGS_MULTI_CHIP \
(MV88E6XXX_FLAG_SMI_CMD | \ (MV88E6XXX_FLAG_SMI_CMD | \
MV88E6XXX_FLAG_SMI_DATA) MV88E6XXX_FLAG_SMI_DATA)
#define MV88E6XXX_FLAGS_FAMILY_6095 \ #define MV88E6XXX_FLAGS_FAMILY_6095 \
(MV88E6XXX_FLAG_GLOBAL2 | \ (MV88E6XXX_FLAGS_MULTI_CHIP)
MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6097 \ #define MV88E6XXX_FLAGS_FAMILY_6097 \
(MV88E6XXX_FLAG_GLOBAL2 | \ (MV88E6XXX_FLAGS_MULTI_CHIP)
MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6165 \ #define MV88E6XXX_FLAGS_FAMILY_6165 \
(MV88E6XXX_FLAG_GLOBAL2 | \ (MV88E6XXX_FLAGS_MULTI_CHIP)
MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6185 \ #define MV88E6XXX_FLAGS_FAMILY_6185 \
(MV88E6XXX_FLAG_GLOBAL2 | \ (MV88E6XXX_FLAGS_MULTI_CHIP)
MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6320 \ #define MV88E6XXX_FLAGS_FAMILY_6320 \
(MV88E6XXX_FLAG_EEE | \ (MV88E6XXX_FLAG_EEE | \
MV88E6XXX_FLAG_GLOBAL2 | \
MV88E6XXX_FLAGS_MULTI_CHIP) MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6341 \ #define MV88E6XXX_FLAGS_FAMILY_6341 \
(MV88E6XXX_FLAG_EEE | \ (MV88E6XXX_FLAG_EEE | \
MV88E6XXX_FLAG_GLOBAL2 | \
MV88E6XXX_FLAGS_MULTI_CHIP) MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6351 \ #define MV88E6XXX_FLAGS_FAMILY_6351 \
(MV88E6XXX_FLAG_GLOBAL2 | \ (MV88E6XXX_FLAGS_MULTI_CHIP)
MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6352 \ #define MV88E6XXX_FLAGS_FAMILY_6352 \
(MV88E6XXX_FLAG_EEE | \ (MV88E6XXX_FLAG_EEE | \
MV88E6XXX_FLAG_GLOBAL2 | \
MV88E6XXX_FLAGS_MULTI_CHIP) MV88E6XXX_FLAGS_MULTI_CHIP)
#define MV88E6XXX_FLAGS_FAMILY_6390 \ #define MV88E6XXX_FLAGS_FAMILY_6390 \
(MV88E6XXX_FLAG_EEE | \ (MV88E6XXX_FLAG_EEE | \
MV88E6XXX_FLAG_GLOBAL2 | \
MV88E6XXX_FLAGS_MULTI_CHIP) MV88E6XXX_FLAGS_MULTI_CHIP)
struct mv88e6xxx_ops; struct mv88e6xxx_ops;
...@@ -179,6 +163,7 @@ struct mv88e6xxx_info { ...@@ -179,6 +163,7 @@ struct mv88e6xxx_info {
unsigned int max_vid; unsigned int max_vid;
unsigned int port_base_addr; unsigned int port_base_addr;
unsigned int global1_addr; unsigned int global1_addr;
unsigned int global2_addr;
unsigned int age_time_coeff; unsigned int age_time_coeff;
unsigned int g1_irqs; unsigned int g1_irqs;
unsigned int g2_irqs; unsigned int g2_irqs;
......
...@@ -22,22 +22,22 @@ ...@@ -22,22 +22,22 @@
static int mv88e6xxx_g2_read(struct mv88e6xxx_chip *chip, int reg, u16 *val) static int mv88e6xxx_g2_read(struct mv88e6xxx_chip *chip, int reg, u16 *val)
{ {
return mv88e6xxx_read(chip, MV88E6XXX_G2, reg, val); return mv88e6xxx_read(chip, chip->info->global2_addr, reg, val);
} }
static int mv88e6xxx_g2_write(struct mv88e6xxx_chip *chip, int reg, u16 val) static int mv88e6xxx_g2_write(struct mv88e6xxx_chip *chip, int reg, u16 val)
{ {
return mv88e6xxx_write(chip, MV88E6XXX_G2, reg, val); return mv88e6xxx_write(chip, chip->info->global2_addr, reg, val);
} }
static int mv88e6xxx_g2_update(struct mv88e6xxx_chip *chip, int reg, u16 update) static int mv88e6xxx_g2_update(struct mv88e6xxx_chip *chip, int reg, u16 update)
{ {
return mv88e6xxx_update(chip, MV88E6XXX_G2, reg, update); return mv88e6xxx_update(chip, chip->info->global2_addr, reg, update);
} }
static int mv88e6xxx_g2_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask) static int mv88e6xxx_g2_wait(struct mv88e6xxx_chip *chip, int reg, u16 mask)
{ {
return mv88e6xxx_wait(chip, MV88E6XXX_G2, reg, mask); return mv88e6xxx_wait(chip, chip->info->global2_addr, reg, mask);
} }
/* Offset 0x00: Interrupt Source Register */ /* Offset 0x00: Interrupt Source Register */
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include "chip.h" #include "chip.h"
#define MV88E6XXX_G2 0x1c
/* Offset 0x00: Interrupt Source Register */ /* Offset 0x00: Interrupt Source Register */
#define MV88E6XXX_G2_INT_SRC 0x00 #define MV88E6XXX_G2_INT_SRC 0x00
#define MV88E6XXX_G2_INT_SRC_WDOG 0x8000 #define MV88E6XXX_G2_INT_SRC_WDOG 0x8000
...@@ -273,7 +271,7 @@ extern const struct mv88e6xxx_irq_ops mv88e6390_watchdog_ops; ...@@ -273,7 +271,7 @@ extern const struct mv88e6xxx_irq_ops mv88e6390_watchdog_ops;
static inline int mv88e6xxx_g2_require(struct mv88e6xxx_chip *chip) static inline int mv88e6xxx_g2_require(struct mv88e6xxx_chip *chip)
{ {
if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_GLOBAL2)) { if (chip->info->global2_addr) {
dev_err(chip->dev, "this chip requires CONFIG_NET_DSA_MV88E6XXX_GLOBAL2 enabled\n"); dev_err(chip->dev, "this chip requires CONFIG_NET_DSA_MV88E6XXX_GLOBAL2 enabled\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
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