summaryrefslogtreecommitdiffstats
path: root/sys/dev/tx
diff options
context:
space:
mode:
authorsemenu <semenu@FreeBSD.org>2001-06-23 19:30:26 +0000
committersemenu <semenu@FreeBSD.org>2001-06-23 19:30:26 +0000
commit0235c0e8cbac19c911822f6ca12627292b50c4ff (patch)
treee9a95ed99ebc88f3fa87f3b5ab62ef477d273fee /sys/dev/tx
parentc513bda9e2e8e845601a3c40c083c53718e0a8e9 (diff)
downloadFreeBSD-src-0235c0e8cbac19c911822f6ca12627292b50c4ff.zip
FreeBSD-src-0235c0e8cbac19c911822f6ca12627292b50c4ff.tar.gz
Add initializetion of NVCTL register with EEPROM stored value.
This fix hazardous very slow work for one of my cards. MFC after: 1 week
Diffstat (limited to 'sys/dev/tx')
-rw-r--r--sys/dev/tx/if_tx.c3
-rw-r--r--sys/dev/tx/if_txreg.h13
-rw-r--r--sys/dev/tx/if_txvar.h13
3 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c
index b16ac50..93c715b 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 f8d1e16..a9ec762 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 f8d1e16..a9ec762 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
OpenPOWER on IntegriCloud