[phantom] Unhalt/halt all PEGs during driver startup/shutdown

A hardware bug means that reads through the expansion ROM BAR can
return corrupted data if the PEGs are running.  This breaks platforms
that re-read the expansion ROM after invoking gPXE code, such as IBM
blade servers.

Halt PEGs during driver shutdown, and unhalt PEGs during driver
startup if we detect that this is not the first startup since
power-on.
This commit is contained in:
Michael Brown
2008-10-24 03:49:11 +01:00
parent df033de24f
commit 664f4cf365
2 changed files with 70 additions and 0 deletions

View File

@@ -80,6 +80,11 @@ enum unm_reg_blocks {
UNM_CRB_BLK_CAM = 0x22,
UNM_CRB_BLK_ROMUSB = 0x33,
UNM_CRB_BLK_TEST = 0x02,
UNM_CRB_BLK_PEG_0 = 0x11,
UNM_CRB_BLK_PEG_1 = 0x12,
UNM_CRB_BLK_PEG_2 = 0x13,
UNM_CRB_BLK_PEG_3 = 0x14,
UNM_CRB_BLK_PEG_4 = 0x0f,
};
#define UNM_CRB_BASE(blk) ( (blk) << 20 )
#define UNM_CRB_BLK(reg) ( (reg) >> 20 )
@@ -160,6 +165,26 @@ enum unm_reg_blocks {
#define UNM_TEST_RDDATA_LO ( UNM_CRB_TEST + 0x000a8 )
#define UNM_TEST_RDDATA_HI ( UNM_CRB_TEST + 0x000ac )
#define UNM_CRB_PEG_0 UNM_CRB_BASE ( UNM_CRB_BLK_PEG_0 )
#define UNM_PEG_0_HALT_STATUS ( UNM_CRB_PEG_0 + 0x00030 )
#define UNM_PEG_0_HALT ( UNM_CRB_PEG_0 + 0x0003c )
#define UNM_CRB_PEG_1 UNM_CRB_BASE ( UNM_CRB_BLK_PEG_1 )
#define UNM_PEG_1_HALT_STATUS ( UNM_CRB_PEG_1 + 0x00030 )
#define UNM_PEG_1_HALT ( UNM_CRB_PEG_1 + 0x0003c )
#define UNM_CRB_PEG_2 UNM_CRB_BASE ( UNM_CRB_BLK_PEG_2 )
#define UNM_PEG_2_HALT_STATUS ( UNM_CRB_PEG_2 + 0x00030 )
#define UNM_PEG_2_HALT ( UNM_CRB_PEG_2 + 0x0003c )
#define UNM_CRB_PEG_3 UNM_CRB_BASE ( UNM_CRB_BLK_PEG_3 )
#define UNM_PEG_3_HALT_STATUS ( UNM_CRB_PEG_3 + 0x00030 )
#define UNM_PEG_3_HALT ( UNM_CRB_PEG_3 + 0x0003c )
#define UNM_CRB_PEG_4 UNM_CRB_BASE ( UNM_CRB_BLK_PEG_4 )
#define UNM_PEG_4_HALT_STATUS ( UNM_CRB_PEG_4 + 0x00030 )
#define UNM_PEG_4_HALT ( UNM_CRB_PEG_4 + 0x0003c )
/******************************************************************************
*
* Flash layout