Mainline u-boot for khadas sbc

mainline u-boot for Khadas VIM and EDGE sbc series

Features

  • universal series for VIM1 VIM2 VIM3 VIM3L EDGE boards
  • mainline u-boot + patches
  • suitable for SPI - SD - MMC
  • spi flash - read / write / bootup / env
  • usb kbd
  • usb storages
  • HDMI output
  • HDMI 4K supported
  • EFI
  • embed LOGO splash - easy customize
  • extra commands like script kbi
  • boot seq SPI => USB => SD => NVME => MMC => PXE => DHCP
  • fully stand-alone
  • embed env suitable for SPI/MMC/SD
  • meta info

DOWNLOADS

3 diff formats *.bin - raw image // *.aml.img - amlogic burn images // *.kresq - krescue images

BUILD from sources

Extra

Special environment Options

no_video - disable video
no_usb   - disable usb
# Activate
setenv no_video yes
setenv no_usb yes
saveenv

# Deactivate
setenv no_video
setenv no_usb
saveenv

Environment location autodetection

  • uboot booted from SPI => Environment use SPI location
  • uboot booted from MMC/SD => Environment use MMC/SD location

Embed Environment VIM

UBOOT_ENV_OFFSET=1228800
UBOOT_ENV_SIZE=0x8000
UBOOT_ENV_SIZE=32768

NOTE: spi/sd/emmc have same env offset and size

Other features

get meta from image file

tail -n18 VIM*.u-boot.sd.bin
tail -n18 VIM*.u-boot.spi.bin

grep -m1 \#\#UBOOT\#\# -B16 /dev/mmcblk1
head -c2m /dev/mmcblk1 | grep -m1 \#\#UBOOT\#\# -B16 # get sd/mmc uboot meta
grep -m1 \#\#UBOOT\#\# -B16 /dev/mtdblock0           # get spi uboot meta

check online meta examples

curl https://dl.khadas.com/Firmware/uboot/mainline/VIM2.u-boot.spi.bin.meta
curl https://github.com/khadas/khadas-uboot/releases/download/0.10/VIM2.u-boot.sd.bin.meta
wget -qO- https://github.com/khadas/khadas-uboot/releases/download/0.10/VIM2.u-boot.spi.bin.meta
curl https://github.com/khadas/khadas-uboot/releases/latest

PXE FDT overlays example usage

FDTOVERLAYS   fdt/ethmac_disable.dtbo fdt/pcie_disable.dtbo fdt/vpu_disable.dtbo
FDTOVERLAYDIR fdt
FDTOVERLAYS   ethmac_disable.dtbo pcie_disable.dtbo vpu_disable.dtbo
FDTOVERLAYS   ethmac_disable pcie_disable vpu_disable
11 Likes

Awesome Work guys, Thanks @hyphop was waiting for this for quite some time now

@Spikerguy, maybe your beloved distro can now take also advantage of this uboot !?

1 Like

Only if it can work without the need of cleaning vendor uboot from the emmc.

So will have to try it first.

i fear that mainline uboot will not be for you because there will only be one uboot on the emmc : either vendor or mainline

this mainline uboot edition have special boot sequence

SPI => USB => SD => NVME => MMC => PXE => DHCP

if u write this u boot to emmc == u can start many OS and distros ( excluded android ) from any external and internal storages by boot sequence prio! without additional manipulation

same u can write this uboot to SD card with your distro
and start system fully from sd (without emmc clean )
by TST mode (tripple press F_KEY) / mask rom mode

  • VIM1 VIM2 Edge - OK
  • this method not work for VIM3 VIM3L (full boot from from sd only if emmc uboot was removed - )

PS: NVME support for mainline uboot not ready for amlogic but for rockhip will be soon (still testing )

another feature is easy custom boot logo

uboot LOGO / SPLASH

uboot LOGO, displayed after uboot activate display

LOGO PATHS

+ MMC|SD /splash.bmp                    (1st partition)
+ MMC|SD /usr/share/fenix/logo/logo.bmp (2nd partition)

INFO

file splash.*
splash.bmp       PC bitmap, Windows 3.x format, 32 bit per pixel (bgra - pixel_format)
splash.bmp.gz    gzip compressed data, was "splash.bmp"

raw bmp and gzipped bmp must have same name splash.bmp or logo.bmp
and same .bmp extension (without .gz)

PACK

gzip -9c splash.raw.bmp > splash.bmp

UNPACK

file splash.bmp | grep gzip \
gzip -dc splash.bmp > splash.raw.bmp

CUSTOMIZE

very easy customize boot LOGO, logo-file is simple BMP file (or gzipped BMP)

2 Likes

@hyphop how do I Implement this in my Ubuntu OS build, I did the 3 commands you listed what to do after that ?

if it mainline ubuntu builded by fenix (this uboot series already integrated to fenix) its very easy

just create /boot/splash.bmp (1st partition)
or edit /usr/share/fenix/logo/logo.bmp (2nd partition )

No no, you got me Wrong i am talking about how to implement mainline uboot in the ubuntu OS what are the steps to implement mainline uboot in my build?

all info was provided in 1st topic :wink:

source , binaries, links , docs , manuals …
plz clarify what are u need … ?

I am trying to build a Ubuntu bionic server image for my VIM3, please tell me the steps I need to execute to build this OS, I have built a few OSes using fenix before, and i have already done the first three steps you have given,

what should be my next step ?
do I run, source env/setenv.sh
and set the same Environment and then run the “make” command ?

no need to make some special in fenix (this uboot already integrated)

just download or upgrade your fenix (sync with our repo before use it)

make configuration like this for example

#KHADAS_BOARD=VIM3
#VENDOR=Amlogic
#CHIP=A311D
#LINUX=mainline
#UBOOT=mainline
#DISTRIBUTION=Ubuntu
#DISTRIB_RELEASE=bionic
#DISTRIB_TYPE=server
#DISTRIB_ARCH=arm64
#INSTALL_TYPE=SD-USB

and start make or make uboot

1 Like

Ok @hyphop thanks so much, what do I do to sync the Repo?

now to sync fenix pero

cd fenix
git pull

Thanks @hyphop will definitely do it and tell you my results :smile:

Good to hear this :slight_smile:

I can give this a try next weekend.
Thanks

I’ve tried to install the VIMx.UBOOT.mainline.emmc.kresq image but it failed according to the screenshot attached. I’ve checked the downloaded image using the Krescue option.
Using VIM3/PRO.
Thanks
Marco

plz update your krescue SD (download latest system https://dl.khadas.com/Firmware/Krescue/dump/ )

PS: i will check tomorrow too maybe i forget update images :wink: