Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt/fdt: add empty versions of early_init_dt_*_memory_arch

With the addition of commit 0166dc1 (of: make CONFIG_OF user
selectable), architectures which don't enable memblock and don't
have their own early_init_dt_*_memory_arch implementations will break
when CONFIG_OF is enabled.

Really, we should have better separation of CONFIG_OF and
CONFIG_OF_EARLY_FLATTREE, but doing that will require quite a bit of
shuffling of architecture code. That will have to wait for another day.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Grant Likely <grant.likely@linaro.org>

+11
+11
drivers/of/fdt.c
··· 1015 1015 return __va(memblock_alloc(size, align)); 1016 1016 } 1017 1017 #else 1018 + void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size) 1019 + { 1020 + WARN_ON(1); 1021 + } 1022 + 1018 1023 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, 1019 1024 phys_addr_t size, bool nomap) 1020 1025 { 1021 1026 pr_err("Reserved memory not supported, ignoring range 0x%pa - 0x%pa%s\n", 1022 1027 &base, &size, nomap ? " (nomap)" : ""); 1023 1028 return -ENOSYS; 1029 + } 1030 + 1031 + void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align) 1032 + { 1033 + WARN_ON(1); 1034 + return NULL; 1024 1035 } 1025 1036 #endif 1026 1037