
Hello Masahiro-san,
On Thu, 2016-10-20 at 09:15 +0900, Masahiro Yamada wrote:
Commit e2f88dfd2d96 ("libfdt: Introduce new ARCH_FIXUP_FDT option") allows us to skip memory setup of DTB, but a problem for ARM is that spin_table_update_dt() and psci_update_dt() are skipped as well if CONFIG_ARCH_FIXUP_FDT is disabled.
This commit allows us to skip only fdt_fixup_memory_banks() instead of the whole of arch_fixup_fdt(). It will be useful when we want to use a memory node from a kernel DTB as is, but need some fixups for Spin-Table/PSCI.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com
Changes in v2: - Add empty stub to ARC, PowerPC, Microblaze instead of a weak function common/image-fdt.c
[snip]
diff --git a/arch/arc/lib/bootm.c b/arch/arc/lib/bootm.c index 04d9d9c..5798149 100644 --- a/arch/arc/lib/bootm.c +++ b/arch/arc/lib/bootm.c @@ -37,6 +37,11 @@ void arch_lmb_reserve(struct lmb *lmb) lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp)); } +int arch_fixup_fdt(void *blob) +{
- return 0;
+}
I'm wondering why don't we add weak implementation of arch_fixup_fdt() right in say common/image-fdt.c? This will allow us to not add dummy stubs for those arches that don't really use it.
diff --git a/common/image-fdt.c b/common/image-fdt.c index 5454227..e7540be 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -474,12 +474,10 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, printf("ERROR: /chosen node create failed\n"); goto err; } -#ifdef CONFIG_ARCH_FIXUP_FDT if (arch_fixup_fdt(blob) < 0) { printf("ERROR: arch-specific fdt fixup failed\n"); goto err; } -#endif if (IMAGE_OF_BOARD_SETUP) { fdt_ret = ft_board_setup(blob, gd->bd); if (fdt_ret) { diff --git a/include/fdt_support.h b/include/fdt_support.h index 506bc5a..955c121 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -93,7 +93,15 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size); * property will be left untouched. * @return 0 if ok, or -1 or -FDT_ERR_... on error */ +#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks); +#else +static inline int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[],
int banks)
+{
- return 0;
+} +#endif
-Alexey