X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fcmd_bootm.c;h=452686dd3dc72f2ec37b9b66e003f77a2ae3220d;hb=ffa37fc98d71ef930bccd4e9eed37f6ce6b4d6af;hp=94ddac37cf33142db1d718b1b35d8ea22cb26147;hpb=6ca9da4d42aeb43df5ef29f7d0518009df583b2f;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 94ddac3..452686d 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -105,10 +105,6 @@ extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); typedef int boot_os_fn (int flag, int argc, char *argv[], bootm_headers_t *images); /* pointers to os/initrd/fdt */ -#define CONFIG_BOOTM_LINUX 1 -#define CONFIG_BOOTM_NETBSD 1 -#define CONFIG_BOOTM_RTEMS 1 - #ifdef CONFIG_BOOTM_LINUX extern boot_os_fn do_bootm_linux; #endif @@ -157,18 +153,6 @@ static boot_os_fn *boot_os[] = { ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */ static bootm_headers_t images; /* pointers to os/initrd/fdt images */ -void __board_lmb_reserve(struct lmb *lmb) -{ - /* please define platform specific board_lmb_reserve() */ -} -void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve"))); - -void __arch_lmb_reserve(struct lmb *lmb) -{ - /* please define platform specific arch_lmb_reserve() */ -} -void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve"))); - /* Allow for arch specific config before we boot */ void __arch_preboot_os(void) { @@ -204,15 +188,11 @@ void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os"))); # error Unknown CPU type #endif -static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static void bootm_start_lmb(void) { +#ifdef CONFIG_LMB ulong mem_start; phys_size_t mem_size; - void *os_hdr; - int ret; - - memset ((void *)&images, 0, sizeof (images)); - images.verify = getenv_yesno ("verify"); lmb_init(&images.lmb); @@ -223,6 +203,20 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) arch_lmb_reserve(&images.lmb); board_lmb_reserve(&images.lmb); +#else +# define lmb_reserve(lmb, base, size) +#endif +} + +static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + void *os_hdr; + int ret; + + memset ((void *)&images, 0, sizeof (images)); + images.verify = getenv_yesno ("verify"); + + bootm_start_lmb(); /* get kernel image header, start address and length */ os_hdr = boot_get_kernel (cmdtp, flag, argc, argv, @@ -297,7 +291,9 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } - if (images.os.os == IH_OS_LINUX) { + if (((images.os.type == IH_TYPE_KERNEL) || + (images.os.type == IH_TYPE_MULTI)) && + (images.os.os == IH_OS_LINUX)) { /* find ramdisk */ ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH, &images.rd_start, &images.rd_end); @@ -357,6 +353,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) *load_end = load + image_len; puts("OK\n"); break; +#ifdef CONFIG_GZIP case IH_COMP_GZIP: printf (" Uncompressing %s ... ", type_name); if (gunzip ((void *)load, unc_len, @@ -370,6 +367,7 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) *load_end = load + image_len; break; +#endif /* CONFIG_GZIP */ #ifdef CONFIG_BZIP2 case IH_COMP_BZIP2: printf (" Uncompressing %s ... ", type_name); @@ -465,7 +463,7 @@ static int bootm_start_standalone(ulong iflag, int argc, char *argv[]) /* we overload the cmd field with our state machine info instead of a * function pointer */ -cmd_tbl_t cmd_bootm_sub[] = { +static cmd_tbl_t cmd_bootm_sub[] = { U_BOOT_CMD_MKENT(start, 0, 1, (void *)BOOTM_STATE_START, "", ""), U_BOOT_CMD_MKENT(loados, 0, 1, (void *)BOOTM_STATE_LOADOS, "", ""), #if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_SPARC) @@ -888,9 +886,6 @@ static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] image_multi_getimg (hdr, 0, os_data, os_len); break; case IH_TYPE_STANDALONE: - if (argc >2) { - hdr->ih_load = htonl(simple_strtoul(argv[2], NULL, 16)); - } *os_data = image_get_data (hdr); *os_len = image_get_data_size (hdr); break;