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

I added the brcm firmware catalog into the dtbs-share I made. So you could pick the fwfiles you need from there.
I don’t think the es8838 is working with the device tree I made so I removed it from my dtb, but kept the clock.

I cannot find the firmware file in this link.

anything else you shared?

It should be there:
https://drive.google.com/file/d/1i_N_HM8dcmnepfzipInDBDJHigqtv055/view?usp=sharing

1 Like

thx for reply @spikerguy, i’ve changed dtb from meson-sm1-sei610 to meson-g12a-sei510.dtb or x96-max, now device booting & running well.

Using the botoscript method I have no hdmi audio nor wifi using your files.

so now need to compare what you changed in your dts that made it work.

Update:
Fixed HDMI audio with am6-plus.dtb and opened my device to make sure whether I have the same AP6275s wifi chip and it is there but still it doesn’t seem to work.

Update:
Fixed HDMI audio with am6-plus.dtb

Nice that you got the HDMI audio working.
I found that there was something wrong with usb with my dts file so I copied in the usb settings from the original am6 dts. I removed the es8388 and some khadas vim3 stuff. I have now 2 dtb files one with the cpu freq from s922x and one with higher clock based on s922x-j
dtbs am6b 12.01

1 Like

Can you be more specific so I can look into it.
I am trying to find why wifi is not working.

Wifi response:

[spikerguy@spikerguy-pc ~]$ sudo dmesg | grep brcm
[sudo] password for spikerguy: 
[    5.274312] brcmfmac: brcmf_chip_recognition: SB chip is not supported
[    5.275248] brcmfmac: brcmf_sdio_probe_attach: brcmf_chip_attach failed!
[    5.281923] brcmfmac: brcmf_sdio_probe: brcmf_sdio_probe_attach failed
[    5.282008] brcmfmac: brcmf_ops_sdio_probe: F2 error, probe failed -19...
[    5.295164] usbcore: registered new interface driver brcmfmac
[    5.963082] Bluetooth: hci0: BCM4362A2 'brcm/BCM4362A2.hcd' Patch
[spikerguy@spikerguy-pc ~]$ 

Using files from you and also libreelec sdio source.

I used the usb variables from the khadas-vim3. Booting on usb worked ok but if booting from sdcard it didn’t detect the usbdisk that was in the usbslot . Had to take it out and in again to get the disk detected. When using the usb variables for am6.dts the disk is recognized at boottime even wen booting from sdcard.

I don’t know why wifi will not work for you, but for me I get:

    5.869143] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-sdio for chip BCM43752/2
[    5.869475] usbcore: registered new interface driver brcmfmac
[    6.122240] Bluetooth: hci0: BCM4362A2 'brcm/BCM4362A2.hcd' Patch
[    6.281298] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-sdio for chip BCM43752/2
[    6.522104] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43752/2 wl0: Dec  4 2019 01:55:28 version 18.35.387.11 (wlan=r853831) FWID 01-ae9dfd3b

Which USB ? is it the OTG usb ? Do you have something in usb that is stopping it frm booting ?
I cannot understand the use case here. Currently I am typing from Ugoos AM6B Plus.

the wifi6 blob is causing mmc spam

Which kernel are you using ? I am on linux-khadas

Now on linux

[spikerguy@spikerguy-pc ~]$ sudo dmesg | grep brcm
[    4.940356] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-sdio for chip BCM43752/2
[    4.940453] usbcore: registered new interface driver brcmfmac
[    5.324843] Bluetooth: hci0: BCM4362A2 'brcm/BCM4362A2.hcd' Patch
[    6.189383] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[    7.199395] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

Now I will try your files

5.15.11-1-MANJARO-ARM, without problems. I had the same errors when I was using orginal am6.dts files. It was because the HS200 controller wasn’t recognized. I think it was something with max freqency variable was to low. I used the variables from khadad and got HS200 controller recognized and the the error messages was gone

/* eMMC */
&sd_emmc_c {
	status = "okay";
	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
	pinctrl-1 = <&emmc_clk_gate_pins>;
	pinctrl-names = "default", "clk-gate";

	bus-width = <8>;
	cap-mmc-highspeed;
	mmc-ddr-1_8v;
	mmc-hs200-1_8v;
	max-frequency = <200000000>;
	disable-wp;

	mmc-pwrseq = <&emmc_pwrseq>;
	vmmc-supply = <&vcc_3v3>;
	vqmmc-supply = <&emmc_1v8>;
};
1 Like

Yes it if I have a disk in the OTG-port without boot partition or if I have a usb-bootdisk which mount the root partition from sdcard. When the system boots up it will not detect /dev/sda. I have to take out the stick wait and plug it in again to be detected. That was with my old dtb. With my new dtb that works ok

What is the last version that is capable of being installed to the emmc? Or is there a noobs guide for the workaround?

Hello and welcome to the forum,
Which device are you asking about ?

S905, which uses the gxbb_p201 dtb. The latest release boots fine on this box, but I really want to get internal install working again.

Hi, updated guide would be awesome, especially for noobs!
I’m also struggling with running recent builds on my am6+ eMMC (s922xj), sdcard is fine though.
Tried lastest stable (21.12) and dev (Manjaro-ARM-gnome-vim3-20220117).

My steps:

  • Flash image to sdcard, change dtb_name=/dtbs/amlogic/meson-g12b-ugoos-am6-plus.dtb in uEnv.ini
  • Boot from SD card, sync time, run sudo /boot/install-aml-emmc.sh
  • Mount emmc boot, change bootargs root to PARTUUID of eMMC ROOT partition (can be taken from script output). In latest DEV build it’s already correct
    And that gives me just black screen without sdcard, good it still boots from sdcard if inserted

Install script output:

  desperex@ugloos-manjaro  /boot  sudo ./install-aml-emmc.sh
Start script create MBR and filesystem
/dev/mmcblk1
Start backup u-boot default
4+0 records in
4+0 records out
4194304 bytes (4,2 MB, 4,0 MiB) copied, 0,0970369 s, 43,2 MB/s
1+0 records in
1+0 records out
512 bytes copied, 0,000806747 s, 635 kB/s
Start create MBR and partittion
Start restore u-boot
442+0 records in
442+0 records out
442 bytes copied, 0,00882417 s, 50,1 kB/s
8191+0 records in
8191+0 records out
4193792 bytes (4,2 MB, 4,0 MiB) copied, 0,450252 s, 9,3 MB/s
Done
Start copy system for eMMC.
Formatting BOOT partition...mkfs.fat 4.2 (2021-01-31)
done.
Formatting ROOT partition...
/dev/mmcblk1p2 contains a ext4 file system labelled 'ROOT_MNJRO'
last mounted on /ddbr/install on Fri Feb 4 01:38:26 2022
e2fsck 1.46.5 (30-Dec-2021)
ROOT_MNJRO: clean, 11/1851392 files, 160257/7400192 blocks
done.
BOOT PARTITION: /dev/mmcblk1p1
ROOT PARTITION: /dev/mmcblk1p2
BOOT PARTUUID: e9f50000-01
ROOT PARTUUID: e9f50000-02
Copying BOOT...done.
rm: cannot remove '/ddbr/install/boot.ini': No such file or directory
Copying ROOTFS.
Copy BIN
Create DEV
Copy ETC
Copy HOME
Copy LIB
Create MEDIA
Create MNT
Copy OPT
Create PROC
Copy ROOT
Create RUN
Copy SBIN
Copy SELINUX
tar: selinux: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Copy SRV
Create SYS
Create TMP
Copy USR
Copy VAR
tar: var/lib/samba/private/msg.sock/940: socket ignored
tar: var/lib/samba/private/msg.sock/1682: socket ignored
tar: var/lib/samba/private/msg.sock/912: socket ignored
tar: var/lib/samba/private/msg.sock/911: socket ignored
tar: var/lib/samba/private/msg.sock/1277: socket ignored
tar: var/lib/samba/private/msg.sock/909: socket ignored
tar: var/lib/samba/private/msg.sock/915: socket ignored
tar: var/lib/samba/private/msg.sock/1681: socket ignored
tar: var/lib/samba/private/msg.sock/941: socket ignored
tar: var/lib/samba/private/msg.sock/908: socket ignored
tar: var/lib/samba/private/msg.sock/1500: socket ignored
tar: var/lib/samba/private/msg.sock/907: socket ignored
rm: cannot remove '/ddbr/install/usr/bin/ddbr': No such file or directory
*******************************************
Flasing Manjaro to eMMC Completed
Please Restart and Re-Activate the Multi-Boot
*******************************************

eMMC boot directory listing
dtbs --dir–
emmc_autoscript
emmc_autoscript.cmd
Image
initramfs-linux.img
install-aml-emmc.sh
u-boot-default-aml.img
uEnv.ini
uImage
uInitrd

My doubts and questions:

  • Do I need to do anything with the box before flashing? Installing particular firmware or version?
  • Is there a requirement to be on dual boot firmware? I planned to replace stock android with manjaro…
  • When installation script has finished, I’ve checked /etc/fstab on eMMC and it had root partition linked to sdcard, changed it to emmc root, but it didn’t help either…

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.