aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tg3.c43
-rw-r--r--drivers/net/tg3.h3
2 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index c69c8df088d0..b4c5bab2bb40 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8938,6 +8938,47 @@ static void __devinit tg3_get_5752_nvram_info(struct tg3 *tp)
8938 } 8938 }
8939} 8939}
8940 8940
8941static void __devinit tg3_get_5755_nvram_info(struct tg3 *tp)
8942{
8943 u32 nvcfg1;
8944
8945 nvcfg1 = tr32(NVRAM_CFG1);
8946
8947 /* NVRAM protection for TPM */
8948 if (nvcfg1 & (1 << 27))
8949 tp->tg3_flags2 |= TG3_FLG2_PROTECTED_NVRAM;
8950
8951 switch (nvcfg1 & NVRAM_CFG1_5752VENDOR_MASK) {
8952 case FLASH_5755VENDOR_ATMEL_EEPROM_64KHZ:
8953 case FLASH_5755VENDOR_ATMEL_EEPROM_376KHZ:
8954 tp->nvram_jedecnum = JEDEC_ATMEL;
8955 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
8956 tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
8957
8958 nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS;
8959 tw32(NVRAM_CFG1, nvcfg1);
8960 break;
8961 case FLASH_5752VENDOR_ATMEL_FLASH_BUFFERED:
8962 case FLASH_5755VENDOR_ATMEL_FLASH_1:
8963 case FLASH_5755VENDOR_ATMEL_FLASH_2:
8964 case FLASH_5755VENDOR_ATMEL_FLASH_3:
8965 case FLASH_5755VENDOR_ATMEL_FLASH_4:
8966 tp->nvram_jedecnum = JEDEC_ATMEL;
8967 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
8968 tp->tg3_flags2 |= TG3_FLG2_FLASH;
8969 tp->nvram_pagesize = 264;
8970 break;
8971 case FLASH_5752VENDOR_ST_M45PE10:
8972 case FLASH_5752VENDOR_ST_M45PE20:
8973 case FLASH_5752VENDOR_ST_M45PE40:
8974 tp->nvram_jedecnum = JEDEC_ST;
8975 tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
8976 tp->tg3_flags2 |= TG3_FLG2_FLASH;
8977 tp->nvram_pagesize = 256;
8978 break;
8979 }
8980}
8981
8941static void __devinit tg3_get_5787_nvram_info(struct tg3 *tp) 8982static void __devinit tg3_get_5787_nvram_info(struct tg3 *tp)
8942{ 8983{
8943 u32 nvcfg1; 8984 u32 nvcfg1;
@@ -9011,6 +9052,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
9011 9052
9012 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752) 9053 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752)
9013 tg3_get_5752_nvram_info(tp); 9054 tg3_get_5752_nvram_info(tp);
9055 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755)
9056 tg3_get_5755_nvram_info(tp);
9014 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787) 9057 else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787)
9015 tg3_get_5787_nvram_info(tp); 9058 tg3_get_5787_nvram_info(tp);
9016 else 9059 else
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 672f375ef711..c43cc3264202 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1444,6 +1444,9 @@
1444#define FLASH_5755VENDOR_ATMEL_FLASH_1 0x03400001 1444#define FLASH_5755VENDOR_ATMEL_FLASH_1 0x03400001
1445#define FLASH_5755VENDOR_ATMEL_FLASH_2 0x03400002 1445#define FLASH_5755VENDOR_ATMEL_FLASH_2 0x03400002
1446#define FLASH_5755VENDOR_ATMEL_FLASH_3 0x03400000 1446#define FLASH_5755VENDOR_ATMEL_FLASH_3 0x03400000
1447#define FLASH_5755VENDOR_ATMEL_FLASH_4 0x00000003
1448#define FLASH_5755VENDOR_ATMEL_EEPROM_64KHZ 0x03c00003
1449#define FLASH_5755VENDOR_ATMEL_EEPROM_376KHZ 0x03c00002
1447#define FLASH_5787VENDOR_ATMEL_EEPROM_64KHZ 0x03000003 1450#define FLASH_5787VENDOR_ATMEL_EEPROM_64KHZ 0x03000003
1448#define FLASH_5787VENDOR_ATMEL_EEPROM_376KHZ 0x03000002 1451#define FLASH_5787VENDOR_ATMEL_EEPROM_376KHZ 0x03000002
1449#define FLASH_5787VENDOR_MICRO_EEPROM_64KHZ 0x03000000 1452#define FLASH_5787VENDOR_MICRO_EEPROM_64KHZ 0x03000000