mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] filetype: add arm u-boot support
@ 2013-09-17  7:52 Jean-Christophe PLAGNIOL-VILLARD
  2013-09-17  7:52 ` [PATCH 2/2] bootm: add " Jean-Christophe PLAGNIOL-VILLARD
  2013-09-18  7:00 ` [PATCH 1/2] filetype: add arm " Sascha Hauer
  0 siblings, 2 replies; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-17  7:52 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index 7507d85..59ea25a 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
 	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
 	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
+	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
 	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
 	[filetype_ubi] = { "UBI image", "ubi" },
 	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
@@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 
 	if (is_barebox_arm_head(_buf))
 		return filetype_arm_barebox;
+	if (buf[15] == 0xdeadbeef)
+		return filetype_arm_uboot;
 	if (buf[9] == 0x016f2818 || buf[9] == 0x18286f01)
 		return filetype_arm_zimage;
 
diff --git a/include/filetype.h b/include/filetype.h
index 9a864da..b83b9be 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -12,6 +12,7 @@ enum filetype {
 	filetype_lzo_compressed,
 	filetype_lz4_compressed,
 	filetype_arm_barebox,
+	filetype_arm_uboot,
 	filetype_uimage,
 	filetype_ubi,
 	filetype_jffs2,
-- 
1.8.4.rc1


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

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

* [PATCH 2/2] bootm: add u-boot support
  2013-09-17  7:52 [PATCH 1/2] filetype: add arm u-boot support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-17  7:52 ` Jean-Christophe PLAGNIOL-VILLARD
  2013-09-18  7:03   ` Sascha Hauer
  2013-09-18  7:00 ` [PATCH 1/2] filetype: add arm " Sascha Hauer
  1 sibling, 1 reply; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-17  7:52 UTC (permalink / raw)
  To: barebox

Simply do the same as barebox and hope for the best as u-boot does not handle
runtime address detection for boot quite often. It does only execpt you to
choose as compiling time.

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

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 599b09a..71200be 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -315,6 +315,12 @@ static struct image_handler barebox_handler = {
 	.filetype = filetype_arm_barebox,
 };
 
+static struct image_handler uboot_handler = {
+	.name = "ARM u-boot",
+	.bootm = do_bootm_barebox,
+	.filetype = filetype_arm_uboot,
+};
+
 #include <aimage.h>
 
 static int aimage_load_resource(int fd, struct resource *r, void* buf, int ps)
@@ -470,9 +476,15 @@ static struct binfmt_hook binfmt_barebox_hook = {
 	.exec = "bootm",
 };
 
+static struct binfmt_hook binfmt_uboot_hook = {
+	.type = filetype_arm_uboot,
+	.exec = "bootm",
+};
+
 static int armlinux_register_image_handler(void)
 {
 	register_image_handler(&barebox_handler);
+	register_image_handler(&uboot_handler);
 	register_image_handler(&uimage_handler);
 	register_image_handler(&rawimage_handler);
 	register_image_handler(&zimage_handler);
@@ -482,6 +494,7 @@ static int armlinux_register_image_handler(void)
 	}
 	binfmt_register(&binfmt_arm_zimage_hook);
 	binfmt_register(&binfmt_barebox_hook);
+	binfmt_register(&binfmt_uboot_hook);
 
 	return 0;
 }
-- 
1.8.4.rc1


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

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

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-17  7:52 [PATCH 1/2] filetype: add arm u-boot support Jean-Christophe PLAGNIOL-VILLARD
  2013-09-17  7:52 ` [PATCH 2/2] bootm: add " Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-18  7:00 ` Sascha Hauer
  2013-09-19 11:56   ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2013-09-18  7:00 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  common/filetype.c  | 3 +++
>  include/filetype.h | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/common/filetype.c b/common/filetype.c
> index 7507d85..59ea25a 100644
> --- a/common/filetype.c
> +++ b/common/filetype.c
> @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
>  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
>  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
>  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
>  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
>  	[filetype_ubi] = { "UBI image", "ubi" },
>  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
>  
>  	if (is_barebox_arm_head(_buf))
>  		return filetype_arm_barebox;
> +	if (buf[15] == 0xdeadbeef)
> +		return filetype_arm_uboot;

0xdeadbeef is such a widely used placeholder that we should use it for
filetype detection. Also, I don't think that U-Boot ever specified
0xdeadbeef at this offset as a fixed value. It could be changed without
notice.

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] 11+ messages in thread

* Re: [PATCH 2/2] bootm: add u-boot support
  2013-09-17  7:52 ` [PATCH 2/2] bootm: add " Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-18  7:03   ` Sascha Hauer
  2013-09-19 11:50     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2013-09-18  7:03 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Sep 17, 2013 at 09:52:19AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Simply do the same as barebox and hope for the best as u-boot does not handle
