Correct setup for u-boot and fstab ? Device not booting
#1
I am trying to get Vanilla Debian up and running on the H64B.

I have build Arm-Trusted-Firmware and U-Boot from git/source and got the u-boot-sunxi-with-spl.bin file which I copied with "sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8" to my eMMC-Module.

My fstab is as below, with /boot flagged as bootable by fdisk.

/dev/mmcblk1p1    /boot    ext2    defaults    0    2
/dev/mmcblk1p2    /           ext4    errors=remount-ro    0    1
/dev/mmcblk1p3    swap   swap    defaults    0    0

Then powered up the H64B only shows that he has loaded u-boot and then stops/hangs and does not carry on to load Linux from /boot.

Am I missing something ???
Any adivce would be greatly appreciated.

I am tinkering with this for a while now and can't get past the U-Boot SPL prompt....

Here is that i am doing https://github.com/as365n4/Debian_on_Pin...neH64B.pdf
  Reply
#2
(10-02-2020, 09:11 AM)as365n4 Wrote: I am trying to get Vanilla Debian up and running on the H64B.

I have build Arm-Trusted-Firmware and U-Boot from git/source and got the u-boot-sunxi-with-spl.bin file which I copied with "sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8" to my eMMC-Module.
,,,
Am I missing something ???
Any adivce would be greatly appreciated.

Maybe you can get some inspiration by looking at mobian distribution?
  Reply
#3
Silly me made a mistake in my fstab, on the H64B the eMMC-Module is mmcblk2 and not mmcblk1 like on the Rock64.

So I amanded my fstab is as below, with /boot flagged as bootable by fdisk.

/dev/mmcblk2p1    /boot    ext2    defaults    0    2
/dev/mmcblk2p2    /           ext4    errors=remount-ro    0    1
/dev/mmcblk2p3    swap   swap    defaults    0    0

But still, then the H64B gets powered up it loads u-boot and then stops/hangs and does not carry on to load Linux from /boot.

Any ideas, what do I miss here ???

Is u-boot-sunxi-with-spl.bin able to boot ext2 or does it really need vfat ?

EDIT: my initial fstab was correct and is not the issue. Mainline u-boot simply does not support the Pine H64 model B as there is no board definition (pine_h64_model_b_defconfig) in the configs folder and therefore is unable to build u-boot for the Pine H64 model B. Sad

Would be nice if Pine64 could push such config file to https://gitlab.denx.de/u-boot/u-boot  Idea
  Reply
#4
It's already a long time ago I did this, but you should use pine_h64_defconfig -> https://gitlab.denx.de/u-boot/u-boot/-/b..._defconfig

I don' t know how debian handles this stuff.

Maybe follow the guide as described for the A20-ILinuXino-LIME in the digikey wiki. It's for the allwinner A20 but you can follow the steps.
0
https://www.digikey.com/eewiki/display/l...linux.conf
  Reply
#5
What exact message are you getting in uboot? In general, I recommend using a custom extlinux.conf on the boot partition. I've written a tutorial on this which you might be interested in as it covers the same topic (getting vanilla Debian running):

https://www.kulesz.me/post/140-debian-de...4-install/

Btw.: Mainline u-boot does work nicely on the H64 model B, however, I had trouble with Ethernet last time I checked (must have been Kernel 5.6 or 5.7 back then). See here for details:

https://forum.pine64.org/showthread.php?tid=10645
  Reply
#6
@roel

I used ARM Trusted Firmware v2.4 and uBoot v2020.10 and the pine_h64_defconfig for my build since nothing else was available.
That surpised me was that the pine_h64_defconfig is only 16 lines of code, whilst rock64-rk3328_defconfig is 102 lines of code, which lead me to my conclusion that H64 is not supported by Mainline uBoot.

@kuleszdl
My stuff is based on your tutorial and works nicely on Rock64 so I thought I adapt further to get Debian running on H64.

Here is the output of uBoot:
Code:
U-Boot SPL 2020.10 (Nov 27 2020 - 13:45:46 +0000)
DRAM: 2048 MiB
Trying to boot from MMC2
  Reply
#7
@as365n4

As long as it boots, it doesn't matter, the only thing you should be sure is that you point U-boot to the sun50i-h6-pine-h64-model-b.dtb provided by the kernel. In Manjaro you do it in the boot.src file. Probably in debian it's in extlinux.conf as @kuleszdl mentions.

Regarding the ethernet problem @kuleszdl is talking about, I had it also on Manjaro. It's not that the ethernet is not working, for me it was only down, so I had to bring it up. No idea why.
  Reply
#8
@as365n4 Well, if you compile it for the H6 there are a couple of differences:

When building arm-trusted-firmware, select the h6 platform:

Code:
make CROSS_COMPILE=aarch64-linux-gnu- PLAT=sun50i_h6 bl31

The binary it produces is a ".bin" not a ".elf". Therefore, when linking it from u-boot do as follows:

Code:
ln -s ../arm-trusted-firmware/build/sun50i_h6/release/bl31.bin bl31.bin

And then when building:

