mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Reserve bd82x6x LPC decode ranges in the resource allocator
The LPC bus normally allocates the range for legacy devices, 0-0x1000. Some devices on LPC are above that range and need to be accounted for. Check the decode range settings for addresses > 0x1000 and reserve them. Change-Id: Idba800d7cee3185296f29dd237ba306f3de8de55 Signed-off-by: Marc Jones <marc.jones@se-eng.com> Reviewed-on: http://review.coreboot.org/1337 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
1bb79bcf89
commit
a0bec17455
1 changed files with 37 additions and 2 deletions
|
@ -593,18 +593,20 @@ static void lpc_init(struct device *dev)
|
||||||
static void pch_lpc_read_resources(device_t dev)
|
static void pch_lpc_read_resources(device_t dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
config_t *config = dev->chip_info;
|
||||||
|
u8 io_index = 0;
|
||||||
|
|
||||||
/* Get the normal PCI resources of this device. */
|
/* Get the normal PCI resources of this device. */
|
||||||
pci_dev_read_resources(dev);
|
pci_dev_read_resources(dev);
|
||||||
|
|
||||||
/* Add an extra subtractive resource for both memory and I/O. */
|
/* Add an extra subtractive resource for both memory and I/O. */
|
||||||
res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
|
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||||
res->base = 0;
|
res->base = 0;
|
||||||
res->size = 0x1000;
|
res->size = 0x1000;
|
||||||
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
||||||
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
|
||||||
res = new_resource(dev, IOINDEX_SUBTRACTIVE(1, 0));
|
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||||
res->base = 0xff800000;
|
res->base = 0xff800000;
|
||||||
res->size = 0x00800000; /* 8 MB for flash */
|
res->size = 0x00800000; /* 8 MB for flash */
|
||||||
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
|
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
|
||||||
|
@ -614,6 +616,39 @@ static void pch_lpc_read_resources(device_t dev)
|
||||||
res->base = IO_APIC_ADDR;
|
res->base = IO_APIC_ADDR;
|
||||||
res->size = 0x00001000;
|
res->size = 0x00001000;
|
||||||
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
|
||||||
|
/* Set PCH IO decode ranges if required.*/
|
||||||
|
if ((config->gen1_dec & 0xFFFC) > 0x1000) {
|
||||||
|
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||||
|
res->base = config->gen1_dec & 0xFFFC;
|
||||||
|
res->size = (config->gen1_dec >> 16) & 0xFC;
|
||||||
|
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
||||||
|
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((config->gen2_dec & 0xFFFC) > 0x1000) {
|
||||||
|
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||||
|
res->base = config->gen2_dec & 0xFFFC;
|
||||||
|
res->size = (config->gen2_dec >> 16) & 0xFC;
|
||||||
|
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
||||||
|
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((config->gen3_dec & 0xFFFC) > 0x1000) {
|
||||||
|
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||||
|
res->base = config->gen3_dec & 0xFFFC;
|
||||||
|
res->size = (config->gen3_dec >> 16) & 0xFC;
|
||||||
|
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
||||||
|
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((config->gen4_dec & 0xFFFC) > 0x1000) {
|
||||||
|
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||||
|
res->base = config->gen4_dec & 0xFFFC;
|
||||||
|
res->size = (config->gen4_dec >> 16) & 0xFC;
|
||||||
|
res->flags = IORESOURCE_IO| IORESOURCE_SUBTRACTIVE |
|
||||||
|
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pch_lpc_enable_resources(device_t dev)
|
static void pch_lpc_enable_resources(device_t dev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue