diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2016-11-25 18:56:47 -0800 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-02-01 15:15:42 +0100 |
commit | ab839f4c2e4ad1bf9f58534a63645e6961469e33 (patch) | |
tree | a4d7c9b3fcac5b902145d98f726274758b41b691 /board/toradex/colibri_imx7/colibri_imx7.c | |
parent | dfa01e8a2827faea771f138119c8d62c9e1bf7b5 (diff) |
board: colibri_imx7: avoid using DDR reserved for Cortex-M42015.04-toradex-next2015.04-toradex
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: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'board/toradex/colibri_imx7/colibri_imx7.c')
-rw-r--r-- | board/toradex/colibri_imx7/colibri_imx7.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index e4a6ed5d5d..d0a0092b64 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -784,7 +784,17 @@ void udc_pins_setting(void) #endif /*CONFIG_IMX_UDC*/ -#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_CMD_BOOTAUX) +#if defined(CONFIG_CMD_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; +} + +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { int up; @@ -825,3 +835,4 @@ int ft_board_setup(void *blob, bd_t *bd) return 0; } #endif +#endif |