device: Add fixed_io_range_flags() and helpers
Function fixed_io_resource() and alias io_resource() were previously unused. Unlike previously, IORESOURCE_STORED flag needs to be set by the caller, when necessary. For fixed resources, fields alignment, granularity and limit need not be initialised, as the resource cannot be moved. It is assumed the caller provides valid base and size parameters. Change-Id: I8fb4cf2dee4f5193e5652648b63c0ecba7b8bab2 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55458 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
parent
ce34596f74
commit
ad5fab2362
2 changed files with 23 additions and 20 deletions
|
|
@ -841,20 +841,6 @@ const struct resource *fixed_resource_range_idx(struct device *dev, unsigned lon
|
|||
return resource;
|
||||
}
|
||||
|
||||
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(struct device *dev, unsigned long index)
|
||||
{
|
||||
struct resource *resource = new_resource(dev, index);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue