This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
The attached patch changes redboot's fs/ide.c so that it first checks the status of the BSY bit to be 0 before looking at any of the other bits. Per the ATA rev. 6 spec i have:
7.3.3 & 7.15.3 Access restrictions (Alternate status register and status register)
When the BSY bit is set to one, the other bits in this register shall not be used. The contents of this register are not valid while the device is in Sleep mode.
This was causing a detection failure on a Compact Flash card in "True ATA" mode on one of our targets.
Index: redboot/current/src/fs/ide.c
===================================================================
RCS file: /home/cvsroot/Projects/ecos/packages/redboot/current/src/fs/ide.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -5 -w -r1.1.1.1 -r1.2
--- redboot/current/src/fs/ide.c 28 Mar 2004 18:52:37 -0000 1.1.1.1
+++ redboot/current/src/fs/ide.c 16 May 2004 20:08:20 -0000 1.2
@@ -82,16 +82,18 @@
cyg_uint8 status;
CYGACC_CALL_IF_DELAY_US(10);
do {
HAL_IDE_READ_UINT8(ctlr, IDE_REG_STATUS, status);
+ if (!(status & IDE_STAT_BSY)) {
if (status & IDE_STAT_DRQ)
return 1;
- } while (status & IDE_STAT_BSY);
-
+ else
return 0;
}
+ } while (1);
+}
Jifl -- eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts --["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |