.. | .. |
---|
75 | 75 | return mv88e6xxx_g1_wait_bit(chip, MV88E6XXX_G1_STS, bit, 1); |
---|
76 | 76 | } |
---|
77 | 77 | |
---|
78 | | -void mv88e6xxx_g1_wait_eeprom_done(struct mv88e6xxx_chip *chip) |
---|
79 | | -{ |
---|
80 | | - const unsigned long timeout = jiffies + 1 * HZ; |
---|
81 | | - u16 val; |
---|
82 | | - int err; |
---|
83 | | - |
---|
84 | | - /* Wait up to 1 second for the switch to finish reading the |
---|
85 | | - * EEPROM. |
---|
86 | | - */ |
---|
87 | | - while (time_before(jiffies, timeout)) { |
---|
88 | | - err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_STS, &val); |
---|
89 | | - if (err) { |
---|
90 | | - dev_err(chip->dev, "Error reading status"); |
---|
91 | | - return; |
---|
92 | | - } |
---|
93 | | - |
---|
94 | | - /* If the switch is still resetting, it may not |
---|
95 | | - * respond on the bus, and so MDIO read returns |
---|
96 | | - * 0xffff. Differentiate between that, and waiting for |
---|
97 | | - * the EEPROM to be done by bit 0 being set. |
---|
98 | | - */ |
---|
99 | | - if (val != 0xffff && |
---|
100 | | - val & BIT(MV88E6XXX_G1_STS_IRQ_EEPROM_DONE)) |
---|
101 | | - return; |
---|
102 | | - |
---|
103 | | - usleep_range(1000, 2000); |
---|
104 | | - } |
---|
105 | | - |
---|
106 | | - dev_err(chip->dev, "Timeout waiting for EEPROM done"); |
---|
107 | | -} |
---|
108 | | - |
---|
109 | 78 | /* Offset 0x01: Switch MAC Address Register Bytes 0 & 1 |
---|
110 | 79 | * Offset 0x02: Switch MAC Address Register Bytes 2 & 3 |
---|
111 | 80 | * Offset 0x03: Switch MAC Address Register Bytes 4 & 5 |
---|