mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/5] Multi uImage support on ARM
@ 2011-10-08 14:17 Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 1/5] bootm: ensure the uImage is mapped first to allow option to used it Jean-Christophe PLAGNIOL-VILLARD
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-08 14:17 UTC (permalink / raw)
  To: barebox

Hi,

	This the final patch seires to add the Multi uImage support to
	barebox

	This does not support yet the script type but allow us to boot a uImage
	with a kernel and an initrd inside

	It will be easy to add the DT support too

	And enable it on arm.

Jean-Christophe PLAGNIOL-VILLARD (5):
      bootm: ensure the uImage is mapped first to allow option to used it
      get_fake_image_handle: set nb_data_entries to 1 and update the header size
      bootm: add -L option to specify the initrd load address
      arm/bootm: enable multi uimage support
      defaultenv: add bootm_opt var to allow the board to pass parameter to bootm

 arch/arm/lib/bootm.c |    5 -----
 commands/bootm.c     |   42 +++++++++++++++++++++++++++++++++++-------
 defaultenv/bin/boot  |    2 +-
 3 files changed, 36 insertions(+), 13 deletions(-)

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/5] bootm: ensure the uImage is mapped first to allow option to used it
  2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-08 14:29 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 2/5] get_fake_image_handle: set nb_data_entries to 1 and update the header size Jean-Christophe PLAGNIOL-VILLARD
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-08 14:29 UTC (permalink / raw)
  To: barebox

needed for multi image support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 commands/bootm.c |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index 755932b..f0f64cf 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -274,10 +274,7 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[])
 
 			return 0;
 		default:
-			if (!handler_parse_options(&data, opt, optarg))
-				continue;
-
-			return 1;
+			break;
 		}
 	}
 
@@ -297,6 +294,21 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[])
 		goto err_out;
 	}
 
+	optind = 0;
+
+	while((opt = getopt(argc, argv, options)) > 0) {
+		switch(opt) {
+		case 'h':
+		case 'n':
+			break;
+		default:
+			if (!handler_parse_options(&data, opt, optarg))
+				continue;
+
+			return 1;
+		}
+	}
+
 	/*
 	 * We have reached the point of no return: we are going to
 	 * overwrite all exception vector code, so we cannot easily
-- 
1.7.6.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/5] get_fake_image_handle: set nb_data_entries to 1 and update the header size
  2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 1/5] bootm: ensure the uImage is mapped first to allow option to used it Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-08 14:29 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 3/5] bootm: add -L option to specify the initrd load address Jean-Christophe PLAGNIOL-VILLARD
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-08 14:29 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 commands/bootm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index f0f64cf..afb9e06 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -181,6 +181,8 @@ static struct image_handle *get_fake_image_handle(struct image_data *data, int n
 	handle = xzalloc(sizeof(struct image_handle));
 	header = &handle->header;
 	handle->data_entries = gen_image_handle_data(iha->data, iha->len);
+	handle->nb_data_entries = 1;
+	header->ih_size = cpu_to_uimage(iha->len);
 	handle->data = handle->data_entries[0].data;
 
 	return handle;
-- 
1.7.6.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/5] bootm: add -L option to specify the initrd load address
  2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 1/5] bootm: ensure the uImage is mapped first to allow option to used it Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 2/5] get_fake_image_handle: set nb_data_entries to 1 and update the header size Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-08 14:29 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 4/5] arm/bootm: enable multi uimage support Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-08 14:29 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 commands/bootm.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/commands/bootm.c b/commands/bootm.c
index afb9e06..f11138a 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -191,7 +191,18 @@ static struct image_handle *get_fake_image_handle(struct image_data *data, int n
 static int initrd_handler_parse_options(struct image_data *data, int opt,
 		char *optarg)
 {
+	uint32_t initrd_start;
+
 	switch(opt) {
+	case 'L':
+		if (!data->initrd) {
+			eprintf("Warning -L ingnored. Specify the initrd first\n");
+			break;
+		}
+		initrd_start = simple_strtoul(optarg, NULL, 0);
+		printf("initrd_start=0x%x\n", initrd_start);
+		data->initrd->header.ih_load = cpu_to_uimage(initrd_start);
+		break;
 	case 'r':
 		printf("use initrd %s\n", optarg);
 		/* check for multi image @<num> */
