X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fcmd_bootm.c;h=efd6aec0cf19f60b36e32f15c5345db6be03865e;hb=206c00f26f56af02686cb69bfe5c75e979063171;hp=401bf27d15de35d54841ab2813e4f98d4b4f5fe9;hpb=0008555f4d57c15ad86ee735861ca0d783042f61;p=oweals%2Fu-boot.git diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 401bf27d15..efd6aec0cf 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -57,6 +57,10 @@ #include #endif /* CONFIG_LZMA */ +#ifdef CONFIG_LZO +#include +#endif /* CONFIG_LZO */ + DECLARE_GLOBAL_DATA_PTR; extern int gunzip (void *dst, int dstlen, unsigned char *src, unsigned long *lenp); @@ -405,6 +409,24 @@ static int bootm_load_os(image_info_t os, ulong *load_end, int boot_progress) *load_end = load + unc_len; break; #endif /* CONFIG_LZMA */ +#ifdef CONFIG_LZO + case IH_COMP_LZO: + printf (" Uncompressing %s ... ", type_name); + + int ret = lzop_decompress((const unsigned char *)image_start, + image_len, (unsigned char *)load, + &unc_len); + if (ret != LZO_E_OK) { + printf ("LZO: uncompress or overwrite error %d " + "- must RESET board to recover\n", ret); + if (boot_progress) + show_boot_progress (-6); + return BOOTM_ERR_RESET; + } + + *load_end = load + unc_len; + break; +#endif /* CONFIG_LZO */ default: printf ("Unimplemented compression type %d\n", comp); return BOOTM_ERR_UNIMPLEMENTED; @@ -453,8 +475,8 @@ cmd_tbl_t cmd_bootm_sub[] = { #ifdef CONFIG_OF_LIBFDT U_BOOT_CMD_MKENT(fdt, 0, 1, (void *)BOOTM_STATE_FDT, "", ""), #endif - U_BOOT_CMD_MKENT(bdt, 0, 1, (void *)BOOTM_STATE_OS_BD_T, "", ""), U_BOOT_CMD_MKENT(cmdline, 0, 1, (void *)BOOTM_STATE_OS_CMDLINE, "", ""), + U_BOOT_CMD_MKENT(bdt, 0, 1, (void *)BOOTM_STATE_OS_BD_T, "", ""), U_BOOT_CMD_MKENT(prep, 0, 1, (void *)BOOTM_STATE_OS_PREP, "", ""), U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""), }; @@ -1000,8 +1022,8 @@ U_BOOT_CMD( #if defined(CONFIG_OF_LIBFDT) "\tfdt - relocate flat device tree\n" #endif - "\tbdt - OS specific bd_t processing\n" "\tcmdline - OS specific command line processing/setup\n" + "\tbdt - OS specific bd_t processing\n" "\tprep - OS specific prep before relocation or go\n" "\tgo - start OS" );