Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making build to work in EMMC #30

Open
lonerkim opened this issue Mar 9, 2024 · 17 comments
Open

making build to work in EMMC #30

lonerkim opened this issue Mar 9, 2024 · 17 comments

Comments

@lonerkim
Copy link

lonerkim commented Mar 9, 2024

It seems I have hard time make proper image due to lack of my skill hehe,

What I did

based on

OS: Ubuntu 22.04.4 LTS x86_64 
Kernel: 6.5.0-25-generic 
Packages: 2056 (dpkg), 11 (snap) 
Shell: bash 5.1.16 
DE: GNOME 42.9 
Terminal: gnome-terminal 
CPU: AMD Ryzen 5 5600X (12) @ 3.700G 
GPU: Intel Device 56a0 
Memory: 2281MiB / 31989MiB 
sudo apt install qemu-user-static gcc-aarch64-linux-gnu mmdebstrap git binfmt-support make build-essential  bison flex make gcc libncurses-dev debian-archive-keyring swig libssl-dev bc python3-setuptools

does steps according to link with some modification :
git clone https://github.com/sipeed/LonganPi-3H-SDK.git

then
modify mkrootfs.sh collate to this

run scripts as order of

./mkatf.sh
./mklinux.sh
./mkuboot.sh
sudo ./mkrootfs.sh

build an image from same article from
3. Make a boot TF card
4. Make a boot TF card image

either boot from baked TF(microSD) card
or
SCP built image to /opt and

dd if=/opt/your_image_file of=/dev/mmcblk1
sync

to copy stuff to eMMC.

===========
also tried :
modify LonganPi-3H-SDK/overlay/boot/extlinux to have below

label g1
	menu label Linux (boot from EMMC)
	linux /Image
	fdtdir /dtbs

	append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

modify LonganPi-3H-SDK/overlay/opt/firstboot.sh to have below

# resize root filesystem

if (lsblk | grep -q "mmcblk1p2"); then
        parted -s /dev/mmcblk1 "resizepart 2 -0"
	resize2fs /dev/mmcblk1p2
fi

parted -s /dev/mmcblk0 "resizepart 2 -0"
resize2fs /dev/mmcblk0p2

logs are attached below.

mkatf_output.log
mklinux.log
mkuboot.log
mkrootfs.log

@wu-yue-yu
Copy link
Collaborator

The build log seems no problem, how about the boot log?

@lonerkim
Copy link
Author

it seems no output to HDMI(when tried in eMMC) nor ssh connection.
have no acess to serial console, so don't know any logs to UART.
it's weird that board worked with provided image(from 0228) but nothing with my image?

if anything I can get additonal logs I will try again.

@wu-yue-yu
Copy link
Collaborator

it seems no output to HDMI(when tried in eMMC) nor ssh connection. have no acess to serial console, so don't know any logs to UART. it's weird that board worked with provided image(from 0228) but nothing with my image?

if anything I can get additonal logs I will try again.

Well, it seems that it didn't boot successfully. I'll paste some critical file for EMMC boot image, you can check below:
extlinux.conf

default g1
menu title U-Boot menu
prompt 2
timeout 5

label g0
	menu label Linux (boot from SD)
	linux /Image
	fdtdir /dtbs

	append root=/dev/mmcblk0p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
	
label g1
	menu label Linux (boot from EMMC)
	linux /Image
	fdtdir /dtbs

	append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

firstboot.sh

#!/bin/bash

PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
export PATH

# resize root filesystem

if (lsblk | grep -q "mmcblk1p2"); then
        parted -s /dev/mmcblk1 "resizepart 2 -0"
	resize2fs /dev/mmcblk1p2
fi

parted -s /dev/mmcblk0 "resizepart 2 -0"
resize2fs /dev/mmcblk0p2

# add normal user
useradd -s /bin/bash -m -k /etc/skel sipeed
echo 'sipeed:licheepi' | chpasswd
echo 'root:root' | chpasswd
usermod -a -G dialout sipeed
usermod -a -G cdrom sipeed
usermod -a -G sudo sipeed
usermod -a -G audio sipeed
usermod -a -G video sipeed
usermod -a -G plugdev sipeed
usermod -a -G users sipeed
usermod -a -G netdev sipeed

# generate locale data
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen

# change hostname
NEW_HOSTNAME="lpi3h-$(cat /sys/class/net/end0/address | tr -d ':\n' | tail -c 4)"
echo "NEW HOSTNAME: $NEW_HOSTNAME"
echo "$NEW_HOSTNAME" > /etc/hostname
echo "127.0.0.1	$NEW_HOSTNAME" > /etc/hosts
hostname "$NEW_HOSTNAME"
nmcli general hostname "$NEW_HOSTNAME"
systemctl enable avahi-daemon

# regenerate openssh host keys
dpkg-reconfigure openssh-server

# enable rc-local service
systemctl enable rc-local

# change the timezone
timedatectl set-timezone Asia/Shanghai

And the other files has no difference between SD boot image and EMMC boot image.
If the files above is same as yours, you can check if the image file is packaged correctly, the steps to package the EMMC boot image are the same as the steps to package the SD boot image.

@lonerkim
Copy link
Author

I tried method introduced in guide

export DATE=$(date +"%Y%m%d")
dd if=/dev/zero of=LPI3H_${DATE}.img bs=1M count=3072

then

fdisk LPI3H_${DATE}.img
n > p > 1 > 2048 > +64M > n > p > 2 > t > 1 > c > a > 1 > w

then fdisk -l LPI3H_${DATE}.img .
while section of
Disk LPI3H_20231215.img: 2.5 GiB, 2684354560 bytes, 5242880 sectors isn't corret with current image size,
below part was correct(3.2GB)

sudo losetup -f LPI3H_${DATE}.img
# fdisk 查看的分区信息用于挂载
# sudo losetup -f -o $[Start*512] --sizelimit $[Sectors*512] LPI3H_${DATE}.img
sudo losetup -f -o $[2048*512] --sizelimit $[131072*512] LPI3H_${DATE}.img
sudo losetup -f -o $[133120*512] --sizelimit $[6158336*512] LPI3H_${DATE}.img

so I proceed with sudo losetup -l | grep LPI3H to get loopN / loopM / loopM-1

and then noticed section 4. make file system with

sudo mkfs.fat /dev/loopM
sudo mkfs.ext4 /dev/loopM-1

while section 3 make file system with

sudo mkfs.vfat -F 32 -n "boot" /dev/sdXN
sudo mke2fs -t ext4 -F -L "rootfs" /dev/sdXM

tried both method and when I checked
sudo fsck /dev/mmcblkp2
it said bad superblock if I tried with sudo mkfs.ext4 /dev/loopM

so I tried

sudo mkfs.vfat -F 32 -n "boot" /dev/loopM
sudo mke2fs -t ext4 -F -L "rootfs" /dev/loopM-1

instead.

while now
sudo fsck /dev/mmcblk1p1

fsck from util-linux 2.39.3
fsck.fat 4.2 (2021-01-31)
/dev/mmcblk1p1: 103 files, 56981/129022 clusters

sudo fsck /dev/mmcblk1p2

fsck from util-linux 2.39.3
e2fsck 1.47.0 (5-Feb-2023)
rootfs: clean, 39985/192768 files, 433421/769792 blocks

said no error but still no boot from eMMC

when I checked

sudo mkdir /mnt/mmcblk1p2
sudo mount /dev/mmcblk1p1 /mnt/mmcblk1p1
mount: /mnt/mmcblk1p1: unknown filesystem type 'vfat'.
       dmesg(1) may have more information after failed mount system call.
sudo mkdir /mnt/mmcblk1p2
sudo mount /dev/mmcblk1p2 /mnt/mmcblk1p2
ls /mnt/mmcblk1p2
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

also

 cat /mnt/mmcblk1p2/opt/firstboot.sh
#!/bin/bash

PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
export PATH

# resize root filesystem

if (lsblk | grep -q "mmcblk1p2"); then
        parted -s /dev/mmcblk1 "resizepart 2 -0"
        resize2fs /dev/mmcblk1p2
fi

parted -s /dev/mmcblk0 "resizepart 2 -0"
resize2fs /dev/mmcblk0p2

# add normal user
useradd -s /bin/bash -m -k /etc/skel sipeed
echo 'sipeed:licheepi' | chpasswd
echo 'root:root' | chpasswd
usermod -a -G dialout sipeed
usermod -a -G cdrom sipeed
usermod -a -G sudo sipeed
usermod -a -G audio sipeed
usermod -a -G video sipeed
usermod -a -G plugdev sipeed
usermod -a -G users sipeed
usermod -a -G netdev sipeed

# generate locale data
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen

# change hostname
NEW_HOSTNAME="lpi3h-$(cat /sys/class/net/end0/address | tr -d ':\n' | tail -c 4)"
echo "NEW HOSTNAME: $NEW_HOSTNAME"
echo "$NEW_HOSTNAME" > /etc/hostname
echo "127.0.0.1 $NEW_HOSTNAME" > /etc/hosts
hostname "$NEW_HOSTNAME"
nmcli general hostname "$NEW_HOSTNAME"
systemctl enable avahi-daemon

# regenerate openssh host keys
dpkg-reconfigure openssh-server

# enable rc-local service
systemctl enable rc-local

# change the timezone
timedatectl set-timezone Asia/Shanghai
cat /mnt/mmcblk1p2/boot/extlinux/extlinux.conf
default g1
menu title U-Boot menu
prompt 2
timeout 5

label g0
        menu label Linux (boot from SD)
        linux /Image
        fdtdir /dtbs

        append root=/dev/mmcblk0p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

label g1
        menu label Linux (boot from EMMC)
        linux /Image
        fdtdir /dtbs

        append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

now I suspect first assumation of 'rootfs' build failed is in fact there but
either failure of kernel/uboot or copying of them(corruption during opration) was my problem?

@lonerkim lonerkim reopened this Mar 12, 2024
@wu-yue-yu
Copy link
Collaborator

wu-yue-yu commented Mar 13, 2024

I tried method introduced in guide

export DATE=$(date +"%Y%m%d")
dd if=/dev/zero of=LPI3H_${DATE}.img bs=1M count=3072

then

fdisk LPI3H_${DATE}.img
n > p > 1 > 2048 > +64M > n > p > 2 > t > 1 > c > a > 1 > w

then fdisk -l LPI3H_${DATE}.img . while section of Disk LPI3H_20231215.img: 2.5 GiB, 2684354560 bytes, 5242880 sectors isn't corret with current image size, below part was correct(3.2GB)

sudo losetup -f LPI3H_${DATE}.img
# fdisk 查看的分区信息用于挂载
# sudo losetup -f -o $[Start*512] --sizelimit $[Sectors*512] LPI3H_${DATE}.img
sudo losetup -f -o $[2048*512] --sizelimit $[131072*512] LPI3H_${DATE}.img
sudo losetup -f -o $[133120*512] --sizelimit $[6158336*512] LPI3H_${DATE}.img

so I proceed with sudo losetup -l | grep LPI3H to get loopN / loopM / loopM-1

and then noticed section 4. make file system with

sudo mkfs.fat /dev/loopM
sudo mkfs.ext4 /dev/loopM-1

while section 3 make file system with

sudo mkfs.vfat -F 32 -n "boot" /dev/sdXN
sudo mke2fs -t ext4 -F -L "rootfs" /dev/sdXM

tried both method and when I checked sudo fsck /dev/mmcblkp2 it said bad superblock if I tried with sudo mkfs.ext4 /dev/loopM

so I tried

sudo mkfs.vfat -F 32 -n "boot" /dev/loopM
sudo mke2fs -t ext4 -F -L "rootfs" /dev/loopM-1

instead.