> runtime address detection for boot quite often. It does only execpt you to
> choose as compiling time.
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/lib/bootm.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 599b09a..71200be 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -315,6 +315,12 @@ static struct image_handler barebox_handler = {
>  	.filetype = filetype_arm_barebox,
>  };
>  
> +static struct image_handler uboot_handler = {
> +	.name = "ARM u-boot",
> +	.bootm = do_bootm_barebox,
> +	.filetype = filetype_arm_uboot,
> +};
> +

Wolfgang always emphasizes that it's not possible to start U-Boot second
stage. Most U-Boot images indeed do not support this without hacking the
lowlevel code. We can't support this feature which happens to work on
only some U-Boot images.

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] 11+ messages in thread

* Re: [PATCH 2/2] bootm: add u-boot support
  2013-09-18  7:03   ` Sascha Hauer
@ 2013-09-19 11:50     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-19 11:50 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 09:03 Wed 18 Sep     , Sascha Hauer wrote:
> On Tue, Sep 17, 2013 at 09:52:19AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Simply do the same as barebox and hope for the best as u-boot does not handle
> > runtime address detection for boot quite often. It does only execpt you to
> > choose as compiling time.
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  arch/arm/lib/bootm.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > index 599b09a..71200be 100644
> > --- a/arch/arm/lib/bootm.c
> > +++ b/arch/arm/lib/bootm.c
> > @@ -315,6 +315,12 @@ static struct image_handler barebox_handler = {
> >  	.filetype = filetype_arm_barebox,
> >  };
> >  
> > +static struct image_handler uboot_handler = {
> > +	.name = "ARM u-boot",
> > +	.bootm = do_bootm_barebox,
> > +	.filetype = filetype_arm_uboot,
> > +};
> > +
> 
> Wolfgang always emphasizes that it's not possible to start U-Boot second
> stage. Most U-Boot images indeed do not support this without hacking the
> lowlevel code.
yeah they still does not understand that it's a hugely usefull feature
> We can't support this feature which happens to work on
> only some U-Boot images.
that's why the comment "hope for the best"

but it's still possible on at91 and others as example

so how can we run those bianry from barebox easely

Best Regards,
J.

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

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

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-18  7:00 ` [PATCH 1/2] filetype: add arm " Sascha Hauer
@ 2013-09-19 11:56   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-09-20  6:29     ` Sascha Hauer
  0 siblings, 1 reply; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-19 11:56 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  common/filetype.c  | 3 +++
> >  include/filetype.h | 1 +
> >  2 files changed, 4 insertions(+)
> > 
> > diff --git a/common/filetype.c b/common/filetype.c
> > index 7507d85..59ea25a 100644
> > --- a/common/filetype.c
> > +++ b/common/filetype.c
> > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> >  	[filetype_ubi] = { "UBI image", "ubi" },
> >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> >  
> >  	if (is_barebox_arm_head(_buf))
> >  		return filetype_arm_barebox;
> > +	if (buf[15] == 0xdeadbeef)
> > +		return filetype_arm_uboot;
> 
> 0xdeadbeef is such a widely used placeholder that we should use it for
> filetype detection. Also, I don't think that U-Boot ever specified
> 0xdeadbeef at this offset as a fixed value. It could be changed without
> notice.

on ARM it's keeped for years > 7 IIRC

Best Regards,
J.
> 
> 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] 11+ messages in thread

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-19 11:56   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-20  6:29     ` Sascha Hauer
  2013-09-20  8:02       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2013-09-20  6:29 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Thu, Sep 19, 2013 at 01:56:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> > On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > ---
> > >  common/filetype.c  | 3 +++
> > >  include/filetype.h | 1 +
> > >  2 files changed, 4 insertions(+)
> > > 
> > > diff --git a/common/filetype.c b/common/filetype.c
> > > index 7507d85..59ea25a 100644
> > > --- a/common/filetype.c
> > > +++ b/common/filetype.c
> > > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> > >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> > >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> > >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> > >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> > >  	[filetype_ubi] = { "UBI image", "ubi" },
> > >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > >  
> > >  	if (is_barebox_arm_head(_buf))
> > >  		return filetype_arm_barebox;
> > > +	if (buf[15] == 0xdeadbeef)
> > > +		return filetype_arm_uboot;
> > 
> > 0xdeadbeef is such a widely used placeholder that we should use it for
> > filetype detection. Also, I don't think that U-Boot ever specified
> > 0xdeadbeef at this offset as a fixed value. It could be changed without
> > notice.
> 
> on ARM it's keeped for years > 7 IIRC

