From 5de879f9d8719f327f244c7b96c6e33885714104 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Sun, 19 Apr 2020 11:49:58 +0800 Subject: [PATCH] common: board_f: reserve noncache memory region board_r.c supports noncache memory region right below malloc area, but board_f.c seems does not reserve it. Signed-off-by: Joseph Chen Change-Id: I7da218b6d994227a04a91cea02b64b6c91a0cc54 --- common/board_f.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/common/board_f.c b/common/board_f.c index 0c63474fe8..489a7d111e 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -436,6 +436,23 @@ static int reserve_malloc(void) return 0; } +#ifdef CONFIG_SYS_NONCACHED_MEMORY +static int reserve_noncached(void) +{ + phys_addr_t start, end; + size_t size; + + end = ALIGN(gd->start_addr_sp, MMU_SECTION_SIZE) - MMU_SECTION_SIZE; + size = ALIGN(CONFIG_SYS_NONCACHED_MEMORY, MMU_SECTION_SIZE); + start = end - size; + gd->start_addr_sp = start; + debug("Reserving %zu for noncached_alloc() at: %08lx\n", + size, gd->start_addr_sp); + + return 0; +} +#endif + /* (permanently) allocate a Board Info struct */ static int reserve_board(void) { @@ -874,6 +891,9 @@ static const init_fnc_t init_sequence_f[] = { reserve_trace, reserve_uboot, reserve_malloc, +#ifdef CONFIG_SYS_NONCACHED_MEMORY + reserve_noncached, +#endif reserve_board, setup_machine, reserve_global_data,