@@ -204,16 +215,19 @@ static int initrd_handler_parse_options(struct image_data *data, int opt,
 		}
 		if (!data->initrd)
 			return -1;
-		return 0;
+		break;
 	default:
 		return 1;
 	}
+
+	return 0;
 }
 
 static struct image_handler initrd_handler = {
-	.cmdline_options = "r:",
+	.cmdline_options = "r:L:",
 	.cmdline_parse = initrd_handler_parse_options,
-	.help_string = " -r <initrd>    specify an initrd image",
+	.help_string = " -r <initrd>    specify an initrd image\n"
+		       " -L <load addr> specify initrd load address",
 };
 
 static int initrd_register_image_handler(void)
-- 
1.7.6.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/5] arm/bootm: enable multi uimage support
  2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 preceding siblings ...)
  2011-10-08 14:29 ` [PATCH 3/5] bootm: add -L option to specify the initrd load address Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-08 14:29 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-08 14:29 ` [PATCH 5/5] defaultenv: add bootm_opt var to allow the board to pass parameter to bootm Jean-Christophe PLAGNIOL-VILLARD
  2011-10-09  9:37 ` [PATCH 0/5] Multi uImage support on ARM Sascha Hauer
  5 siblings, 0 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-08 14:29 UTC (permalink / raw)
  To: barebox

tested on imx53 loco board with a Multi uImage file

generate like this

mkimage -A arm -O linux -T multi -C none -a 0x70008000 -e 0x70008000 -n Linux-2.6.35.3-00745-gce4c61a-dirty -d zImage:rootfs.cpio.lzma uImage.Multi

and boot via bootm

bootm -r @1 -L 0x72000000 /dev/ram0.kernel

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/lib/bootm.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 7156eea..87bf3b3 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -24,11 +24,6 @@ static int do_bootm_linux(struct image_data *data)
 	void (*theKernel)(int zero, int arch, void *params);
 	image_header_t *os_header = &data->os->header;
 
-	if (image_get_type(os_header) == IH_TYPE_MULTI) {
-		printf("Multifile images not handled at the moment\n");
-		return -1;
-	}
-
 	theKernel = (void *)image_get_ep(os_header);
 
 	debug("## Transferring control to Linux (at address 0x%p) ...\n",
-- 
1.7.6.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 5/5] defaultenv: add bootm_opt var to allow the board to pass parameter to bootm
  2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
                   ` (3 preceding siblings ...)
  2011-10-08 14:29 ` [PATCH 4/5] arm/bootm: enable multi uimage support Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-08 14:29 ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-09  9:37 ` [PATCH 0/5] Multi uImage support on ARM Sascha Hauer
  5 siblings, 0 replies; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-08 14:29 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 defaultenv/bin/boot |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
index 652ae0c..6761d84 100644
--- a/defaultenv/bin/boot
+++ b/defaultenv/bin/boot
@@ -115,7 +115,7 @@ fi
 echo "booting kernel of type $kernelimage_type from $kdev"
 
 if [ x$kernelimage_type = xuimage ]; then
-	bootm $kdev
+	bootm $bootm_opt $kdev
 elif [ x$kernelimage_type = xzimage ]; then
 	bootz $kdev
 elif [ x$kernelimage_type = xraw ]; then
-- 
1.7.6.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] Multi uImage support on ARM
  2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
                   ` (4 preceding siblings ...)
  2011-10-08 14:29 ` [PATCH 5/5] defaultenv: add bootm_opt var to allow the board to pass parameter to bootm Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-09  9:37 ` Sascha Hauer
  2011-10-10 22:06   ` Jean-Christophe PLAGNIOL-VILLARD
  5 siblings, 1 reply; 9+ messages in thread
From: Sascha Hauer @ 2011-10-09  9:37 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Sat, Oct 08, 2011 at 04:17:22PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Hi,
> 
> 	This the final patch seires to add the Multi uImage support to
> 	barebox
> 
> 	This does not support yet the script type but allow us to boot a uImage
> 	with a kernel and an initrd inside
> 
> 	It will be easy to add the DT support too
> 
> 	And enable it on arm.
> 
> Jean-Christophe PLAGNIOL-VILLARD (5):
>       bootm: ensure the uImage is mapped first to allow option to used it
>       get_fake_image_handle: set nb_data_entries to 1 and update the header size
>       bootm: add -L option to specify the initrd load address
>       arm/bootm: enable multi uimage support
>       defaultenv: add bootm_opt var to allow the board to pass parameter to bootm

