diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-11-25 18:56:47 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2017-01-11 21:25:10 +0100 |
commit | 942fdd4441ec72ec92ccbeff45e0e192a86fad24 (patch) | |
tree | e796bd36a3d4021add2be969624c4f9371f2247f /board/toradex | |
parent | c2b777467b92a73592441993f280f48fb99cde39 (diff) |
board: colibri_imx7: avoid using DDR reserved for Cortex-M4
Using linux,usable-memory the board code carves out 1MiB of memory
for the Cortex-M4 core at the end of the 256MiB block. However,
in case a board has 256MiB of memory (Colibri iMX7S), that is the
area where U-Boot gets relocated to... Use board_get_usable_ram_top
to avoid using that area as relocation target.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'board/toradex')
-rw-r--r-- | board/toradex/colibri_imx7/colibri_imx7.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 8ed85c780ac..8af59950924 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -389,6 +389,17 @@ int checkboard(void) return 0; } +#if defined(CONFIG_IMX_BOOTAUX) +ulong board_get_usable_ram_top(ulong total_size) +{ + /* Reserve last 1MiB for M4 on modules with 256MiB RAM */ + if (gd->ram_size == SZ_256M) + return gd->ram_top - SZ_1M; + else + return gd->ram_top; +} +#endif + #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { |