summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2011-10-26 21:05:45 +0000
committeryongari <yongari@FreeBSD.org>2011-10-26 21:05:45 +0000
commitdf46b0b7687f76c773a31ad4063cb53ffa90e1ab (patch)
treee2339439cf2e64a5072f939c49d441ad2b94d3f1 /sys/dev/bge
parent1643ec7110724cae0b6729833cf0d77a17b34cac (diff)
downloadFreeBSD-src-df46b0b7687f76c773a31ad4063cb53ffa90e1ab.zip
FreeBSD-src-df46b0b7687f76c773a31ad4063cb53ffa90e1ab.tar.gz
Rename definition of BGE_SOFTWARE_GENCOMM_* to more readable ones.
The origin of GENCOMM seems to come from Alteon Tigon Host/NIC interface definition where it defines general communications region which is active when firmware is loaded and running. This region was used in communication between the host and processor internal to the Tigon chip. Broadcom data sheet also defines the region as 'Software Gencomm' in NetXtreme memory map but lacks detailed description of its interface so it was hard to know which ones are used for which interface. This change shall slightly enhance readability. No functional changes.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c28
-rw-r--r--sys/dev/bge/if_bgereg.h19
2 files changed, 24 insertions, 23 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 5db6f00..854b76c 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -1309,7 +1309,7 @@ bge_sig_pre_reset(struct bge_softc *sc, int type)
* Some chips don't like this so only do this if ASF is enabled
*/
if (sc->bge_asf_mode)
- bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER);
+ bge_writemem_ind(sc, BGE_SRAM_FW_MB, BGE_SRAM_FW_MB_MAGIC);
if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) {
switch (type) {
@@ -1362,7 +1362,7 @@ bge_stop_fw(struct bge_softc *sc)
int i;
if (sc->bge_asf_mode) {
- bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM_FW, BGE_FW_PAUSE);
+ bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, BGE_FW_PAUSE);
CSR_WRITE_4(sc, BGE_CPU_EVENT,
CSR_READ_4(sc, BGE_CPU_EVENT) | (1 << 14));
@@ -3081,9 +3081,9 @@ bge_attach(device_t dev)
}
sc->bge_asf_mode = 0;
- if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG)
- == BGE_MAGIC_NUMBER)) {
- if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG)
+ if (bge_allow_asf && (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) ==
+ BGE_SRAM_DATA_SIG_MAGIC)) {
+ if (bge_readmem_ind(sc, BGE_SRAM_DATA_CFG)
& BGE_HWCFG_ASF) {
sc->bge_asf_mode |= ASF_ENABLE;
sc->bge_asf_mode |= ASF_STACKUP;
@@ -3197,8 +3197,8 @@ bge_attach(device_t dev)
* by its PCI subsystem ID, as we do below for the SysKonnect
* SK-9D41.
*/
- if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) == BGE_MAGIC_NUMBER)
- hwcfg = bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG);
+ if (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) == BGE_SRAM_DATA_SIG_MAGIC)
+ hwcfg = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG);
else if ((sc->bge_flags & BGE_FLAG_EADDR) &&
(sc->bge_asicrev != BGE_ASICREV_BCM5906)) {
if (bge_read_eeprom(sc, (caddr_t)&hwcfg, BGE_EE_HWCFG_OFFSET,
@@ -3433,9 +3433,9 @@ bge_reset(struct bge_softc *sc)
/*
* Write the magic number to SRAM at offset 0xB50.
* When firmware finishes its initialization it will
- * write ~BGE_MAGIC_NUMBER to the same location.
+ * write ~BGE_SRAM_FW_MB_MAGIC to the same location.
*/
- bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM, BGE_MAGIC_NUMBER);
+ bge_writemem_ind(sc, BGE_SRAM_FW_MB, BGE_SRAM_FW_MB_MAGIC);
reset = BGE_MISCCFG_RESET_CORE_CLOCKS | BGE_32BITTIME_66MHZ;
@@ -3560,8 +3560,8 @@ bge_reset(struct bge_softc *sc)
*/
for (i = 0; i < BGE_TIMEOUT; i++) {
DELAY(10);
- val = bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM);
- if (val == ~BGE_MAGIC_NUMBER)
+ val = bge_readmem_ind(sc, BGE_SRAM_FW_MB);
+ if (val == ~BGE_SRAM_FW_MB_MAGIC)
break;
}
@@ -4100,10 +4100,10 @@ bge_asf_driver_up(struct bge_softc *sc)
sc->bge_asf_count --;
else {
sc->bge_asf_count = 2;
- bge_writemem_ind(sc, BGE_SOFTWARE_GENCOMM_FW,
+ bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB,
BGE_FW_DRV_ALIVE);
- bge_writemem_ind(sc, BGE_SOFTWARE_GENNCOMM_FW_LEN, 4);
- bge_writemem_ind(sc, BGE_SOFTWARE_GENNCOMM_FW_DATA, 3);
+ bge_writemem_ind(sc, BGE_SRAM_FW_CMD_LEN_MB, 4);
+ bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB, 3);
CSR_WRITE_4(sc, BGE_CPU_EVENT,
CSR_READ_4(sc, BGE_CPU_EVENT) | (1 << 14));
}
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index c2b8589..041f0ac 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -71,12 +71,12 @@
#define BGE_STATS_BLOCK_END 0x00000AFF
#define BGE_STATUS_BLOCK 0x00000B00
#define BGE_STATUS_BLOCK_END 0x00000B4F
-#define BGE_SOFTWARE_GENCOMM 0x00000B50
-#define BGE_SOFTWARE_GENCOMM_SIG 0x00000B54
-#define BGE_SOFTWARE_GENCOMM_NICCFG 0x00000B58
-#define BGE_SOFTWARE_GENCOMM_FW 0x00000B78
-#define BGE_SOFTWARE_GENNCOMM_FW_LEN 0x00000B7C
-#define BGE_SOFTWARE_GENNCOMM_FW_DATA 0x00000B80
+#define BGE_SRAM_FW_MB 0x00000B50
+#define BGE_SRAM_DATA_SIG 0x00000B54
+#define BGE_SRAM_DATA_CFG 0x00000B58
+#define BGE_SRAM_FW_CMD_MB 0x00000B78
+#define BGE_SRAM_FW_CMD_LEN_MB 0x00000B7C
+#define BGE_SRAM_FW_CMD_DATA_MB 0x00000B80
#define BGE_SOFTWARE_GENCOMM_END 0x00000FFF
#define BGE_UNMAPPED 0x00001000
#define BGE_UNMAPPED_END 0x00001FFF
@@ -87,6 +87,7 @@
#define BGE_SEND_RING_1_TO_4_END 0x00005FFF
/* Firmware interface */
+#define BGE_SRAM_DATA_SIG_MAGIC 0x4B657654 /* 'KevT' */
#define BGE_FW_DRV_ALIVE 0x00000001
#define BGE_FW_PAUSE 0x00000002
@@ -2052,10 +2053,10 @@
* This magic number is written to the firmware mailbox at 0xb50
* before a software reset is issued. After the internal firmware
* has completed its initialization it will write the opposite of
- * this value, ~BGE_MAGIC_NUMBER, to the same location, allowing the
- * driver to synchronize with the firmware.
+ * this value, ~BGE_SRAM_FW_MB_MAGIC, to the same location,
+ * allowing the driver to synchronize with the firmware.
*/
-#define BGE_MAGIC_NUMBER 0x4B657654
+#define BGE_SRAM_FW_MB_MAGIC 0x4B657654
typedef struct {
uint32_t bge_addr_hi;
OpenPOWER on IntegriCloud