Manjaro ARM for the VIM3

This is a good news for aml device users.
https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.7-Media-Updates

Can’t wait for bifrost support in panfrost. :star_struck:

1 Like

NB: The “HEVC” code that was merged for Linux 5.7 is some common code shared between the VP9 and HEVC drivers. VP9 is now merged. HEVC is still in development. The commit messages for the common code are misleading unless you kmow the details.

3 Likes

UPDATE
Recently Updated boot-vim3 package which can help fixing the green screen issue.
For those who would like to try Manjaro on their Vim3.

Please download and install the latest boot-vim3 package version=2020.04-1 from unstable branch. Run this command.
sudo pacman -U https://www.uex.dk/public/manjaro/arm-unstable/core/aarch64/boot-vim3-2020.04-1-aarch64.pkg.tar.xz
It has all the required files just make sure of the following points:

  • Just verify that ROOT= in uEnv.ini should be ROOT_MNJRO
  • If booting from SD Card rename u-boot.sd to u-boot.ext
  • If booting from USB Drive rename u-boot.usb to u-boot.ext

I have tested it myself and it fixes the green screen issue on latest android images.

All the above is a re-use of @balbes150 work.

Thank You.

3 Likes

Hi,
unfortunatelly i did not read your last post, did the upgrade sudo pacman -Syyu on my Manjaro VIM3 system yesterday and did not check uEnv.ini. System did not boot again.

I decided to try fresh image of 2020.04 from SD (first boot with green issue), after installing boot-vim3-2020.04-1 colours are OK now.

Now I will try to install it on eMMC.

Martin

1 Like

Which os do you have on emmc?

Until yesterday I had Manjaro on my emmc installed from krescue (now it is not available in krescue anymore). After corrupting boot process by updating packages yesterday I wanted to install fresh Manjaro 20.04.
I burned SD image, booted SD, updated SD installation with new boot-vim3-2020.04-1 for correcting colours.
I tried to copy ROOT_MNJRO from SD partition to ROOT_MNJRO on EMMC, but I stuck with BOOT partition somehow.
Tried to search the solution on forums, but could not make the EMMC bootable. ARM/AMLOGIC boot process is a bit complicated for me.
Now I had to temporarily flash Ubuntu over USB cable.
But I am still trying to bring my favourite distro - Manjaro - back to emmc.

You cannot do that so easily due to the uboot issues.

Please flash latest android img to eMMC using the burning tool and then flash the latest Manjaro 20.04 img from manjaro forum link to sd card. Then i will build a new boot package with install script. And share with you but I need to confirm it works on every try. Other wise it will have a bricked device.

I had that working long back but now I plan to make it publicly available to everyone.

Thanks for your support.

1 Like

I have flashed latest Android to eMMC and have functional SD Manjaro 20.04.
I appreciate your help.
Thank you very much
Martin

1 Like

Good please use ur like this for sometime until i test the script out its late here I have the img ready but will have to test it tomorrow.

@Spikerguy I’m in the same boat as @Martin_B, wanted to try out kernel 5.7rc2, but the new boot-vim3 made my emmc install unbootable. I noticed /boot/boot.cmd would overwrite the one written by @hyphop, but even restoring his doesn’t make it boot.

Is there any way to make it bootable again? I can chroot into the system just fine with krescue. Don’t really want to reinstall everything, and I don’t have an SD card to spare atm.

Yes you change make it boot again but just correcting the dtb name in uEnv.ini file it must have changed to vim1 instead of vim3.
Please change the exact vim3 dtb file name from /dtbs/amlogic directory.

Once you boot into manjaro then you will have to remove the boot-vim1 with this command
sudo pacman -R boot-vim1
And then install boot-vim3 using this command
sudo pacman -S boot-vim3

Try it and let me know.

1 Like

I already had the correct dtb, and boot-vim3 installed instead of boot-vim1, had to fix that a while back. I don’t know anything about uboot unfortunately. As a shot in the dark I tried copying all the boot-emmc file over the regular boot files, but it didn’t work.

