]> xenbits.xensource.com Git - people/andrewcoop/seabios.git/commitdiff
ahci: Set upper 32-bit registers to zero
authorLadi Prosek <lprosek@redhat.com>
Fri, 13 Jan 2017 09:48:29 +0000 (10:48 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 17 Jan 2017 15:12:07 +0000 (10:12 -0500)
If the HBA supports 64-bit addressing, the registers may contain
non-zero values, for example after reboot as a leftover from the
OS driving the adapter.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
src/hw/ahci.c

index 261a7d24b6a45ecb50c721a8490540d8c44e2698..2eee192bfb3e57b09c0bc13aa46cbfb9122e0642 100644 (file)
@@ -361,6 +361,11 @@ ahci_port_alloc(struct ahci_ctrl_s *ctrl, u32 pnr)
 
     ahci_port_writel(ctrl, pnr, PORT_LST_ADDR, (u32)port->list);
     ahci_port_writel(ctrl, pnr, PORT_FIS_ADDR, (u32)port->fis);
+    if (ctrl->caps & HOST_CAP_64) {
+        ahci_port_writel(ctrl, pnr, PORT_LST_ADDR_HI, 0);
+        ahci_port_writel(ctrl, pnr, PORT_FIS_ADDR_HI, 0);
+    }
+
     return port;
 }