From 5bc3870d6763eb0bb28a8d5d85061e4a75e8a861 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 13 Aug 2012 02:04:23 +0800 Subject: [PATCH 1/4] arm/bootm: fix initrd_start init initrd_start need to be init to data->initrd_address and updated only if the addr is invalid. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/arm/lib/bootm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index a8840fe42..c5b76ea97 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -58,7 +58,9 @@ static int __do_bootm_linux(struct image_data *data, int swap) kernel = data->os_res->start + data->os_entry; - if (data->initrd_file && data->initrd_address == UIMAGE_INVALID_ADDRESS) { + initrd_start = data->initrd_address; + + if (data->initrd_file && initrd_start == UIMAGE_INVALID_ADDRESS) { initrd_start = data->os_res->start + SZ_8M; if (bootm_verbose(data)) { From 73918efe1a720f8837760fd99b6402e39bb8daf9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 13 Aug 2012 14:30:40 +0800 Subject: [PATCH 2/4] bootm: do not load the initrd in the common code This need to be handled by the arch bootm as the address can be invalid and provided at arch level. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- commands/bootm.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/commands/bootm.c b/commands/bootm.c index 3c47ab5d9..5f858e8a1 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -126,14 +126,6 @@ static int bootm_open_initrd_uimage(struct image_data *data) if (data->initrd_address == UIMAGE_SOME_ADDRESS) data->initrd_address = data->initrd->header.ih_load; - if (data->initrd_address != UIMAGE_INVALID_ADDRESS) { - data->initrd_res = uimage_load_to_sdram(data->initrd, - data->initrd_num, - data->initrd_address); - if (!data->initrd_res) - return -ENOMEM; - } - return 0; } From 3120585df8b537493681fd4c395919a341f96e6e Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 13 Aug 2012 14:34:08 +0800 Subject: [PATCH 3/4] uimage_sdram_flush: fix resource start The start is the start of the previous resource nor the size of it. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/uimage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/uimage.c b/common/uimage.c index 43878b59a..735b64e8f 100644 --- a/common/uimage.c +++ b/common/uimage.c @@ -355,8 +355,9 @@ static struct resource *uimage_resource; static int uimage_sdram_flush(void *buf, unsigned int len) { if (uimage_size + len > resource_size(uimage_resource)) { - resource_size_t start = resource_size(uimage_resource); + resource_size_t start = uimage_resource->start; resource_size_t size = resource_size(uimage_resource) + len; + release_sdram_region(uimage_resource); uimage_resource = request_sdram_region("uimage", From d9cefaed51917da5121443715cb9a14c237f9b9b Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 13 Aug 2012 14:34:08 +0800 Subject: [PATCH 4/4] uimage_laod: fix ramdisk support ramdisk U-Boot expect to ignore the compression type Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- common/uimage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/uimage.c b/common/uimage.c index 735b64e8f..442a7f097 100644 --- a/common/uimage.c +++ b/common/uimage.c @@ -334,7 +334,8 @@ int uimage_load(struct uimage_handle *handle, unsigned int image_no, if (ret < 0) return ret; - if (hdr->ih_comp == IH_COMP_NONE) + /* if ramdisk U-Boot expect to ignore the compression type */ + if (hdr->ih_comp == IH_COMP_NONE || hdr->ih_type == IH_TYPE_RAMDISK) uncompress_fn = uncompress_copy; else uncompress_fn = uncompress;