diff options
author | David Cai <david.cai@microchip.com> | 2017-05-02 16:59:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-05-03 09:41:52 -0400 |
commit | f6fec61eb555e47e87234e8915ad726ba6c2d3f8 (patch) | |
tree | 002a475c62b41ab17c3db5733c9310ac43b43bab | |
parent | 8b8e3ad0c840f64a5de2c292cba33976571b9b73 (diff) |
smsc911x: Adding support for Micochip LAN9250 Ethernet controller
Adding support for Microchip LAN9250 Ethernet controller.
Signed-off-by: David Cai <david.cai@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 49 | ||||
-rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.h | 19 |
2 files changed, 49 insertions, 19 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index fa5ca0992be6..ea1bbc355b4d 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c | |||
@@ -25,7 +25,7 @@ | |||
25 | * LAN9215, LAN9216, LAN9217, LAN9218 | 25 | * LAN9215, LAN9216, LAN9217, LAN9218 |
26 | * LAN9210, LAN9211 | 26 | * LAN9210, LAN9211 |
27 | * LAN9220, LAN9221 | 27 | * LAN9220, LAN9221 |
28 | * LAN89218 | 28 | * LAN89218,LAN9250 |
29 | * | 29 | * |
30 | */ | 30 | */ |
31 | 31 | ||
@@ -1450,6 +1450,8 @@ static int smsc911x_soft_reset(struct smsc911x_data *pdata) | |||
1450 | unsigned int timeout; | 1450 | unsigned int timeout; |
1451 | unsigned int temp; | 1451 | unsigned int temp; |
1452 | int ret; | 1452 | int ret; |
1453 | unsigned int reset_offset = HW_CFG; | ||
1454 | unsigned int reset_mask = HW_CFG_SRST_; | ||
1453 | 1455 | ||
1454 | /* | 1456 | /* |
1455 | * Make sure to power-up the PHY chip before doing a reset, otherwise | 1457 | * Make sure to power-up the PHY chip before doing a reset, otherwise |
@@ -1476,15 +1478,23 @@ static int smsc911x_soft_reset(struct smsc911x_data *pdata) | |||
1476 | } | 1478 | } |
1477 | } | 1479 | } |
1478 | 1480 | ||
1481 | if ((pdata->idrev & 0xFFFF0000) == LAN9250) { | ||
1482 | /* special reset for LAN9250 */ | ||
1483 | reset_offset = RESET_CTL; | ||
1484 | reset_mask = RESET_CTL_DIGITAL_RST_; | ||
1485 | } | ||
1486 | |||
1479 | /* Reset the LAN911x */ | 1487 | /* Reset the LAN911x */ |
1480 | smsc911x_reg_write(pdata, HW_CFG, HW_CFG_SRST_); | 1488 | smsc911x_reg_write(pdata, reset_offset, reset_mask); |
1489 | |||
1490 | /* verify reset bit is cleared */ | ||
1481 | timeout = 10; | 1491 | timeout = 10; |
1482 | do { | 1492 | do { |
1483 | udelay(10); | 1493 | udelay(10); |
1484 | temp = smsc911x_reg_read(pdata, HW_CFG); | 1494 | temp = smsc911x_reg_read(pdata, reset_offset); |
1485 | } while ((--timeout) && (temp & HW_CFG_SRST_)); | 1495 | } while ((--timeout) && (temp & reset_mask)); |
1486 | 1496 | ||
1487 | if (unlikely(temp & HW_CFG_SRST_)) { | 1497 | if (unlikely(temp & reset_mask)) { |
1488 | SMSC_WARN(pdata, drv, "Failed to complete reset"); | 1498 | SMSC_WARN(pdata, drv, "Failed to complete reset"); |
1489 | return -EIO; | 1499 | return -EIO; |
1490 | } | 1500 | } |
@@ -2253,28 +2263,29 @@ static int smsc911x_init(struct net_device *dev) | |||
2253 | 2263 | ||
2254 | pdata->idrev = smsc911x_reg_read(pdata, ID_REV); | 2264 | pdata->idrev = smsc911x_reg_read(pdata, ID_REV); |
2255 | switch (pdata->idrev & 0xFFFF0000) { | 2265 | switch (pdata->idrev & 0xFFFF0000) { |
2256 | case 0x01180000: | 2266 | case LAN9118: |
2257 | case 0x01170000: | 2267 | case LAN9117: |
2258 | case 0x01160000: | 2268 | case LAN9116: |
2259 | case 0x01150000: | 2269 | case LAN9115: |
2260 | case 0x218A0000: | 2270 | case LAN89218: |
2261 | /* LAN911[5678] family */ | 2271 | /* LAN911[5678] family */ |
2262 | pdata->generation = pdata->idrev & 0x0000FFFF; | 2272 | pdata->generation = pdata->idrev & 0x0000FFFF; |
2263 | break; | 2273 | break; |
2264 | 2274 | ||
2265 | case 0x118A0000: | 2275 | case LAN9218: |
2266 | case 0x117A0000: | 2276 | case LAN9217: |
2267 | case 0x116A0000: | 2277 | case LAN9216: |
2268 | case 0x115A0000: | 2278 | case LAN9215: |
2269 | /* LAN921[5678] family */ | 2279 | /* LAN921[5678] family */ |
2270 | pdata->generation = 3; | 2280 | pdata->generation = 3; |
2271 | break; | 2281 | break; |
2272 | 2282 | ||
2273 | case 0x92100000: | 2283 | case LAN9210: |
2274 | case 0x92110000: | 2284 | case LAN9211: |
2275 | case 0x92200000: | 2285 | case LAN9220: |
2276 | case 0x92210000: | 2286 | case LAN9221: |
2277 | /* LAN9210/LAN9211/LAN9220/LAN9221 */ | 2287 | case LAN9250: |
2288 | /* LAN9210/LAN9211/LAN9220/LAN9221/LAN9250 */ | ||
2278 | pdata->generation = 4; | 2289 | pdata->generation = 4; |
2279 | break; | 2290 | break; |
2280 | 2291 | ||
diff --git a/drivers/net/ethernet/smsc/smsc911x.h b/drivers/net/ethernet/smsc/smsc911x.h index 54d648920a1b..8d75508acd2b 100644 --- a/drivers/net/ethernet/smsc/smsc911x.h +++ b/drivers/net/ethernet/smsc/smsc911x.h | |||
@@ -20,6 +20,22 @@ | |||
20 | #ifndef __SMSC911X_H__ | 20 | #ifndef __SMSC911X_H__ |
21 | #define __SMSC911X_H__ | 21 | #define __SMSC911X_H__ |
22 | 22 | ||
23 | /*Chip ID*/ | ||
24 | #define LAN9115 0x01150000 | ||
25 | #define LAN9116 0x01160000 | ||
26 | #define LAN9117 0x01170000 | ||
27 | #define LAN9118 0x01180000 | ||
28 | #define LAN9215 0x115A0000 | ||
29 | #define LAN9216 0x116A0000 | ||
30 | #define LAN9217 0x117A0000 | ||
31 | #define LAN9218 0x118A0000 | ||
32 | #define LAN9210 0x92100000 | ||
33 | #define LAN9211 0x92110000 | ||
34 | #define LAN9220 0x92200000 | ||
35 | #define LAN9221 0x92210000 | ||
36 | #define LAN9250 0x92500000 | ||
37 | #define LAN89218 0x218A0000 | ||
38 | |||
23 | #define TX_FIFO_LOW_THRESHOLD ((u32)1600) | 39 | #define TX_FIFO_LOW_THRESHOLD ((u32)1600) |
24 | #define SMSC911X_EEPROM_SIZE ((u32)128) | 40 | #define SMSC911X_EEPROM_SIZE ((u32)128) |
25 | #define USE_DEBUG 0 | 41 | #define USE_DEBUG 0 |
@@ -303,6 +319,9 @@ | |||
303 | #define E2P_DATA_EEPROM_DATA_ 0x000000FF | 319 | #define E2P_DATA_EEPROM_DATA_ 0x000000FF |
304 | #define LAN_REGISTER_EXTENT 0x00000100 | 320 | #define LAN_REGISTER_EXTENT 0x00000100 |
305 | 321 | ||
322 | #define RESET_CTL 0x1F8 | ||
323 | #define RESET_CTL_DIGITAL_RST_ 0x00000001 | ||
324 | |||
306 | /* | 325 | /* |
307 | * MAC Control and Status Register (Indirect Address) | 326 | * MAC Control and Status Register (Indirect Address) |
308 | * Offset (through the MAC_CSR CMD and DATA port) | 327 | * Offset (through the MAC_CSR CMD and DATA port) |