Browse Source

[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.
tags/v0.9.4
Michael Brown 15 years ago
parent
commit
4011f9d956
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      src/drivers/net/phantom/phantom.c

+ 11
- 0
src/drivers/net/phantom/phantom.c View File

1673
 	uint32_t cmdpeg_state;
1673
 	uint32_t cmdpeg_state;
1674
 	uint32_t last_cmdpeg_state = 0;
1674
 	uint32_t last_cmdpeg_state = 0;
1675
 
1675
 
1676
+	/* Check for a previous initialisation.  This could have
1677
+	 * happened if, for example, the BIOS used the UNDI API to
1678
+	 * drive the NIC prior to a full PXE boot.
1679
+	 */
1680
+	cmdpeg_state = phantom_readl ( phantom, UNM_NIC_REG_CMDPEG_STATE );
1681
+	if ( cmdpeg_state == UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK ) {
1682
+		DBGC ( phantom, "Phantom %p command PEG already initialized\n",
1683
+		       phantom );
1684
+		return 0;
1685
+	}
1686
+
1676
 	/* If this was a cold boot, check that the hardware came up ok */
1687
 	/* If this was a cold boot, check that the hardware came up ok */
1677
 	cold_boot = phantom_readl ( phantom, UNM_CAM_RAM_COLD_BOOT );
1688
 	cold_boot = phantom_readl ( phantom, UNM_CAM_RAM_COLD_BOOT );
1678
 	if ( cold_boot == UNM_CAM_RAM_COLD_BOOT_MAGIC ) {
1689
 	if ( cold_boot == UNM_CAM_RAM_COLD_BOOT_MAGIC ) {

Loading…
Cancel
Save