Welcome! Log In Create A New Profile

Advanced

[OXNAS]uImage sans DTB file

Posted by habibie 
[OXNAS]uImage sans DTB file
May 17, 2017 10:19AM
I noticed OpenWRT/LEDE stops providing .dtb file. So, how do I craft uEnv.txt to adopt the missing .dtb file?
Re: [OXNAS]uImage sans DTB file
May 17, 2017 10:30AM
Here is u-boot installation thread:
2015.10 U-Boot for Pogoplug V3 (OXNAS OX820)

Section:

Quote

A. How to use the uEnv.txt script

This uEnv.txt script can be used to further customizing u-boot envs without saving to NAND or to boot with a completely different set of u-boot envs.

Create a text file in /boot directory with the content in the format that u-boot envs are listed.

Examples:

These 4 examples are only to demonstrate the syntax in uEnv.txt (they might or might not apply to your current settings):

- Load appropriate DTB file for the kernel to run the Pogo Classic box.
- Use only USB drives for kernel and rootfs during booting
- Use USB and SATA for booting. The kernel and rootfs search order is as they are appeared on the list: usb, ide.
- Define that there are 8 storage devices (i.e. disk partitions).

cat /boot/uEnv.txt 
dtb_file=/boot/dts/ox820-pogoplug-classic.dtb
devices=usb
devices=usb ide
disks=0 1 2 3 4 5 6 7

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: [OXNAS]uImage sans DTB file
May 17, 2017 05:34PM
Hello Bodhi and thank you for your response.

Sorry that I forgot to mention I have a working uEnv.txt file when OpenWRT/LEDE still provided the .dtb file. Unfortunately, now the .dtb file has been depricated when they started supporting DTS format. I am not sure that makes any sense to you. IIRC, we had such a discussion before about DTS format where you mentioned there wasn't a support on your uboot, but would add it in the future release. I don't know if you've already done so.
Re: [OXNAS]uImage sans DTB file
May 17, 2017 11:47PM
habibie Wrote:
-------------------------------------------------------
> Hello Bodhi and thank you for your response.
>
> Sorry that I forgot to mention I have a working uE
> nv.txt file when OpenWRT/LEDE still provided the .
> dtb file. Unfortunately, now the .dtb file has bee
> n depricated when they started supporting DTS form
> at. I am not sure that makes any sense to you. IIR
> C, we had such a discussion before about DTS forma
> t where you mentioned there wasn't a support on yo
> ur uboot, but would add it in the future release.
> I don't know if you've already done so.

You only need to do: copy the DTB file from OpenWrt build website to your OpenWrt rootfs and use it.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: [OXNAS]uImage sans DTB file
May 18, 2017 05:35AM
bodhi Wrote:
-------------------------------------------------------
> habibie Wrote:
> --------------------------------------------------
> -----
> > Hello Bodhi and thank you for your response. Sorry that I forgot to mention I have a working uEnv.txt file when OpenWRT/LEDE still provided the .dtb file. Unfortunately, now the .dtb file has been depricated when they started supporting DTS form at. I am not sure that makes any sense to you. IIRC, we had such a discussion before about DTS format where you mentioned there wasn't a support on your uboot, but would add it in the future release. I don't know if you've already done so.
> You only need to do: copy the DTB file from OpenWrt build website to your OpenWrt rootfs and use it.
>
OK. But, how about the DTS format?
Re: [OXNAS]uImage sans DTB file
May 19, 2017 08:49AM
hi, bodhi

I download uImage from LEDE 17.01.1. I find it can't boot up with your u-boot.

Wrong Image Format for bootm command
ERROR: can't get kernel image!

The header four bytes of the uImage is 0xd00dfeed.
#define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */

How could I boot this uImage with your latest u-boot?
Re: [OXNAS]uImage sans DTB file
May 19, 2017 08:49AM
hi, bodhi

I download uImage from LEDE 17.01.1. I find it can't boot up with your u-boot.

Wrong Image Format for bootm command
ERROR: can't get kernel image!

The header four bytes of the uImage is 0xd00dfeed.
#define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */

How could I boot this uImage with your latest u-boot?

Thanks.
Re: [OXNAS]uImage sans DTB file
May 19, 2017 09:55AM
lpwsxy Wrote:
-------------------------------------------------------
> hi, bodhi
>
> I download uImage from LEDE 17.01.1. I find it can
> 't boot up with your u-boot.
>
>
> Wrong Image Format for bootm command
> ERROR: can't get kernel image!
>
>
> The header four bytes of the uImage is 0xd00dfeed.
>
> #define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: tot
> al size */
>
>
> How could I boot this uImage with your latest u-bo
> ot?
>
> Thanks.

Interrupt serial console and

printenv

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: [OXNAS]uImage sans DTB file
May 19, 2017 10:25AM

U-Boot SPL 2013.10-tld-4 (Sep 07 2014 - 14:10:12)
  Boot device: NAND
Attempting to set PLLA to 850 MHz ...
  plla_ctrl0 : 0000020a
  plla_ctrl1 : 00330000
  plla_ctrl2 : 0065008b
  plla_ctrl3 : 000000f1

PLLA Set


U-Boot 2015.10-tld-1 (Nov 21 2015 - 01:17:59 -0800)
OXNAS OX820

