[coreboot-gerrit] Patch set updated for coreboot: 40cd160 qemu: reserve ports

Gerd Hoffmann (kraxel@redhat.com) gerrit at coreboot.org
Fri Aug 9 15:37:15 CEST 2013


Gerd Hoffmann (kraxel at redhat.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3851

-gerrit

commit 40cd160656aeb47d98fb7d596cf7c74bc616cfff
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Tue Aug 6 10:48:41 2013 +0200

    qemu: reserve ports
    
    QEMU has a bunch of non-standard virtual devices on various I/O ports.
    Allocate resources for them so the coreboot resource management knows
    those ports are used.
    
    Change-Id: I51a85967cf2dcd634b0c883210bb52c0c34c8283
    Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
 src/mainboard/emulation/qemu-i440fx/northbridge.c | 30 +++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index b58652d..c08d59e 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -28,6 +28,23 @@ static unsigned long qemu_get_high_memory_size(void)
 	return high;
 }
 
+static void qemu_reserve_ports(struct device *dev, unsigned int idx,
+			       unsigned int base, unsigned int size,
+			       const char *name)
+{
+	unsigned int end = base + size -1;
+	struct resource *res;
+
+	printk(BIOS_DEBUG, "QEMU: reserve ioports 0x%04x-0x%04x [%s]\n",
+	       base, end, name);
+	res = new_resource(dev, idx);
+	res->base = base;
+	res->size = size;
+	res->limit = 0xffff;
+	res->flags = IORESOURCE_IO | IORESOURCE_FIXED | IORESOURCE_STORED |
+		IORESOURCE_ASSIGNED;
+}
+
 static void cpu_pci_domain_set_resources(device_t dev)
 {
 	assign_resources(dev->link_list);
@@ -56,6 +73,19 @@ static void cpu_pci_domain_read_resources(struct device *dev)
 	if (high)
 		ram_resource(dev, idx++, 4 * 1024 * 1024, high);
 
+	/* Reserve I/O ports used by QEMU */
+	qemu_reserve_ports(dev, idx++, 0x0510, 0x02, "firmware-config");
+	qemu_reserve_ports(dev, idx++, 0x5658, 0x01, "vmware-port");
+	if (i440fx) {
+		qemu_reserve_ports(dev, idx++, 0xae00, 0x10, "pci-hotplug");
+		qemu_reserve_ports(dev, idx++, 0xaf00, 0x20, "cpu-hotplug");
+		qemu_reserve_ports(dev, idx++, 0xafe0, 0x04, "piix4-gpe0");
+	}
+	if (inb(CONFIG_CONSOLE_QEMU_DEBUGCON_PORT) == 0xe9) {
+		qemu_reserve_ports(dev, idx++, CONFIG_CONSOLE_QEMU_DEBUGCON_PORT, 1,
+				   "debugcon");
+	}
+
 #if !CONFIG_DYNAMIC_CBMEM
 	/* Leave some space for ACPI, PIRQ and MP tables */
 	high_tables_base = (tomk * 1024) - HIGH_MEMORY_SIZE;



More information about the coreboot-gerrit mailing list