summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-08-09 19:20:15 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-08-15 14:44:20 +0000
commit6e039076ab106a11ec9f82ef2f8250b20f1a885e (patch)
treecddedee84c8e33801996a599023d6f06f5db1aca /src/soc/amd/common/block
parent702365e18621617bf5892c77b9db94fde859068f (diff)
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>
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/lpc/lpc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/soc/amd/common/block/lpc/lpc.c b/src/soc/amd/common/block/lpc/lpc.c
index 3d5775fe35..96b9a2c4e7 100644
--- a/src/soc/amd/common/block/lpc/lpc.c
+++ b/src/soc/amd/common/block/lpc/lpc.c
@@ -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,