Build Own u-Boot for VIM1 & VIM3

Hello,

I plan to build and maintain uboot(mostly mainline) from source so we can get rid of the android img on the eMMC.

This way I can support new releases of Manjaro Images for these devices.

From @chewitt post here, I understand that there is basic support in Mainline uboot already so this will do for normal Manjaro Users.

Can anyone share a guide on how to build uboot for AML as for rk and sunxi devices we have used ATF.

I have no idea on AML uboot. Please advice.

Thanks.

Hello

I was able to flash Manjaro OS from usb to emmc using install.sh but after reboot is getting stuck at uboot. I have tried all the latest aml scripts.
I have corrected the emmc-autoscript and replaced zImage to Image as we use Image . but uboot is not able to run start_emmc_autoscript automatically

If I run it manually I am able to boot into the emmc OS fine.
Here are the uboot logs
Boot UART: https://pastebin.com/sB31mz6a

printenv : https://pastebin.com/HAZXFNEt

I have used the scripts from here.

Can someone advice on this? I have been trying to get it right since few hours.

Thanks

I’m still learning u-boot things (so not expert) but from the UART output it’s clear you’re still booting from the eMMC device which looks like it has the Khadas (vendor bsp) u-boot installed.

I find it easiest to test u-boot things from SD card, so the first step is to zero the eMMC storage with “dd if=/dev/zero of=/dev/mmcblkX bs=1M” … and now the SoC is forced to check the SD card for your u-boot and scripts, and will boot when it finds them. Once you have everything working from SD card; dd the install image to eMMC and test (again) from there.

NB: The build recipe is documented in u-boot source code, e.g. https://github.com/u-boot/u-boot/blob/v2020.04-rc1/board/amlogic/p212/README.khadas-vim. I haven’t swapped LE to use BL30? from ATF but I know others have done this for other GXL/GXM devices. I haven’t swapped because there is no support in ATF for G12 devices at the moment (and I’m not aware of anyone working on it). Partial coverage complicates distro packaging so I’ve left Amlogic so that all devices use same process. Only Allwinner devices are using ATF in LE.

1 Like

I have done the same. Ive used the libreelc install script which takes backup of the first 4mb of the emmc android and flashes it back to emmc then copies all the boot and root partition to emmc and that way i can run os from. Emmc but only when i make the uboot to run emmc_autoscript manually

I will try renaming the boot scripts maybe its looking for some other name.

Thanks for the response.

LE does not have emmc backup scripts in our codebase so it sounds like you’re using Oleg’s testing images which deviate in several areas. The scripts in the actual LE repo (or my fork, which is still hoarding a bunch of changes I didn’t push yet) are a little more simple.

Yes I think I found my mistake.
After Flashing OS in eMMC I never activated the Multiboot by entering the upgrade mode.

I will try it once again from android img and re-write the script again we all the correct and report back.

Thanks.

UPDATE: Even after trying to activate multi-boot it doesn’t work automatically.

I had to pass these lines to activate multi-boot and set the right env so after that it boots fine directly to the eMMC.

After these it boot automatically but have to manually pass these once in uboot cli. Also It can boot into the USB bootable if inserted.
The above script is already present as aml_autoscript, So I assume BSP uboot is looking for this script with a different name?

Please advice. Thanks.

Update.
I think i understand the concept of multiboot now and i have updated the bootscripts to make correct use of Manjaro kernel Image in boot partition.

But i would like someone to explain how I can make my own uboot with multi boot activated by default.

Please advice.

Thanks.

You can have a look at include/configs/meson64.h (BOOT_TARGET_DEVICES) and include/configs/meson64_android.h (BOOTENV_DEV_SYSTEM and CONFIG_EXTRA_ENV_SETTINGS) in u-boot sources, but the default mainline u-boot configuration already supports booting from SD or USB in addition to eMMC so there’s no need to add multi-boot content. If you’re planning to support direct install on VIM devices (flash u-boot and OS stuff to eMMC) just package for extlinux.conf. Multi-boot (which exploits the Android recovery process in Amlogic BSP sources to make u-boot search for files in more places) is only needed if you also want to support “box” devices that need to continue using the existing vendor u-boot.