If the system starts from an SD card, it is very easy to create install script in eMMC (literally it takes 5 minutes). Write to PM, I’ll tell you how.

I guess I should copy ROOT_MNJRO from SD to eMMC ROOT partition, then to add kernel to BOOT partition on eMMC and change script files to boot the new kernel.
But I am confused from ARM booting stages and different u-boot versions with config script files different fromversion to version.
I spent hours reading armbian and ondroid.net forums and tutorials - how to install on emmc.
I am still not sure what are the correct steps to install manjaro from sd over existing android on emmc on VIM3, what makes emmc booting on VIM3 different from SD booting.
Would you as an expert briefly summarize the key steps for VIM3 - some tips and tricks and pitfalls please? I will then try to write the script.
Thank you
Martin

I am using the latest install script from armbian and added it to the boot-vim3 package for users who wants to install manjaro on emmc. Is there anything else? I’ve tested that before and it worked fine.

I have tried install-aml-emmc.sh script from boot-vim3 package and the system did not start.
I attached USB-serial to my PC and saved the log.
there are many lines like this:

Cannot find dev.
amlmmc cmd <NULL> failed
store - STORE sub-system
Usage:
store init flag

and then

** Unable to read file /boot.ini **
cfgload: no /boot.ini or empty file on mmc 1:1

strange, while there is boot.ini file in boot-vim3 package.
So I have copied boot-emmc.ini to boot.ini, but no success again:

cfgload: reading /boot.ini from mmc 1:1 ...
reading /boot.ini
562 bytes read in 2 ms (274.4 KiB/s)
cfgload: MAGIC NAME, KHADAS-UBOOT-CONFIG, is not found!!

any idea what’s wrong?

my u-boot is
U-Boot 2015.01-g4752efb (Mar 19 2020 - 11:49:51)

Martin

Did you run the command using root access?

Flash Android on the emmc using burning tool and then run manjaro from sd card and run the command again with root access.

Please make sure the time is correct on the system when you run the command.

Also please get the output of the script after you run it.
That way I can understand what commands were successfully and which ones failed.

Wait did you enable the multiboot after running the script?
After running the script shut down the device, and keep the sdcard inserted and enable multiboot.

Let it boot on sd card once and then shutdown and remove the sd card this time the device should be able to boot from emmc.

Of course I run the command with sudo.
I was able to boot from SD, so I flashed U-Boot 2020.01-rc5 (Mar 12 2020 - 13:37:56 +0900) khadas-vim3 over Krescue, booted Manjaro from SD, run
sudo ./install-aml-emmc.sh
with this output:

output
Start script create MBR and filesystem
/dev/mmcblk2
Start backup u-boot default
4+0 záznamů přečteno
4+0 záznamů zapsáno
4194304 bajtů (4,2 MB, 4,0 MiB) zkopírováno, 0,0513184 s, 81,7 MB/s
Start create MBR and partittion
Varování: The resulting partition is not properly aligned for best performance: 62500s % 2048s != 0s
Varování: The resulting partition is not properly aligned for best performance: 500001s % 2048s != 0s
Start restore u-boot
442+0 záznamů přečteno
442+0 záznamů zapsáno
442 bajtů zkopírováno, 0,00452121 s, 97,8 kB/s
8191+0 záznamů přečteno
8191+0 záznamů zapsáno
4193792 bajtů (4,2 MB, 4,0 MiB) zkopírováno, 0,370852 s, 11,3 MB/s
Done
Start copy system for eMMC.
Formatting BOOT partition...mkfs.fat 4.1 (2017-01-24)
done.
Copying BOOT...done.
Formatting ROOT partition...
/dev/mmcblk2p2 obsahuje systém souborů ext4 se jmenovkou „ROOT“
	last mounted on /ddbr/install on Fri Apr 24 21:46:51 2020
