From: Marian Balakowicz Date: Tue, 8 Jan 2008 17:11:43 +0000 (+0100) Subject: [new uImage] Cleanup OF/FDT #if/#elif/#endif use in do_bootm_linux() X-Git-Tag: v1.3.3-rc1~141^2^2~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d45d5a18b6b36688f2365623f9d550566c664b5b;p=u-boot [new uImage] Cleanup OF/FDT #if/#elif/#endif use in do_bootm_linux() Make CONFIG_OF_LIBFDT and CONFIG_OF_FLAT_TREE use more readable in PPC variant of do_bootm_linux() routine. Signed-off-by: Marian Balakowicz --- diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index e61a30456a..5f1b6b6d67 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -40,8 +40,7 @@ #include #include #include -#endif -#if defined(CONFIG_OF_FLAT_TREE) +#elif defined(CONFIG_OF_FLAT_TREE) #include #endif diff --git a/lib_ppc/ppc_linux.c b/lib_ppc/ppc_linux.c index ff2a3e56ff..94872a61dc 100644 --- a/lib_ppc/ppc_linux.c +++ b/lib_ppc/ppc_linux.c @@ -37,8 +37,7 @@ #include #include #include -#endif -#if defined(CONFIG_OF_FLAT_TREE) +#elif defined(CONFIG_OF_FLAT_TREE) #include #endif @@ -269,7 +268,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, hdr = (image_header_t *)of_flat_tree; #if defined(CONFIG_OF_FLAT_TREE) if (*((ulong *)(of_flat_tree + image_get_header_size ())) != OF_DT_HEADER) { -#else +#elif defined(CONFIG_OF_LIBFDT) if (fdt_check_header (of_flat_tree + image_get_header_size ()) != 0) { #endif #ifndef CFG_NO_FLASH @@ -313,7 +312,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, } #if defined(CONFIG_OF_FLAT_TREE) if (*((ulong *)(of_flat_tree + image_get_header_size ())) != OF_DT_HEADER) { -#else +#elif defined(CONFIG_OF_LIBFDT) if (fdt_check_header (of_flat_tree + image_get_header_size ()) != 0) { #endif puts ("ERROR: uImage data is not a fdt - " @@ -364,7 +363,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_OF_FLAT_TREE) if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) { -#else +#elif defined(CONFIG_OF_LIBFDT) if (fdt_check_header (of_flat_tree) != 0) { #endif puts ("ERROR: image is not a fdt - " @@ -375,7 +374,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, #if defined(CONFIG_OF_FLAT_TREE) if (((struct boot_param_header *)of_flat_tree)->totalsize != image_to_cpu (len_ptr[2])) { -#else +#elif defined(CONFIG_OF_LIBFDT) if (be32_to_cpu (fdt_totalsize (of_flat_tree)) != image_to_cpu (len_ptr[2])) { #endif @@ -518,8 +517,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, ft_board_setup(of_flat_tree, gd->bd); #endif } -#endif /* CONFIG_OF_LIBFDT */ -#if defined(CONFIG_OF_FLAT_TREE) + +#elif defined(CONFIG_OF_FLAT_TREE) + #ifdef CFG_BOOTMAPSZ /* * The blob must be within CFG_BOOTMAPSZ, @@ -552,7 +552,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, */ ft_setup(of_flat_tree, kbd, initrd_start, initrd_end); /* ft_dump_blob(of_flat_tree); */ -#endif + +#endif /* #if defined(CONFIG_OF_LIBFDT) #elif defined(CONFIG_OF_FLAT_TREE) */ + debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong)kernel);