From a6e9c386ff9a3339ce78eb4aafc61389f2109b26 Mon Sep 17 00:00:00 2001 From: GuEe-GUI Date: Fri, 15 Sep 2023 09:51:10 +0800 Subject: [PATCH] [BSP/rockchip/rk3568] fixup heapmem init flow In RT-Smart, `rt_hw_interrupt_init` will call `rt_ioremap` to map GIC's MMIO registers. There is a `rt_malloc` called in rt_ioremap, that will fail if we not init the mem heap yet. Signed-off-by: GuEe-GUI --- bsp/rockchip/rk3568/driver/board.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp/rockchip/rk3568/driver/board.c b/bsp/rockchip/rk3568/driver/board.c index 5fdbe52ea0..4a6d7dea51 100644 --- a/bsp/rockchip/rk3568/driver/board.c +++ b/bsp/rockchip/rk3568/driver/board.c @@ -62,6 +62,10 @@ void rt_hw_board_init(void) rt_hw_mmu_setup(&rt_kernel_space, platform_mem_desc, platform_mem_desc_size); +#ifdef RT_USING_HEAP + /* initialize memory system */ + rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); +#endif /* initialize hardware interrupt */ rt_hw_interrupt_init(); @@ -84,7 +88,6 @@ void rt_hw_board_init(void) #ifdef RT_USING_HEAP /* initialize memory system */ rt_kprintf("heap: [0x%08x - 0x%08x]\n", RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); - rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END); #endif #ifdef RT_USING_COMPONENTS_INIT