Commit 146ebbe6 authored by Yuri Tikhonov's avatar Yuri Tikhonov

RT #112561. Enable FDT booting on STM32F4 SOMs

Also fix a bug in arch_lmb_reserve() ARM procedure, which reveals
itself (as 'device tree allocation error') when we have stack not
in external RAM, and try booting with FDT.
Signed-off-by: default avatarYuri Tikhonov <yur@emcraft.com>
parent 8a4ec5d7
...@@ -469,4 +469,17 @@ ...@@ -469,4 +469,17 @@
#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_SETUP_MEMORY_TAGS
#define CONFIG_CMDLINE_TAG #define CONFIG_CMDLINE_TAG
/*
* Enable support for booting with FDT
*/
#define CONFIG_OF_LIBFDT
/*
* The early kernel mapping on ARM currently only maps from the base of DRAM
* to the end of the kernel image. The kernel is loaded at DRAM base + 0x8000.
* The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
* so that leaves DRAM base to DRAM base + 0x4000 available.
*/
#define CONFIG_SYS_BOOTMAPSZ 0x4000
#endif /* __CONFIG_H */ #endif /* __CONFIG_H */
...@@ -87,8 +87,15 @@ void arch_lmb_reserve(struct lmb *lmb) ...@@ -87,8 +87,15 @@ void arch_lmb_reserve(struct lmb *lmb)
/* adjust sp by 1K to be safe */ /* adjust sp by 1K to be safe */
sp -= 1024; sp -= 1024;
lmb_reserve(lmb, sp,
gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size - sp); /*
* Skip reservation if our stack is not in external RAM
*/
if (sp >= gd->bd->bi_dram[0].start &&
sp < gd->bd->bi_dram[0].start + gd->bd->bi_dram[0].size) {
lmb_reserve(lmb, sp, gd->bd->bi_dram[0].start +
gd->bd->bi_dram[0].size - sp);
}
} }
static void announce_and_cleanup(void) static void announce_and_cleanup(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment