Commit e29607ed972056723e4bf0ac90767421cf0f0b78
Committed by
Albert ARIBAUD
1 parent
38510a4b34
Exists in
v2017.01-smarct4x
and in
37 other branches
ARM: convert arch_fixup_memory_node to a generic FDT fixup function
Some architecture needs extra device tree setup. Instead of adding yet another hook, convert arch_fixup_memory_node to be a generic FDT fixup function. [maz: collapsed 3 patches into one, rewrote commit message] Signed-off-by: Ma Haijun <mahaijuns@gmail.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Showing 4 changed files with 10 additions and 7 deletions Side-by-side Diff
arch/arm/lib/bootm-fdt.c
arch/arm/lib/bootm.c
... | ... | @@ -359,7 +359,7 @@ |
359 | 359 | if (images->ft_addr) { |
360 | 360 | off = fdt_path_offset(images->ft_addr, "/memory"); |
361 | 361 | if (off < 0) { |
362 | - if (arch_fixup_memory_node(images->ft_addr)) | |
362 | + if (arch_fixup_fdt(images->ft_addr)) | |
363 | 363 | puts("## WARNING: fixup memory failed!\n"); |
364 | 364 | } |
365 | 365 | } |
common/image-fdt.c
... | ... | @@ -450,7 +450,7 @@ |
450 | 450 | return 1; |
451 | 451 | } |
452 | 452 | |
453 | -__weak int arch_fixup_memory_node(void *blob) | |
453 | +__weak int arch_fixup_fdt(void *blob) | |
454 | 454 | { |
455 | 455 | return 0; |
456 | 456 | } |
... | ... | @@ -467,7 +467,10 @@ |
467 | 467 | puts(" - must RESET the board to recover.\n"); |
468 | 468 | return -1; |
469 | 469 | } |
470 | - arch_fixup_memory_node(blob); | |
470 | + if (arch_fixup_fdt(blob) < 0) { | |
471 | + puts("ERROR: arch specific fdt fixup failed"); | |
472 | + return -1; | |
473 | + } | |
471 | 474 | if (IMAGE_OF_BOARD_SETUP) |
472 | 475 | ft_board_setup(blob, gd->bd); |
473 | 476 | fdt_fixup_ethernet(blob); |
include/common.h
... | ... | @@ -318,14 +318,14 @@ |
318 | 318 | void board_show_dram(ulong size); |
319 | 319 | |
320 | 320 | /** |
321 | - * arch_fixup_memory_node() - Write arch-specific memory information to fdt | |
321 | + * arch_fixup_fdt() - Write arch-specific information to fdt | |
322 | 322 | * |
323 | - * Defined in arch/$(ARCH)/lib/bootm.c | |
323 | + * Defined in arch/$(ARCH)/lib/bootm-fdt.c | |
324 | 324 | * |
325 | 325 | * @blob: FDT blob to write to |
326 | 326 | * @return 0 if ok, or -ve FDT_ERR_... on failure |
327 | 327 | */ |
328 | -int arch_fixup_memory_node(void *blob); | |
328 | +int arch_fixup_fdt(void *blob); | |
329 | 329 | |
330 | 330 | /* common/flash.c */ |
331 | 331 | void flash_perror (int); |