public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB
@ 2015-11-26  3:17 Chin Liang See
  2015-11-26  6:14 ` Stefan Roese
  0 siblings, 1 reply; 6+ messages in thread
From: Chin Liang See @ 2015-11-26  3:17 UTC (permalink / raw)
  To: u-boot

Adding new environment usbload which will load zImage and
Linux DTB from USB mass storage through FAT file system.

Signed-off-by: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Dinh Nguyen <dinh.linux@gmail.com>
Cc: Pavel Machek <pavel@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Stefan Roese <sr@denx.de>
---
 include/configs/socfpga_arria5_socdk.h   | 5 ++++-
 include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h
index 0506336..f488b00 100644
--- a/include/configs/socfpga_arria5_socdk.h
+++ b/include/configs/socfpga_arria5_socdk.h
@@ -100,7 +100,10 @@
 		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
 	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
 		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
-		"bootm ${loadaddr} - ${fdt_addr}\0"
+		"bootm ${loadaddr} - ${fdt_addr}\0" \
+	"usbload=usb reset;" \
+		"fatload usb 0 ${loadaddr} ${bootimage};" \
+		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
 
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h
index d7369ee..40a4f08 100644
--- a/include/configs/socfpga_cyclone5_socdk.h
+++ b/include/configs/socfpga_cyclone5_socdk.h
@@ -100,7 +100,10 @@
 		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
 	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
 		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
-		"bootm ${loadaddr} - ${fdt_addr}\0"
+		"bootm ${loadaddr} - ${fdt_addr}\0" \
+	"usbload=usb reset;" \
+		"fatload usb 0 ${loadaddr} ${bootimage};" \
+		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
 
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
-- 
2.2.0

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

* [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB
  2015-11-26  3:17 [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB Chin Liang See
@ 2015-11-26  6:14 ` Stefan Roese
  2015-11-26 11:04   ` Marek Vasut
  2015-11-27  1:40   ` Chin Liang See
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Roese @ 2015-11-26  6:14 UTC (permalink / raw)
  To: u-boot

On 26.11.2015 04:17, Chin Liang See wrote:
> Adding new environment usbload which will load zImage and
> Linux DTB from USB mass storage through FAT file system.
>
> Signed-off-by: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> Cc: Dinh Nguyen <dinh.linux@gmail.com>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Stefan Roese <sr@denx.de>
> ---
>   include/configs/socfpga_arria5_socdk.h   | 5 ++++-
>   include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
>   2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/include/configs/socfpga_arria5_socdk.h b/include/configs/socfpga_arria5_socdk.h
> index 0506336..f488b00 100644
> --- a/include/configs/socfpga_arria5_socdk.h
> +++ b/include/configs/socfpga_arria5_socdk.h
> @@ -100,7 +100,10 @@
>   		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
>   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
>   		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
> -		"bootm ${loadaddr} - ${fdt_addr}\0"
> +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> +	"usbload=usb reset;" \
> +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
>
>   /* The rest of the configuration is shared */
>   #include <configs/socfpga_common.h>
> diff --git a/include/configs/socfpga_cyclone5_socdk.h b/include/configs/socfpga_cyclone5_socdk.h
> index d7369ee..40a4f08 100644
> --- a/include/configs/socfpga_cyclone5_socdk.h
> +++ b/include/configs/socfpga_cyclone5_socdk.h
> @@ -100,7 +100,10 @@
>   		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
>   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
>   		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
> -		"bootm ${loadaddr} - ${fdt_addr}\0"
> +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> +	"usbload=usb reset;" \
> +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"

Again, please use the generic FS commands here, e.g. "load" instead
of "fatload".

And doesn't it make sense to consolidate these common, identical
commands into a common file (socfpga_common.h)?

Thanks,
Stefan

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

* [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB
  2015-11-26  6:14 ` Stefan Roese
@ 2015-11-26 11:04   ` Marek Vasut
  2015-11-27  1:38     ` Chin Liang See
  2015-11-27  1:40   ` Chin Liang See
  1 sibling, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2015-11-26 11:04 UTC (permalink / raw)
  To: u-boot

On Thursday, November 26, 2015 at 07:14:56 AM, Stefan Roese wrote:
> On 26.11.2015 04:17, Chin Liang See wrote:
> > Adding new environment usbload which will load zImage and
> > Linux DTB from USB mass storage through FAT file system.
> > 
> > Signed-off-by: Chin Liang See <clsee@altera.com>
> > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> > Cc: Dinh Nguyen <dinh.linux@gmail.com>
> > Cc: Pavel Machek <pavel@denx.de>
> > Cc: Marek Vasut <marex@denx.de>
> > Cc: Stefan Roese <sr@denx.de>
> > ---
> > 
> >   include/configs/socfpga_arria5_socdk.h   | 5 ++++-
> >   include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
> >   2 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/configs/socfpga_arria5_socdk.h
> > b/include/configs/socfpga_arria5_socdk.h index 0506336..f488b00 100644
> > --- a/include/configs/socfpga_arria5_socdk.h
> > +++ b/include/configs/socfpga_arria5_socdk.h
> > @@ -100,7 +100,10 @@
> > 
> >   		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
> >   	
> >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> >   	
> >   		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
> > 
> > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > +	"usbload=usb reset;" \
> > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> > 
> >   /* The rest of the configuration is shared */
> >   #include <configs/socfpga_common.h>
> > 
> > diff --git a/include/configs/socfpga_cyclone5_socdk.h
> > b/include/configs/socfpga_cyclone5_socdk.h index d7369ee..40a4f08 100644
> > --- a/include/configs/socfpga_cyclone5_socdk.h
> > +++ b/include/configs/socfpga_cyclone5_socdk.h
> > @@ -100,7 +100,10 @@
> > 
> >   		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \
> >   	
> >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> >   	
> >   		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
> > 
> > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > +	"usbload=usb reset;" \
> > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> 
> Again, please use the generic FS commands here, e.g. "load" instead
> of "fatload".
> 
> And doesn't it make sense to consolidate these common, identical
> commands into a common file (socfpga_common.h)?

Even better -- why not switch to distro_bootcmd and/or update it to support
booting from USB (it probably already does).

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB
  2015-11-26 11:04   ` Marek Vasut
@ 2015-11-27  1:38     ` Chin Liang See
  2015-11-27 10:19       ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Chin Liang See @ 2015-11-27  1:38 UTC (permalink / raw)
  To: u-boot

Hi Marek,

On Thu, 2015-11-26 at 12:04 +0100, Marek Vasut wrote:
> On Thursday, November 26, 2015 at 07:14:56 AM, Stefan Roese wrote:
> > On 26.11.2015 04:17, Chin Liang See wrote:
> > > Adding new environment usbload which will load zImage and
> > > Linux DTB from USB mass storage through FAT file system.
> > > 
> > > Signed-off-by: Chin Liang See <clsee@altera.com>
> > > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> > > Cc: Dinh Nguyen <dinh.linux@gmail.com>
> > > Cc: Pavel Machek <pavel@denx.de>
> > > Cc: Marek Vasut <marex@denx.de>
> > > Cc: Stefan Roese <sr@denx.de>
> > > ---
> > > 
> > >   include/configs/socfpga_arria5_socdk.h   | 5 ++++-
> > >   include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
> > >   2 files changed, 8 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/include/configs/socfpga_arria5_socdk.h
> > > b/include/configs/socfpga_arria5_socdk.h index 0506336..f488b00
> > > 100644
> > > --- a/include/configs/socfpga_arria5_socdk.h
> > > +++ b/include/configs/socfpga_arria5_socdk.h
> > > @@ -100,7 +100,10 @@
> > > 
> > >   		"sf read ${fdt_addr} ${qspifdtaddr}
> > > ${fdtimagesize};\0" \
> > >   	
> > >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> > >   	
> > >   		" root=${qspiroot} rw
> > > rootfstype=${qspirootfstype};"\
> > > 
> > > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > > +	"usbload=usb reset;" \
> > > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> > > 
> > >   /* The rest of the configuration is shared */
> > >   #include <configs/socfpga_common.h>
> > > 
> > > diff --git a/include/configs/socfpga_cyclone5_socdk.h
> > > b/include/configs/socfpga_cyclone5_socdk.h index d7369ee..40a4f08
> > > 100644
> > > --- a/include/configs/socfpga_cyclone5_socdk.h
> > > +++ b/include/configs/socfpga_cyclone5_socdk.h
> > > @@ -100,7 +100,10 @@
> > > 
> > >   		"sf read ${fdt_addr} ${qspifdtaddr}
> > > ${fdtimagesize};\0" \
> > >   	
> > >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> > >   	
> > >   		" root=${qspiroot} rw
> > > rootfstype=${qspirootfstype};"\
> > > 
> > > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > > +	"usbload=usb reset;" \
> > > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> > 
> > Again, please use the generic FS commands here, e.g. "load" instead
> > of "fatload".
> > 
> > And doesn't it make sense to consolidate these common, identical
> > commands into a common file (socfpga_common.h)?
> 
> Even better -- why not switch to distro_bootcmd and/or update it to
> support
> booting from USB (it probably already does).

Thanks for sharing this. I presume we need a script to store the boot
command? Let me read more on this.

Thanks
Chin Liang

> 
> Best regards,
> Marek Vasut

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

* [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB
  2015-11-26  6:14 ` Stefan Roese
  2015-11-26 11:04   ` Marek Vasut
@ 2015-11-27  1:40   ` Chin Liang See
  1 sibling, 0 replies; 6+ messages in thread
From: Chin Liang See @ 2015-11-27  1:40 UTC (permalink / raw)
  To: u-boot

Hi Stefan,

On Thu, 2015-11-26 at 07:14 +0100, Stefan Roese wrote:
> On 26.11.2015 04:17, Chin Liang See wrote:
> > Adding new environment usbload which will load zImage and
> > Linux DTB from USB mass storage through FAT file system.
> > 
> > Signed-off-by: Chin Liang See <clsee@altera.com>
> > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> > Cc: Dinh Nguyen <dinh.linux@gmail.com>
> > Cc: Pavel Machek <pavel@denx.de>
> > Cc: Marek Vasut <marex@denx.de>
> > Cc: Stefan Roese <sr@denx.de>
> > ---
> >   include/configs/socfpga_arria5_socdk.h   | 5 ++++-
> >   include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
> >   2 files changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/configs/socfpga_arria5_socdk.h
> > b/include/configs/socfpga_arria5_socdk.h
> > index 0506336..f488b00 100644
> > --- a/include/configs/socfpga_arria5_socdk.h
> > +++ b/include/configs/socfpga_arria5_socdk.h
> > @@ -100,7 +100,10 @@
> >   		"sf read ${fdt_addr} ${qspifdtaddr}
> > ${fdtimagesize};\0" \
> >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> >   		" root=${qspiroot} rw
> > rootfstype=${qspirootfstype};"\
> > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > +	"usbload=usb reset;" \
> > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> > 
> >   /* The rest of the configuration is shared */
> >   #include <configs/socfpga_common.h>
> > diff --git a/include/configs/socfpga_cyclone5_socdk.h
> > b/include/configs/socfpga_cyclone5_socdk.h
> > index d7369ee..40a4f08 100644
> > --- a/include/configs/socfpga_cyclone5_socdk.h
> > +++ b/include/configs/socfpga_cyclone5_socdk.h
> > @@ -100,7 +100,10 @@
> >   		"sf read ${fdt_addr} ${qspifdtaddr}
> > ${fdtimagesize};\0" \
> >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> >   		" root=${qspiroot} rw
> > rootfstype=${qspirootfstype};"\
> > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > +	"usbload=usb reset;" \
> > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> 
> Again, please use the generic FS commands here, e.g. "load" instead
> of "fatload".

Oops, forget about the load. Let me fix this.

> 
> And doesn't it make sense to consolidate these common, identical
> commands into a common file (socfpga_common.h)?

Hmmm, currently there are all in board specific configuration as board
to board might have different configuration (e.g. some board might not
have USB).

Thanks
Chin Liang

> 
> Thanks,
> Stefan
> 

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

* [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB
  2015-11-27  1:38     ` Chin Liang See
@ 2015-11-27 10:19       ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-11-27 10:19 UTC (permalink / raw)
  To: u-boot

On Friday, November 27, 2015 at 02:38:57 AM, Chin Liang See wrote:
> Hi Marek,
> 
> On Thu, 2015-11-26 at 12:04 +0100, Marek Vasut wrote:
> > On Thursday, November 26, 2015 at 07:14:56 AM, Stefan Roese wrote:
> > > On 26.11.2015 04:17, Chin Liang See wrote:
> > > > Adding new environment usbload which will load zImage and
> > > > Linux DTB from USB mass storage through FAT file system.
> > > > 
> > > > Signed-off-by: Chin Liang See <clsee@altera.com>
> > > > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> > > > Cc: Dinh Nguyen <dinh.linux@gmail.com>
> > > > Cc: Pavel Machek <pavel@denx.de>
> > > > Cc: Marek Vasut <marex@denx.de>
> > > > Cc: Stefan Roese <sr@denx.de>
> > > > ---
> > > > 
> > > >   include/configs/socfpga_arria5_socdk.h   | 5 ++++-
> > > >   include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
> > > >   2 files changed, 8 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/include/configs/socfpga_arria5_socdk.h
> > > > b/include/configs/socfpga_arria5_socdk.h index 0506336..f488b00
> > > > 100644
> > > > --- a/include/configs/socfpga_arria5_socdk.h
> > > > +++ b/include/configs/socfpga_arria5_socdk.h
> > > > @@ -100,7 +100,10 @@
> > > > 
> > > >   		"sf read ${fdt_addr} ${qspifdtaddr}
> > > > 
> > > > ${fdtimagesize};\0" \
> > > > 
> > > >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> > > >   	
> > > >   		" root=${qspiroot} rw
> > > > 
> > > > rootfstype=${qspirootfstype};"\
> > > > 
> > > > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > > > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > > > +	"usbload=usb reset;" \
> > > > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > > > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> > > > 
> > > >   /* The rest of the configuration is shared */
> > > >   #include <configs/socfpga_common.h>
> > > > 
> > > > diff --git a/include/configs/socfpga_cyclone5_socdk.h
> > > > b/include/configs/socfpga_cyclone5_socdk.h index d7369ee..40a4f08
> > > > 100644
> > > > --- a/include/configs/socfpga_cyclone5_socdk.h
> > > > +++ b/include/configs/socfpga_cyclone5_socdk.h
> > > > @@ -100,7 +100,10 @@
> > > > 
> > > >   		"sf read ${fdt_addr} ${qspifdtaddr}
> > > > 
> > > > ${fdtimagesize};\0" \
> > > > 
> > > >   	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
> > > >   	
> > > >   		" root=${qspiroot} rw
> > > > 
> > > > rootfstype=${qspirootfstype};"\
> > > > 
> > > > -		"bootm ${loadaddr} - ${fdt_addr}\0"
> > > > +		"bootm ${loadaddr} - ${fdt_addr}\0" \
> > > > +	"usbload=usb reset;" \
> > > > +		"fatload usb 0 ${loadaddr} ${bootimage};" \
> > > > +		"fatload usb 0 ${fdt_addr} ${fdtimage}\0"
> > > 
> > > Again, please use the generic FS commands here, e.g. "load" instead
> > > of "fatload".
> > > 
> > > And doesn't it make sense to consolidate these common, identical
> > > commands into a common file (socfpga_common.h)?
> > 
> > Even better -- why not switch to distro_bootcmd and/or update it to
> > support
> > booting from USB (it probably already does).
> 
> Thanks for sharing this. I presume we need a script to store the boot
> command? Let me read more on this.

Yeah, it'd be much better than this ad-hoc stuff.

Best regards,
Marek Vasut

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

end of thread, other threads:[~2015-11-27 10:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26  3:17 [U-Boot] [PATCH v1] arm: socfpga: Enable load zImage and Linux DTB from USB Chin Liang See
2015-11-26  6:14 ` Stefan Roese
2015-11-26 11:04   ` Marek Vasut
2015-11-27  1:38     ` Chin Liang See
2015-11-27 10:19       ` Marek Vasut
2015-11-27  1:40   ` Chin Liang See

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