Skip to contentSkip to conversation

arm: socfpga: Enable load zImage and Linux DTB from USB

PATCH Superseded Chin Liang See 4 participants 10 messages Nov 27, 2015 – Dec 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

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

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>

---
Changes for v2
- Using load command instead of fatload

---
 include/configs/socfpga_arria5_socdk.h   | 5 ++++-
 include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
include/configs/socfpga_arria5_socdk.h +4 -1
index 9337a58..1d335c4 100644
@@ -99,7 +99,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;" \
+		"load usb 0 ${loadaddr} ${bootimage};" \
+		"load usb 0 ${fdt_addr} ${fdtimage}\0"
 
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
include/configs/socfpga_cyclone5_socdk.h +4 -1
index 3b2cfb0..d045127 100644
@@ -99,7 +99,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;" \
+		"load usb 0 ${loadaddr} ${bootimage};" \
+		"load usb 0 ${fdt_addr} ${fdtimage}\0"
 
 /* The rest of the configuration is shared */
 #include <configs/socfpga_common.h>
Signature · 1 line
2.2.0
#1 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 39 lines · Chin Liang See

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

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>

---
Changes for v2
- Using load command instead of fatload

---
  include/configs/socfpga_arria5_socdk.h   | 5 ++++-
  include/configs/socfpga_cyclone5_socdk.h | 5 ++++-
  2 files changed, 8 insertions(+), 2 deletions(-)
include/configs/socfpga_arria5_socdk.h +4 -1
index 9337a58..1d335c4 100644
@@ -99,7 +99,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;" \
+		"load usb 0 ${loadaddr} ${bootimage};" \
+		"load usb 0 ${fdt_addr} ${fdtimage}\0"
 
  /* The rest of the configuration is shared */
  #include <configs/socfpga_common.h>
include/configs/socfpga_cyclone5_socdk.h +0 -0
index 3b2cfb0..d045127 100644
@@ -99,7 +99,10 @@
  		"sf read ${fdt_addr} ${qspifdtaddr} ${fdtimagesize};\0" \

include/configs/socfpga_cyclone5_socdk.h line 108

Quoted 10 lines
include/configs/socfpga_cyclone5_socdk.h +4 -1
  	"qspiboot=setenv bootargs " CONFIG_BOOTARGS \
  		" root=${qspiroot} rw rootfstype=${qspirootfstype};"\
-		"bootm ${loadaddr} - ${fdt_addr}\0"
+		"bootm ${loadaddr} - ${fdt_addr}\0" \
+	"usbload=usb reset;" \
+		"load usb 0 ${loadaddr} ${bootimage};" \
+		"load usb 0 ${fdt_addr} ${fdtimage}\0"
 
  /* The rest of the configuration is shared */
  #include <configs/socfpga_common.h>

Thanks,
Stefan

#2 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

In reply to Chin Liang See
Quoted 9 lines · Chin Liang See

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

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
Quoted 3 lines

---
Changes for v2
- Using load command instead of fatload

The distro_bootcmd can do this and even let's you boot debian/fedora on such a machine in a standardized way. Should we switch to distro_bootcmd instead of adding new ad-hoc stuff ?

Best regards,
Marek Vasut

#3 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 14 lines · Marek Vasut
Quoted 9 lines · Chin Liang See

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

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>
Quoted 3 lines

---
Changes for v2
- Using load command instead of fatload

Quoted 5 lines

The distro_bootcmd can do this and even let's you boot debian/fedora on such
a machine in a standardized way. Should we switch to distro_bootcmd instead
of adding new ad-hoc stuff ?

It seems to me that we need to add script into the fs to get that work, right?

Thanks
Chin Liang

Quoted 3 lines

Best regards,
Marek Vasut

#4 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 15 lines · Chin Liang See
Quoted 14 lines · Marek Vasut
Quoted 12 lines · Chin Liang See

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

Cc Dinh Nguyen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Stefan Roese <[email protected]>

---
Changes for v2
- Using load command instead of fatload

Quoted 8 lines
Quoted 5 lines

The distro_bootcmd can do this and even let's you boot debian/fedora on such
a machine in a standardized way. Should we switch to distro_bootcmd instead
of adding new ad-hoc stuff ?

It seems to me that we need to add script into the fs to get that work, right?

Yes, that's right. CCing Vagrant, he's the debian guru around here.

Best regards,
Marek Vasut

#5 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 5 lines · Marek Vasut
Quoted 4 lines · Chin Liang See
Quoted 3 lines · Marek Vasut
Quoted 2 lines · Chin Liang See

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

...

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

The distro_bootcmd can do this and even let's you boot debian/fedora on such
a machine in a standardized way. Should we switch to distro_bootcmd instead
of adding new ad-hoc stuff ?