Code:
make -j15 CROSS_COMPILE=aarch64-linux-gnu- BL31=bl31.bin all u-boot.itb

=> When building u-boot for different boards there is more to do than just selecting a different config.

Also, when flashing the Image youz have to use different offsets. For Allwinner boards:

Code:
dd if=u-boot-sunxi-.... of=/dev/sdX bs=1024 seek=8 conv=notrunc

Btw.: The differences between config sizes are not due to support status. Often, the configs include other configs, so if there is not soo much special about the Pine H64 when compared to other Allwinner H6-based boards this results in a much smaller config.

However, I had issues with ethernet on the H6 as well. See this thread: https://forum.pine64.org/showthread.php?tid=10645
  Reply
#9
Quote:make -j15 CROSS_COMPILE=aarch64-linux-gnu- BL31=bl31.bin all u-boot.itb
This line results in an error message and compiler aborts.

After reading the Build section here --> https://linux-sunxi.org/U-Boot I figured that it should be
Quote:make -j15 CROSS_COMPILE=aarch64-linux-gnu- BL31=bl31.bin
and it compiled, altough with a yellow warning at the end.

U-Boot is working and even Ethernet works, but it wont accept my extlinux.conf for some reason....
I think it has something to do with the eMMC-Module
Code:
U-Boot SPL 2021.01 (Jan 18 2021 - 11:23:42 +0000)
DRAM: 2048 MiB
Trying to boot from MMC2
NOTICE:  BL31: v2.4(release):v2.4
NOTICE:  BL31: Built : 11:03:17, Jan 18 2021
NOTICE:  BL31: Detected Allwinner H6 SoC (1728)
NOTICE:  BL31: Found U-Boot DTB at 0xc087388, model: Pine H64
NOTICE:  PSCI: System suspend is unavailable


U-Boot 2021.01 (Jan 18 2021 - 11:23:42 +0000) Allwinner Technology

CPU:   Allwinner H6 (SUN50I)
Model: Pine H64
DRAM:  2 GiB
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to use mmc 1:1... In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   phy interface7
eth0: ethernet@5020000
starting USB...
Bus usb@5101000: USB EHCI 1.00
Bus usb@5101400: USB OHCI 1.0
Bus usb@5311000: USB EHCI 1.00
Bus usb@5311400: USB OHCI 1.0
scanning bus usb@5101000 for devices... 1 USB Device(s) found
scanning bus usb@5101400 for devices... 1 USB Device(s) found
scanning bus usb@5311000 for devices... 1 USB Device(s) found
scanning bus usb@5311400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  2  1  0
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
191 bytes read in 2 ms (92.8 KiB/s)
Ignoring unknown command: MENULABEL
Ignoring unknown command: KERNEL
Ignoring unknown command: INITRD
Ignoring unknown command: DEVICETREEDIR
Ignoring unknown command: APPEND
1:    debian
No kernel given, skipping debian
SCRIPT FAILED: continuing...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
78MMC: no card present
Scanning disk mmc@4020000.blk...
Disk mmc@4020000.blk not ready
Scanning disk mmc@4022000.blk...
** Unrecognized filesystem type **
Found 4 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
MMC: no card present

Device 0: unknown device
ethernet@5020000 Waiting for PHY auto negotiation to complete........ done
BOOTP broadcast 1
DHCP client bound to address 192.168.1.218 (7 ms)
Using ethernet@5020000 device
TFTP from server 192.168.1.160; our IP address is 192.168.1.218
Filename '/extlinux/extlinux.conf'.
Load address: 0x42000000
Loading: *T T T T T T T T T T
Retry count exceeded; starting again
missing environment variable: pxeuuid
Retrieving file: /extlinux/pxelinux.cfg/01-02-07-36-ae-78-6c
Using ethernet@5020000 device
TFTP from server 192.168.1.160; our IP address is 192.168.1.218
Filename '/extlinux/pxelinux.cfg/01-02-07-36-ae-78-6c'.
Load address: 0x4fd00000
Loading: *T T T T T T T T T T
Retry count exceeded; starting again
Retrieving file: /extlinux/pxelinux.cfg/C0A801DA
Using ethernet@5020000 device
TFTP from server 192.168.1.160; our IP address is 192.168.1.218
Filename '/extlinux/pxelinux.cfg/C0A801DA'.
Load address: 0x4fd00000
Loading: *
  Reply
#10
@as365n4 Seems like your u-boot can read but can't parse the extlinux.conf file. Please double-check it.

u-boot compiled fine for me last time it tried, it only had a warning about using some deprecated mechanism or parameter. Your u-boot also seems to work fine so far. Are you trying to boot from eMMC, SD? And did you flash uboot into the SPI (I had trouble booting from there) or do you load it from the same card where the OS resides?
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  U-boot not booting on H64 model B CGNZVV 2 1,265 06-08-2022, 10:32 AM
Last Post: as365n4
  Unable to boot any armbian linux vicsanca 6 5,431 10-17-2019, 12:08 PM
Last Post: JGwinner

Forum Jump:


Users browsing this thread: 1 Guest(s)