Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31911
Change subject: resources: introduce io_resource() ......................................................................
resources: introduce io_resource()
This patch creates new resource function to perform allocation of IO resource, similar to mmio_resource() function does for MMIO.
Change-Id: I3fdcabb14302537d6074bfd6a362690c06b66bb5 Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/device/device_util.c M src/include/device/device.h 2 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/31911/1
diff --git a/src/device/device_util.c b/src/device/device_util.c index 38207eb..4593898 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -801,6 +801,22 @@ resource->flags |= type; }
+void fixed_io_resource(struct device *dev, unsigned long index, + unsigned long basek, unsigned long sizek, + unsigned long type) +{ + struct resource *resource; + + resource = new_resource(dev, index); + resource->base = (resource_t)basek; + resource->size = (resource_t)sizek; + resource->limit = resource->base + resource->size - 1; + resource->flags = IORESOURCE_IO | IORESOURCE_FIXED | + IORESOURCE_STORED | IORESOURCE_ASSIGNED; + + resource->flags |= type; +} + void mmconf_resource_init(struct resource *resource, resource_t base, int buses) { diff --git a/src/include/device/device.h b/src/include/device/device.h index 2e2cda9..efc04fa 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -260,6 +260,9 @@ #define mmio_resource(dev, idx, basek, sizek) \ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
+#define io_resource(dev, idx, basek, sizek) \ + fixed_io_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE) + void tolm_test(void *gp, struct device *dev, struct resource *new); u32 find_pci_tolm(struct bus *bus);