diff options
author | yongari <yongari@FreeBSD.org> | 2011-10-27 21:27:37 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2011-10-27 21:27:37 +0000 |
commit | 6aafd5d8529d62bb46fdca61fc6ec8da22566eb9 (patch) | |
tree | 0bb872f5991c2b75ad04abc214b62955e51f3161 /sys/dev/bge | |
parent | cdc2d138734e99b90a7e6082580ff9cc6e1dd1ee (diff) | |
download | FreeBSD-src-6aafd5d8529d62bb46fdca61fc6ec8da22566eb9.zip FreeBSD-src-6aafd5d8529d62bb46fdca61fc6ec8da22566eb9.tar.gz |
Rename hard-coded value 1 << 14 with BGE_RX_CPU_DRV_EVENT.
This bit(SW event 7 in publicly available data sheet) is used to
make RX CPU handle a firmware command and the bit is automatically
cleared after RX CPU completed the command.
Generally firmware command takes the following steps.
1. Write BGE_SRAM_FW_CMD_MB with a command.
2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes.
3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data.
4. Generate BGE_RX_CPU_EVENT and let firmware handle the command.
5. Wait for the ACK of the firmware command.
No functional changes.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r-- | sys/dev/bge/if_bge.c | 8 | ||||
-rw-r--r-- | sys/dev/bge/if_bgereg.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 13c9c1f..77b4a69 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -1370,10 +1370,11 @@ bge_stop_fw(struct bge_softc *sc) if (sc->bge_asf_mode) { bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, BGE_FW_CMD_PAUSE); CSR_WRITE_4(sc, BGE_RX_CPU_EVENT, - CSR_READ_4(sc, BGE_RX_CPU_EVENT) | (1 << 14)); + CSR_READ_4(sc, BGE_RX_CPU_EVENT) | BGE_RX_CPU_DRV_EVENT); for (i = 0; i < 100; i++ ) { - if (!(CSR_READ_4(sc, BGE_RX_CPU_EVENT) & (1 << 14))) + if (!(CSR_READ_4(sc, BGE_RX_CPU_EVENT) & + BGE_RX_CPU_DRV_EVENT)) break; DELAY(10); } @@ -4111,7 +4112,8 @@ bge_asf_driver_up(struct bge_softc *sc) 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_RX_CPU_EVENT, - CSR_READ_4(sc, BGE_RX_CPU_EVENT) | (1 << 14)); + CSR_READ_4(sc, BGE_RX_CPU_EVENT) | + BGE_RX_CPU_DRV_EVENT); } } } diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index 4962a4c..c46ba3e 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -1901,6 +1901,8 @@ #define BGE_EE_DELAY 0x6848 #define BGE_FASTBOOT_PC 0x6894 +#define BGE_RX_CPU_DRV_EVENT 0x00004000 + /* * NVRAM Control registers */ |