diff options
author | Thierry Reding | 2021-09-03 15:16:21 +0200 |
---|---|---|
committer | Tom Warren | 2021-10-13 14:18:30 -0700 |
commit | b9aad375917d4ae0dec5aedcdfa79929e1dbb730 (patch) | |
tree | 6b5ae83f42b3d4c77d3f7a84f37a488393f4e269 /test/dm/fdtdec.c | |
parent | 9019487608c8afe7d3fc34cb5192df064b60cdb7 (diff) |
fdtdec: Support reserved-memory flags
Reserved memory nodes can have additional flags. Support reading and
writing these flags to ensure that reserved memory nodes can be properly
parsed and emitted.
This converts support for the existing "no-map" flag to avoid extending
the argument list for fdtdec_add_reserved_memory() to excessive length.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'test/dm/fdtdec.c')
-rw-r--r-- | test/dm/fdtdec.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c index 385aa77a686..087d4846da8 100644 --- a/test/dm/fdtdec.c +++ b/test/dm/fdtdec.c @@ -29,17 +29,17 @@ static int dm_test_fdtdec_set_carveout(struct unit_test_state *uts) resv.start = 0x1000; resv.end = 0x2000; ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 2, - &resv, "test_resv1", NULL, 0)); + &resv, "test_resv1", NULL, 0, 0)); resv.start = 0x10000; resv.end = 0x20000; ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 1, - &resv, "test_resv2", NULL, 0)); + &resv, "test_resv2", NULL, 0, 0)); resv.start = 0x100000; resv.end = 0x200000; ut_assertok(fdtdec_set_carveout(blob, "/a-test", "memory-region", 0, - &resv, "test_resv3", NULL, 0)); + &resv, "test_resv3", NULL, 0, 0)); offset = fdt_path_offset(blob, "/a-test"); ut_assert(offset > 0); @@ -64,6 +64,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts) fdt_addr_t addr; fdt_size_t size; void *blob; + unsigned long flags = FDTDEC_RESERVED_MEMORY_NO_MAP; int blob_sz, parent, subnode; uint32_t phandle, phandle1; @@ -78,7 +79,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts) resv.start = 0x1000; resv.end = 0x1fff; ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region", &resv, - NULL, 0, &phandle, false)); + NULL, 0, &phandle, 0)); /* Test /reserve-memory and its subnode should exist */ parent = fdt_path_offset(blob, "/reserved-memory"); @@ -99,7 +100,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts) resv.start = 0x2000; resv.end = 0x2fff; ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region1", &resv, - NULL, 0, &phandle1, true)); + NULL, 0, &phandle1, flags)); subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region1"); ut_assert(subnode > 0); @@ -116,7 +117,7 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts) resv.start = 0x1000; resv.end = 0x1fff; ut_assertok(fdtdec_add_reserved_memory(blob, "rsvd_region2", &resv, - NULL, 0, &phandle1, false)); + NULL, 0, &phandle1, 0)); subnode = fdt_path_offset(blob, "/reserved-memory/rsvd_region2"); ut_assert(subnode < 0); |