qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	gor Mammedov <imammedo@redhat.com>,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Haozhong Zhang <haozhong.zhang@intel.com>
Subject: [Qemu-devel] [RFC PATCH v2 09/12] ich9: enable pm registers when there is no firmware
Date: Thu, 25 Aug 2016 06:15:02 -0400	[thread overview]
Message-ID: <1472120105-29235-10-git-send-email-chao.p.peng@linux.intel.com> (raw)
In-Reply-To: <1472120105-29235-1-git-send-email-chao.p.peng@linux.intel.com>

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
 hw/isa/lpc_ich9.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 10d1ee8..28e9911 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -484,6 +484,9 @@ static void ich9_lpc_reset(DeviceState *qdev)
 {
     PCIDevice *d = PCI_DEVICE(qdev);
     ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
+    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
+    uint32_t pm_base = ICH9_LPC_PMBASE_DEFAULT;
+    uint8_t lpc_ctlr = ICH9_LPC_ACPI_CTRL_DEFAULT;
     uint32_t rcba_old = pci_get_long(d->config + ICH9_LPC_RCBA);
     int i;
 
@@ -495,9 +498,14 @@ static void ich9_lpc_reset(DeviceState *qdev)
         pci_set_byte(d->config + ICH9_LPC_PIRQE_ROUT + i,
                      ICH9_LPC_PIRQ_ROUT_DEFAULT);
     }
-    pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, ICH9_LPC_ACPI_CTRL_DEFAULT);
 
-    pci_set_long(d->config + ICH9_LPC_PMBASE, ICH9_LPC_PMBASE_DEFAULT);
+    if (!pcms->fw_cfg) {
+        lpc_ctlr = ICH9_LPC_ACPI_CTRL_ACPI_EN;
+        pm_base = 0x600 | ICH9_LPC_PMBASE_RTE;
+    }
+
+    pci_set_byte(d->config + ICH9_LPC_ACPI_CTRL, lpc_ctlr);
+    pci_set_long(d->config + ICH9_LPC_PMBASE, pm_base);
     pci_set_long(d->config + ICH9_LPC_RCBA, ICH9_LPC_RCBA_DEFAULT);
 
     ich9_cc_reset(lpc);
-- 
1.8.3.1

  parent reply	other threads:[~2016-08-25 10:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25 10:14 [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 01/12] pc: make smbus configurable Chao Peng
2016-09-06 20:18   ` Eduardo Habkost
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 02/12] pc: make sata configurable Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 03/12] pc: make pic configurable Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 04/12] pc: make pit configurable Chao Peng
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT Chao Peng
2016-08-29 17:06   ` Paolo Bonzini
2016-08-25 10:14 ` [Qemu-devel] [RFC PATCH v2 06/12] acpi: expose data structurs and functions of BIOS linker loader Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 07/12] acpi: expose acpi_checksum() Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 08/12] acpi: patch guest ACPI when there is no firmware Chao Peng
2016-08-25 10:15 ` Chao Peng [this message]
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 10/12] q35: initialize MMCFG base " Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 11/12] pc: support direct loading protected/long mode kernel Chao Peng
2016-08-25 10:15 ` [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware Chao Peng
2016-08-29 17:08   ` Paolo Bonzini
2016-09-02 11:08 ` [Qemu-devel] [RFC PATCH v2 00/12] Guest startup time optimization Paolo Bonzini
2016-09-05  2:37   ` Michael S. Tsirkin
2016-09-06 10:48   ` Chao Peng
2016-09-06 11:53     ` Michael S. Tsirkin
2016-09-06 14:28       ` Chao Peng
2016-09-12 15:15         ` Gerd Hoffmann
2016-09-12 17:57           ` [Qemu-devel] [SeaBIOS] " Peter Stuge
2016-09-06 14:21     ` [Qemu-devel] " Paolo Bonzini
2016-09-06 14:31       ` Chao Peng
2016-09-06 14:45       ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472120105-29235-10-git-send-email-chao.p.peng@linux.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=ehabkost@redhat.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=haozhong.zhang@intel.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).