while now sudo fsck /dev/mmcblk1p1

fsck from util-linux 2.39.3
fsck.fat 4.2 (2021-01-31)
/dev/mmcblk1p1: 103 files, 56981/129022 clusters

sudo fsck /dev/mmcblk1p2

fsck from util-linux 2.39.3
e2fsck 1.47.0 (5-Feb-2023)
rootfs: clean, 39985/192768 files, 433421/769792 blocks

said no error but still no boot from eMMC

when I checked

sudo mkdir /mnt/mmcblk1p2
sudo mount /dev/mmcblk1p1 /mnt/mmcblk1p1
mount: /mnt/mmcblk1p1: unknown filesystem type 'vfat'.
       dmesg(1) may have more information after failed mount system call.
sudo mkdir /mnt/mmcblk1p2
sudo mount /dev/mmcblk1p2 /mnt/mmcblk1p2
ls /mnt/mmcblk1p2
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

also

 cat /mnt/mmcblk1p2/opt/firstboot.sh
#!/bin/bash

PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
export PATH

# resize root filesystem

if (lsblk | grep -q "mmcblk1p2"); then
        parted -s /dev/mmcblk1 "resizepart 2 -0"
        resize2fs /dev/mmcblk1p2
fi

parted -s /dev/mmcblk0 "resizepart 2 -0"
resize2fs /dev/mmcblk0p2

# add normal user
useradd -s /bin/bash -m -k /etc/skel sipeed
echo 'sipeed:licheepi' | chpasswd
echo 'root:root' | chpasswd
usermod -a -G dialout sipeed
usermod -a -G cdrom sipeed
usermod -a -G sudo sipeed
usermod -a -G audio sipeed
usermod -a -G video sipeed
usermod -a -G plugdev sipeed
usermod -a -G users sipeed
usermod -a -G netdev sipeed

# generate locale data
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
locale-gen

# change hostname
NEW_HOSTNAME="lpi3h-$(cat /sys/class/net/end0/address | tr -d ':\n' | tail -c 4)"
echo "NEW HOSTNAME: $NEW_HOSTNAME"
echo "$NEW_HOSTNAME" > /etc/hostname
echo "127.0.0.1 $NEW_HOSTNAME" > /etc/hosts
hostname "$NEW_HOSTNAME"
nmcli general hostname "$NEW_HOSTNAME"
systemctl enable avahi-daemon

# regenerate openssh host keys
dpkg-reconfigure openssh-server

# enable rc-local service
systemctl enable rc-local

# change the timezone
timedatectl set-timezone Asia/Shanghai
cat /mnt/mmcblk1p2/boot/extlinux/extlinux.conf
default g1
menu title U-Boot menu
prompt 2
timeout 5

label g0
        menu label Linux (boot from SD)
        linux /Image
        fdtdir /dtbs

        append root=/dev/mmcblk0p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

label g1
        menu label Linux (boot from EMMC)
        linux /Image
        fdtdir /dtbs

        append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

now I suspect first assumation of 'rootfs' build failed is in fact there but either failure of kernel/uboot or copying of them(corruption during opration) was my problem?

Try this (make sure the extlinux.conf and firstboot.sh are modified for EMMC boot before run the script below):

#!/bin/bash -e

# make a image file in size of 3G

export DATE=$(date +"%Y%m%d")
dd if=/dev/zero of=LPI3H_${DATE}.img bs=1M count=3072

echo "n
p
1
2048
+64M
n
p
2


t
1
c
a
1
w
" | fdisk LPI3H_${DATE}.img

sudo losetup -f LPI3H_${DATE}.img
sudo losetup -f -o $[2048*512] --sizelimit $[131072*512] LPI3H_${DATE}.img
sudo losetup -f -o $[133120*512] --sizelimit $[6158336*512] LPI3H_${DATE}.img

img_file=$(sudo losetup -l | grep LPI3H | grep "         0        0" | awk '{print $1}')
boot_partition=$(sudo losetup -l | grep LPI3H | grep "  67108864  1048576" | awk '{print $1}')
root_partition=$(sudo losetup -l | grep LPI3H | grep "3153068032 68157440" | awk '{print $1}')

sudo mkfs.vfat -F 32 -n boot $boot_partition
sudo mkfs.ext4 -L rootfs $root_partition

sudo dd if=build/u-boot-sunxi-with-spl.bin of=$img_file bs=1k seek=8 conv=fsync

