]> git.ipfire.org Git - people/ms/u-boot.git/commit - arch/sandbox/cpu/cpu.c
sandbox: Provide a way to map from host RAM to U-Boot RAM
authorSimon Glass <sjg@chromium.org>
Sat, 20 Apr 2013 08:42:37 +0000 (08:42 +0000)
committerTom Rini <trini@ti.com>
Wed, 1 May 2013 15:17:21 +0000 (11:17 -0400)
commit781adb5710694601e8ceb01256becea142c5ba6c
tree8e2c0c7ea5e223e0dd0209afb3d09230f8e765d2
parentfada9e2048446878c95fb331bbc21e1e40eddc72
sandbox: Provide a way to map from host RAM to U-Boot RAM

In many cases, pointers to memory are passed around, and these pointers
refer to U-Boot memory, not host memory. This in itself is not a
problem.

However, in a few places, we cast that pointer back to a ulong (being
a U-Boot memory address). It is possible to convert many of these cases
to avoid this. However there are data structures (e.g. struct
bootm_headers) which use pointers. We could with a lot of effort adjust
the structs and all code that uses them to use ulong instead of pointers.

This seems like an unacceptable cost, since our objective with sandbox
is to minimise the impact on U-Boot code while maximising the features
available to sandbox.

Therefore, create a map_to_sysmem() function which converts from a
pointer to a U-Boot address. This can be used sparingly when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/cpu.c
arch/sandbox/include/asm/io.h
include/common.h