[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 <m8@semihalf.com>
This commit is contained in:
Marian Balakowicz 2008-01-08 18:11:43 +01:00 committed by Wolfgang Denk
parent 5d3cc55ecb
commit d45d5a18b6
2 changed files with 12 additions and 11 deletions

View File

@ -40,8 +40,7 @@
#include <fdt.h> #include <fdt.h>
#include <libfdt.h> #include <libfdt.h>
#include <fdt_support.h> #include <fdt_support.h>
#endif #elif defined(CONFIG_OF_FLAT_TREE)
#if defined(CONFIG_OF_FLAT_TREE)
#include <ft_build.h> #include <ft_build.h>
#endif #endif

View File

@ -37,8 +37,7 @@
#include <fdt.h> #include <fdt.h>
#include <libfdt.h> #include <libfdt.h>
#include <fdt_support.h> #include <fdt_support.h>
#endif #elif defined(CONFIG_OF_FLAT_TREE)
#if defined(CONFIG_OF_FLAT_TREE)
#include <ft_build.h> #include <ft_build.h>
#endif #endif
@ -269,7 +268,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
hdr = (image_header_t *)of_flat_tree; hdr = (image_header_t *)of_flat_tree;
#if defined(CONFIG_OF_FLAT_TREE) #if defined(CONFIG_OF_FLAT_TREE)
if (*((ulong *)(of_flat_tree + image_get_header_size ())) != OF_DT_HEADER) { 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) { if (fdt_check_header (of_flat_tree + image_get_header_size ()) != 0) {
#endif #endif
#ifndef CFG_NO_FLASH #ifndef CFG_NO_FLASH
@ -313,7 +312,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
} }
#if defined(CONFIG_OF_FLAT_TREE) #if defined(CONFIG_OF_FLAT_TREE)
if (*((ulong *)(of_flat_tree + image_get_header_size ())) != OF_DT_HEADER) { 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) { if (fdt_check_header (of_flat_tree + image_get_header_size ()) != 0) {
#endif #endif
puts ("ERROR: uImage data is not a fdt - " 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 defined(CONFIG_OF_FLAT_TREE)
if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) { if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) {
#else #elif defined(CONFIG_OF_LIBFDT)
if (fdt_check_header (of_flat_tree) != 0) { if (fdt_check_header (of_flat_tree) != 0) {
#endif #endif
puts ("ERROR: image is not a fdt - " 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 defined(CONFIG_OF_FLAT_TREE)
if (((struct boot_param_header *)of_flat_tree)->totalsize != if (((struct boot_param_header *)of_flat_tree)->totalsize !=
image_to_cpu (len_ptr[2])) { image_to_cpu (len_ptr[2])) {
#else #elif defined(CONFIG_OF_LIBFDT)
if (be32_to_cpu (fdt_totalsize (of_flat_tree)) != if (be32_to_cpu (fdt_totalsize (of_flat_tree)) !=
image_to_cpu (len_ptr[2])) { image_to_cpu (len_ptr[2])) {
#endif #endif
@ -518,8 +517,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
ft_board_setup(of_flat_tree, gd->bd); ft_board_setup(of_flat_tree, gd->bd);
#endif #endif
} }
#endif /* CONFIG_OF_LIBFDT */
#if defined(CONFIG_OF_FLAT_TREE) #elif defined(CONFIG_OF_FLAT_TREE)
#ifdef CFG_BOOTMAPSZ #ifdef CFG_BOOTMAPSZ
/* /*
* The blob must be within 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_setup(of_flat_tree, kbd, initrd_start, initrd_end);
/* ft_dump_blob(of_flat_tree); */ /* 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", debug ("## Transferring control to Linux (at address %08lx) ...\n",
(ulong)kernel); (ulong)kernel);