Made await_ide(), which polls for an ide status change, check the status
reg much more often. In my case this reduced the time spent in coreboot by 1.5 sec! The timeout values of course aren't changed, only the granularity. Also, I didn't see any udelay() implementation that looked like it couldn't cope with 10 us delays. (Most are written as for (...) inb(0x80) loops.) Signed-off-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de> Acked-by: Marc Jones <marc.jones@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3690 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
f6fa12d89e
commit
c811a1c6ae
|
@ -29,6 +29,7 @@ static int await_ide(int (*done)(struct controller *ctrl),
|
||||||
struct controller *ctrl, unsigned long timeout)
|
struct controller *ctrl, unsigned long timeout)
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
timeout *= 100; /* timeout was ms; finer granularity => reacts faster */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
result = done(ctrl);
|
result = done(ctrl);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -38,7 +39,7 @@ static int await_ide(int (*done)(struct controller *ctrl),
|
||||||
if (timeout-- <= 0) {
|
if (timeout-- <= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
udelay(1000); /* Added to avoid spinning GRW */
|
udelay(10); /* Added to avoid spinning GRW */
|
||||||
}
|
}
|
||||||
printk_info("IDE time out\n");
|
printk_info("IDE time out\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue