[How To] Install run Manjaro ARM on Amlogic TV Boxes with S922X - S905X3 SOC

AM6+ already have its official image so no need to try Vim3.

eMMC install is not been tested on AM6 Plus with the latest Android Firmware cause I feel there is some changes in latest firmware which stops it from boot from emmc.

I have AM6+ running on emmc with the same script but I had Old Android firmware which had come pre-installed. While when I tried the same with AM6B+ It fails to load from emmc but works fine from sdcard. I will have to connect uart and find out what is going on in the backrground.

BTW after you flashed it on emmc. Did you do the following?

  1. Match PARTUUID in /boot/uEnv.ini and /etc/fstab ?
  2. On first reboot enable multi-boot ? which is like pressing hand holding the reset key with Manjaro-SDcard installed. (This is the most important part which gets missed out)

Yes you mentioned here so it is something similar to what I am facing on AM6B+

If both the above was done then we can only tell from bootlogs. I will have to hookup the uart on the board to see whats happening. Maybe in coming days.

Thanks didn’t know that

Which one? I was not sure which one I’m on, so while restoring stock Android I tried every version and only 0.4.2 worked. Asking that to try downgrading

But that’d require upgrading to latest FW first…

Well latest dev version puts right IDs in both places for root pt

Could you please be more specific here, I’m not sure I understand…
First of all, re-enabling multi-boot means I’m on multi-boot firmware, but I’m not…
Pressing recovery button would just instantly hard-reset/reboot the box, so I’m not sure how to do that on first reboot. I guess first reboot is right after initial setup wizard, so I should probably make a shutdown instead of reboot, power off, pin-press the recovery button, power on while still pressing it, right?

You have done it already so that have cleared my doubt. That you’re doing the right things but still it doesnt seem to work. You already have multi-boot enabled as per you previous post.

Try these steps.

  1. Flash Android on eMMC and use AM6+ image from sdcard and then update time and run emmc install script.
  2. Reboot with sd card inserted and boot into sdcard version.
  3. Mount emmc and check if the PARTUUID in /boot/uEnv.ini and /etc/fstab is the same for emmc partitions for both boot and root.

If all the above is correct and then it still doesn’t work then I have doubt on android uboot present in emmc.

Flashed Manjaro-ARM-gnome-am6-plus-20220114.img.xz

Done, mounted two partitions of emmc, changed PARTUUID of root in uEnv.ini (emmc boot part), and PARTUUIDs for both boot and root in /etc/fstab (emmc root part)

No news, the same black screen with no text at all…
My only guess is install script somehow damages boot loader info or bootloader just can’t find boot partition where it has to be, maybe partition layout has changed on latest firmware. I’m total noob here…
If uboot is not there, how is that supposed to boot from sdcard (which is still ok)?

Here hope your putting partition 2 which is the rootfs and not partition 1.

Maybe. There are 2 theory for this.

  1. Either emmc script is removing too much of the bootloader where it cannot reach till the emmc rootfs boot process.
  2. Or emmc script is keeping too much of Android boot files that it partially boots into Android boot and gets stuck.

Initial bootloader is present.

Update : I tried on AM6B+ and it seems the emmc doesn’t get initialized on boot so it fails to find rootfs and kernel panics.

I updated my am6+ emmc setup to latest kernel and that didn’t crash. So mostly something in new device.

I’m still interested which FW version does your am6+ run. And could this whole thing be related to encrypted bootloader, which is since 3.9 something.

I cannot find this anymore as I have already installed Manjaro on eMMC.

Not sure yet. Will have to test it further with old firmware on am6B+ to see if that works.

So it loads the uboot from emmc, but the intramfs fails to mount the emmc?

Thats what it looks like to me.

Do you use the same emmc values in your dts file as I use ref post 220: [How To] Install run Manjaro ARM on Amlogic TV Boxes with S922X - S905X3 SOC - #220 by hste ?

I havn’t installed the os on emmc, but I had some error messages in dmesg about emmc before I copied those parameters from a khadas dts file.

1 Like

Will give this a try thanks.

Tried the patch but that just fixes the read/write IO error but does not boot from emmc.

Looking at the logs I see emmc is not probed during boot process but it works fine once the kernel is loaded when booting from sdcard.

Tried many fixes but nothing helped so far. I have asked usptream kernel devs to see if they know something about hs200 issue.

SD Card Boot shows emmc:

udo dmesg | grep mmc | less
[sudo] password for spikerguy: 
[    0.155608] meson-gx-mmc ffe05000.sd: Got CD GPIO
[    0.225641] mmc0: new high speed SDHC card at address aaaa
[    0.226489] mmcblk0: mmc0:aaaa SB16G 14.8 GiB 
[    0.229859]  mmcblk0: p1 p2
[    0.313164] meson-gx-mmc ffe07000.mmc: allocated mmc-pwrseq
[    0.350668] EXT4-fs (mmcblk0p2): Mount option "data=writeback" incompatible with ext2
[    0.494496] mmc1: new HS200 MMC card at address 0001
[    0.495228] mmcblk1: mmc1:0001 BJTD4R 29.1 GiB 
[    0.496940]  mmcblk1: p1 p2
[    0.497660] mmcblk1boot0: mmc1:0001 BJTD4R 4.00 MiB 
[    0.499370] mmcblk1boot1: mmc1:0001 BJTD4R 4.00 MiB 
[    0.500624] mmcblk1rpmb: mmc1:0001 BJTD4R 4.00 MiB, chardev (235:0)
[    0.843388] EXT4-fs (mmcblk0p2): recovery complete
[    0.845660] EXT4-fs (mmcblk0p2): mounted filesystem with writeback data mode. Opts: data=writeback. Quota mode: none.
[    2.666841] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null). Quota mode: none.
[    4.045802] meson-gx-mmc ffe03000.sd: allocated mmc-pwrseq
[    4.224805] mmc2: new high speed SDIO card at address 0001
[    4.562459] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43752-sdio.ugoos,am6.bin failed with error -2
[    4.562513] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43752-sdio.bin failed with error -2
may be corrupt. Please run fsck.

Emmc visible when booting from sdcard:

lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk0      179:0    0  14.8G  0 disk 
├─mmcblk0p1  179:1    0 213.6M  0 part /boot
└─mmcblk0p2  179:2    0  14.6G  0 part /
mmcblk1      179:32   0  29.1G  0 disk 
├─mmcblk1p1  179:33   0   424M  0 part 
└─mmcblk1p2  179:34   0  28.2G  0 part 
mmcblk1boot0 179:64   0     4M  1 disk 
mmcblk1boot1 179:96   0     4M  1 disk 
zram0        252:0    0   5.4G  0 disk [SWAP]

emmc boot fails with rootfs not found:

[    0.255593] VFS: Cannot open root device "PARTUUID=18230000-02" or unknown-block(0,0): error -6
[    0.258744] Please append a correct "root=" boot option; here are the available partitions:
[    0.267041] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    0.275126] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.16.2-2-MANJARO-ARM-KHADAS #1
[    0.282800] Hardware name: Ugoos AM6 Plus (DT)
[    0.287200] Call trace:
[    0.289613]  dump_backtrace+0x0/0x1d0
[    0.293237]  show_stack+0x18/0x24
[    0.296514]  dump_stack_lvl+0x68/0x84
[    0.300136]  dump_stack+0x18/0x34
[    0.303414]  panic+0x15c/0x32c
[    0.306432]  mount_block_root+0x14c/0x200
[    0.310400]  mount_root+0xa4/0xb4
[    0.313677]  prepare_namespace+0x134/0x174
[    0.317731]  kernel_init_freeable+0x15c/0x188
[    0.322044]  kernel_init+0x28/0x140
[    0.325494]  ret_from_fork+0x10/0x20
[    0.329032] SMP: stopping secondary CPUs
[    0.332917] Kernel Offset: disabled
[    0.336361] CPU features: 0x0,0000c142,00000846
[    0.340846] Memory Limit: none
[    0.343870] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
G12B:BL:6e7c85:2a3b91;FEAT:F0F931B0:412020;POC:F;RCY:0;EMMC:0;READ:0;0.0;0.
bl2_stage_init 0x01

One thing you could try is to boot from emmc try to point root to /dev/mmcblk1p2 instead of partuid and also try the same with label of the partition to see if it boot.

Also a test using boot from sdcard pointing to emmc rootdevice would be interesting

Done. No luck.

Testing it this way as i can always upgrade the uimage of sd card on my x6r host pc.

I am using sdcard. I added rootdelay =10 to bootarg and I can see that the rootdelay in dmesg is added just before HS200. Have you tested booting on EMMC with rootdelay or rootwait args?

1 Like

Just found that latest builds can’t boot from USB OTG drive either (builds with extlinux boot ok), managed to change sdcard links to usb drive root partition and everything works fine, even wifi started to work after updating kernel to 5.16.7-1-MANJARO-ARM-KHADAS

This seem to have fixed the issue of emmc boot. Thanks I will update the boot package for am6 devices.

Hello, are you still active on the forum, I have a few questions for you if so

Yes I’m still here