soc/amd/common/lpc: use fixed_io_range_flags instead of open coding
Instead of open coding the same functionality, use fixed_io_range_flags to tell the resource allocator about the FCH subtractively decoding the first 0x1000 bytes of I/O space. Also update the comment to match the code. TEST=On Mandolin the flags of this resource stay the same (0xc0040100). Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ia30a87a4e37c98248568476b74af2730a3c0e88d Reviewed-on: https://review.coreboot.org/c/coreboot/+/77170 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
702365e186
commit
6e039076ab
|
@ -105,18 +105,14 @@ static void lpc_init(struct device *dev)
|
||||||
|
|
||||||
static void lpc_read_resources(struct device *dev)
|
static void lpc_read_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
|
||||||
unsigned long idx = 0;
|
unsigned long idx = 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 I/O. */
|
||||||
res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
|
fixed_io_range_flags(dev, IOINDEX_SUBTRACTIVE(0, 0), 0, 0x1000,
|
||||||
res->base = 0;
|
IORESOURCE_SUBTRACTIVE);
|
||||||
res->size = 0x1000;
|
|
||||||
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
|
|
||||||
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
|
|
||||||
|
|
||||||
/* Only up to 16 MByte of the SPI flash can be mapped right below 4 GB */
|
/* Only up to 16 MByte of the SPI flash can be mapped right below 4 GB */
|
||||||
mmio_range(dev, idx++, FLASH_BELOW_4GB_MAPPING_REGION_BASE,
|
mmio_range(dev, idx++, FLASH_BELOW_4GB_MAPPING_REGION_BASE,
|
||||||
|
|
Loading…
Reference in New Issue