Skip to contentSkip to conversation

Bootm uImage initrd fix

PATCH In review Jean-Christophe PLAGNIOL-VILLARD 2 participants 6 messages Aug 13, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover Bootm uImage initrd fix

Hi,

please pull
The following changes since commit 58713d32746d49ad39ba17658fe82f1b98b80b2e:

commands: memset: fix help message (2012-08-09 08:44:38 +0200)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git tags/bootm_fix

for you to fetch changes up to d9cefaed51917da5121443715cb9a14c237f9b9b:

uimage_laod: fix ramdisk support (2012-08-13 14:48:16 +0800)

----------------------------------------------------------------
bootm: uImage initrd fix support

Fix multiple issues:
- arm: loadaddr hardcode to 0x0 if valid
- uncompress the ramdisk (U-Boot do not do so)
- image_sdram_flush: wrong start address when expending the resource
- bootm: load the initrd to ram where this is done at arch level

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (4):
arm/bootm: fix initrd_start init
bootm: do not load the initrd in the common code
uimage_sdram_flush: fix resource start
uimage_laod: fix ramdisk support

 arch/arm/lib/bootm.c |    4 +++-
 commands/bootm.c     |    8 --------
 common/uimage.c      |    6 ++++--
 3 files changed, 7 insertions(+), 11 deletions(-)

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw

PATCH 2/4 bootm: do not load the initrd in the common code

In reply to Jean-Christophe PLAGNIOL-VILLARD

This need to be handled by the arch bootm as the address can be invalid and provided at arch level.

---
 commands/bootm.c |    8 --------
 1 file changed, 8 deletions(-)
commands/bootm.c +0 -8
index 3c47ab5..5f858e8 100644
@@ -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;
 }
 
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/4 arm/bootm: fix initrd_start init

In reply to Jean-Christophe PLAGNIOL-VILLARD

initrd_start need to be init to data->initrd_address and updated only if the addr is invalid.

---
 arch/arm/lib/bootm.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/lib/bootm.c +3 -1
index a8840fe..c5b76ea 100644
@@ -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)) {
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH 3/4 uimage_sdram_flush: fix resource start

The start is the start of the previous resource nor the size of it.

---
 common/uimage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
common/uimage.c +2 -1
index 43878b5..735b64e 100644
@@ -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",
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH 4/4 uimage_laod: fix ramdisk support

In reply to Jean-Christophe PLAGNIOL-VILLARD

ramdisk U-Boot expect to ignore the compression type

---
 common/uimage.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
common/uimage.c +2 -1
index 735b64e..442a7f0 100644
@@ -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;
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD

Hi,

please pull
The following changes since commit 58713d32746d49ad39ba17658fe82f1b98b80b2e:

commands: memset: fix help message (2012-08-09 08:44:38 +0200)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git tags/bootm_fix

Pulled, thanks

Sascha

Quoted 36 lines

for you to fetch changes up to d9cefaed51917da5121443715cb9a14c237f9b9b:

uimage_laod: fix ramdisk support (2012-08-13 14:48:16 +0800)

----------------------------------------------------------------
bootm: uImage initrd fix support

Fix multiple issues:
- arm: loadaddr hardcode to 0x0 if valid
- uncompress the ramdisk (U-Boot do not do so)
- image_sdram_flush: wrong start address when expending the resource
- bootm: load the initrd to ram where this is done at arch level

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (4):
arm/bootm: fix initrd_start init
bootm: do not load the initrd in the common code
uimage_sdram_flush: fix resource start
uimage_laod: fix ramdisk support

 arch/arm/lib/bootm.c |    4 +++-
 commands/bootm.c     |    8 --------
 common/uimage.c      |    6 ++++--
 3 files changed, 7 insertions(+), 11 deletions(-)

Best Regards,
J.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox