diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-08-17 13:42:35 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-18 14:39:06 +0200 |
commit | e0295cbdd7357e7d610d2946805de435c636c30b (patch) | |
tree | 41d71e005e658825405ff46e7b4951d0644d364f /common/resource.c | |
parent | 81f0511d0fde5ac917fb322f2ad2184b3b033eec (diff) | |
download | barebox-e0295cbdd7357e7d610d2946805de435c636c30b.tar.gz barebox-e0295cbdd7357e7d610d2946805de435c636c30b.tar.xz |
resource: add flags parameter to __request_region
__request_region allocates a child resource within the parent resource,
which so far always had a flags field of zero. Later commits will
use the flags field to mark reserved SDRAM regions, so MMU init code can
take that into consideration and ensure that CPU doesn't speculate into
these regions and risk aborts. Prepare for this by giving
__request_region a flags parameter.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220817114244.1810531-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/resource.c')
-rw-r--r-- | common/resource.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/common/resource.c b/common/resource.c index f96cb94b50..8678609229 100644 --- a/common/resource.c +++ b/common/resource.c @@ -28,8 +28,8 @@ static int init_resource(struct resource *res, const char *name) * resources. */ struct resource *__request_region(struct resource *parent, - const char *name, resource_size_t start, - resource_size_t end) + resource_size_t start, resource_size_t end, + const char *name, unsigned flags) { struct resource *r, *new; @@ -73,15 +73,16 @@ struct resource *__request_region(struct resource *parent, } ok: - debug("%s ok: 0x%08llx:0x%08llx\n", __func__, + debug("%s ok: 0x%08llx:0x%08llx flags=0x%x\n", __func__, (unsigned long long)start, - (unsigned long long)end); + (unsigned long long)end, flags); new = xzalloc(sizeof(*new)); init_resource(new, name); new->start = start; new->end = end; new->parent = parent; + new->flags = flags; list_add_tail(&new->sibling, &r->sibling); return new; @@ -138,7 +139,7 @@ struct resource iomem_resource = { struct resource *request_iomem_region(const char *name, resource_size_t start, resource_size_t end) { - return __request_region(&iomem_resource, name, start, end); + return __request_region(&iomem_resource, start, end, name, 0); } /* The root resource for the whole io-mapped io space */ @@ -157,7 +158,7 @@ struct resource *request_ioport_region(const char *name, { struct resource *res; - res = __request_region(&ioport_resource, name, start, end); + res = __request_region(&ioport_resource, start, end, name, 0); if (IS_ERR(res)) return ERR_CAST(res); |