mkdir -p /tmp/kernel
sudo mount $boot_partition /tmp/kernel
sudo cp -r overlay/boot/* /tmp/kernel

mkdir -p /tmp/rootfs
sudo mount $root_partition /tmp/rootfs
sudo tar -vxf build/rootfs.tar -C /tmp/rootfs/

sync
sudo umount /tmp/rootfs
sudo umount /tmp/kernel
sudo losetup -d $root_partition
sudo losetup -d $boot_partition
sudo losetup -d $img_file

This script should work, it still need some changes though.

@lonerkim
Copy link
Author

lonerkim commented Mar 13, 2024

tried.
it seems build an image but still no luck with boot from eMMC.
just in case I tried 0228_EMMC.img for once more, and it boot
I think I should get serial console to further investigate? hehe

I'll try re-install host(ubuntu22.04) next day and build one from clean state only with minimal dependencies

also might this could be an issue? curious.

@wu-yue-yu
Copy link
Collaborator

tried. it seems build an image but still no luck with boot from eMMC. just in case I tried 0228_EMMC.img for once more, and it boot I think I should get serial console to further investigate? hehe

I'll try re-install host(ubuntu22.04) next day and build one from clean state only with minimal dependencies

also might this could be an issue? curious.

Yes, you can post your serial log here.

@lonerkim
Copy link
Author

lonerkim commented Mar 19, 2024

it seems I completely failed to burn image on to eMMC?
but dd'ing it with 0228_EMMC.img wasn't the problem, so might be the packageing itself cause the problem?

tried again March 20th yield same result.

(failed one)

U-Boot SPL 2024.01-rc2-00069-ga64f08dce2 (Mar 17 2024 - 21:16:24 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
MMC Device 1 not found
spl: could not find mmc device 1. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

=================
(defalt)

U-Boot 2024.01-rc2-00062-gda2e3196e4-dirty (Jan 10 2024 - 16:53:53 +0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  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
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40cf0000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

(0228_EMMC.img)

U-Boot 2024.01-rc2-00062-gda2e3196e4-dirty (Jan 10 2024 - 16:53:53 +0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  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
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40d30000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

...

~
[  OK  ] Finished firstboot.service - FirstBoot.
         Starting rc-local.service - /etc/rc.local Compatibility...
~

@wu-yue-yu
Copy link
Collaborator

it seems I completely failed to burn image on to eMMC? but dd'ing it with 0228_EMMC.img wasn't the problem, so might be the packageing itself cause the problem?

tried again March 20th yield same result.

(failed one)

U-Boot SPL 2024.01-rc2-00069-ga64f08dce2 (Mar 17 2024 - 21:16:24 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
MMC Device 1 not found
spl: could not find mmc device 1. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

================= (defalt)

U-Boot 2024.01-rc2-00062-gda2e3196e4-dirty (Jan 10 2024 - 16:53:53 +0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  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
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40cf0000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

(0228_EMMC.img)

U-Boot 2024.01-rc2-00062-gda2e3196e4-dirty (Jan 10 2024 - 16:53:53 +0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  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
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40d30000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

...

~
[  OK  ] Finished firstboot.service - FirstBoot.
         Starting rc-local.service - /etc/rc.local Compatibility...
~

Sorry for late reply, I'll check this problem this week.

@wu-yue-yu
Copy link
Collaborator

it seems I completely failed to burn image on to eMMC? but dd'ing it with 0228_EMMC.img wasn't the problem, so might be the packageing itself cause the problem?

tried again March 20th yield same result.

(failed one)

U-Boot SPL 2024.01-rc2-00069-ga64f08dce2 (Mar 17 2024 - 21:16:24 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
MMC Device 1 not found
spl: could not find mmc device 1. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

================= (defalt)

U-Boot 2024.01-rc2-00062-gda2e3196e4-dirty (Jan 10 2024 - 16:53:53 +0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  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
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40cf0000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

(0228_EMMC.img)

U-Boot 2024.01-rc2-00062-gda2e3196e4-dirty (Jan 10 2024 - 16:53:53 +0800) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  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
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40d30000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

...

~
[  OK  ] Finished firstboot.service - FirstBoot.
         Starting rc-local.service - /etc/rc.local Compatibility...
~

It turns out my patch file missed something to for emmc usage in uboot. #39 shuold fix this, you can try out.

@lonerkim
Copy link
Author

lonerkim commented Apr 1, 2024

I got different errors, but I assume it's either due to my bad formatting/packaging or partioning. either way, will try next Dat again. always thanks for help && let me know if I am doing something wrong. ;)

EDIT : 2024-04-02
tried again with slight diffrent method, but still same error.
fyi 0228_emmc still work as intended. it can boot as uboot arguments, run firstboot.sh, and pop-up logins.

U-Boot SPL 2024.01-rc2-00070-g2ce6ac3430 (Apr 01 2024 - 20:33:22 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

@lonerkim
Copy link
Author

lonerkim commented Apr 5, 2024

tried to make 'bootable TF' from new TF card,
and build again both TF card and .img file from scratch fixed an issue.

I'd assume TFcard itself was corrupted?

anyway this issue will be marked as closed as issue is resolved

sipeed@lpi3h-c6dd:~$ neofetch
       _,met$$$$$gg.          sipeed@lpi3h-c6dd
    ,g$$$$$$$$$$$$$$$P.       -----------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux trixie/sid aarch64
 ,$$P'              `$$$.     Host: Sipeed Longan Pi 3H
',$$P       ,ggs.     `$$b:   Kernel: 6.7.0-rc3+
`d$$'     ,$P"'   .    $$$    Uptime: 2 mins
 $$P      d$'     ,    $$P    Packages: 650 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.21
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0
 Y$$.    `.`"Y$$$$P"'         CPU: (4) @ 1.416GHz
 `$$b      "-.__              Memory: 144MiB / 3946MiB
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

sipeed@lpi3h-c6dd:~$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk1      179:0    0 28.9G  0 disk
|-mmcblk1p1  179:1    0   64M  0 part
`-mmcblk1p2  179:2    0 28.8G  0 part /
mmcblk1boot0 179:32   0    4M  1 disk
mmcblk1boot1 179:64   0    4M  1 disk
sipeed@lpi3h-c6dd:~$

@lonerkim lonerkim closed this as completed Apr 6, 2024
@lonerkim lonerkim reopened this Apr 7, 2024
@lonerkim
Copy link
Author

lonerkim commented Apr 7, 2024

It seems,
if TFcard isn't present(eMMC alone) could not boot,
but TFcrad has boot area that contain extlinux.conf that direct eMMC could boot?

cat /mnt/mmcblk0p2/boot/extlinux/extlinux.conf

default g1
menu title U-Boot menu
prompt 2
timeout 5

label g0
        menu label Linux (boot from SD)
        linux /Image
        fdtdir /dtbs

        append root=/dev/mmcblk0p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

label g1
        menu label Linux (boot from EMMC)
        linux /Image
        fdtdir /dtbs

        append root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused

@wu-yue-yu
Copy link
Collaborator

The boot media priority is that the TF card has a higher priority than the eMMC. If you want to boot from eMMC and use TF card as a storage device, you need format the TF card.
Refer here

@lonerkim
Copy link
Author

lonerkim commented Apr 8, 2024

The boot media priority is that the TF card has a higher priority than the eMMC. If you want to boot from eMMC and use TF card as a storage device, you need format the TF card.
Refer here

Yes I know that.
tho what I meant is

  1. eMMC boot still failed on me
    (```
    U-Boot SPL 2024.01-rc2-00070-g2ce6ac3430 (Apr 01 2024 - 20:33:22 +0900)
    DRAM: 4096 MiB
    Trying to boot from MMC2
    mmc_load_image_raw_sector: mmc block read error
    SPL: failed to boot from all boot devices

ERROR ### Please RESET the board

2. if I make specific TFcard to contain script to boot from eMMC it can boot from eMMC

3. after eMMC boot, I can remove TF card , but I cannot reboot without previous TFcard

maybe mmcblk1boot1 /mmcblk1boot2 is the problem?(I can see them when I do fdisk -l)

@wu-yue-yu
Copy link
Collaborator

The boot media priority is that the TF card has a higher priority than the eMMC. If you want to boot from eMMC and use TF card as a storage device, you need format the TF card.
Refer here

Yes I know that. tho what I meant is

  1. eMMC boot still failed on me
    (```
    U-Boot SPL 2024.01-rc2-00070-g2ce6ac3430 (Apr 01 2024 - 20:33:22 +0900)
    DRAM: 4096 MiB
    Trying to boot from MMC2
    mmc_load_image_raw_sector: mmc block read error
    SPL: failed to boot from all boot devices

ERROR ### Please RESET the board

2. if I make specific TFcard to contain script to boot from eMMC it can boot from eMMC

3. after eMMC boot, I can remove TF card , but I cannot reboot without previous TFcard

maybe mmcblk1boot1 /mmcblk1boot2 is the problem?(I can see them when I do fdisk -l)

It seems not problem of the device partition number, because your boot stuck at uboot.
I think you may only succeed in booting from TF card, make sure the uboot is the right one.
You can compile a uboot and put it in your TF card, then just dd uboot into eMMC to check if the uboot runs well.

@lonerkim
Copy link
Author

lonerkim commented Apr 9, 2024

1. tried with updated mkimage script and same result
1-1. cannot boot from eMMC alone
1-2. same result after dd uboot.bin standalone
1-3. If I insert TFcard that instructed to boot from eMMC it can boot from eMMC

EDIT : was my thought but it seems eMMC totally failed on boot(hence same issue with

U-Boot SPL 2024.01-rc2-00070-g2ce6ac3430 (Apr 01 2024 - 20:33:22 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
  1. TFcard version had no issue. TFcard can boot

EDIT:
but same result after dd uboot.bin standalone is true anyway.
uboot saying MMC2 thus I think it is eMMC scripts? really don't know what I am missing here.
thanks for answer though, I'll check thoroughly once more.

EDIT2:

boot normal in TFCard.

root@lpi3h-c6dd:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk0      179:0    0 29.5G  0 disk 
├─mmcblk0p1  179:1    0   64M  0 part 
└─mmcblk0p2  179:2    0 29.5G  0 part /
mmcblk1      179:32   0 28.9G  0 disk 
├─mmcblk1p1  179:33   0   64M  0 part 
└─mmcblk1p2  179:34   0  2.9G  0 part 
mmcblk1boot0 179:64   0    4M  1 disk 
mmcblk1boot1 179:96   0    4M  1 disk 
root@lpi3h-c6dd:~# sudo reboot
Broadcast message from root@lpi3h-c6dd on pts/0 (Wed 2024-04-10 16:43:58 KST):
The system will reboot now!
~~~
[   52.248243] reboot: Restarting system

Start from TFCard, manually input eMMC boot from Serial Console.

U-Boot SPL 2024.01-rc2-00070-gb053783281 (Apr 10 2024 - 15:12:08 +0900)
DRAM: 4096 MiB
Trying to boot from MMC1
NOTICE:  BL31: v2.9.0	(release):v2.10-rc0-4-g5e52433dd
NOTICE:  BL31: Built : 15:11:37, Apr 10 2024
NOTICE:  BL31: Detected Allwinner H616 SoC (1823)
NOTICE:  BL31: Found U-Boot DTB at 0x4a083438, model: LonganPi 3H
ERROR:   RSB: set run-time address: 0x10003


U-Boot 2024.01-rc2-00070-gb053783281 (Apr 10 2024 - 15:12:08 +0900) Allwinner Technology

CPU:   Allwinner H616 (SUN50I)
Model: LonganPi 3H
DRAM:  4 GiB
Core:  48 devices, 19 uclasses, devicetree: separate
WDT:   Not starting watchdog@30090a0
MMC:   mmc@4020000: 0, mmc@4022000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... 
In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   eth0: ethernet@5020000
Unknown command 'usb' - try 'help'
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
U-Boot menu
1:	Linux (boot from SD)
2:	Linux (boot from EMMC)
Enter choice: 2
2:	Linux (boot from EMMC)
Retrieving file: /Image
append: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
Retrieving file: /dtbs/allwinner/sun50i-h618-longanpi-3h.dtb
Moving Image from 0x40080000 to 0x40200000, end=40f80000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
Working FDT set to 4fa00000
   Loading Device Tree to 0000000049ff8000, end 0000000049fffd38 ... OK
Working FDT set to 49ff8000

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 6.7.0-rc3+ (root@lonerkim-5600x) (aarch64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP PREEMPT Wed Apr 10 15:21:43 KST 2024
[    0.000000] Machine model: Sipeed Longan Pi 3H
[    0.000000] earlycon: uart0 at MMIO32 0x0000000005000000 (options '115200n8')
[    0.000000] printk: legacy bootconsole [uart0] enabled
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000041000000, size 128 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] OF: reserved mem: 0x0000000041000000..0x0000000048ffffff (131072 KiB) map reusable linux,cma
[    0.000000] OF: reserved mem: 0x0000000040000000..0x000000004003ffff (256 KiB) nomap non-reusable secmon@40000000
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000013fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x000000004003ffff]
[    0.000000]   node   0: [mem 0x0000000040040000-0x000000013fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x000000013fffffff]
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] psci: PSCIv1.1 detected in firmware.
[    0.000000] psci: Using standard PSCI v0.2 function IDs
[    0.000000] psci: MIGRATE_INFO_TYPE not supported.
[    0.000000] psci: SMC Calling Convention v1.4
[    0.000000] percpu: Embedded 22 pages/cpu s51176 r8192 d30744 u90112
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: kernel page table isolation disabled by kernel configuration
[    0.000000] alternatives: applying boot alternatives
[    0.000000] Kernel command line: root=/dev/mmcblk1p2 console=tty1 console=ttyS0,115200 rootwait rw earlycon clk_ignore_unused
[    0.000000] printk: log_buf_len individual max cpu contribution: 131072 bytes
[    0.000000] printk: log_buf_len total cpu_extra contributions: 393216 bytes
[    0.000000] printk: log_buf_len min size: 131072 bytes
[    0.000000] printk: log_buf_len: 524288 bytes
[    0.000000] printk: early log buf free: 128864(98%)
[    0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 1032192
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: area num 4.
[    0.000000] software IO TLB: mapped [mem 0x00000000fbfff000-0x00000000fffff000] (64MB)
[    0.000000] Memory: 3908324K/4194304K available (9472K kernel code, 934K rwdata, 2504K rodata, 448K init, 310K bss, 154908K reserved, 131072K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] Root IRQ handler: gic_handle_irq
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000000] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.009138] Console: colour dummy device 80x25
[    0.013598] printk: legacy console [tty1] enabled
[    0.019245] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.029619] pid_max: default: 32768 minimum: 301
[    0.034821] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.042970] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.052395] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.059636] RCU Tasks: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.066743] RCU Tasks Trace: Setting shift to 2 and lim to 1 rcu_task_cb_adjust=1.
[    0.075186] rcu: Hierarchical SRCU implementation.
[    0.080445] rcu: 	Max phase no-delay instances is 1000.
[    0.086502] smp: Bringing up secondary CPUs ...
[    0.091815] Detected VIPT I-cache on CPU1
[    0.091885] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.092266] Detected VIPT I-cache on CPU2
[    0.092307] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.092648] Detected VIPT I-cache on CPU3
[    0.092689] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.092755] smp: Brought up 1 node, 4 CPUs
[    0.131901] SMP: Total of 4 processors activated.
[    0.137029] CPU features: detected: 32-bit EL0 Support
[    0.142681] CPU features: detected: CRC32 instructions
[    0.147842] CPU: All CPU(s) started at EL2
[    0.152336] alternatives: applying system-wide alternatives
[    0.159805] devtmpfs: initialized
[    0.166709] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.177126] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.189022] pinctrl core: initialized pinctrl subsystem
[    0.195740] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.203388] DMA: preallocated 512 KiB GFP_KERNEL pool for atomic allocations
[    0.211229] DMA: preallocated 512 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.220207] cpuidle: using governor menu
[    0.224567] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.232105] ASID allocator initialised with 65536 entries
[    0.240194] platform 3001000.clock: Fixed dependency cycle(s) with /soc/rtc@7000000
[    0.251089] platform 6510000.tcon-top: Fixed dependency cycle(s) with /soc/hdmi@6000000/ports/port@0/endpoint
[    0.262157] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000/ports/port@4/endpoint@0
[    0.273263] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000/ports/port@1/endpoint@2
[    0.285040] platform 6515000.lcd-controller: Fixed dependency cycle(s) with /soc/tcon-top@6510000
[    0.295095] platform 7010000.clock: Fixed dependency cycle(s) with /soc/rtc@7000000
[    0.304153] platform connector: Fixed dependency cycle(s) with /soc/hdmi@6000000/ports/port@1/endpoint
[    0.314936] Modules: 29312 pages in range for non-PLT usage
[    0.314941] Modules: 520832 pages in range for PLT usage
[    0.321380] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[    0.334626] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[    0.341514] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
[    0.348419] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[    0.355079] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[    0.362530] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[    0.369415] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
[    0.376866] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[    0.384770] SCSI subsystem initialized
[    0.388680] usbcore: registered new interface driver usbfs
[    0.394730] usbcore: registered new interface driver hub
[    0.400581] usbcore: registered new device driver usb
[    0.406045] Advanced Linux Sound Architecture Driver Initialized.
[    0.413204] Bluetooth: Core ver 2.22
[    0.416834] NET: Registered PF_BLUETOOTH protocol family
[    0.422638] Bluetooth: HCI device and connection manager initialized
[    0.429009] Bluetooth: HCI socket layer initialized
[    0.434332] Bluetooth: L2CAP socket layer initialized
[    0.439882] Bluetooth: SCO socket layer initialized
[    0.445671] clocksource: Switched to clocksource arch_sys_counter
[    0.458628] NET: Registered PF_INET protocol family
[    0.463738] IP idents hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.475099] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
[    0.484538] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.493064] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.501264] TCP bind hash table entries: 32768 (order: 8, 1048576 bytes, linear)
[    0.510697] TCP: Hash tables configured (established 32768 bind 32768)
[    0.517974] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.525420] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
[    0.533454] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.541781] Initialise system trusted keyrings
[    0.546787] workingset: timestamp_bits=46 max_order=20 bucket_order=0
[    0.554499] SGI XFS with security attributes, no debug enabled
[    0.623027] Key type asymmetric registered
[    0.627533] Asymmetric key parser 'x509' registered
[    0.632985] io scheduler mq-deadline registered
[    0.642041] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    0.649973] printk: legacy console [ttyS0] disabled
[    0.655134] 5000000.serial: ttyS0 at MMIO 0x5000000 (irq = 14, base_baud = 1500000) is a 16550A
[    0.663932] printk: legacy console [ttyS0] enabled
[    0.663932] printk: legacy console [ttyS0] enabled
[    0.673981] printk: legacy bootconsole [uart0] disabled
[    0.673981] printk: legacy bootconsole [uart0] disabled
[    0.709524] usbcore: registered new interface driver usb-storage
[    0.716241] sun6i-rtc 7000000.rtc: registered as rtc0
[    0.721313] sun6i-rtc 7000000.rtc: setting system clock to 2024-04-10T07:44:09 UTC (1712735049)
[    0.730304] i2c_dev: i2c /dev entries driver
[    0.734761] mv64xxx_i2c 7081400.i2c: can't get pinctrl, bus recovery not supported
[    0.742733] axp20x-i2c 0-0036: AXP20x variant AXP313a found
[    0.748593] axp20x-i2c 0-0036: AXP20X driver loaded
[    0.754164] sunxi-wdt 30090a0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    0.762390] usbcore: registered new interface driver bcm203x
[    0.768097] usbcore: registered new interface driver bpa10x
[    0.773695] usbcore: registered new interface driver bfusb
[    0.779401] usbcore: registered new interface driver btusb
[    0.786128] SMCCC: SOC_ID: ID = jep106:091e:1823 Revision = 0x00000002
[    0.792819] usbcore: registered new interface driver usbhid
[    0.798657] usbhid: USB HID core driver
[    0.803112] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available
[    0.813109] Initializing XFRM netlink socket
[    0.817415] NET: Registered PF_PACKET protocol family
[    0.822502] Bridge firewalling registered
[    0.826608] Bluetooth: RFCOMM TTY layer initialized
[    0.831492] Bluetooth: RFCOMM socket layer initialized
[    0.836651] Bluetooth: RFCOMM ver 1.11
[    0.840408] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    0.845731] Bluetooth: BNEP filters: protocol multicast
[    0.850960] Bluetooth: BNEP socket layer initialized
[    0.855931] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    0.861854] Bluetooth: HIDP socket layer initialized
[    0.872440] Loading compiled-in X.509 certificates
[    0.892496] platform 1100000.mixer: Fixed dependency cycle(s) with /soc/tcon-top@6510000/ports/port@0/endpoint@0
[    0.904639] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    0.920695] sun50i-h616-pinctrl 300b000.pinctrl: initialized sunXi PIO driver
[    0.928156] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    0.937231] sun50i-h616-r-pinctrl 7022000.pinctrl: initialized sunXi PIO driver
[    0.945210] debugfs: Directory '1100000.mixer' with parent 'regmap' already present!
[    0.952999] debugfs: Directory '1100000.mixer' with parent 'regmap' already present!
[    0.976641] sun4i-drm display-engine: bound 1100000.mixer (ops 0xffffffc0809bdb10)
[    0.984337] sun4i-drm display-engine: bound 6510000.tcon-top (ops 0xffffffc0809c2638)
[    0.992453] sun4i-drm display-engine: bound 6515000.lcd-controller (ops 0xffffffc0809bb020)
[    1.000865] sun8i-dw-hdmi 6000000.hdmi: supply hvcc not found, using dummy regulator
[    1.008796] sun8i-dw-hdmi 6000000.hdmi: Detected HDMI TX controller v2.12a with HDCP (DWC HDMI 2.0 TX PHY)
[    1.018867] sun8i-dw-hdmi 6000000.hdmi: registered DesignWare HDMI I2C bus driver
[    1.026543] sun4i-drm display-engine: bound 6000000.hdmi (ops 0xffffffc0809bcbd0)
[    1.034391] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    1.042227] sun4i-drm display-engine: [drm] Cannot find any crtc or sizes
[    1.049103] sun4i-drm display-engine: [drm] Cannot find any crtc or sizes
[    1.057112] dwmac-sun8i 5020000.ethernet: IRQ eth_wake_irq not found
[    1.063473] dwmac-sun8i 5020000.ethernet: IRQ eth_lpi not found
[    1.069568] dwmac-sun8i 5020000.ethernet: PTP uses main clock
[    1.075328] dwmac-sun8i 5020000.ethernet: Current syscon value is not the default 51fe6 (expect 0)
[    1.084429] dwmac-sun8i 5020000.ethernet: No HW DMA feature register supported
[    1.091667] dwmac-sun8i 5020000.ethernet: RX Checksum Offload Engine supported
[    1.098898] dwmac-sun8i 5020000.ethernet: COE Type 2
[    1.103865] dwmac-sun8i 5020000.ethernet: TX Checksum insertion supported
[    1.110661] dwmac-sun8i 5020000.ethernet: Normal descriptors
[    1.116332] dwmac-sun8i 5020000.ethernet: Chain mode enabled
[    1.127370] ehci-platform 5200000.usb: EHCI Host Controller
[    1.132962] ehci-platform 5200000.usb: new USB bus registered, assigned bus number 1
[    1.140833] ehci-platform 5200000.usb: irq 288, io mem 0x05200000
[    1.144028] ehci-platform 5310000.usb: EHCI Host Controller
[    1.144082] ohci-platform 5310400.usb: Generic Platform OHCI controller
[    1.144099] ohci-platform 5310400.usb: new USB bus registered, assigned bus number 2
[    1.144189] ohci-platform 5310400.usb: irq 290, io mem 0x05310400
[    1.144382] ehci-platform 5311000.usb: EHCI Host Controller
[    1.144396] ehci-platform 5311000.usb: new USB bus registered, assigned bus number 3
[    1.144430] ohci-platform 5200400.usb: Generic Platform OHCI controller
[    1.144445] ohci-platform 5200400.usb: new USB bus registered, assigned bus number 4
[    1.144462] ehci-platform 5311000.usb: irq 291, io mem 0x05311000
[    1.144568] ohci-platform 5200400.usb: irq 292, io mem 0x05200400
[    1.147238] ohci-platform 5311400.usb: Generic Platform OHCI controller
[    1.152673] ehci-platform 5310000.usb: new USB bus registered, assigned bus number 5
[    1.152804] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    1.159127] ohci-platform 5311400.usb: new USB bus registered, assigned bus number 6
[    1.159781] sunxi-mmc 4020000.mmc: Got CD GPIO
[    1.160687] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    1.160723] clk: Not disabling unused clocks
[    1.160728] ALSA device list:
[    1.160731]   No soundcards found.
[    1.160806] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    1.160813] cfg80211: failed to load regulatory.db
[    1.166926] ehci-platform 5310000.usb: irq 289, io mem 0x05310000
[    1.172970] ohci-platform 5311400.usb: irq 293, io mem 0x05311400
[    1.175681] ehci-platform 5311000.usb: USB 2.0 started, EHCI 1.00
[    1.175801] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.07
[    1.175808] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.175813] usb usb3: Product: EHCI Host Controller
[    1.175817] usb usb3: Manufacturer: Linux 6.7.0-rc3+ ehci_hcd
[    1.175821] usb usb3: SerialNumber: 5311000.usb
[    1.176162] hub 3-0:1.0: USB hub found
[    1.176181] hub 3-0:1.0: 1 port detected
[    1.185041] sunxi-mmc 4020000.mmc: initialized, max. request size: 16384 KB, uses new timings mode
[    1.205679] sunxi-mmc 4022000.mmc: initialized, max. request size: 2048 KB, uses new timings mode
[    1.206709] ehci-platform 5200000.usb: USB 2.0 started, EHCI 1.00
[    1.223799] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.07
[    1.235673] ehci-platform 5310000.usb: USB 2.0 started, EHCI 1.00
[    1.242564] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.265670] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.271875] usb usb2: Product: Generic Platform OHCI controller
[    1.278402] mmc0: new high speed SDHC card at address 59b4
[    1.282740] usb usb2: Manufacturer: Linux 6.7.0-rc3+ ohci_hcd
[    1.289356] mmcblk0: mmc0:59b4 LX32G 29.5 GiB
[    1.294897] usb usb2: SerialNumber: 5310400.usb
[    1.304797]  mmcblk0: p1 p2
[    1.315862] hub 2-0:1.0: USB hub found
[    1.419329] hub 2-0:1.0: 1 port detected
[    1.423562] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.07
[    1.431832] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.439062] usb usb4: Product: Generic Platform OHCI controller
[    1.444979] usb usb4: Manufacturer: Linux 6.7.0-rc3+ ohci_hcd
[    1.450727] usb usb4: SerialNumber: 5200400.usb
[    1.455493] hub 4-0:1.0: USB hub found
[    1.459266] hub 4-0:1.0: 1 port detected
[    1.463442] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.07
[    1.471715] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.475679] usb 3-1: new high-speed USB device number 2 using ehci-platform
[    1.478935] usb usb1: Product: EHCI Host Controller
[    1.490772] usb usb1: Manufacturer: Linux 6.7.0-rc3+ ehci_hcd
[    1.496591] usb usb1: SerialNumber: 5200000.usb
[    1.501342] hub 1-0:1.0: USB hub found
[    1.505106] hub 1-0:1.0: 1 port detected
[    1.505136] mmc1: new HS200 MMC card at address 0001
[    1.514205] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.07
[    1.522787] mmcblk1: mmc1:0001 AT2SAB 28.9 GiB
[    1.525674] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.534451] usb usb5: Product: EHCI Host Controller
[    1.539382] usb usb5: Manufacturer: Linux 6.7.0-rc3+ ehci_hcd
[    1.539682]  mmcblk1: p1 p2
[    1.545120] usb usb5: SerialNumber: 5310000.usb
[    1.548459] mmcblk1boot0: mmc1:0001 AT2SAB 4.00 MiB
[    1.552728] hub 5-0:1.0: USB hub found
[    1.558126] mmcblk1boot1: mmc1:0001 AT2SAB 4.00 MiB
[    1.561064] hub 5-0:1.0: 1 port detected
[    1.570127] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.07
[    1.578408] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.585627] usb usb6: Product: Generic Platform OHCI controller
[    1.591552] usb usb6: Manufacturer: Linux 6.7.0-rc3+ ohci_hcd
[    1.597308] usb usb6: SerialNumber: 5311400.usb
[    1.602609] hub 6-0:1.0: USB hub found
[    1.606380] hub 6-0:1.0: 1 port detected
[    1.614807] EXT4-fs (mmcblk1p2): mounted filesystem 7b6f661c-27c3-497e-822f-ee50c369252e r/w with ordered data mode. Quota mode: disabled.
[    1.627308] VFS: Mounted root (ext4 filesystem) on device 179:34.
[    1.633721] devtmpfs: mounted
[    1.636901] Freeing unused kernel memory: 448K
[    1.665924] Run /sbin/init as init process
[    1.696789] usb 3-1: New USB device found, idVendor=a69c, idProduct=8d80, bcdDevice= 1.00
[    1.705008] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.712172] usb 3-1: Product: AIC Wlan
[    1.716045] usb 3-1: Manufacturer: aicsemi
[    1.720315] usb 3-1: SerialNumber: 20220103
[    1.926202] systemd[1]: Failed to find module 'autofs4'
[    1.960249] systemd[1]: systemd 255.4-1 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[    1.992284] systemd[1]: Detected architecture arm64.
[    1.997599] systemd[1]: Detected first boot.

Welcome to Debian GNU/Linux trixie/sid!

TFCard Removed and reboot.

[  863.803231] mmc0: card 59b4 removed
root@lpi3h-c6dd:~# sudo reboot

Broadcast message from root@lpi3h on pts/0 (Wed 2024-04-10 16:58:55 KST):

The system will reboot now!
[  892.487067] reboot: Restarting system

U-Boot SPL 2024.01-rc2-00070-gb053783281 (Apr 10 2024 - 15:12:08 +0900)
DRAM: 4096 MiB
Trying to boot from MMC2
mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

it seems uboot setup is the problem I guess(as you said)

Update 3:
it seems 0403 debian cli image is working.
still failed on own built image tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants