sb/intel/i82801jx: Add addition IO resources
Adapted from i82801gx. Change-Id: I9108a45135908b7c4e74e9df3bb8f89f55893299 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/19251 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
899577676b
commit
e5dcaf1269
|
@ -471,6 +471,7 @@ static void lpc_init(struct device *dev)
|
|||
|
||||
static void i82801jx_lpc_read_resources(device_t dev)
|
||||
{
|
||||
int i, io_index = 0;
|
||||
/*
|
||||
* I/O Resources
|
||||
*
|
||||
|
@ -507,15 +508,15 @@ static void i82801jx_lpc_read_resources(device_t dev)
|
|||
pci_dev_read_resources(dev);
|
||||
|
||||
/* 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->size = 0x1000;
|
||||
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
||||
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||
|
||||
res = new_resource(dev, IOINDEX_SUBTRACTIVE(1, 0));
|
||||
res->base = 0xff800000;
|
||||
res->size = 0x00800000; /* 8 MB for flash */
|
||||
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||
res->base = 0xff000000;
|
||||
res->size = 0x01000000; /* 16 MB for flash */
|
||||
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
|
||||
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||
|
||||
|
@ -523,6 +524,20 @@ static void i82801jx_lpc_read_resources(device_t dev)
|
|||
res->base = IO_APIC_ADDR;
|
||||
res->size = 0x00001000;
|
||||
res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||
|
||||
/* Set IO decode ranges if required.*/
|
||||
for (i = 0; i < 4; i++) {
|
||||
u32 gen_dec;
|
||||
gen_dec = pci_read_config32(dev, 0x84 + 4 * i);
|
||||
|
||||
if ((gen_dec & 0xFFFC) > 0x1000) {
|
||||
res = new_resource(dev, IOINDEX_SUBTRACTIVE(io_index++, 0));
|
||||
res->base = gen_dec & 0xFFFC;
|
||||
res->size = (gen_dec >> 16) & 0xFC;
|
||||
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
||||
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
||||
|
|
Loading…
Reference in New Issue