diff options
author | Semen Ustimenko <semenu@FreeBSD.org> | 2001-06-23 19:30:26 +0000 |
---|---|---|
committer | Semen Ustimenko <semenu@FreeBSD.org> | 2001-06-23 19:30:26 +0000 |
commit | 1d57ebcdbf18fc20f881f1f4c04cf00a89524011 (patch) | |
tree | e9a95ed99ebc88f3fa87f3b5ab62ef477d273fee /sys/dev/tx | |
parent | f1a1584029213dc0933e8f2547916add3b93911d (diff) | |
download | src-1d57ebcdbf18fc20f881f1f4c04cf00a89524011.tar.gz src-1d57ebcdbf18fc20f881f1f4c04cf00a89524011.zip |
Add initializetion of NVCTL register with EEPROM stored value.
This fix hazardous very slow work for one of my cards.
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=78677
Diffstat (limited to 'sys/dev/tx')
-rw-r--r-- | sys/dev/tx/if_tx.c | 3 | ||||
-rw-r--r-- | sys/dev/tx/if_txreg.h | 13 | ||||
-rw-r--r-- | sys/dev/tx/if_txvar.h | 13 |
3 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index b16ac50fc76c..93c715b3253f 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -781,6 +781,9 @@ epic_common_attach(sc) for (i = 0; i < ETHER_ADDR_LEN / sizeof(u_int16_t); i++) ((u_int16_t *)sc->sc_macaddr)[i] = epic_read_eeprom(sc,i); + /* Set Non-Volatile Control Register from EEPROM */ + CSR_WRITE_4(sc, NVCTL, epic_read_eeprom(sc, EEPROM_NVCTL) & 0x1F); + /* Set defaults */ sc->tx_threshold = TRANSMIT_THRESHOLD; sc->txcon = TXCON_DEFAULT; diff --git a/sys/dev/tx/if_txreg.h b/sys/dev/tx/if_txreg.h index f8d1e16d9a4c..a9ec762161fa 100644 --- a/sys/dev/tx/if_txreg.h +++ b/sys/dev/tx/if_txreg.h @@ -206,6 +206,19 @@ #define RXCON_DEFAULT (RXCON_EARLY | \ RXCON_RECEIVE_MULTICAST_FRAMES | \ RXCON_RECEIVE_BROADCAST_FRAMES) +/* + * EEPROM structure + * SMC9432* eeprom is organized by words and only first 8 words + * have distinctive meaning (according to datasheet) + */ +#define EEPROM_MAC0 0x0000 /* Byte 0 / Byte 1 */ +#define EEPROM_MAC1 0x0001 /* Byte 2 / Byte 3 */ +#define EEPROM_MAC2 0x0002 /* Byte 4 / Byte 5 */ +#define EEPROM_BID_CSUM 0x0003 /* Board Id / Check Sum */ +#define EEPROM_NVCTL 0x0004 /* NVCTL (bits 0-5) / nothing */ +#define EEPROM_PCI_MGD_MLD 0x0005 /* PCI MinGrant / MaxLatency. Desired */ +#define EEPROM_SSVENDID 0x0006 /* Subsystem Vendor Id */ +#define EEPROM_SSID 0x0006 /* Subsystem Id */ /* * Structures definition and Functions prototypes diff --git a/sys/dev/tx/if_txvar.h b/sys/dev/tx/if_txvar.h index f8d1e16d9a4c..a9ec762161fa 100644 --- a/sys/dev/tx/if_txvar.h +++ b/sys/dev/tx/if_txvar.h @@ -206,6 +206,19 @@ #define RXCON_DEFAULT (RXCON_EARLY | \ RXCON_RECEIVE_MULTICAST_FRAMES | \ RXCON_RECEIVE_BROADCAST_FRAMES) +/* + * EEPROM structure + * SMC9432* eeprom is organized by words and only first 8 words + * have distinctive meaning (according to datasheet) + */ +#define EEPROM_MAC0 0x0000 /* Byte 0 / Byte 1 */ +#define EEPROM_MAC1 0x0001 /* Byte 2 / Byte 3 */ +#define EEPROM_MAC2 0x0002 /* Byte 4 / Byte 5 */ +#define EEPROM_BID_CSUM 0x0003 /* Board Id / Check Sum */ +#define EEPROM_NVCTL 0x0004 /* NVCTL (bits 0-5) / nothing */ +#define EEPROM_PCI_MGD_MLD 0x0005 /* PCI MinGrant / MaxLatency. Desired */ +#define EEPROM_SSVENDID 0x0006 /* Subsystem Vendor Id */ +#define EEPROM_SSID 0x0006 /* Subsystem Id */ /* * Structures definition and Functions prototypes |