summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2008-09-24 00:36:55 +0200
committerMichael Brown2008-09-24 00:36:55 +0200
commit4011f9d956e224ed245d54dcfcf5d152a5ca297d (patch)
tree69672ed63529c597155301d32b265f78dd770824
parent[pcbios] Sanity-check the INT15,e820 and INT15,e801 memory maps (diff)
downloadipxe-4011f9d956e224ed245d54dcfcf5d152a5ca297d.tar.gz
ipxe-4011f9d956e224ed245d54dcfcf5d152a5ca297d.tar.xz
ipxe-4011f9d956e224ed245d54dcfcf5d152a5ca297d.zip
[phantom] Skip command PEG initialisation if PEG is already running
It is possible for the BIOS to use the UNDI API to bring up the NIC prior to system boot. If this happens, UNM_NIC_REG_CMDPEG_STATE will contain the value 0xf00f (UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK), and we should skip initialising the command PEG.
-rw-r--r--src/drivers/net/phantom/phantom.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/drivers/net/phantom/phantom.c b/src/drivers/net/phantom/phantom.c
index a1313dc3..6c7d1fc9 100644
--- a/src/drivers/net/phantom/phantom.c
+++ b/src/drivers/net/phantom/phantom.c
@@ -1673,6 +1673,17 @@ static int phantom_init_cmdpeg ( struct phantom_nic *phantom ) {
uint32_t cmdpeg_state;
uint32_t last_cmdpeg_state = 0;
+ /* Check for a previous initialisation. This could have
+ * happened if, for example, the BIOS used the UNDI API to
+ * drive the NIC prior to a full PXE boot.
+ */
+ cmdpeg_state = phantom_readl ( phantom, UNM_NIC_REG_CMDPEG_STATE );
+ if ( cmdpeg_state == UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK ) {
+ DBGC ( phantom, "Phantom %p command PEG already initialized\n",
+ phantom );
+ return 0;
+ }
+
/* If this was a cold boot, check that the hardware came up ok */
cold_boot = phantom_readl ( phantom, UNM_CAM_RAM_COLD_BOOT );
if ( cold_boot == UNM_CAM_RAM_COLD_BOOT_MAGIC ) {