From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG8Ry-0006Vi-DB for qemu-devel@nongnu.org; Thu, 23 Jun 2016 13:29:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG8Rs-0008V1-7W for qemu-devel@nongnu.org; Thu, 23 Jun 2016 13:29:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG8Rs-0008Us-1i for qemu-devel@nongnu.org; Thu, 23 Jun 2016 13:29:52 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AE32C0799AA for ; Thu, 23 Jun 2016 17:29:51 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-75.ams2.redhat.com [10.36.112.75]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5NHTmVo027314 for ; Thu, 23 Jun 2016 13:29:50 -0400 From: Paolo Bonzini Date: Thu, 23 Jun 2016 19:29:47 +0200 Message-Id: <1466702988-25575-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1466702988-25575-1-git-send-email-pbonzini@redhat.com> References: <1466702988-25575-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] ich9: implement ACPI_EN register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- hw/isa/lpc_ich9.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index cc4e63b..3a8ef51 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -394,10 +394,16 @@ static void ich9_apm_ctrl_changed(uint32_t val, void *arg) /* config:PMBASE */ static void -ich9_lpc_pmbase_update(ICH9LPCState *lpc) +ich9_lpc_pmbase_sci_update(ICH9LPCState *lpc) { uint32_t pm_io_base = pci_get_long(lpc->d.config + ICH9_LPC_PMBASE); - pm_io_base &= ICH9_LPC_PMBASE_BASE_ADDRESS_MASK; + uint8_t acpi_cntl = pci_get_long(lpc->d.config + ICH9_LPC_ACPI_CTRL); + + if (acpi_cntl & ICH9_LPC_ACPI_CTRL_ACPI_EN) { + pm_io_base &= ICH9_LPC_PMBASE_BASE_ADDRESS_MASK; + } else { + pm_io_base = 0; + } ich9_pm_iospace_update(&lpc->pm, pm_io_base); } @@ -449,7 +455,8 @@ static void ich9_lpc_config_write(PCIDevice *d, uint32_t rcba_old = pci_get_long(d->config + ICH9_LPC_RCBA); pci_default_write_config(d, addr, val, len); - if (ranges_overlap(addr, len, ICH9_LPC_PMBASE, 4)) { + if (ranges_overlap(addr, len, ICH9_LPC_PMBASE, 4) || + ranges_overlap(addr, len, ICH9_LPC_ACPI_CTRL, 1)) { ich9_lpc_pmbase_update(lpc); } if (ranges_overlap(addr, len, ICH9_LPC_RCBA, 4)) { @@ -610,6 +617,8 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) pci_set_long(d->wmask + ICH9_LPC_PMBASE, ICH9_LPC_PMBASE_BASE_ADDRESS_MASK); + pci_set_byte(d->wmask + ICH9_LPC_PMBASE, + ICH9_LPC_ACPI_CTRL_ACPI_EN); memory_region_init_io(&lpc->rcrb_mem, OBJECT(d), &rcrb_mmio_ops, lpc, "lpc-rcrb-mmio", ICH9_CC_SIZE); -- 2.5.5