e2fsck 1.45.6 (20-Mar-2020)
ROOT_MNJRO: čistý, 11/1893120 souborů, 162877/7571419 bloků
done.
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 SRV
Create SYS
Create TMP
Copy USR
Copy VAR
tar: var/lib/samba/private/msg.sock/1295: soket ignorován
tar: var/lib/samba/private/msg.sock/790: soket ignorován
tar: var/lib/samba/private/msg.sock/1258: soket ignorován
tar: var/lib/samba/private/msg.sock/1298: soket ignorován
tar: var/lib/samba/private/msg.sock/733: soket ignorován
tar: var/lib/samba/private/msg.sock/1293: soket ignorován
tar: var/lib/samba/private/msg.sock/1296: soket ignorován
tar: var/lib/samba/private/msg.sock/789: soket ignorován
Copying fstab
*******************************************
Complete copy OS to eMMC 
******************************************

After that I checked boot partition on emmc and boot.ini was missing again, because install-aml-emms.sh contains this:

echo -n "Copying BOOT..."
cp -r /boot/* $DIR_INSTALL && sync
echo "done."

rm $DIR_INSTALL/s9*
rm $DIR_INSTALL/aml*
rm $DIR_INSTALL/boot.ini

umount $DIR_INSTALL

So I copied it to boot partition of emmc from boot-vim3 package, rebooted with SD inserted - normal boot to SD Manjaro, tehn shutdown, removed SD and power on again
This is the serial debug output:

serial log

G12B:BL:6e7c85:2a3b91;FEAT:E0F83180:402000;POC:F;RCY:0;EMMC:0;READ:0;0.
bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

L0:00000000
L1:20000703
L2:00008067
L3:14000000
B2:00402000
B1:e0f83180

TE: 189511

BL2 Built : 15:22:05, Aug 28 2019. g12b g1bf2b53 - luan.yuan@droid15-sz

Board ID = 8
Set A53 clk to 24M
Set A73 clk to 24M
Set clk81 to 24M
A53 clk: 1200 MHz
A73 clk: 1200 MHz
CLK81: 166.6M
smccc: 00032c24
eMMC boot @ 0
sw8 s
DDR driver_vesion: LPDDR4_PHY_V_0_1_18 build time: Aug 28 2019 15:22:01
board id: 8
Load FIP HDR from eMMC, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0
fw parse done
Load ddrfw from eMMC, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0
Load ddrfw from eMMC, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0
PIEI prepare done
fastboot data load
00000000
emmc switch 1 ok
ddr saved addr:00016000
Load ddr parameter from eMMC, src: 0x02c00000, des: 0xfffd0000, size: 0x00001000, part: 0
00000000
emmc switch 0 ok
fastboot data verify
verify result: 266
Cfg max: 4, cur: 1. Board id: 255. Force loop cfg
LPDDR4 probe
ddr clk to 1608MHz
Load ddrfw from eMMC, src: 0x0003c200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0001
Check phy result
INFO : End of CA training
INFO : End of initialization
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of Write leveling coarse delay
INFO : Training has run successfully!
Check phy result
INFO : End of initialization
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from eMMC, src: 0x00048200, des: 0xfffd0000, size: 0x0000c000, part: 0
Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

channel==0
RxClkDly_Margin_A0==87 ps 9
TxDqDly_Margin_A0==97 ps 10
RxClkDly_Margin_A1==87 ps 9
TxDqDly_Margin_A1==87 ps 9
TrainedVREFDQ_A0==26
TrainedVREFDQ_A1==26
VrefDac_Margin_A0==29
DeviceVref_Margin_A0==26
VrefDac_Margin_A1==28
DeviceVref_Margin_A1==26

channel==1
RxClkDly_Margin_A0==87 ps 9
TxDqDly_Margin_A0==97 ps 10
RxClkDly_Margin_A1==106 ps 11
TxDqDly_Margin_A1==106 ps 11
TrainedVREFDQ_A0==24
TrainedVREFDQ_A1==24
VrefDac_Margin_A0==26
DeviceVref_Margin_A0==24
VrefDac_Margin_A1==28
DeviceVref_Margin_A1==24

dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0004

soc_vref_reg_value 0x 00000029 00000027 00000026 00000025 00000026 00000026 00000027 00000025 00000027 00000025 00000024 00000026 00000027 00000026 00000024 00000025 00000028 00000026 00000026 00000026 00000025 00000027 00000027 00000025 00000025 00000027 00000027 00000027 00000026 00000024 00000025 00000028 dram_vref_reg_value 0x 00000012
2D training succeed
aml_ddr_fw_vesion: LPDDR4_PHY_V_0_1_18 build time: Aug 28 2019 13:54:19
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 2048MB
DMC_DDR_CTRL: 00e00024DDR size: 3928MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass

100bdlr_step_size ps== 464
result report
boot times 0Enable ddr reg access
00000000
emmc switch 3 ok
Authentication key not yet programmed
get rpmb counter error 0x00000007
00000000
emmc switch 0 ok
Load FIP HDR from eMMC, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0
Load BL3X from eMMC, src: 0x00078200, des: 0x01768000, size: 0x00090000, part: 0
0.0;M3 CHK:0;cm4_sp_mode 0
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12b_v1.1.3390-6ac5299 2019-09-26 14:10:05 luan.yuan@droid15-sz]
OPS=0x10
ring efuse init
chipver efuse init
29 0b 10 00 01 19 25 00 00 02 37 30 4e 42 4e 50
[0.018961 Inits done]
secure task start!
high task start!
low task start!
run into bl31
NOTICE: BL31: v1.3(release):4fc40b1
NOTICE: BL31: Built : 15:58:17, May 22 2019
NOTICE: BL31: G12A normal boot!
NOTICE: BL31: BL33 decompress pass
ERROR: Error initializing runtime service opteed_fast

U-Boot 2020.01-rc5 (Mar 12 2020 - 13:37:56 +0900) khadas-vim3

Model: Khadas VIM3
SoC: Amlogic Meson G12B (A311D) Revision 29:b (10:2)
DRAM: 3.8 GiB
MMC: sd@ffe03000: 0, sd@ffe05000: 1, mmc@ffe07000: 2
Loading Environment from FAT… booted from emmc…OK
In: serial@3000
Out: serial@3000
Err: serial@3000
Net: eth0: ethernet@ff3f0000
Hit any key to stop autoboot: 0
Card did not respond to voltage select!
Card did not respond to voltage select!
switch to partitions #0, OK
mmc2(part 0) is current device
Scanning mmc 2:1…
Found U-Boot script /boot.cmd
840 bytes read in 1 ms (820.3 KiB/s)

Script run a:08000000 l:812 c:0

Card did not respond to voltage select!
SCRIPT FAILED: continuing…
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
Card did not respond to voltage select!
starting USB…
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices… 2 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found

Device 0: unknown device
ethernet@ff3f0000 Waiting for PHY auto negotiation to complete…

it allways fails with this:

Found U-Boot script /boot.ini 
840 bytes read in 1 ms (820.3 KiB/s)
Script run a:08000000 l:812 c:0
Card did not respond to voltage select!
SCRIPT FAILED: continuing...

when SD card with Krescue img is inserted, it boots Krsescue OK from SD.

You’re not following the steps I’ve mentioned above, the script needs Android on emmc where it takes backup of android uboot and flash it back to the emmc after formatting the whole emmc.

While you’re trying it with mainline uboot so it will never work as both are using different scripts.

Please follow the steps mentioned in my previous post.
Without that I won’t be able to help you much as for what i have tested I can help.

These lines were commented out afair. Please comment them out.

This is your mistake. EMMC must have the standard Android firmware (as the device is manufactured from the factory). There should be no other systems in eMMC. When you make all sorts of strange steps (recording other u-boot and so on), you break the entire system and no one will be engaged in tracking such eMMC States, which would pick out various errors of extraneous systems.

Restore the regular Android firmware (use only Android, no other systems should be used) using the USB Burn Tool (use only this tool, because only it guarantees the correct content of the eMMC). And then perform the activation of multi-loading using the latest Armbian\LE scripts (maybe Manjaro also has new scripts, but I’m not sure). And perform the installation. If this doesn’t work, show the full UART log, and I’ll see what the error might be.