From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58975 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmQMu-00052Z-Jk for qemu-devel@nongnu.org; Mon, 07 Feb 2011 07:39:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmQMs-0008BQ-6j for qemu-devel@nongnu.org; Mon, 07 Feb 2011 07:38:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:63176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmQMr-0008Ay-TQ for qemu-devel@nongnu.org; Mon, 07 Feb 2011 07:38:58 -0500 From: Kevin Wolf Date: Mon, 7 Feb 2011 13:40:24 +0100 Message-Id: <1297082430-628-9-git-send-email-kwolf@redhat.com> In-Reply-To: <1297082430-628-1-git-send-email-kwolf@redhat.com> References: <1297082430-628-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 08/14] ahci: Implement HBA reset List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Alexander Graf 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 Signed-off-by: Kevin Wolf --- 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.7.2.3