Skip to content
Snippets Groups Projects
Commit e2f88dfd authored by Michal Simek's avatar Michal Simek Committed by Simon Glass
Browse files

libfdt: Introduce new ARCH_FIXUP_FDT option


Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
U-Boot shouldn't update memory setup in DTB file.
One example of usage of this option is to boot OS with different memory
setup than U-Boot use.

Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent 26fb8db0
No related branches found
No related tags found
No related merge requests found
...@@ -342,6 +342,15 @@ config SYS_CLK_FREQ ...@@ -342,6 +342,15 @@ config SYS_CLK_FREQ
help help
TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture
config ARCH_FIXUP_FDT
bool "Enable arch_fixup_fdt() call"
depends on ARM || MIPS
default y
help
Enable FDT memory map syncup before OS boot. This feature can be
used for booting OS with different memory setup where the part of
the memory location should be used for different purpose.
endmenu # Boot images endmenu # Boot images
source "common/Kconfig" source "common/Kconfig"
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_ARCH_FIXUP_FDT
int arch_fixup_fdt(void *blob) int arch_fixup_fdt(void *blob)
{ {
bd_t *bd = gd->bd; bd_t *bd = gd->bd;
...@@ -60,3 +61,4 @@ int arch_fixup_fdt(void *blob) ...@@ -60,3 +61,4 @@ int arch_fixup_fdt(void *blob)
return 0; return 0;
} }
#endif
...@@ -367,8 +367,10 @@ void boot_prep_vxworks(bootm_headers_t *images) ...@@ -367,8 +367,10 @@ void boot_prep_vxworks(bootm_headers_t *images)
if (images->ft_addr) { if (images->ft_addr) {
off = fdt_path_offset(images->ft_addr, "/memory"); off = fdt_path_offset(images->ft_addr, "/memory");
if (off < 0) { if (off < 0) {
#ifdef CONFIG_ARCH_FIXUP_FDT
if (arch_fixup_fdt(images->ft_addr)) if (arch_fixup_fdt(images->ft_addr))
puts("## WARNING: fixup memory failed!\n"); puts("## WARNING: fixup memory failed!\n");
#endif
} }
} }
#endif #endif
......
...@@ -253,6 +253,7 @@ static int boot_reloc_fdt(bootm_headers_t *images) ...@@ -253,6 +253,7 @@ static int boot_reloc_fdt(bootm_headers_t *images)
#endif #endif
} }
#ifdef CONFIG_ARCH_FIXUP_FDT
int arch_fixup_fdt(void *blob) int arch_fixup_fdt(void *blob)
{ {
#if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT) #if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT)
...@@ -264,6 +265,7 @@ int arch_fixup_fdt(void *blob) ...@@ -264,6 +265,7 @@ int arch_fixup_fdt(void *blob)
return 0; return 0;
#endif #endif
} }
#endif
static int boot_setup_fdt(bootm_headers_t *images) static int boot_setup_fdt(bootm_headers_t *images)
{ {
......
...@@ -458,11 +458,6 @@ __weak int ft_verify_fdt(void *fdt) ...@@ -458,11 +458,6 @@ __weak int ft_verify_fdt(void *fdt)
return 1; return 1;
} }
__weak int arch_fixup_fdt(void *blob)
{
return 0;
}
int image_setup_libfdt(bootm_headers_t *images, void *blob, int image_setup_libfdt(bootm_headers_t *images, void *blob,
int of_size, struct lmb *lmb) int of_size, struct lmb *lmb)
{ {
...@@ -479,10 +474,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, ...@@ -479,10 +474,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
printf("ERROR: /chosen node create failed\n"); printf("ERROR: /chosen node create failed\n");
goto err; goto err;
} }
#ifdef CONFIG_ARCH_FIXUP_FDT
if (arch_fixup_fdt(blob) < 0) { if (arch_fixup_fdt(blob) < 0) {
printf("ERROR: arch-specific fdt fixup failed\n"); printf("ERROR: arch-specific fdt fixup failed\n");
goto err; goto err;
} }
#endif
if (IMAGE_OF_BOARD_SETUP) { if (IMAGE_OF_BOARD_SETUP) {
fdt_ret = ft_board_setup(blob, gd->bd); fdt_ret = ft_board_setup(blob, gd->bd);
if (fdt_ret) { if (fdt_ret) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment