This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Use redboot ide disks in VMware
- From: Iztok Zupet <iz at elsis dot si>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Sun, 10 Oct 2004 21:34:46 +0200
- Subject: Use redboot ide disks in VMware
- Organization: Elsis d.o.o.
- Reply-to: iz at elsis dot si
This simple patch allows the use of RedBoot IDE disks under VMware as a
configtool option.
Regards
Iztok
diff -C5 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/redboot/current/cdl/redboot.cdl ./redboot/current/cdl/redboot.cdl
*** /ecoscvs/orig/ecos/packages/redboot/current/cdl/redboot.cdl 2004-09-27 20:55:22.000000000 +0200
--- ./redboot/current/cdl/redboot.cdl 2004-10-10 21:20:07.151260549 +0200
***************
*** 964,973 ****
--- 964,981 ----
active_if { CYGINT_HAL_PLF_IF_IDE != 0 }
description "
When this option is enabled, RedBoot will support IDE disks."
compile -library=libextras.a fs/ide.c
implements CYGINT_REDBOOT_DISK_DRIVERS
+
+ cdl_option CYGSEM_REDBOOT_DISK_IDE_VMWARE {
+ display "Work with VMware virtual disks"
+ flavor bool
+ default_value 0
+ description "
+ This option controls the disk driver beaviour at ide-init"
+ }
}
cdl_component CYGSEM_REDBOOT_DISK_EXT2FS {
display "Support Linux second extended filesystems."
flavor bool
diff -C5 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/redboot/current/ChangeLog ./redboot/current/ChangeLog
*** /ecoscvs/orig/ecos/packages/redboot/current/ChangeLog 2004-10-10 16:54:41.000000000 +0200
--- ./redboot/current/ChangeLog 2004-10-10 18:21:46.000000000 +0200
***************
*** 1,5 ****
--- 1,10 ----
+ 2004-10-10 Iztok Zupet <iz@elsis.si>
+
+ * cdl/redboot.cdl: added CYGSEM_REDBOOT_DISK_IDE_VMWARE option.
+ * src/fs/ide.c : skip reset IDE commands if running under VMware.
+
2004-10-08 Andrew Lunn <andrew.lunn@ascom.ch>
* doc/redboot_installing.sgml: Added links to the tools for the
Atmel AT91 JTST board.
diff -C5 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/redboot/current/src/fs/ide.c ./redboot/current/src/fs/ide.c
*** /ecoscvs/orig/ecos/packages/redboot/current/src/fs/ide.c 2004-09-27 21:24:16.000000000 +0200
--- ./redboot/current/src/fs/ide.c 2004-10-10 18:16:59.000000000 +0200
***************
*** 97,111 ****
static int
ide_reset(int ctlr)
{
cyg_uint8 status;
int delay;
!
HAL_IDE_WRITE_CONTROL(ctlr, 6); // polled mode, reset asserted
CYGACC_CALL_IF_DELAY_US(5000);
HAL_IDE_WRITE_CONTROL(ctlr, 2); // polled mode, reset cleared
CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000);
// wait 30 seconds max for not busy and drive ready
for (delay = 0; delay < 300; ++delay) {
CYGACC_CALL_IF_DELAY_US((cyg_uint32)100000);
HAL_IDE_READ_UINT8(ctlr, IDE_REG_STATUS, status);
--- 97,118 ----
static int
ide_reset(int ctlr)
{
cyg_uint8 status;
int delay;
! //
! // VMware note:
! // VMware virtual IDE device handler obviously expects that
! // the reset and setup functions were already done
! // by it's bios and complais if one uses reset here...
! //
! #ifndef CYGSEM_REDBOOT_DISK_IDE_VMWARE
HAL_IDE_WRITE_CONTROL(ctlr, 6); // polled mode, reset asserted
CYGACC_CALL_IF_DELAY_US(5000);
HAL_IDE_WRITE_CONTROL(ctlr, 2); // polled mode, reset cleared
CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000);
+ #endif
// wait 30 seconds max for not busy and drive ready
for (delay = 0; delay < 300; ++delay) {
CYGACC_CALL_IF_DELAY_US((cyg_uint32)100000);
HAL_IDE_READ_UINT8(ctlr, IDE_REG_STATUS, status);
***************
*** 130,141 ****
--- 137,150 ----
CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000);
HAL_IDE_WRITE_UINT8(ctlr, IDE_REG_DEVICE, sel);
CYGACC_CALL_IF_DELAY_US((cyg_uint32)50000);
HAL_IDE_READ_UINT8(ctlr, IDE_REG_DEVICE, val);
if (val == sel) {
+ #ifndef CYGSEM_REDBOOT_DISK_IDE_VMWARE
if (i)
HAL_IDE_WRITE_UINT8(ctlr, IDE_REG_DEVICE, 0);
+ #endif
return 1;
}
}
return 0;
}