Author: stepan Date: 2008-10-29 04:15:42 +0100 (Wed, 29 Oct 2008) New Revision: 3699
Modified: trunk/coreboot-v2/src/config/Options.lb trunk/coreboot-v2/src/devices/device.c trunk/coreboot-v2/src/devices/pci_device.c Log: Changes required to the device allocator: - leave a hole for mmapped PCIe config space if CONFIG_PCIE_CONFIGSPACE_HOLE is set. - Mask moving bits to 32bit when resources are not supposed above 4G. Linux does not like this, even though the resource is disabled.
Signed-off-by: Stefan Reinauer stepan@coresystems.de Acked-by: Myles Watson mylesgw@gmail.com
Modified: trunk/coreboot-v2/src/config/Options.lb =================================================================== --- trunk/coreboot-v2/src/config/Options.lb 2008-10-28 22:13:38 UTC (rev 3698) +++ trunk/coreboot-v2/src/config/Options.lb 2008-10-29 03:15:42 UTC (rev 3699) @@ -1115,6 +1115,12 @@ # 4 for 1280x1024 end
+define CONFIG_PCIE_CONFIGSPACE_HOLE + default 0 + export always + comment "Leave a hole for PCIe config space in the device allocator" +end + ############################################### # Board specific options ###############################################
Modified: trunk/coreboot-v2/src/devices/device.c =================================================================== --- trunk/coreboot-v2/src/devices/device.c 2008-10-28 22:13:38 UTC (rev 3698) +++ trunk/coreboot-v2/src/devices/device.c 2008-10-29 03:15:42 UTC (rev 3699) @@ -366,6 +366,12 @@ (resource->flags & IORESOURCE_IO)? "io": (resource->flags & IORESOURCE_PREFETCH)? "prefmem": "mem"); } +#if CONFIG_PCIE_CONFIGSPACE_HOLE +#warning Handle PCIe hole differently... + if (base >= 0xf0000000 && base < 0xf4000000) { + base = 0xf4000000; + } +#endif } /* A pci bridge resource does not need to be a power * of two size, but it does have a minimum granularity.
Modified: trunk/coreboot-v2/src/devices/pci_device.c =================================================================== --- trunk/coreboot-v2/src/devices/pci_device.c 2008-10-28 22:13:38 UTC (rev 3698) +++ trunk/coreboot-v2/src/devices/pci_device.c 2008-10-29 03:15:42 UTC (rev 3699) @@ -377,7 +377,11 @@ * clear it and forget it. */ if (resource->size == 0) { +#if CONFIG_PCI_64BIT_PREF_MEM == 1 resource->base = moving; +#else + resource->base = moving & 0xffffffff; +#endif resource->flags |= IORESOURCE_ASSIGNED; resource->flags &= ~IORESOURCE_STORED; pci_set_resource(dev, resource);