summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-07-13 06:06:58 -0600
committerSimon Glass <sjg@chromium.org>2022-07-26 02:30:56 -0600
commit281996110c1f42b5476e43040798cb38169b6119 (patch)
tree01b20167e46f50bead23e6d34bc5335ff58356bc /lib
parent109dbdf042e2a034edd8ed7b711143c522cb1465 (diff)
addrmap: Support on sandbox
Update this feature so that it works on sandbox, using a basic identity mapping. This allows us to run the 'ut addrmap' test. Also fix up the test to use the correct macros to access the linker list, so that the 'ut addrmap' command actually works. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/addr_map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/addr_map.c b/lib/addr_map.c
index fb2ef40007..9b3e0a544e 100644
--- a/lib/addr_map.c
+++ b/lib/addr_map.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <addr_map.h>
+#include <mapmem.h>
struct addrmap address_map[CONFIG_SYS_NUM_ADDR_MAP];
@@ -18,7 +19,7 @@ phys_addr_t addrmap_virt_to_phys(void * vaddr)
if (address_map[i].size == 0)
continue;
- addr = (u64)((u32)vaddr);
+ addr = map_to_sysmem(vaddr);
base = (u64)(address_map[i].vaddr);
upper = (u64)(address_map[i].size) + base - 1;
@@ -48,7 +49,7 @@ void *addrmap_phys_to_virt(phys_addr_t paddr)
offset = address_map[i].paddr - address_map[i].vaddr;
- return (void *)(unsigned long)(paddr - offset);
+ return map_sysmem(paddr - offset, 0);
}
}