Skip to content

Commit

Permalink
mem_region: Check for no-map in reserved nodes
Browse files Browse the repository at this point in the history
Regions with the no-map property should be handled seperately to
"normal" firmware reservations. When creating mem_region regions
from a reserved-memory DT node use the no-map property to select
the right reservation type.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Jul 25, 2017
1 parent 0443f60 commit 6430a7e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/mem_region.c
Expand Up @@ -975,6 +975,7 @@ static bool mem_region_parse_reserved_nodes(const char *path)
dt_for_each_child(parent, node) {
const struct dt_property *reg;
struct mem_region *region;
int type;

reg = dt_find_property(node, "reg");
if (!reg) {
Expand All @@ -985,10 +986,15 @@ static bool mem_region_parse_reserved_nodes(const char *path)
continue;
}

if (dt_has_node_property(node, "no-map", NULL))
type = REGION_RESERVED;
else
type = REGION_FW_RESERVED;

region = new_region(strdup(node->name),
dt_get_number(reg->prop, 2),
dt_get_number(reg->prop + sizeof(u64), 2),
node, REGION_FW_RESERVED);
node, type);
add_region(region);
}

Expand Down

0 comments on commit 6430a7e

Please sign in to comment.