DRAM:  128 MiB
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.40400000
Hit any key to stop autoboot:  0
OX820> printenv
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec; run bootz_ubi; reset
bootcmd_exec=if run load_uimage; then if run load_initrd; then if run load_dtb; then bootm 0x60500000 0x60e00000 0x62c00000; else bootm 0x60500000 0x60e00000; fi; else if run load_dtb; then bootm 0x60500000 - 0x62c00000; else bootm 0x60500000; fi; fi; fi
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootdelay=10
bootdev=usb
bootz_ubi=echo Booting from nand ...; run load_ubi; run set_ubi_args; bootz 0x60500000 - 0x62c00000
device=0:1
devices=usb ide
disks=0 1 2 3
dtb_file=/boot/dts/ox820-pogoplug-pro.dtb
ethact=dwmac.40400000
ethaddr=52:3b:20:9c:11:51
if_netconsole=ping $serverip
ipaddr=192.168.1.222
load_dtb=echo loading DTB $dtb_file ...; ext2load $bootdev $device 0x62c00000 $dtb_file
load_initrd=echo loading uInitrd ...; ext2load $bootdev $device 0x60e00000 /boot/uInitrd
load_ubi=echo Trying to boot from NAND ...;if run mount_ubi; then run load_ubi_zimage; run load_ubi_dtb; ubifsumount; fi
load_ubi_dtb=echo loading DTB from ubi /boot/dts/ox820-pogoplug-pro.dtb ...; ubifsload 0x62c00000 /boot/dts/ox820-pogoplug-pro.dtb
load_ubi_zimage=echo loading zImage from ubi ...; ubifsload 0x60500000 /boot/zImage
load_uimage=echo loading uImage ...; ext2load $bootdev $device 0x60500000 /boot/uImage
mainlineLinux=yes
mount_ubi=ubi part data; ubifsmount ubi0:rootfs
mtdids=nand0=41000000.nand
mtdparts=mtdparts=41000000.nand:14m(boot),-(data)
preboot_nc=run if_netconsole start_netconsole
scan_disk=echo running scan_disk ...; scan_done=0; setenv scan_usb "usb start";  setenv scan_ide "ide reset";  setenv scan_mmc "mmc rescan"; for dev in $devices; do if test $scan_done -eq 0; then echo Scan device $dev; run scan_$dev; for disknum in $disks; do if test $scan_done -eq 0; then echo device $dev $disknum:1; if ext2load $dev $disknum:1 0x60500000 /boot/uImage 1; then scan_done=1; echo Found bootable drive on $dev $disknum; setenv device $disknum:1; setenv bootdev $dev; fi; fi; done; fi; done
serverip=192.168.1.220
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts $custom_params
set_ubi_args=setenv bootargs console=ttyS0,115200n8 ubi.mtd=1 root=ubi0:rootfs rw rootfstype=ubifs rootwait mtdparts=41000000.nand:14m(boot),-(data)
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_import=echo importing envs ...; env import -t 0x60500000
uenv_init_devices=setenv init_usb "usb start";  setenv init_ide "ide reset";  setenv init_mmc "mmc rescan"; for devtype in $devices; do run init_$devtype; done;
uenv_load=run uenv_init_devices; setenv uenv_loaded 0; for devtype in $devices;  do for disknum in 0; do run uenv_read_disk; done; done;
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x60500000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_custom_params=zswap.enabled=1
usb_ready_retry=15

Environment size: 3262/131068 bytes
OX820>

This env is boot with zImage. but the feedback is "Bad Linux ARM zImage magic"
if I replace zImage with uImage. Boot fail with "Wrong Image Format for bootm command ERROR: can't get kernel image!" The uImage has integrated dtb.

Did you enable CONFIG_FIT when compile this uboot?

Thanks.
Re: [OXNAS]uImage sans DTB file
May 19, 2017 11:47AM
lpwsxy,

> This env is boot with zImage. but the feedback is
> "Bad Linux ARM zImage magic"

> if I replace zImage with uImage. Boot fail with "W
> rong Image Format for bootm command ERROR: can't
> get kernel image!" The uImage has integrated dtb.
>

Please post this OpenWrt booting problem in this thread:
http://forum.doozan.com/read.php?4,29966

so that bobafet get notification and help you. If after a few days, and you still have not heard from bobafet then I'll help when I have time.

> Did you enable CONFIG_FIT when compile this uboot?
>

This is Debian forum. So there is no need for me to spend any effort to do that. My u-boot developing effort is oriented toward helping with booting Debian and Arch. OpenWrt or other distro can use my released u-boot, but it is just a bonus,

I might support FIT in the future, but don't know when (I would immediately switch to FIT if u-boot mainline phased out the DTB format completely).

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: [OXNAS]uImage sans DTB file
May 19, 2017 12:56PM
bodhi Wrote:
-------------------------------------------------------
> I might support FIT in the future, but don't know when (I would immediately switch to FIT if u-boot mainline phased out the DTB format completely).
>
Bodhi, am I right to say it is time to kiss goodbye on your u-boot for both OpenWRT and/or LEDE until you have updated your u-boot with a support for FIT?
Re: [OXNAS]uImage sans DTB file
May 19, 2017 01:13PM
habibie,

Quote
bodhi
You only need to do: copy the DTB file from OpenWrt build website to your OpenWrt rootfs and use it

Hacking should be fun :) so whatever you choose to do is fine!

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: