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:
Felix Held 2023-08-09 19:20:15 +02:00
parent 702365e186
commit 6e039076ab
1 changed files with 3 additions and 7 deletions

View File

@ -105,18 +105,14 @@ static void lpc_init(struct device *dev)
static void lpc_read_resources(struct device *dev)
{
struct resource *res;
unsigned long idx = 0;
/* Get the normal pci resources of this device */
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->base = 0;
res->size = 0x1000;
res->flags = IORESOURCE_IO | IORESOURCE_SUBTRACTIVE |
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
/* Add an extra subtractive resource for I/O. */
fixed_io_range_flags(dev, IOINDEX_SUBTRACTIVE(0, 0), 0, 0x1000,
IORESOURCE_SUBTRACTIVE);
/* 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,