]> git.proxmox.com Git - mirror_qemu.git/commitdiff
ahci: set ahci mode on reset
authorMichael S. Tsirkin <mst@redhat.com>
Sat, 28 Sep 2013 21:09:35 +0000 (00:09 +0300)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Oct 2013 14:49:59 +0000 (16:49 +0200)
ATM we set AHCI mode on 1st GHC write.
Spec says we should set it on reset.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/ahci.c

index a71a4ca47c113ba119b592d5b8dac8e150c0044c..a8be62cf990648cd9b29af168ebee7a46a2c8d0c 100644 (file)
@@ -1198,7 +1198,15 @@ void ahci_reset(AHCIState *s)
     int i;
 
     s->control_regs.irqstatus = 0;
-    s->control_regs.ghc = 0;
+    /* AHCI Enable (AE)
+     * The implementation of this bit is dependent upon the value of the
+     * CAP.SAM bit. If CAP.SAM is '0', then GHC.AE shall be read-write and
+     * shall have a reset value of '0'. If CAP.SAM is '1', then AE shall be
+     * read-only and shall have a reset value of '1'.
+     *
+     * We set HOST_CAP_AHCI so we must enable AHCI at reset.
+     */
+    s->control_regs.ghc = HOST_CTL_AHCI_EN;
 
     for (i = 0; i < s->ports; i++) {
         pr = &s->dev[i].port_regs;