Applied to next.

Sascha

> 
>  arch/arm/lib/bootm.c |    5 -----
>  commands/bootm.c     |   42 +++++++++++++++++++++++++++++++++++-------
>  defaultenv/bin/boot  |    2 +-
>  3 files changed, 36 insertions(+), 13 deletions(-)
> 
> Best Regards,
> J.
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] Multi uImage support on ARM
  2011-10-09  9:37 ` [PATCH 0/5] Multi uImage support on ARM Sascha Hauer
@ 2011-10-10 22:06   ` Jean-Christophe PLAGNIOL-VILLARD
  2011-10-12  6:55     ` Sascha Hauer
  0 siblings, 1 reply; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-10 22:06 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 11:37 Sun 09 Oct     , Sascha Hauer wrote:
> On Sat, Oct 08, 2011 at 04:17:22PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Hi,
> > 
> > 	This the final patch seires to add the Multi uImage support to
> > 	barebox
> > 
> > 	This does not support yet the script type but allow us to boot a uImage
> > 	with a kernel and an initrd inside
> > 
> > 	It will be easy to add the DT support too
> > 
> > 	And enable it on arm.
> > 
> > Jean-Christophe PLAGNIOL-VILLARD (5):
> >       bootm: ensure the uImage is mapped first to allow option to used it
> >       get_fake_image_handle: set nb_data_entries to 1 and update the header size
> >       bootm: add -L option to specify the initrd load address
> >       arm/bootm: enable multi uimage support
> >       defaultenv: add bootm_opt var to allow the board to pass parameter to bootm
> 
> Applied to next.
can we have it on the master it's the second part of the Multi uImage patch
series already present in the master

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/5] Multi uImage support on ARM
  2011-10-10 22:06   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2011-10-12  6:55     ` Sascha Hauer
  0 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2011-10-12  6:55 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Oct 11, 2011 at 12:06:36AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:37 Sun 09 Oct     , Sascha Hauer wrote:
> > On Sat, Oct 08, 2011 at 04:17:22PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > Hi,
> > > 
> > > 	This the final patch seires to add the Multi uImage support to
> > > 	barebox
> > > 
> > > 	This does not support yet the script type but allow us to boot a uImage
> > > 	with a kernel and an initrd inside
> > > 
> > > 	It will be easy to add the DT support too
> > > 
> > > 	And enable it on arm.
> > > 
> > > Jean-Christophe PLAGNIOL-VILLARD (5):
> > >       bootm: ensure the uImage is mapped first to allow option to used it
> > >       get_fake_image_handle: set nb_data_entries to 1 and update the header size
> > >       bootm: add -L option to specify the initrd load address
> > >       arm/bootm: enable multi uimage support
> > >       defaultenv: add bootm_opt var to allow the board to pass parameter to bootm
> > 
> > Applied to next.
> can we have it on the master it's the second part of the Multi uImage patch
> series already present in the master

No. It changes the bootm command which most boards use. A little bit
more testing is a good thing for this kind of stuff.

Sascha


-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-12  6:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-08 14:17 [PATCH 0/5] Multi uImage support on ARM Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:29 ` [PATCH 1/5] bootm: ensure the uImage is mapped first to allow option to used it Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:29 ` [PATCH 2/5] get_fake_image_handle: set nb_data_entries to 1 and update the header size Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:29 ` [PATCH 3/5] bootm: add -L option to specify the initrd load address Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:29 ` [PATCH 4/5] arm/bootm: enable multi uimage support Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:29 ` [PATCH 5/5] defaultenv: add bootm_opt var to allow the board to pass parameter to bootm Jean-Christophe PLAGNIOL-VILLARD
2011-10-09  9:37 ` [PATCH 0/5] Multi uImage support on ARM Sascha Hauer
2011-10-10 22:06   ` Jean-Christophe PLAGNIOL-VILLARD
2011-10-12  6:55     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox