[coreboot] non static < 0x1000 IO space can be broken

Kevin O'Connor kevin at koconnor.net
Sun Jul 19 21:41:50 CEST 2009


On Sun, Jul 19, 2009 at 09:13:20PM +0200, Rudolf Marek wrote:
> Hi,
>
> Kevin just noticed that recent change in devices.c removed the IO alloc 
> start on IO port address 0x1000, so all code which relies on the fact 
> that 0x1000 and down can be done for static device allocation like in 
> vt8237r.h and k8t890.h will fail now. This needs to be fixed with proper 
> static resource to the read_resources. I'm trying to fix this together 
> with Kevin.
>
> Maybe other chipsets/boards will need similar fixups!

The patch Rudolf and I made is attached.  On IRC though, Rudolf noted
that we aren't explicilty allocating 0xcf8 and other crucial
resources.  Maybe we should just add a generic resource for everything
under 0x1000?

-Kevin
-------------- next part --------------
Index: vt8237r_lpc.c
===================================================================
--- vt8237r_lpc.c	(revision 4441)
+++ vt8237r_lpc.c	(working copy)
@@ -421,8 +421,8 @@
 {
 	struct resource *res;
 
+	/* Fixed APIC resource */
 	pci_dev_read_resources(dev);
-	/* Fixed APIC resource */
 	res = new_resource(dev, 0x44);
 	res->base = VT8237R_APIC_BASE;
 	res->size = 256;
@@ -431,6 +431,50 @@
 	res->gran = 8;
 	res->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
 		     IORESOURCE_STORED | IORESOURCE_ASSIGNED;
+
+	/* Fixed SPI resource */
+	pci_dev_read_resources(dev);
+	res = new_resource(dev, 0xbe);
+	res->base = VT8237S_SPI_MEM_BASE;
+	res->size = 256;
+	res->limit = res->base + res->size - 1;
+	res->align = 8;
+	res->gran = 8;
+	res->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
+		     IORESOURCE_STORED | IORESOURCE_ASSIGNED;
+
+	/* Fixed HPET resource */
+	pci_dev_read_resources(dev);
+	res = new_resource(dev, 0x69);
+	res->base = VT8237R_HPET_ADDR;
+	res->size = 1024;
+	res->limit = res->base + res->size - 1;
+	res->align = 8;
+	res->gran = 8;
+	res->flags = IORESOURCE_MEM | IORESOURCE_FIXED |
+		     IORESOURCE_STORED | IORESOURCE_ASSIGNED;
+
+	/* Fixed smbus resource */
+	pci_dev_read_resources(dev);
+	res = new_resource(dev, 0xd0);
+	res->base = VT8237R_SMBUS_IO_BASE;
+	res->size = 16;
+	res->limit = res->base + res->size - 1;
+	res->align = 8;
+	res->gran = 8;
+	res->flags = IORESOURCE_IO | IORESOURCE_FIXED |
+		     IORESOURCE_STORED | IORESOURCE_ASSIGNED;
+
+	pci_dev_read_resources(dev);
+	/* Fixed pmio resource */
+	res = new_resource(dev, 0x88);
+	res->base = VT8237R_ACPI_IO_BASE;
+	res->size = 128;
+	res->limit = res->base + res->size - 1;
+	res->align = 8;
+	res->gran = 8;
+	res->flags = IORESOURCE_IO | IORESOURCE_FIXED |
+		     IORESOURCE_STORED | IORESOURCE_ASSIGNED;
 }
 
 /**


More information about the coreboot mailing list