[SOLVED] Problems getting u-boot set up properly on SD card

Post Reply
escalade
Posts: 93
Joined: Thu Mar 14, 2019 8:34 pm
languages_spoken: english and norwegian
Has thanked: 3 times
Been thanked: 13 times
Contact:

[SOLVED] Problems getting u-boot set up properly on SD card

Unread post by escalade » Sun May 05, 2019 7:38 am

I've added support to LibreELEC (JeOS built on a toolchain similar to buildroot) for the XU4. I'm having problems getting the bootloader configuration (copied the same routine as in Lakka) to work. The red light turns on but the fan doesn't spin and the blue light does not turn on, so it looks like the kernel isn't getting loaded.

Here's how I install u-boot:

Code: Select all

dd if="$RELEASE_DIR/3rdparty/bootloader/bl1.bin.hardkernel" of="$DISK" bs=512 seek=1 conv=notrunc
dd if="$RELEASE_DIR/3rdparty/bootloader/bl2.bin.hardkernel.720k_uboot" of="$DISK" bs=512 seek=31 conv=notrunc
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot.bin.hardkernel" of="$DISK" bs=512 seek=63 conv=notrunc
dd if="$RELEASE_DIR/3rdparty/bootloader/tzsw.bin.hardkernel" of="$DISK" bs=512 seek=2111 conv=notrunc
The bootloader blobs have all been taken from the sd-fuse directory of u-boot version 88af53fb from the odroidxu4-v2017.05 hardkernel branch.

Partition table looks like this:

Code: Select all

(parted) unit s                                                           
unit s
(parted) print                                                            
print
Model: Loopback device (loopback)
Disk /dev/loop1: 1120256s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start     End       Size      Type     File system  Flags
 1      3072s     1051647s  1048576s  primary  fat16        boot, lba
 2      1051648s  1117183s  65536s    primary  ext4
The FAT partition is correctly populated with boot.ini and dtb's from the kernel. The Lakka image has the same setup, not sure what I'm missing here.
Last edited by escalade on Tue May 07, 2019 4:04 am, edited 1 time in total.
Maintainer of RetroELEC (XU4 support!)

User avatar
igorpec
Posts: 396
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 8 times
Been thanked: 29 times
Contact:

Re: Problems getting u-boot set up properly on SD card

Unread post by igorpec » Sun May 05, 2019 9:19 pm

ARMBIAN - follow on Twitter
linux for ARM development boards with user friendly development tools

escalade
Posts: 93
Joined: Thu Mar 14, 2019 8:34 pm
languages_spoken: english and norwegian
Has thanked: 3 times
Been thanked: 13 times
Contact:

Re: Problems getting u-boot set up properly on SD card

Unread post by escalade » Mon May 06, 2019 5:40 am

That only made me more confused, as armbian puts TZSW in starting block 718. Lakka uses 2111 and the sd_fusing script (part of u-boot) uses 1503. From what I can tell, odroid.h defines 2111 and odroid_xu4.h defines 1503. I suppose the XU4 also checks 2111 as it's compatible with the XU3. That doesn't explain armbian using 718 though on the same u-boot version.
Maintainer of RetroELEC (XU4 support!)

escalade
Posts: 93
Joined: Thu Mar 14, 2019 8:34 pm
languages_spoken: english and norwegian
Has thanked: 3 times
Been thanked: 13 times
Contact:

Re: Problems getting u-boot set up properly on SD card

Unread post by escalade » Tue May 07, 2019 4:03 am

Breakthrough! The header is correct, u-boot with the odroid-xu4_defconfig expects TZSW at sector 1503. Lakka has it placed at 2111, this won't work. I've checked their image, and it is correctly set up:

Code: Select all

dd if=/dev/loop1 bs=2M count=1 | strings | grep raw
u-boot raw 0x3f 0x800;bl1 raw 0x1 0x1e;bl2 raw 0x1f 0x1d;tzsw raw [b]0x5df[/b] 0x200;params.bin raw 0x7df 0x20
u-boot raw 0x3e 0x800 mmcpart 1;bl1 raw 0x0 0x1e mmcpart 1;bl2 raw 0x1e 0x1d mmcpart 1;tzsw raw 0x5de 0x200 mmcpart 1;params.bin raw 0x7df 0x20
0x5df = 1503

Looks like to me that whoever made their working image didn't commit the right value. This had me confused :)
Maintainer of RetroELEC (XU4 support!)

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 2 guests