SRAM offset 0x0C04 is used by driver to inform the IPMI/ASF firmware

about the various driver events like load, unload, reset, suspend,
restart, and ioctl operations.
Define driver's event rather than using hard-coded values.  We don't
still send suspend/resume event to firmware.

Previously bge(4) used BGE_SDI_STATUS to send events. Because driver
has to access firmware mail box to inform current state, using
BGE_SDI_STATUS register was wrong. The end result was the same as
BGE_SDI_STATUS is 0x0C04.

No functional changes.
This commit is contained in:
yongari 2011-10-26 23:52:02 +00:00
parent eca1a7f126
commit 9eaf5975ff
2 changed files with 20 additions and 6 deletions

View File

@ -1314,10 +1314,12 @@ bge_sig_pre_reset(struct bge_softc *sc, int type)
if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) {
switch (type) {
case BGE_RESET_START:
bge_writemem_ind(sc, BGE_SDI_STATUS, 0x1); /* START */
bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB,
BGE_FW_DRV_STATE_START);
break;
case BGE_RESET_STOP:
bge_writemem_ind(sc, BGE_SDI_STATUS, 0x2); /* UNLOAD */
bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB,
BGE_FW_DRV_STATE_UNLOAD);
break;
}
}
@ -1330,11 +1332,13 @@ bge_sig_post_reset(struct bge_softc *sc, int type)
if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) {
switch (type) {
case BGE_RESET_START:
bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001);
bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB,
BGE_FW_DRV_STATE_START_DONE);
/* START DONE */
break;
case BGE_RESET_STOP:
bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002);
bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB,
BGE_FW_DRV_STATE_UNLOAD_DONE);
break;
}
}
@ -1347,10 +1351,12 @@ bge_sig_legacy(struct bge_softc *sc, int type)
if (sc->bge_asf_mode) {
switch (type) {
case BGE_RESET_START:
bge_writemem_ind(sc, BGE_SDI_STATUS, 0x1); /* START */
bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB,
BGE_FW_DRV_STATE_START);
break;
case BGE_RESET_STOP:
bge_writemem_ind(sc, BGE_SDI_STATUS, 0x2); /* UNLOAD */
bge_writemem_ind(sc, BGE_SRAM_FW_DRV_STATE_MB,
BGE_FW_DRV_STATE_UNLOAD);
break;
}
}

View File

@ -77,6 +77,7 @@
#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_SRAM_FW_DRV_STATE_MB 0x00000C04
#define BGE_SRAM_MAC_ADDR_HIGH_MB 0x00000C14
#define BGE_SRAM_MAC_ADDR_LOW_MB 0x00000C18
#define BGE_SOFTWARE_GENCOMM_END 0x00000FFF
@ -93,6 +94,13 @@
#define BGE_FW_DRV_ALIVE 0x00000001
#define BGE_FW_PAUSE 0x00000002
#define BGE_FW_DRV_STATE_START 0x00000001
#define BGE_FW_DRV_STATE_START_DONE 0x80000001
#define BGE_FW_DRV_STATE_UNLOAD 0x00000002
#define BGE_FW_DRV_STATE_UNLOAD_DONE 0x80000002
#define BGE_FW_DRV_STATE_WOL 0x00000003
#define BGE_FW_DRV_STATE_SUSPEND 0x00000004
/* Mappings for internal memory configuration */
#define BGE_STD_RX_RINGS 0x00006000
#define BGE_STD_RX_RINGS_END 0x00006FFF