From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58100 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkHZx-0001U2-6L for qemu-devel@nongnu.org; Tue, 01 Feb 2011 09:51:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkHZv-0003ef-Ki for qemu-devel@nongnu.org; Tue, 01 Feb 2011 09:51:36 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50690 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkHZv-0003dr-E1 for qemu-devel@nongnu.org; Tue, 01 Feb 2011 09:51:35 -0500 From: Alexander Graf Date: Tue, 1 Feb 2011 15:51:30 +0100 Message-Id: <1296571892-12702-6-git-send-email-agraf@suse.de> In-Reply-To: <1296571892-12702-1-git-send-email-agraf@suse.de> References: <1296571892-12702-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 5/7] ahci: Implement HBA reset List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Cc: Kevin Wolf , Joerg Roedel , Sebastian Herbszt The ahci code was missing its soft reset functionality. This wasn't really an issue for Linux guests, but Windows gets confused when the controller doesn't reset when it tells it so. Using this patch I can now successfully boot Windows 7 from AHCI using AHCI enabled SeaBIOS. Signed-off-by: Alexander Graf --- hw/ide/ahci.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index e6ac77c..105dd53 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -335,7 +335,7 @@ static void ahci_mem_writel(void *ptr, target_phys_addr_t addr, uint32_t val) case HOST_CTL: /* R/W */ if (val & HOST_CTL_RESET) { DPRINTF(-1, "HBA Reset\n"); - /* FIXME reset? */ + ahci_reset(container_of(s, AHCIPCIState, ahci)); } else { s->control_regs.ghc = (val & 0x3) | HOST_CTL_AHCI_EN; ahci_check_irq(s); @@ -1134,6 +1134,9 @@ void ahci_reset(void *opaque) struct AHCIPCIState *d = opaque; int i; + d->ahci.control_regs.irqstatus = 0; + d->ahci.control_regs.ghc = 0; + for (i = 0; i < SATA_PORTS; i++) { ahci_reset_port(&d->ahci, i); } -- 1.6.0.2