Yes, and there's no indication that it will change. Anyway, this was
never meant as an API and everybody uses 0xdeadbeef as placeholder.

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] 11+ messages in thread

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-20  6:29     ` Sascha Hauer
@ 2013-09-20  8:02       ` Jean-Christophe PLAGNIOL-VILLARD
  2013-09-20 11:56         ` Sascha Hauer
  0 siblings, 1 reply; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-20  8:02 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 08:29 Fri 20 Sep     , Sascha Hauer wrote:
> On Thu, Sep 19, 2013 at 01:56:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> > > On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > > ---
> > > >  common/filetype.c  | 3 +++
> > > >  include/filetype.h | 1 +
> > > >  2 files changed, 4 insertions(+)
> > > > 
> > > > diff --git a/common/filetype.c b/common/filetype.c
> > > > index 7507d85..59ea25a 100644
> > > > --- a/common/filetype.c
> > > > +++ b/common/filetype.c
> > > > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> > > >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> > > >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> > > >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > > > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> > > >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> > > >  	[filetype_ubi] = { "UBI image", "ubi" },
> > > >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > > > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > > >  
> > > >  	if (is_barebox_arm_head(_buf))
> > > >  		return filetype_arm_barebox;
> > > > +	if (buf[15] == 0xdeadbeef)
> > > > +		return filetype_arm_uboot;
> > > 
> > > 0xdeadbeef is such a widely used placeholder that we should use it for
> > > filetype detection. Also, I don't think that U-Boot ever specified
> > > 0xdeadbeef at this offset as a fixed value. It could be changed without
> > > notice.
> > 
> > on ARM it's keeped for years > 7 IIRC
> 
> Yes, and there's no indication that it will change. Anyway, this was
> never meant as an API and everybody uses 0xdeadbeef as placeholder.

so the question remain how to boot a u-boot that can be a second stage

Best Regards,
J.
> 
> 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] 11+ messages in thread

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-20  8:02       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-20 11:56         ` Sascha Hauer
  2013-09-21  6:53           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2013-09-20 11:56 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Fri, Sep 20, 2013 at 10:02:57AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 08:29 Fri 20 Sep     , Sascha Hauer wrote:
> > On Thu, Sep 19, 2013 at 01:56:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> > > > On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > > > ---
> > > > >  common/filetype.c  | 3 +++
> > > > >  include/filetype.h | 1 +
> > > > >  2 files changed, 4 insertions(+)
> > > > > 
> > > > > diff --git a/common/filetype.c b/common/filetype.c
> > > > > index 7507d85..59ea25a 100644
> > > > > --- a/common/filetype.c
> > > > > +++ b/common/filetype.c
> > > > > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> > > > >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> > > > >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> > > > >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > > > > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> > > > >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> > > > >  	[filetype_ubi] = { "UBI image", "ubi" },
> > > > >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > > > > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > > > >  
> > > > >  	if (is_barebox_arm_head(_buf))
> > > > >  		return filetype_arm_barebox;
> > > > > +	if (buf[15] == 0xdeadbeef)
> > > > > +		return filetype_arm_uboot;
> > > > 
> > > > 0xdeadbeef is such a widely used placeholder that we should use it for
> > > > filetype detection. Also, I don't think that U-Boot ever specified
> > > > 0xdeadbeef at this offset as a fixed value. It could be changed without
> > > > notice.
> > > 
> > > on ARM it's keeped for years > 7 IIRC
> > 
> > Yes, and there's no indication that it will change. Anyway, this was
> > never meant as an API and everybody uses 0xdeadbeef as placeholder.
> 
> so the question remain how to boot a u-boot that can be a second stage

'go'? You could also embed it in an uImage if you really want to use the
bootm command.

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] 11+ messages in thread

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-20 11:56         ` Sascha Hauer
@ 2013-09-21  6:53           ` Jean-Christophe PLAGNIOL-VILLARD
  2013-09-21  8:10             ` Sascha Hauer
  0 siblings, 1 reply; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-21  6:53 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On 13:56 Fri 20 Sep     , Sascha Hauer wrote:
> On Fri, Sep 20, 2013 at 10:02:57AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > On 08:29 Fri 20 Sep     , Sascha Hauer wrote:
> > > On Thu, Sep 19, 2013 at 01:56:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> > > > > On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > > > > ---
> > > > > >  common/filetype.c  | 3 +++
> > > > > >  include/filetype.h | 1 +
> > > > > >  2 files changed, 4 insertions(+)
> > > > > > 
> > > > > > diff --git a/common/filetype.c b/common/filetype.c
> > > > > > index 7507d85..59ea25a 100644
> > > > > > --- a/common/filetype.c
> > > > > > +++ b/common/filetype.c
> > > > > > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> > > > > >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> > > > > >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> > > > > >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > > > > > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> > > > > >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> > > > > >  	[filetype_ubi] = { "UBI image", "ubi" },
> > > > > >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > > > > > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > > > > >  
> > > > > >  	if (is_barebox_arm_head(_buf))
> > > > > >  		return filetype_arm_barebox;
> > > > > > +	if (buf[15] == 0xdeadbeef)
> > > > > > +		return filetype_arm_uboot;
> > > > > 
> > > > > 0xdeadbeef is such a widely used placeholder that we should use it for
> > > > > filetype detection. Also, I don't think that U-Boot ever specified
> > > > > 0xdeadbeef at this offset as a fixed value. It could be changed without
> > > > > notice.
> > > > 
> > > > on ARM it's keeped for years > 7 IIRC
> > > 
> > > Yes, and there's no indication that it will change. Anyway, this was
> > > never meant as an API and everybody uses 0xdeadbeef as placeholder.
> > 
> > so the question remain how to boot a u-boot that can be a second stage
> 
> 'go'? You could also embed it in an uImage if you really want to use the
> bootm command.

I really hate the go you need to load in ram and then do the go

Best Regards,
J.
> 
> 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] 11+ messages in thread

* Re: [PATCH 1/2] filetype: add arm u-boot support
  2013-09-21  6:53           ` Jean-Christophe PLAGNIOL-VILLARD
