uboot DTB problem S912

This is for ARMv8 based devices

uboot DTB problem S912

Postby sehraf » Sat Oct 06, 2018 11:23 am

Hello everyone,

i'm trying to get a mainline kernel running on my Sunvell T95Z Plus but i'm struggling with a weird :?: uboot error.
I'm using the following uboot commands (taken from s905_autoscript from https://yadi.sk/d/5_32km_EsCV2A/ArchLinux)
Code: Select all
setenv kernel_loadaddr "0x11000000"
setenv initrd_loadaddr "0x13000000"
setenv condev "console=ttyS0,115200n8 console=tty0 no_console_suspend consoleblank=0"
setenv bootargs "root=LABEL=ROOTFS rootflags=data=writeback rw ${condev} fsck.repair=yes net.ifnames=0 mac=${mac}"
setenv boot_start "booti ${kernel_loadaddr} ${initrd_loadaddr} ${dtb_mem_addr}"
if fatload mmc 0 ${initrd_loadaddr} uInitrd; then if fatload mmc 0 ${kernel_loadaddr} Image; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then run boot_start; else store dtb read ${dtb_mem_addr}; run boot_start;fi;fi;fi;

The environment sets
Code: Select all
dtb_mem_addr=0x1000000


The commands above work fine with the 3.14 kernel (see link above) but as soon as i replace the Image with the one from the ALARM i get the following error:
Code: Select all
gxm_q201_v1#if fatload mmc 0 ${initrd_loadaddr} uInitrd.ml; then if fatload mmc 0 ${kernel_loadaddr} Image.ml; then if fatload mmc 0 ${dtb_mem_addr} dtb.img; then run boot_start; else store dtb read ${dtb_mem_addr}; run boot_start;fi;fi;fi;
card in
init_part() 278: PART_TYPE_DOS
[mmc_init] mmc init success
reading uInitrd.ml
6171783 bytes read in 346 ms (17 MiB/s)
reading Image.ml
26372608 bytes read in 1466 ms (17.2 MiB/s)
reading dtb.img
44315 bytes read in 7 ms (6 MiB/s)
[rsvmem] get fdtaddr NULL!
rsvmem - reserve memory



Usage:
rsvmem check                   - check reserved memory
rsvmem dump                    - dump reserved memory

rsvmem check failed
## Loading init Ramdisk from Legacy Image at 13000000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (uncompressed)
   Data Size:    6171719 Bytes = 5.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
load dtb from 0x1000000 ......
      Amlogic multi-dtb tool
      Cannot find legal dtb!
ERROR: Did not find a cmdline Flattened Device Tree
load dtb from 0x0 ......
      Amlogic multi-dtb tool
      Cannot find legal dtb!
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree


The thing that i don't understand is how the dtb can be broken ("Cannot find legal dtb!") by just using a different kernel image? I've tried various things like other memory addresses, only loading kernel with dtb or appending the dtb to the kernel (like it was done in the past with sunxi devices) but everything fails due to the Amlogic multi-dtb tool. (The mainline kernel is bigger (~26MB) compared to the working one (~17MB)).
The dtb i'm using is either the built-in one or the gxm_q201_2g.dtb
one from here https://kszaq.libreelec.tv/s912/8.2/device_trees/100Mbit_Ethernet/
built-in:
Code: Select all
store dtb read ${dtb_mem_addr}
[store]To run cmd[emmc dtb_read 0x1000000 0x40000]
dtb_read_shortcut()-976: short cut in...
      Amlogic multi-dtb tool
      Multi dtb detected
      Multi dtb tool version: v2 .
      Support 2 dtbs.
        aml_dt soc: gxm platform: q201 variant: 2g
        dtb 0 soc: gxm   plat: q201   vari: 1g
        dtb 1 soc: gxm   plat: q201   vari: 2g
      Find match dtb: 1


I've the feeling that i'm missing something here. Did anybody else had this error before or knows what causes it?

There are several Armbian images with a 4.18 kernel, too (https://yadi.sk/d/5_32km_EsCV2A/ARMBIAN/5.60/20180928) but when using any kernel from these the console stays empty after jumping from uboot to the kernel :roll:
sehraf
 
Posts: 49
Joined: Mon Feb 03, 2014 10:06 pm

Re: uboot DTB problem S912

Postby sehraf » Tue Oct 09, 2018 4:33 pm

Update for the sake of record:

Booting Armbians kernel (4.18.7-aml-s9xxx) with ALARM's rootfs work as expected but when i replace the kernel (zImage) with ALARM's (Image) i have the same symptoms again.
(There is even a fresh version of Armbian https://yadi.sk/d/5_32km_EsCV2A/ARMBIAN/5.62 )

I'll rebuild ALARM's kernel with zImage, maybe that does the trick :roll:
sehraf
 
Posts: 49
Joined: Mon Feb 03, 2014 10:06 pm

Re: uboot DTB problem S912

Postby TheSaint » Wed Oct 10, 2018 5:04 am

There might be some patches on the armbian kernel, which gives such result.
You should try to compile your own u-boot with the armbian patches, if any, found at their github repository. Then you may try to use the mainlined kernel.
There could be a difference also from their dtb and the mainlined one, just to pay attention.
TheSaint
 
Posts: 345
Joined: Mon Jul 23, 2018 7:57 am

Re: uboot DTB problem S912

Postby summers » Wed Oct 10, 2018 10:33 am

I guess not clear to me is where you are geeting your bits from.

Arch arm usually either boots a uImage (via bootm) or a zImage (via bootz); you have an Image and use booti - so this is unusual.

Then your device tree, it isn't a mainline one. And actually there doesn't seem one for your board: https://github.com/torvalds/linux/tree/master/arch/arm64/boot/dts/amlogic - your board isn't listed under meson-gxm-*; so thats from a third party.

[Oh yes - sideline, these arm64 amlogic boards seem to use secure boot - you'll need to understand that if you want to respin uboot. Now on the S905 how that is set up is understood. The S912 is hopefuly similar https://fredericb.info/2016/10/amlogic-s905-soc-bypassing-not-so.html]
summers
 
Posts: 869
Joined: Sat Sep 06, 2014 12:56 pm

Re: uboot DTB problem S912

Postby sehraf » Wed Oct 10, 2018 5:41 pm

Well currently i'm sticking to Armbian and they use zImage with booti ;)
Nevertheless, that was a good hint to keep in mind.

I'm more familiar with armv7 ... v8 seems to be more different than i expected. As it turned out there is no zImage target (anymore?) for the kernel. So i'll stick to the Armbian for now.

Regarding uboot: is there a source or config for my board, i would expect that a generic s912 won't work (similar to armv7/allwinner CPUs)? The current one works (at least for Armbian :roll: )

Regarding DTB: yes the device has no official support nor is there an "official" dts. As many Amlogic Android TV boxes you just take a generic one that fits your chip (with reduced hardware support of course).
I'm planning to create a fitting one.
sehraf
 
Posts: 49
Joined: Mon Feb 03, 2014 10:06 pm


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 3 guests