It seems to me that we need to add script into the fs to get that work, right?

Yes and no. Currently Debian uses a bootscript generated with flash-kernel, such as:

https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/bootscript/all/bootscr.uboot-generic

But you can also use a syslinux formatted plain text file, such as extlinux.conf or pxelinux.conf/default, described in u-boot/doc/README.distro. They look something like this:

label Boot
kernel /boot/vmlinuz
append ro root=/dev/sda2 console=ttyS0,115200n8
fdtdir /boot/dtbs/
initrd /boot/initrd.img

The (only) reason debian hasn't yet switched to syslinux-style config files is that is that the console settings vary wildly by board, and the "chosen" console property isn't yet consistantly supported on all boards and kernel versions in use. That may change soon.

But the distro_bootcmd support supports both syslinux-style files and bootscripts out-of-the-box. Because of the standardization, for any board you would hope to see working out of the box on Debian(and I suspect Fedora as well), supporting distro_bootcmd in u-boot upstream would be ideal.

live well,
vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151127/e4034670/attachment.sig>

#6 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Hi Vagrant,

Quoted 50 lines · Vagrant Cascadian
Quoted 6 lines · Marek Vasut
Quoted 5 lines · Chin Liang See
Quoted 4 lines · Marek Vasut
Quoted 2 lines · Chin Liang See

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

...

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines

The distro_bootcmd can do this and even let's you boot debian/fedora
on such
a machine in a standardized way. Should we switch to distro_bootcmd
instead
of adding new ad-hoc stuff ?

It seems to me that we need to add script into the fs to get that work,
right?

Yes and no. Currently Debian uses a bootscript generated with flash-kernel, such as:

https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/bootscrip
t/all/bootscr.uboot-generic

But you can also use a syslinux formatted plain text file, such as extlinux.conf or pxelinux.conf/default, described in u-boot/doc/README.distro. They look something like this:

label Boot
kernel /boot/vmlinuz
append ro root=/dev/sda2 console=ttyS0,115200n8
fdtdir /boot/dtbs/
initrd /boot/initrd.img

The (only) reason debian hasn't yet switched to syslinux-style config files is that is that the console settings vary wildly by board, and the
"chosen" console property isn't yet consistantly supported on all boards
and kernel versions in use. That may change soon.

But the distro_bootcmd support supports both syslinux-style files and bootscripts out-of-the-box. Because of the standardization, for any board you would hope to see working out of the box on Debian(and I suspect Fedora as well), supporting distro_bootcmd in u-boot upstream would be ideal.

Quoted 2 lines

live well,
vagrant

Thanks for the pointers and this looks great. I can imagine how this cool feature easing user when come to update the boot device and boot file name without the need to update the U-Boot source.

To take this advantage socfpga, ubifs support for NOR and NAND boot need to be happened first :)

Thanks
Chin Liang

#7 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 59 lines · Chin Liang See

Hi Vagrant,

Quoted 56 lines · Vagrant Cascadian
Quoted 7 lines · Marek Vasut
Quoted 6 lines · Chin Liang See
Quoted 5 lines · Marek Vasut

On Friday, November 27, 2015 at 03:36:42 AM, Chin Liang See

Quoted 2 lines · wrote:

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

...

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines

The distro_bootcmd can do this and even let's you boot debian/fedora
on such
a machine in a standardized way. Should we switch to distro_bootcmd
instead
of adding new ad-hoc stuff ?

It seems to me that we need to add script into the fs to get that work,
right?

Yes and no. Currently Debian uses a bootscript generated with

flash-kernel, such as:
https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/bootscrip

t/all/bootscr.uboot-generic

But you can also use a syslinux formatted plain text file, such as extlinux.conf or pxelinux.conf/default, described in

u-boot/doc/README.distro. They look something like this:
label Boot
kernel /boot/vmlinuz
append ro root=/dev/sda2 console=ttyS0,115200n8 fdtdir /boot/dtbs/
initrd /boot/initrd.img

The (only) reason debian hasn't yet switched to syslinux-style config files is that is that the console settings vary wildly by board, and the
"chosen" console property isn't yet consistantly supported on all boards
and kernel versions in use. That may change soon.

But the distro_bootcmd support supports both syslinux-style files and bootscripts out-of-the-box. Because of the standardization, for any board you would hope to see working out of the box on Debian(and I suspect Fedora as well), supporting distro_bootcmd in u-boot upstream would be ideal.

live well,

Quoted 8 lines
Quoted 1 line

vagrant

Thanks for the pointers and this looks great. I can imagine how this cool feature easing user when come to update the boot device and boot file name without the need to update the U-Boot source.

To take this advantage socfpga, ubifs support for NOR and NAND boot need to be happened first :)

I already sent you a patch how to do that.

#8 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 78 lines · Marek Vasut
Quoted 77 lines · Chin Liang See

Hi Vagrant,

Quoted 64 lines · Vagrant Cascadian
Quoted 8 lines · Marek Vasut
Quoted 6 lines · Chin Liang See
Quoted 5 lines · Marek Vasut

On Friday, November 27, 2015 at 03:36:42 AM, Chin Liang See

Quoted 2 lines · wrote:

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

...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

The distro_bootcmd can do this and even let's you boot debian/fedora
on such
a machine in a standardized way. Should we switch to distro_bootcmd
instead
of adding new ad-hoc stuff ?

Quoted 4 lines
Quoted 4 lines

It seems to me that we need to add script into the fs to get that
work,
right?

Yes and no. Currently Debian uses a bootscript generated with

flash-kernel, such as:
https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/boots
crip

t/all/bootscr.uboot-generic

But you can also use a syslinux formatted plain text file, such as
extlinux.conf or pxelinux.conf/default, described in

u-boot/doc/README.distro. They look something like this:
label Boot
kernel /boot/vmlinuz
append ro root=/dev/sda2 console=ttyS0,115200n8 fdtdir /boot/dtbs/
initrd /boot/initrd.img

The (only) reason debian hasn't yet switched to syslinux-style config
files is that is that the console settings vary wildly by board, and
the
"chosen" console property isn't yet consistantly supported on all boards
and kernel versions in use. That may change soon.

But the distro_bootcmd support supports both syslinux-style files and
bootscripts out-of-the-box. Because of the standardization, for any
board you would hope to see working out of the box on Debian(and I
suspect Fedora as well), supporting distro_bootcmd in u-boot upstream
would be ideal.

Quoted 3 lines

live well,

vagrant

Thanks for the pointers and this looks great. I can imagine how this
cool feature easing user when come to update the boot device and boot
file name without the need to update the U-Boot source.

Quoted 4 lines
Quoted 2 lines

To take this advantage socfpga, ubifs support for NOR and NAND boot need to be happened first :)

I already sent you a patch how to do that.

Yup, thanks again for that. Hope can continue on that as was attending customer support / requests :)

Thanks
Chin Liang

#9 lore raw

PATCH v2 1/1 arm: socfpga: Enable load zImage and Linux DTB from USB

Quoted 81 lines · Chin Liang See
Quoted 80 lines · Marek Vasut
Quoted 79 lines · Chin Liang See

Hi Vagrant,

Quoted 66 lines · Vagrant Cascadian
Quoted 9 lines · Marek Vasut

On Friday, November 27, 2015 at 01:23:34 PM, Chin Liang See

Quoted 6 lines · wrote:
Quoted 5 lines · Marek Vasut

On Friday, November 27, 2015 at 03:36:42 AM, Chin Liang See

Quoted 2 lines · wrote:

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

...

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

The distro_bootcmd can do this and even let's you boot debian/fedora
on such
a machine in a standardized way. Should we switch to distro_bootcmd
instead
of adding new ad-hoc stuff ?

Quoted 4 lines
Quoted 4 lines

It seems to me that we need to add script into the fs to get that
work,
right?

Yes and no. Currently Debian uses a bootscript generated with

flash-kernel, such as:
https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/boots

crip

t/all/bootscr.uboot-generic

But you can also use a syslinux formatted plain text file, such as
extlinux.conf or pxelinux.conf/default, described in

u-boot/doc/README.distro. They look something like this:
label Boot
kernel /boot/vmlinuz
append ro root=/dev/sda2 console=ttyS0,115200n8 fdtdir /boot/dtbs/
initrd /boot/initrd.img

The (only) reason debian hasn't yet switched to syslinux-style config
files is that is that the console settings vary wildly by board, and
the
"chosen" console property isn't yet consistantly supported on all boards
and kernel versions in use. That may change soon.

But the distro_bootcmd support supports both syslinux-style files and
bootscripts out-of-the-box. Because of the standardization, for any
board you would hope to see working out of the box on Debian(and I
suspect Fedora as well), supporting distro_bootcmd in u-boot upstream
would be ideal.

Quoted 3 lines

live well,

vagrant

Thanks for the pointers and this looks great. I can imagine how this
cool feature easing user when come to update the boot device and boot
file name without the need to update the U-Boot source.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

To take this advantage socfpga, ubifs support for NOR and NAND boot need to be happened first :)

I already sent you a patch how to do that.

Yup, thanks again for that. Hope can continue on that as was attending customer support / requests :)

NP, take your time.