Mercurial > ecos-v3_0-branch
comparison packages/redboot/current/src/fs/ide.c @ 1811:a53cbddaeb77
* cdl/redboot.cdl: added CYGSEM_REDBOOT_DISK_IDE_VMWARE option.
* src/fs/ide.c : skip reset IDE commands if running under VMware.
| author | asl |
|---|---|
| date | Wed, 13 Oct 2004 21:22:53 +0000 |
| parents | 5eec99b3cbea |
| children | 74dbf4c3f2e1 |
comparison
equal
deleted
inserted
replaced
| 1810:13b35973042a | 1811:a53cbddaeb77 |
|---|---|
| 97 static int | 97 static int |
| 98 ide_reset(int ctlr) | 98 ide_reset(int ctlr) |
| 99 { | 99 { |
| 100 cyg_uint8 status; | 100 cyg_uint8 status; |
| 101 int delay; | 101 int delay; |
| 102 | 102 // |
| 103 // VMware note: | |
| 104 // VMware virtual IDE device handler obviously expects that | |
| 105 // the reset and setup functions were already done | |
| 106 // by it's bios and complais if one uses reset here... | |
| 107 // | |
| 108 #ifndef CYGSEM_REDBOOT_DISK_IDE_VMWARE | |
| 103 HAL_IDE_WRITE_CONTROL(ctlr, 6); // polled mode, reset asserted | 109 HAL_IDE_WRITE_CONTROL(ctlr, 6); // polled mode, reset asserted |
| 104 CYGACC_CALL_IF_DELAY_US(5000); | 110 CYGACC_CALL_IF_DELAY_US(5000); |
| 105 HAL_IDE_WRITE_CONTROL(ctlr, 2); // polled mode, reset cleared | 111 HAL_IDE_WRITE_CONTROL(ctlr, 2); // polled mode, reset cleared |
| 106 CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000); | 112 CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000); |
| 113 #endif | |
| 107 | 114 |
| 108 // wait 30 seconds max for not busy and drive ready | 115 // wait 30 seconds max for not busy and drive ready |
| 109 for (delay = 0; delay < 300; ++delay) { | 116 for (delay = 0; delay < 300; ++delay) { |
| 110 CYGACC_CALL_IF_DELAY_US((cyg_uint32)100000); | 117 CYGACC_CALL_IF_DELAY_US((cyg_uint32)100000); |
| 111 HAL_IDE_READ_UINT8(ctlr, IDE_REG_STATUS, status); | 118 HAL_IDE_READ_UINT8(ctlr, IDE_REG_STATUS, status); |
| 130 CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000); | 137 CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000); |
| 131 HAL_IDE_WRITE_UINT8(ctlr, IDE_REG_DEVICE, sel); | 138 HAL_IDE_WRITE_UINT8(ctlr, IDE_REG_DEVICE, sel); |
| 132 CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000); | 139 CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000); |
| 133 HAL_IDE_READ_UINT8(ctlr, IDE_REG_DEVICE, val); | 140 HAL_IDE_READ_UINT8(ctlr, IDE_REG_DEVICE, val); |
| 134 if (val == sel) { | 141 if (val == sel) { |
| 142 #ifndef CYGSEM_REDBOOT_DISK_IDE_VMWARE | |
| 135 if (i) | 143 if (i) |
| 136 HAL_IDE_WRITE_UINT8(ctlr, IDE_REG_DEVICE, 0); | 144 HAL_IDE_WRITE_UINT8(ctlr, IDE_REG_DEVICE, 0); |
| 145 #endif | |
| 137 return 1; | 146 return 1; |
| 138 } | 147 } |
| 139 } | 148 } |
| 140 return 0; | 149 return 0; |
| 141 } | 150 } |
