Skip to contentSkip to conversation

ahci: set ahci mode on reset

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Sep 28, 2013 – Oct 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ahci: set ahci mode on reset

ATM we set AHCI mode on 1st GHC write.
Spec says we should set it on reset.

---
 hw/ide/ahci.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
hw/ide/ahci.c +9 -1
index a71a4ca..a8be62c 100644
@@ -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;
Signature · 1 line
MST
Applied
#1 lore raw

Am 28.09.2013 um 23:09 hat Michael S. Tsirkin geschrieben:

Quoted 4 lines

ATM we set AHCI mode on 1st GHC write.
Spec says we should set it on reset.

Thanks, applied to the block branch.

Kevin