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);
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c File src/device/device_util.c:
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c@811 PS1, Line 811: resource->base = (resource_t)basek; The 'k' in basek an sizek refers to the unit counting in KiB. Remove.
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c@817 PS1, Line 817: resource->flags |= type; Not sure if there are any additional flags to use with IO resources. Maybe you don't have to pass the type parameter at all.
Hello Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31911
to look at the new patch set (#2).
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, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/31911/2
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/#/c/31911/2/src/include/device/device.h File src/include/device/device.h:
https://review.coreboot.org/#/c/31911/2/src/include/device/device.h@239 PS2, Line 239: unsigned long base, unsigned long size); code indent should use tabs where possible
https://review.coreboot.org/#/c/31911/2/src/include/device/device.h@239 PS2, Line 239: unsigned long base, unsigned long size); please, no spaces at the start of a line
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c File src/device/device_util.c:
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c@811 PS1, Line 811: resource->base = (resource_t)basek;
The 'k' in basek an sizek refers to the unit counting in KiB. Remove.
Done
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c File src/device/device_util.c:
https://review.coreboot.org/#/c/31911/1/src/device/device_util.c@817 PS1, Line 817: resource->flags |= type;
Not sure if there are any additional flags to use with IO resources. […]
Done
Hello Philipp Deppenwiese, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/31911
to look at the new patch set (#3).
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, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/31911/3
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 3: Code-Review+1
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 3: Code-Review+2
Lijian Zhao has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31911 )
Change subject: resources: introduce io_resource() ......................................................................
Patch Set 3: Code-Review+2
Subrata Banik has submitted this change and it was merged. ( 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/31911 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Lijian Zhao lijian.zhao@intel.com --- M src/device/device_util.c M src/include/device/device.h 2 files changed, 20 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Kyösti Mälkki: Looks good to me, but someone else must approve Furquan Shaikh: Looks good to me, approved Lijian Zhao: Looks good to me, approved
diff --git a/src/device/device_util.c b/src/device/device_util.c index 38207eb..5c4f911 100644 --- a/src/device/device_util.c +++ b/src/device/device_util.c @@ -801,6 +801,20 @@ resource->flags |= type; }
+void fixed_io_resource(struct device *dev, unsigned long index, + unsigned long base, unsigned long size) +{ + struct resource *resource; + + resource = new_resource(dev, index); + resource->base = (resource_t)base; + resource->size = (resource_t)size; + resource->limit = resource->base + resource->size - 1; + resource->flags = IORESOURCE_IO | IORESOURCE_FIXED | + IORESOURCE_STORED | IORESOURCE_ASSIGNED | + IORESOURCE_RESERVE; +} + 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 7d7be73..39a4d56 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -234,6 +234,9 @@ void pci_domain_read_resources(struct device *dev); void pci_domain_scan_bus(struct device *dev);
+void fixed_io_resource(struct device *dev, unsigned long index, + unsigned long base, unsigned long size); + void fixed_mem_resource(struct device *dev, unsigned long index, unsigned long basek, unsigned long sizek, unsigned long type);
@@ -259,6 +262,9 @@ #define mmio_resource(dev, idx, basek, sizek) \ fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
+#define io_resource(dev, idx, base, size) \ + fixed_io_resource(dev, idx, base, size) + void tolm_test(void *gp, struct device *dev, struct resource *new); u32 find_pci_tolm(struct bus *bus);