Author: stepan
Date: 2008-03-13 01:49:25 +0100 (Thu, 13 Mar 2008)
New Revision: 43
Modified:
trunk/filo-0.5/defconfig
trunk/filo-0.5/drivers/ide.c
trunk/filo-0.5/main/filo.c
Log:
some sata fixes for FILO, inspired by an old patch from Ward Vandewege.
Signed-off-by: Stefan Reinauer <stepan(a)coresystems.de>
Acked-by: Stefan Reinauer <stepan(a)coresystems.de>
Modified: trunk/filo-0.5/defconfig
===================================================================
--- trunk/filo-0.5/defconfig 2008-01-19 21:08:06 UTC (rev 42)
+++ trunk/filo-0.5/defconfig 2008-03-13 00:49:25 UTC (rev 43)
@@ -31,6 +31,13 @@
# whenever possible.
#IDE_DISK_POLL_DELAY = 1
+# SATA drives seem to have problems reporting their spinup.
+# This will delay FILO start by 5s so the disks have some time to settle.
+# (required on some broken SATA controllers)
+# NOTE: Slows down access significantly, so disable
+# whenever possible.
+#SLOW_SATA = 1
+
# Use PCMCIA compact flash on Via Epia MII10000 and MII6000E
# This device is referred to as hde.
#PCMCIA_CF = 1
Modified: trunk/filo-0.5/drivers/ide.c
===================================================================
--- trunk/filo-0.5/drivers/ide.c 2008-01-19 21:08:06 UTC (rev 42)
+++ trunk/filo-0.5/drivers/ide.c 2008-03-13 00:49:25 UTC (rev 43)
@@ -319,6 +319,8 @@
}
debug("ok\n");
+ debug("Resetting ide%d... ",
+ ctrl - controllers);
/* Disable Interrupts and reset the ide bus */
outb(IDE_CTRL_HD15 | IDE_CTRL_SRST | IDE_CTRL_NIEN,
IDE_REG_DEVICE_CONTROL(ctrl));
@@ -326,9 +328,13 @@
if (await_ide(bsy, ctrl, currticks() + IDE_RESET_PULSE) < 0) {
if (slave_exist)
printf ("reset failed, but slave maybe exist\n");
- else
- return -1;
+ else {
+ // return -1;
+ printf("reset failed, but we may be on SATA\n");
+ }
}
+ debug("ok\n");
+
outb(IDE_CTRL_HD15 | IDE_CTRL_NIEN, IDE_REG_DEVICE_CONTROL(ctrl));
mdelay(2);
if (await_ide(not_bsy, ctrl, currticks() + IDE_TIMEOUT) < 0) {
Modified: trunk/filo-0.5/main/filo.c
===================================================================
--- trunk/filo-0.5/main/filo.c 2008-01-19 21:08:06 UTC (rev 42)
+++ trunk/filo-0.5/main/filo.c 2008-03-13 00:49:25 UTC (rev 43)
@@ -32,6 +32,9 @@
#ifdef SUPPORT_SOUND
sound_init();
#endif
+#ifdef SLOW_SATA
+ delay(5);
+#endif
}
void boot(const char *line)