rombios/ata: Do not wait for BSY to be set
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 6 Aug 2013 13:48:37 +0000 (14:48 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 8 Aug 2013 11:03:12 +0000 (12:03 +0100)
After issuing a reset, the BSY bit is expected to be set.  This is not the
case for Qemu.

In SeaBIOS.git: 580e33293244fee4556e56ecc67b8bd877f3c496

this check was even replaced with a udelay(5), as enough real hardware ignored
the BSY bit as well.

As rombios does not have an equivalent udelay(), replace the wait with a write
to port 0x80 which is whitelisted by Xen for 'a small delay'.

This causes 42k fewer IO traps to Qemu.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
tools/firmware/rombios/rombios.c

index e364759b3b4ed5b0637a847a49288815d836d38a..a3efc618e0aa693661f4e1097c03f3e6013809f4 100644 (file)
@@ -2914,8 +2914,8 @@ Bit16u device;
 // 8.2.1 (a) -- set SRST in DC
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN | ATA_CB_DC_SRST);
 
-// 8.2.1 (b) -- wait for BSY
-  await_ide(BSY, iobase1, 20);
+// 8.2.1 (b) -- wait
+  outb(0x80, 0x00);
 
 // 8.2.1 (f) -- clear SRST
   outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);