[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 93/96] pc: acpi-build: reserve PCIHP MMIO resources
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 93/96] pc: acpi-build: reserve PCIHP MMIO resources |
Date: |
Wed, 18 Feb 2015 22:52:49 +0100 |
From: Igor Mammedov <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/acpi-build.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 98553f8..4d5d7e3 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -105,6 +105,8 @@ typedef struct AcpiPmInfo {
uint16_t cpu_hp_io_len;
uint16_t mem_hp_io_base;
uint16_t mem_hp_io_len;
+ uint16_t pcihp_io_base;
+ uint16_t pcihp_io_len;
} AcpiPmInfo;
typedef struct AcpiMiscInfo {
@@ -178,9 +180,15 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
Object *obj = NULL;
QObject *o;
+ pm->pcihp_io_base = 0;
+ pm->pcihp_io_len = 0;
if (piix) {
obj = piix;
pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE;
+ pm->pcihp_io_base =
+ object_property_get_int(obj, ACPI_PCIHP_IO_BASE_PROP, NULL);
+ pm->pcihp_io_len =
+ object_property_get_int(obj, ACPI_PCIHP_IO_LEN_PROP, NULL);
}
if (lpc) {
obj = lpc;
@@ -892,6 +900,25 @@ build_ssdt(GArray *table_data, GArray *linker,
patch_pci_windows(pci, ssdt_ptr, sizeof(ssdp_misc_aml));
+ scope = aml_scope("\\_SB.PCI0");
+ /* reserve PCIHP resources */
+ if (pm->pcihp_io_len) {
+ dev = aml_device("PHPR");
+ aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A06")));
+ aml_append(dev,
+ aml_name_decl("_UID", aml_string("PCI Hotplug resources")));
+ /* device present, functioning, decoding, not shown in UI */
+ aml_append(dev, aml_name_decl("_STA", aml_int(0xB)));
+ crs = aml_resource_template();
+ aml_append(crs,
+ aml_io(aml_decode16, pm->pcihp_io_base, pm->pcihp_io_base, 1,
+ pm->pcihp_io_len)
+ );
+ aml_append(dev, aml_name_decl("_CRS", crs));
+ aml_append(scope, dev);
+ }
+ aml_append(ssdt, scope);
+
/* create S3_ / S4_ / S5_ packages if necessary */
scope = aml_scope("\\");
if (!pm->s3_disabled) {
--
MST
- [Qemu-devel] [PULL 83/96] acpi: add aml_equal() term, (continued)
- [Qemu-devel] [PULL 83/96] acpi: add aml_equal() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 84/96] acpi: add aml_processor() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 85/96] acpi: add aml_eisaid() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 86/96] pc: acpi-build: drop template patching and CPU hotplug objects dynamically, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 87/96] pc: acpi-build: create CPU hotplug IO region dynamically, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 88/96] acpi: add aml_reserved_field() term, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 89/96] pc: acpi-build: drop template patching and memory hotplug objects dynamically, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 90/96] pc: acpi-build: create memory hotplug IO region dynamically, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 91/96] acpi: add aml_word_bus_number(), aml_word_io(), aml_dword_memory(), aml_qword_memory() terms, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 92/96] pc: pcihp: expose MMIO base and len as properties, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 93/96] pc: acpi-build: reserve PCIHP MMIO resources,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 94/96] acpi: update generated hex files, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 95/96] acpi: drop unused generated files, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 96/96] acpi-test: update expected files, Michael S. Tsirkin, 2015/02/18
- Re: [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups, Michael S. Tsirkin, 2015/02/24
- Re: [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups, Peter Maydell, 2015/02/26
- Re: [Qemu-devel] [PULL 00/96] pci, pc, virtio fixes and cleanups, Michael S. Tsirkin, 2015/02/26