There are mysterious 30 seconds delay when only eMMC booting.
Below log is from my new compiled kernel.
And oddly, with the same kernel, there is no delay when it boots from SD/USB.
I did everything to remove the delay for weeks, but everything was useless.
I desperately need any hint about causing the delay.
The 30 seconds delay exists in Khadas’ eMMC firmware image.
There is around 30 seconds delay between below 4 ~ 35 seconds logs.
[ 4.166117@2] usb usb2: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 4.174892@2] hub 2-0:1.0: USB hub found
[ 4.178150@2] hub 2-0:1.0: config failed, hub doesn’t have any ports! (err -19)
[ 4.186200@2] dwc_otg: usb0: type: 2 speed: 0, [ 4.189685@4] config: 0, dma: 0, id: 0,
[ 4.193553@4] phy: d0078000, ctrl: 0
[ 4.297416@4] dwc_otg: Core Release: 3.10a
[ 4.297457@4] dwc_otg: Setting default values for core params
[ 4.301612@4] dwc_otg: curmode: 0, host_only: 0
[ 4.318449@4] dwc_otg: Using Buffer DMA mode
[ 4.318487@4] dwc_otg: OTG VER PARAM: 1, OTG VER FLAG: 1
[ 4.322367@4] dwc_otg: Working on port type = SLAVE
[ 4.327198@4] dwc_otg: Dedicated Tx FIFOs mode
[ 4.332840@4] gxbb_pm: enter meson_pm_probe!
[ 4.335833@4] gxbb_pm: system suspend level: 1
[ 4.340271@4] gxbb_pm: meson_pm_probe done
[ 4.345209@4] Freeing unused kernel memory: 768K (ffffffc001b40000 - ffffffc001c00000)
[ 4.480280@2] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[ 4.888253@2] usb 1-2: new high-speed USB device number 3 using xhci-hcd
[ 4.909289@0] random: fast init done
[ 35.340630@6] EXT4-fs (mmcblk0p6): 13 orphan inodes deleted
[ 35.340688@6] EXT4-fs (mmcblk0p6): recovery complete
[ 35.353898@6] EXT4-fs (mmcblk0p6): mounted filesystem with writeback data mode. Opts: data=writeback
[ 35.554757@7] systemd[1]: System time before build time, advancing clock.
[ 35.558975@7] cgroup: cgroup2: unknown option “nsdelegate”
[ 35.571098@7] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCR
E2 default-hierarchy=hybrid)
I think maybe this issue related to the partition table.
For SD/USB image, it uses MBR patition structure.
For eMMC image, it uses AML partition structure, in order to use Amlogic burn tool to upgrade firmware.
If I changed the eMMC image from AML partition structure to MBR patition structure, it boots eMMC image just with a delay of 5 seconds.
[ 8.496628@6] 720p60hz 60 1
[ 8.503906@6] 720p60hz 60 1
[ 8.511015@6] hdmtix: set audio
[ 8.518101@6] hdmitx tx_aud_src = 0
[ 8.525225@6] hdmitx: fs = 3, cd = 4, tmds_clk = 74250
[ 8.532351@6] hdmitx aud_n_para = 6144
[ 8.539481@6] hdmitx set channel status
[ 8.546593@6] hdmitx: audio: Audio Type: PCM
[ 8.553697@6] vout: new mode 720p60hz
[ 8.553697@6] set ok
[ 8.567993@6] fb: current vmode=720p60hz, cmd: 0x20000
[ 8.619779@6] fb: osd[0] enable: 1 (khadas_init.sh)
[ 8.643690@6] fb: osd[1] enable: 0 (khadas_init.sh)
[ 11.657195@1] vout: aml_tvout_mode_work: monitor_timeout
[ 13.818415@6] EXT4-fs (mmcblk0p2): recovery complete
[ 13.826260@6] EXT4-fs (mmcblk0p2): mounted filesystem with writeback data mode. Opts: data=writeback
[ 14.077264@6] cgroup: cgroup2: unknown option "nsdelegate"
[ 14.093563@6] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[ 14.124994@6] systemd[1]: Detected architecture arm64.
[ 14.160456@6] systemd[1]: Set hostname to <Khadas>.
[ 14.204710@7] meson_uart c81004c0.serial: ttyS0 use xtal(8M) 24000000 change 115200 to 115200
[ 14.277156@7] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support BPF/cgroup based firewalling.
[ 14.295849@7] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 14.466521@6] systemd[1]: Reached target Remote File Systems.
[ 14.483482@6] systemd[1]: Created slice User and Session Slice.
[ 14.499029@6] systemd[1]: Reached target Swap.
[ 14.514976@6] systemd[1]: Created slice System Slice.
When you built the image, you need to boot from SD card first (any SD card image is OK), and then copy the image to your SD card, and write it to eMMC use dd command.