Patchwork [12/13] ahci: set SATA Mode Select

login
register
mail settings
Submitter Alexander Graf
Date Dec. 8, 2010, 12:13 p.m.
Message ID <1291810400-11309-13-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/74694/
State New
Headers show

Comments

Alexander Graf - Dec. 8, 2010, 12:13 p.m.
From: Sebastian Herbszt <herbszt@gmx.de>

Set SATA Mode Select to AHCI in the Address Map Register.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
---
 hw/ide/ahci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 7e7aa89..2ef03ed 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1328,6 +1328,9 @@  static int pci_ahci_init(PCIDevice *dev)
     d->card.config[PCI_LATENCY_TIMER]   = 0x00;  /* Latency timer */
     pci_config_set_interrupt_pin(d->card.config, 1);
 
+    /* XXX Software should program this register */
+    d->card.config[0x90]   = 1 << 6; /* Address Map Register - AHCI mode */
+
     qemu_register_reset(ahci_reset, d);
 
     /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */