Commit 63c0941726e44f31c42de744a57f528fee2df88f
Committed by
Simon Glass
1 parent
f7f191ee41
Exists in
v2017.01-smarct4x
and in
25 other branches
libfdt: replace ARCH_FIXUP_FDT with ARCH_FIXUP_FDT_MEMORY
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> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Acked-by: Simon Glass <sjg@chromium.org> Fixed build error for x86: Signed-off-by: Simon Glass <sjg@chromium.org>
Showing 12 changed files with 37 additions and 11 deletions Side-by-side Diff
Kconfig
... | ... | @@ -298,9 +298,8 @@ |
298 | 298 | help |
299 | 299 | TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture |
300 | 300 | |
301 | -config ARCH_FIXUP_FDT | |
302 | - bool "Enable arch_fixup_fdt() call" | |
303 | - depends on ARM || MIPS | |
301 | +config ARCH_FIXUP_FDT_MEMORY | |
302 | + bool "Enable arch_fixup_memory_banks() call" | |
304 | 303 | default y |
305 | 304 | help |
306 | 305 | Enable FDT memory map syncup before OS boot. This feature can be |
arch/arc/lib/bootm.c
arch/arm/lib/bootm-fdt.c
arch/arm/lib/bootm.c
... | ... | @@ -414,10 +414,8 @@ |
414 | 414 | if (images->ft_addr) { |
415 | 415 | off = fdt_path_offset(images->ft_addr, "/memory"); |
416 | 416 | if (off < 0) { |
417 | -#ifdef CONFIG_ARCH_FIXUP_FDT | |
418 | 417 | if (arch_fixup_fdt(images->ft_addr)) |
419 | 418 | puts("## WARNING: fixup memory failed!\n"); |
420 | -#endif | |
421 | 419 | } |
422 | 420 | } |
423 | 421 | #endif |
arch/microblaze/lib/bootm.c
arch/mips/lib/bootm.c
... | ... | @@ -253,7 +253,6 @@ |
253 | 253 | #endif |
254 | 254 | } |
255 | 255 | |
256 | -#ifdef CONFIG_ARCH_FIXUP_FDT | |
257 | 256 | int arch_fixup_fdt(void *blob) |
258 | 257 | { |
259 | 258 | #if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT) |
... | ... | @@ -265,7 +264,6 @@ |
265 | 264 | return 0; |
266 | 265 | #endif |
267 | 266 | } |
268 | -#endif | |
269 | 267 | |
270 | 268 | static int boot_setup_fdt(bootm_headers_t *images) |
271 | 269 | { |
arch/powerpc/lib/bootm.c
... | ... | @@ -38,6 +38,11 @@ |
38 | 38 | #define CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE (768*1024*1024) |
39 | 39 | #endif |
40 | 40 | |
41 | +int arch_fixup_fdt(void *blob) | |
42 | +{ | |
43 | + return 0; | |
44 | +} | |
45 | + | |
41 | 46 | static void boot_jump_linux(bootm_headers_t *images) |
42 | 47 | { |
43 | 48 | void (*kernel)(bd_t *, ulong r4, ulong r5, ulong r6, |
arch/sandbox/lib/bootm.c
arch/x86/lib/bootm.c
common/fdt_support.c
... | ... | @@ -381,6 +381,7 @@ |
381 | 381 | do_fixup_by_compat(fdt, compat, prop, &tmp, 4, create); |
382 | 382 | } |
383 | 383 | |
384 | +#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY | |
384 | 385 | /* |
385 | 386 | * fdt_pack_reg - pack address and size array into the "reg"-suitable stream |
386 | 387 | */ |
... | ... | @@ -459,6 +460,7 @@ |
459 | 460 | } |
460 | 461 | return 0; |
461 | 462 | } |
463 | +#endif | |
462 | 464 | |
463 | 465 | int fdt_fixup_memory(void *blob, u64 start, u64 size) |
464 | 466 | { |
common/image-fdt.c
... | ... | @@ -474,12 +474,10 @@ |
474 | 474 | printf("ERROR: /chosen node create failed\n"); |
475 | 475 | goto err; |
476 | 476 | } |
477 | -#ifdef CONFIG_ARCH_FIXUP_FDT | |
478 | 477 | if (arch_fixup_fdt(blob) < 0) { |
479 | 478 | printf("ERROR: arch-specific fdt fixup failed\n"); |
480 | 479 | goto err; |
481 | 480 | } |
482 | -#endif | |
483 | 481 | if (IMAGE_OF_BOARD_SETUP) { |
484 | 482 | fdt_ret = ft_board_setup(blob, gd->bd); |
485 | 483 | if (fdt_ret) { |
include/fdt_support.h
... | ... | @@ -93,7 +93,15 @@ |
93 | 93 | * property will be left untouched. |
94 | 94 | * @return 0 if ok, or -1 or -FDT_ERR_... on error |
95 | 95 | */ |
96 | +#ifdef CONFIG_ARCH_FIXUP_FDT_MEMORY | |
96 | 97 | int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks); |
98 | +#else | |
99 | +static inline int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], | |
100 | + int banks) | |
101 | +{ | |
102 | + return 0; | |
103 | +} | |
104 | +#endif | |
97 | 105 | |
98 | 106 | void fdt_fixup_ethernet(void *fdt); |
99 | 107 | int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, |