@ 2013-09-21  8:10             ` Sascha Hauer
  0 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2013-09-21  8:10 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Sat, Sep 21, 2013 at 08:53:43AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 13:56 Fri 20 Sep     , Sascha Hauer wrote:
> > On Fri, Sep 20, 2013 at 10:02:57AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 08:29 Fri 20 Sep     , Sascha Hauer wrote:
> > > > On Thu, Sep 19, 2013 at 01:56:38PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > On 09:00 Wed 18 Sep     , Sascha Hauer wrote:
> > > > > > On Tue, Sep 17, 2013 at 09:52:18AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > > > > > ---
> > > > > > >  common/filetype.c  | 3 +++
> > > > > > >  include/filetype.h | 1 +
> > > > > > >  2 files changed, 4 insertions(+)
> > > > > > > 
> > > > > > > diff --git a/common/filetype.c b/common/filetype.c
> > > > > > > index 7507d85..59ea25a 100644
> > > > > > > --- a/common/filetype.c
> > > > > > > +++ b/common/filetype.c
> > > > > > > @@ -35,6 +35,7 @@ static const struct filetype_str filetype_str[] = {
> > > > > > >  	[filetype_lzo_compressed] = { "lzo compressed", "lzo" },
> > > > > > >  	[filetype_lz4_compressed] = { "lz4 compressed", "lz4" },
> > > > > > >  	[filetype_arm_barebox] = { "arm barebox image", "arm-barebox" },
> > > > > > > +	[filetype_arm_uboot] = { "arm u-boot image", "arm-u-boot" },
> > > > > > >  	[filetype_uimage] = { "U-Boot uImage", "u-boot" },
> > > > > > >  	[filetype_ubi] = { "UBI image", "ubi" },
> > > > > > >  	[filetype_jffs2] = { "JFFS2 image", "jffs2" },
> > > > > > > @@ -226,6 +227,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > > > > > >  
> > > > > > >  	if (is_barebox_arm_head(_buf))
> > > > > > >  		return filetype_arm_barebox;
> > > > > > > +	if (buf[15] == 0xdeadbeef)
> > > > > > > +		return filetype_arm_uboot;
> > > > > > 
> > > > > > 0xdeadbeef is such a widely used placeholder that we should use it for
> > > > > > filetype detection. Also, I don't think that U-Boot ever specified
> > > > > > 0xdeadbeef at this offset as a fixed value. It could be changed without
> > > > > > notice.
> > > > > 
> > > > > on ARM it's keeped for years > 7 IIRC
> > > > 
> > > > Yes, and there's no indication that it will change. Anyway, this was
> > > > never meant as an API and everybody uses 0xdeadbeef as placeholder.
> > > 
> > > so the question remain how to boot a u-boot that can be a second stage
> > 
> > 'go'? You could also embed it in an uImage if you really want to use the
> > bootm command.
> 
> I really hate the go you need to load in ram and then do the go

You could also use the -f option to bootm instead.

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] 11+ messages in thread

end of thread, other threads:[~2013-09-21  8:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-17  7:52 [PATCH 1/2] filetype: add arm u-boot support Jean-Christophe PLAGNIOL-VILLARD
2013-09-17  7:52 ` [PATCH 2/2] bootm: add " Jean-Christophe PLAGNIOL-VILLARD
2013-09-18  7:03   ` Sascha Hauer
2013-09-19 11:50     ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-18  7:00 ` [PATCH 1/2] filetype: add arm " Sascha Hauer
2013-09-19 11:56   ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-20  6:29     ` Sascha Hauer
2013-09-20  8:02       ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-20 11:56         ` Sascha Hauer
2013-09-21  6:53           ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-21  8:10             ` Sascha Hauer

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