Instruction of how to fix 2 seconds delay at boot and not working reboot

I was looking for environment that helps me to edit/compile U-boot loader to disable 2 seconds delay at boot time…Cuz I’m completely new to some kernel editing stuff. So I create it and sharing with you guys))) + Bonus is that now $ reboot stuck bug is fixed by created boot-loader and board can reboot as expected :+1:
The Official instruction doesn’t work for me (there were many errors on different stages) but you should read it to understand the process and where most files and commands were taken. Without this instruction I had 0 chances to create the environment so I want to thank the Radxa developers!

Download Debian ISO. File.

While downloading Debian ISO install VirtualBox. File.

Install Debian on VirtualBox (before install make shure you set option Bridged adapter for Adapter 1 This will give you direct IP of Debian SSH) When on installing process create user pol. All commands path are with pol name in (ex. /home/pol/fip/radxa-zero/).
Use any instruction if needed ex. video
UPD: Be careful - building kernel uses lot of resources (use minimum 15GB virtual HDD space, 2-3GB RAM and as many CPU cores as you can).

To enable SSH on Debian after installing:

sudo su
apt install net-tools
apt-get install openssh-server

Use

$ ifconfig -a

to find out IP of Debian host and you are good to make SSH connection directly from any SSH client you prefer.
Now get all necessary packages:

apt-get update && apt-get upgrade
apt-get install -y wget
apt install bc nano mc build-essential autoconf libtool cmake pkg-config git python-dev swig libpcre3-dev libnode-dev gawk wget diffstat bison flex device-tree-compiler libncurses5-dev gcc-aarch64-linux-gnu g+±aarch64-linux-gnu binfmt-support
apt-get install binfmt-support qemu-user-static
apt-get update && sudo apt-get install -y git
git clone -b radxa-zero-v2021.07 https://github.com/radxa/u-boot.git
git clone https://github.com/radxa/fip.git
apt-get install -y gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev
apt-get install -y bc python dosfstools flex build-essential libssl-dev mtools
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
tar xvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz -C /opt
apt-get install gcc-arm-linux-gnueabihf
apt install fastboot
apt-get install -y python3-pip
pip3 install git+https://github.com/superna9999/pyamlboot

Now its time to do some cool hacking))
To edit delay time U-boot Enairment variable are used. Link.
Set bootdelay variable to -2 to boot without delay and not check for abort.
Lets do it:

nano “/home/rock/u-boot/configs/radxa-zero_defconfig”

Add line
CONFIG_BOOTDELAY=-2
before line
#CONFIG_DISPLAY_CPUINFO is not set
Then close nano with saving changes.

And here comes the compiling parts:

cd u-boot
export ARCH=arm
export CROSS_COMPILE=aarch64-linux-gnu-
make radxa-zero_defconfig
make

Then create binaries:

cp u-boot.bin …/fip/radxa-zero/bl33.bin
cd …/fip/radxa-zero
make

Output
root@debian:/home/pol/u-boot# export ARCH=arm
export CROSS_COMPILE=aarch64-linux-gnu-
root@debian:/home/pol/u-boot# make
scripts/kconfig/conf  --syncconfig Kconfig
  CFG     u-boot.cfg
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  UPD     include/generated/version_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CC      lib/asm-offsets.s
  UPD     include/generated/generic-asm-offsets.h
  CC      arch/arm/lib/asm-offsets.s
  UPD     include/generated/asm-offsets.h
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  LEX     scripts/dtc/dtc-lexer.lex.c
  YACC    scripts/dtc/dtc-parser.tab.h
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  YACC    scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/dtc/dtc
  HOSTCC  tools/gen_eth_addr
  HOSTCC  tools/gen_ethaddr_crc.o
  WRAP    tools/lib/crc8.c
  HOSTCC  tools/lib/crc8.o
  HOSTLD  tools/gen_ethaddr_crc
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/os_support.o
  WRAP    tools/lib/crc32.c
  HOSTCC  tools/lib/crc32.o
  HOSTLD  tools/mkenvimage
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/atmelimage.o
  WRAP    tools/common/fdt_region.c
  HOSTCC  tools/common/fdt_region.o
  WRAP    tools/common/bootm.c
  HOSTCC  tools/common/bootm.o
  HOSTCC  tools/default_image.o
  WRAP    tools/lib/fdtdec_common.c
  HOSTCC  tools/lib/fdtdec_common.o
  WRAP    tools/lib/fdtdec.c
  HOSTCC  tools/lib/fdtdec.o
  WRAP    tools/common/image.c
  HOSTCC  tools/common/image.o
  HOSTCC  tools/imagetool.o
  HOSTCC  tools/imximage.o
  HOSTCC  tools/imx8image.o
  HOSTCC  tools/imx8mimage.o
  HOSTCC  tools/kwbimage.o
  WRAP    tools/lib/md5.c
  HOSTCC  tools/lib/md5.o
  HOSTCC  tools/lpc32xximage.o
  HOSTCC  tools/mxsimage.o
  HOSTCC  tools/omapimage.o
  HOSTCC  tools/pblimage.o
  HOSTCC  tools/pbl_crc32.o
  HOSTCC  tools/vybridimage.o
  HOSTCC  tools/stm32image.o
  WRAP    tools/lib/rc4.c
  HOSTCC  tools/lib/rc4.o
  HOSTCC  tools/rkcommon.o
  HOSTCC  tools/rkimage.o
  HOSTCC  tools/rksd.o
  HOSTCC  tools/rkspi.o
  HOSTCC  tools/socfpgaimage.o
  HOSTCC  tools/sunxi_egon.o
  WRAP    tools/lib/crc16.c
  HOSTCC  tools/lib/crc16.o
  WRAP    tools/lib/hash-checksum.c
  HOSTCC  tools/lib/hash-checksum.o
  WRAP    tools/lib/sha1.c
  HOSTCC  tools/lib/sha1.o
  WRAP    tools/lib/sha256.c
  HOSTCC  tools/lib/sha256.o
  WRAP    tools/lib/sha512.c
  HOSTCC  tools/lib/sha512.o
  WRAP    tools/common/hash.c
  HOSTCC  tools/common/hash.o
  HOSTCC  tools/ublimage.o
  HOSTCC  tools/zynqimage.o
  HOSTCC  tools/zynqmpimage.o
  HOSTCC  tools/zynqmpbif.o
  HOSTCC  tools/libfdt/fdt.o
  HOSTCC  tools/libfdt/fdt_ro.o
  HOSTCC  tools/libfdt/fdt_wip.o
  HOSTCC  tools/libfdt/fdt_sw.o
  HOSTCC  tools/libfdt/fdt_rw.o
  HOSTCC  tools/libfdt/fdt_strerror.o
  HOSTCC  tools/libfdt/fdt_empty_tree.o
  HOSTCC  tools/libfdt/fdt_addresses.o
  HOSTCC  tools/libfdt/fdt_overlay.o
  HOSTCC  tools/gpimage.o
  HOSTCC  tools/gpimage-common.o
  HOSTCC  tools/mtk_image.o
  HOSTCC  tools/dumpimage.o
  HOSTLD  tools/dumpimage
  HOSTCC  tools/mkimage.o
  HOSTLD  tools/mkimage
  HOSTCC  tools/proftool
  HOSTCC  tools/relocate-rela
  HOSTCC  tools/fdtgrep.o
  HOSTLD  tools/fdtgrep
  HOSTCC  tools/spl_size_limit
  AR      arch/arm/cpu/built-in.o
  CC      arch/arm/cpu/armv8/cpu.o
  CC      arch/arm/cpu/armv8/generic_timer.o
  CC      arch/arm/cpu/armv8/cache_v8.o
  AS      arch/arm/cpu/armv8/cache.o
  AS      arch/arm/cpu/armv8/exceptions.o
  CC      arch/arm/cpu/armv8/exception_level.o
  AS      arch/arm/cpu/armv8/tlb.o
  AS      arch/arm/cpu/armv8/transition.o
  CC      arch/arm/cpu/armv8/fwcall.o
  CC      arch/arm/cpu/armv8/cpu-dt.o
  AS      arch/arm/cpu/armv8/smccc-call.o
  AR      arch/arm/cpu/armv8/built-in.o
  AS      arch/arm/cpu/armv8/start.o
  AS      arch/arm/lib/crt0_64.o
  AS      arch/arm/lib/setjmp_aarch64.o
  AS      arch/arm/lib/relocate_64.o
  CC      arch/arm/lib/bootm-fdt.o
  CC      arch/arm/lib/bootm.o
  CC      arch/arm/lib/image.o
  CC      arch/arm/lib/bdinfo.o
  CC      arch/arm/lib/sections.o
  CC      arch/arm/lib/stack.o
  CC      arch/arm/lib/interrupts_64.o
  CC      arch/arm/lib/reset.o
  CC      arch/arm/lib/cache.o
  CC      arch/arm/lib/psci-dt.o
  AR      arch/arm/lib/built-in.o
  AR      arch/arm/lib/lib.a
  AS      arch/arm/lib/crt0_aarch64_efi.o
  CC      arch/arm/lib/reloc_aarch64_efi.o
  CC      arch/arm/mach-meson/board-common.o
  CC      arch/arm/mach-meson/sm.o
  CC      arch/arm/mach-meson/board-info.o
  CC      arch/arm/mach-meson/board-g12a.o
  AR      arch/arm/mach-meson/built-in.o
  CC      board/amlogic/u200/u200.o
  AR      board/amlogic/u200/built-in.o
  AR      cmd/arm/built-in.o
  CC      cmd/boot.o
  CC      cmd/bootm.o
  CC      cmd/help.o
  CC      cmd/panic.o
  CC      cmd/version.o
  CC      cmd/blk_common.o
  CC      cmd/source.o
  CC      cmd/blkcache.o
  CC      cmd/bootefi.o
  CC      cmd/booti.o
  CC      cmd/console.o
  CC      cmd/dm.o
  CC      cmd/echo.o
  CC      cmd/elf.o
  CC      cmd/exit.o
  CC      cmd/ext4.o
  CC      cmd/ext2.o
  CC      cmd/fat.o
  CC      cmd/fdt.o
  CC      cmd/flash.o
  CC      cmd/fs.o
  CC      cmd/gpio.o
  CC      cmd/itest.o
  CC      cmd/load.o
  CC      cmd/mem.o
  CC      cmd/mii.o
  CC      cmd/sleep.o
  CC      cmd/mmc.o
  CC      cmd/net.o
  CC      cmd/part.o
  CC      cmd/pinmux.o
  CC      cmd/pxe.o
  CC      cmd/pxe_utils.o
  CC      cmd/sysboot.o
  CC      cmd/test.o
  CC      cmd/unlz4.o
  CC      cmd/unzip.o
  CC      cmd/lzmadec.o
  CC      cmd/usb.o
  CC      cmd/disk.o
  CC      cmd/usb_mass_storage.o
  CC      cmd/ximg.o
  CC      cmd/regulator.o
  CC      cmd/nvedit.o
  AR      cmd/built-in.o
  CC      common/init/board_init.o
  AR      common/init/built-in.o
  CC      common/main.o
  CC      common/exports.o
  CC      common/hash.o
  CC      common/cli_hush.o
  CC      common/autoboot.o
  CC      common/board_f.o
  CC      common/board_r.o
  CC      common/board_info.o
  CC      common/bootm.o
  CC      common/bootm_os.o
  CC      common/fdt_support.o
  CC      common/miiphyutil.o
  CC      common/usb.o
  CC      common/usb_hub.o
  CC      common/usb_storage.o
  CC      common/iomux.o
  CC      common/edid.o
  CC      common/splash.o
  CC      common/menu.o
  CC      common/usb_kbd.o
  CC      common/cli_readline.o
  CC      common/cli_simple.o
  CC      common/console.o
  CC      common/dlmalloc.o
  CC      common/malloc_simple.o
  CC      common/image.o
  CC      common/image-fdt.o
  CC      common/memsize.o
  CC      common/stdio.o
  CC      common/cli.o
  CC      common/command.o
  CC      common/s_record.o
  CC      common/xyzModem.o
  AR      common/built-in.o
  CC      disk/part.o
  CC      disk/part_dos.o
  CC      disk/part_iso.o
  CC      disk/part_efi.o
  AR      disk/built-in.o
  AR      drivers/adc/built-in.o
  AR      drivers/ata/built-in.o
  AR      drivers/axi/built-in.o
  CC      drivers/block/blk-uclass.o
  CC      drivers/block/blkcache.o
  AR      drivers/block/built-in.o
  AR      drivers/bus/built-in.o
  AR      drivers/cache/built-in.o
  AR      drivers/clk/analogbits/built-in.o
  AR      drivers/clk/imx/built-in.o
  CC      drivers/clk/meson/g12a.o
  CC      drivers/clk/meson/g12a-ao.o
  AR      drivers/clk/meson/built-in.o
  AR      drivers/clk/tegra/built-in.o
  AR      drivers/clk/ti/built-in.o
  CC      drivers/clk/clk-uclass.o
  CC      drivers/clk/clk_fixed_rate.o
  CC      drivers/clk/clk_fixed_factor.o
  AR      drivers/clk/built-in.o
  CC      drivers/core/device.o
  CC      drivers/core/fdtaddr.o
  CC      drivers/core/lists.o
  CC      drivers/core/root.o
  CC      drivers/core/uclass.o
  CC      drivers/core/util.o
  CC      drivers/core/device-remove.o
  CC      drivers/core/simple-bus.o
  CC      drivers/core/dump.o
  CC      drivers/core/regmap.o
  CC      drivers/core/syscon-uclass.o
  CC      drivers/core/of_extra.o
  CC      drivers/core/ofnode.o
  CC      drivers/core/read_extra.o
  AR      drivers/core/built-in.o
  CC      drivers/crypto/fsl/sec.o
  AR      drivers/crypto/fsl/built-in.o
  AR      drivers/crypto/rsa_mod_exp/built-in.o
  AR      drivers/crypto/built-in.o
  AR      drivers/dfu/built-in.o
  CC      drivers/firmware/firmware-uclass.o
  CC      drivers/firmware/psci.o
  AR      drivers/firmware/built-in.o
  CC      drivers/input/key_matrix.o
  CC      drivers/input/input.o
  CC      drivers/input/keyboard-uclass.o
  AR      drivers/input/built-in.o
  AR      drivers/mailbox/built-in.o
  AR      drivers/memory/built-in.o
  CC      drivers/misc/pwrseq-uclass.o
  AR      drivers/misc/built-in.o
  CC      drivers/mmc/mmc.o
  CC      drivers/mmc/mmc-uclass.o
  CC      drivers/mmc/mmc_write.o
  CC      drivers/mmc/mmc-pwrseq.o
  CC      drivers/mmc/meson_gx_mmc.o
  AR      drivers/mmc/built-in.o
  AR      drivers/mtd/nand/built-in.o
  AR      drivers/mtd/onenand/built-in.o
  AR      drivers/mtd/spi/built-in.o
  CC      drivers/mtd/mtdcore.o
  CC      drivers/mtd/mtd_uboot.o
  CC      drivers/mtd/mtd-uclass.o
  AR      drivers/mtd/mtd.o
  AR      drivers/mtd/built-in.o
  CC      drivers/phy/phy-uclass.o
  CC      drivers/phy/meson-g12a-usb2.o
  CC      drivers/phy/meson-g12a-usb3-pcie.o
  AR      drivers/phy/built-in.o
  AR      drivers/phy/allwinner/built-in.o
  AR      drivers/phy/marvell/built-in.o
  AR      drivers/phy/rockchip/built-in.o
  AR      drivers/pinctrl/broadcom/built-in.o
  CC      drivers/pinctrl/meson/pinctrl-meson.o
  CC      drivers/pinctrl/meson/pinctrl-meson-axg-pmx.o
  CC      drivers/pinctrl/meson/pinctrl-meson-g12a.o
  AR      drivers/pinctrl/meson/built-in.o
  AR      drivers/pinctrl/nxp/built-in.o
  CC      drivers/pinctrl/pinctrl-uclass.o
  CC      drivers/pinctrl/pinctrl-generic.o
  AR      drivers/pinctrl/built-in.o
  AR      drivers/pwm/built-in.o
  CC      drivers/reset/reset-uclass.o
  CC      drivers/reset/reset-meson.o
  AR      drivers/reset/built-in.o
  CC      drivers/rng/rng-uclass.o
  CC      drivers/rng/meson-rng.o
  AR      drivers/rng/built-in.o
  CC      drivers/rtc/rtc-lib.o
  AR      drivers/rtc/built-in.o
  AR      drivers/scsi/built-in.o
  AR      drivers/smem/built-in.o
  AR      drivers/soc/built-in.o
  AR      drivers/sound/built-in.o
  AR      drivers/spmi/built-in.o
  AR      drivers/thermal/built-in.o
  AR      drivers/ufs/built-in.o
  AR      drivers/video/bridge/built-in.o
  CC      drivers/video/meson/meson_vpu.o
  CC      drivers/video/meson/meson_vpu_init.o
  CC      drivers/video/meson/meson_canvas.o
  CC      drivers/video/meson/meson_plane.o
  CC      drivers/video/meson/meson_venc.o
  CC      drivers/video/meson/meson_vclk.o
  CC      drivers/video/meson/meson_dw_hdmi.o
  CC      drivers/video/meson/simplefb_common.o
  CC      drivers/video/meson/../dw_hdmi.o
  AR      drivers/video/meson/built-in.o
  AR      drivers/video/sunxi/built-in.o
  AR      drivers/video/ti/built-in.o
  CC      drivers/video/backlight-uclass.o
  CC      drivers/video/console_normal.o
  CC      drivers/video/display-uclass.o
  CC      drivers/video/video-uclass.o
  CC      drivers/video/vidconsole-uclass.o
  CC      drivers/video/video_bmp.o
  CC      drivers/video/panel-uclass.o
  CC      drivers/video/simple_panel.o
  AR      drivers/video/built-in.o
  AR      drivers/watchdog/built-in.o
  AR      drivers/built-in.o
  AR      drivers/dma/ti/built-in.o
  AR      drivers/dma/built-in.o
  CC      drivers/gpio/gpio-uclass.o
  AR      drivers/gpio/built-in.o
  AR      drivers/i2c/built-in.o
  AR      drivers/net/mscc_eswitch/built-in.o
  AR      drivers/net/qe/built-in.o
  AR      drivers/net/ti/built-in.o
  AR      drivers/net/built-in.o
  AR      drivers/net/phy/built-in.o
  AR      drivers/power/built-in.o
  AR      drivers/power/battery/built-in.o
  CC      drivers/power/domain/power-domain-uclass.o
  CC      drivers/power/domain/meson-ee-pwrc.o
  AR      drivers/power/domain/built-in.o
  AR      drivers/power/fuel_gauge/built-in.o
  AR      drivers/power/mfd/built-in.o
  AR      drivers/power/pmic/built-in.o
  CC      drivers/power/regulator/regulator-uclass.o
  CC      drivers/power/regulator/regulator_common.o
  CC      drivers/power/regulator/fixed.o
  AR      drivers/power/regulator/built-in.o
  CC      drivers/serial/serial-uclass.o
  CC      drivers/serial/serial_meson.o
  AR      drivers/serial/built-in.o
  CC      drivers/spi/spi.o
  AR      drivers/spi/built-in.o
  AR      drivers/usb/cdns3/built-in.o
  CC      drivers/usb/common/common.o
  AR      drivers/usb/common/built-in.o
  CC      drivers/usb/dwc3/core.o
  AR      drivers/usb/dwc3/dwc3.o
  CC      drivers/usb/dwc3/dwc3-meson-g12a.o
  AR      drivers/usb/dwc3/built-in.o
  AR      drivers/usb/emul/built-in.o
  AR      drivers/usb/eth/built-in.o
  CC      drivers/usb/gadget/epautoconf.o
  CC      drivers/usb/gadget/config.o
  CC      drivers/usb/gadget/usbstring.o
  CC      drivers/usb/gadget/dwc2_udc_otg.o
  CC      drivers/usb/gadget/g_dnl.o
  CC      drivers/usb/gadget/f_mass_storage.o
  AR      drivers/usb/gadget/built-in.o
  CC      drivers/usb/gadget/udc/udc-uclass.o
  AR      drivers/usb/gadget/udc/built-in.o
  CC      drivers/usb/host/usb-uclass.o
  CC      drivers/usb/host/xhci.o
  CC      drivers/usb/host/xhci-mem.o
  CC      drivers/usb/host/xhci-ring.o
  CC      drivers/usb/host/xhci-dwc3.o
  AR      drivers/usb/host/built-in.o
  AR      drivers/usb/mtu3/built-in.o
  AR      drivers/usb/musb-new/built-in.o
  AR      drivers/usb/musb/built-in.o
  AR      drivers/usb/phy/built-in.o
  AR      drivers/usb/ulpi/built-in.o
  CC      env/common.o
  CC      env/env.o
  CC      env/attr.o
  CC      env/flags.o
  CC      env/callback.o
  CC      env/nowhere.o
  AR      env/built-in.o
  CC      fs/ext4/ext4fs.o
  CC      fs/ext4/ext4_common.o
  CC      fs/ext4/dev.o
  AR      fs/ext4/built-in.o
  CC      fs/fat/fat_write.o
  AR      fs/fat/built-in.o
  CC      fs/fs.o
  CC      fs/fs_internal.o
  AR      fs/built-in.o
  AR      lib/crypto/built-in.o
  CC      lib/efi_driver/efi_uclass.o
  CC      lib/efi_driver/efi_block_device.o
  AR      lib/efi_driver/built-in.o
  CC      lib/efi_loader/efi_bootmgr.o
  CC      lib/efi_loader/efi_boottime.o
  CC      lib/efi_loader/efi_helper.o
  CC      lib/efi_loader/efi_console.o
  CC      lib/efi_loader/efi_device_path.o
  CC      lib/efi_loader/efi_device_path_to_text.o
  CC      lib/efi_loader/efi_device_path_utilities.o
  CC      lib/efi_loader/efi_dt_fixup.o
  CC      lib/efi_loader/efi_file.o
  CC      lib/efi_loader/efi_hii.o
  CC      lib/efi_loader/efi_image_loader.o
  CC      lib/efi_loader/efi_load_options.o
  CC      lib/efi_loader/efi_memory.o
  CC      lib/efi_loader/efi_root_node.o
  CC      lib/efi_loader/efi_runtime.o
  CC      lib/efi_loader/efi_setup.o
  CC      lib/efi_loader/efi_string.o
  CC      lib/efi_loader/efi_unicode_collation.o
  CC      lib/efi_loader/efi_var_common.o
  CC      lib/efi_loader/efi_var_mem.o
  CC      lib/efi_loader/efi_var_file.o
  CC      lib/efi_loader/efi_variable.o
  CC      lib/efi_loader/efi_watchdog.o
  CC      lib/efi_loader/efi_gop.o
  CC      lib/efi_loader/efi_disk.o
  CC      lib/efi_loader/efi_net.o
  CC      lib/efi_loader/efi_smbios.o
  CC      lib/efi_loader/efi_rng.o
  CC      lib/efi_loader/efi_load_initrd.o
  AR      lib/efi_loader/built-in.o
  CC      lib/efi_loader/helloworld.o
  AS      lib/efi_loader/efi_crt0.o
  CC      lib/efi_loader/efi_reloc.o
  CC      lib/efi_loader/efi_freestanding.o
  LD      lib/efi_loader/helloworld_efi.so
  OBJCOPY lib/efi_loader/helloworld.efi
  CC      lib/libfdt/fdt.o
  CC      lib/libfdt/fdt_ro.o
  CC      lib/libfdt/fdt_wip.o
  CC      lib/libfdt/fdt_strerror.o
  CC      lib/libfdt/fdt_sw.o
  CC      lib/libfdt/fdt_rw.o
  CC      lib/libfdt/fdt_empty_tree.o
  CC      lib/libfdt/fdt_addresses.o
  CC      lib/libfdt/fdt_overlay.o
  AR      lib/libfdt/built-in.o
  CC      lib/lzma/LzmaDec.o
  CC      lib/lzma/LzmaTools.o
  AR      lib/lzma/built-in.o
  CC      lib/zlib/zlib.o
  AR      lib/zlib/built-in.o
  CC      lib/charset.o
  CC      lib/crc8.o
  CC      lib/crc16.o
  CC      lib/smbios.o
  CC      lib/ldiv.o
  CC      lib/net_utils.o
  CC      lib/rc4.o
  CC      lib/list_sort.o
  CC      lib/hash-checksum.o
  CC      lib/gunzip.o
  CC      lib/lz4_wrapper.o
  CC      lib/fdtdec_common.o
  CC      lib/fdtdec.o
  CC      lib/qsort.o
  CC      lib/hashtable.o
  CC      lib/errno.o
  CC      lib/display_options.o
  CC      lib/crc32.o
  CC      lib/ctype.o
  CC      lib/div64.o
  CC      lib/hang.o
  CC      lib/linux_compat.o
  CC      lib/linux_string.o
  CC      lib/lmb.o
  CC      lib/membuff.o
  CC      lib/slre.o
  CC      lib/string.o
  CC      lib/tables_csum.o
  CC      lib/time.o
  CC      lib/hexdump.o
  CC      lib/uuid.o
  CC      lib/rand.o
  CC      lib/panic.o
  CC      lib/vsprintf.o
  CC      lib/strto.o
  CC      lib/date.o
  CC      lib/elf.o
  AR      lib/built-in.o
  CC      net/arp.o
  CC      net/bootp.o
  CC      net/eth_legacy.o
  CC      net/eth_common.o
  CC      net/net.o
  CC      net/nfs.o
  CC      net/ping.o
  CC      net/tftp.o
  AR      net/built-in.o
  LDS     u-boot.lds
  LD      u-boot
  OBJCOPY u-boot.srec
  OBJCOPY u-boot-nodtb.bin
  RELOC   u-boot-nodtb.bin
  DTC     arch/arm/dts/meson-axg-s400.dtb
  DTC     arch/arm/dts/meson-gxbb-nanopi-k2.dtb
  DTC     arch/arm/dts/meson-gxbb-odroidc2.dtb
  DTC     arch/arm/dts/meson-gxbb-p200.dtb
  DTC     arch/arm/dts/meson-gxbb-p201.dtb
  DTC     arch/arm/dts/meson-gxbb-wetek-hub.dtb
  DTC     arch/arm/dts/meson-gxbb-wetek-play2.dtb
  DTC     arch/arm/dts/meson-gxl-s805x-libretech-ac.dtb
  DTC     arch/arm/dts/meson-gxl-s905d-libretech-pc.dtb
  DTC     arch/arm/dts/meson-gxl-s905x-khadas-vim.dtb
  DTC     arch/arm/dts/meson-gxl-s905x-libretech-cc.dtb
  DTC     arch/arm/dts/meson-gxl-s905x-libretech-cc-v2.dtb
  DTC     arch/arm/dts/meson-gxl-s905x-p212.dtb
  DTC     arch/arm/dts/meson-gxm-khadas-vim2.dtb
  DTC     arch/arm/dts/meson-gxm-s912-libretech-pc.dtb
  DTC     arch/arm/dts/meson-gxm-wetek-core2.dtb
  DTC     arch/arm/dts/meson-g12a-radxa-zero.dtb
  DTC     arch/arm/dts/meson-g12a-sei510.dtb
  DTC     arch/arm/dts/meson-g12a-u200.dtb
  DTC     arch/arm/dts/meson-g12b-a311d-khadas-vim3.dtb
  DTC     arch/arm/dts/meson-g12b-gtking.dtb
  DTC     arch/arm/dts/meson-g12b-gtking-pro.dtb
  DTC     arch/arm/dts/meson-g12b-gsking-x.dtb
  DTC     arch/arm/dts/meson-g12b-odroid-n2.dtb
  DTC     arch/arm/dts/meson-g12b-odroid-n2-plus.dtb
  DTC     arch/arm/dts/meson-sm1-khadas-vim3l.dtb
  DTC     arch/arm/dts/meson-sm1-odroid-c4.dtb
  DTC     arch/arm/dts/meson-sm1-odroid-hc4.dtb
  DTC     arch/arm/dts/meson-sm1-sei610.dtb
  SHIPPED dts/dt.dtb
  CAT     u-boot-dtb.bin
  COPY    u-boot.bin
  SYM     u-boot.sym
  COPY    u-boot.dtb
  LDS     u-boot-elf.lds
  LD      u-boot.elf
===================== WARNING ======================
This board does not use CONFIG_DM_ETH (Driver Model
for Ethernet drivers). Please update the board to use
CONFIG_DM_ETH before the v2020.07 release. Failure to
update by the deadline may result in board removal.
See doc/driver-model/migration.rst for more info.
====================================================
  CFGCHK  u-boot.cfg
root@debian:/home/pol/u-boot# cp u-boot.bin ../fip/radxa-zero/bl33.bin
root@debian:/home/pol/u-boot# cd ../fip/radxa-zero
root@debian:/home/pol/fip/radxa-zero# make
./blx_fix.sh bl2.bin  zero_tmp bl2_zero.bin  acs.bin   bl21_zero.bin  bl2_new.bin  bl2
4544+0 records in
4544+0 records out
4544 bytes (4.5 kB, 4.4 KiB) copied, 0.00390817 s, 1.2 MB/s
2288+0 records in
2288+0 records out
2288 bytes (2.3 kB, 2.2 KiB) copied, 0.00195729 s, 1.2 MB/s
./aml_encrypt_g12a --bl2sig  --input bl2_new.bin           --output bl2.n.bin.sig
./blx_fix.sh bl30.bin zero_tmp bl30_zero.bin bl301.bin bl301_zero.bin bl30_new.bin bl30
40+0 records in
40+0 records out
40 bytes copied, 0.000221595 s, 181 kB/s
5422+0 records in
5422+0 records out
5422 bytes (5.4 kB, 5.3 KiB) copied, 0.00352714 s, 1.5 MB/s
./aml_encrypt_g12a --bl30sig --input bl30_new.bin              --output bl30_new.bin.g12a.enc --level v3
./aml_encrypt_g12a --bl3sig  --input bl30_new.bin.g12a.enc --output bl30_new.bin.enc      --level v3 --type bl30
./aml_encrypt_g12a --bl3sig  --input bl31.img              --output bl31.img.enc          --level v3 --type bl31
./aml_encrypt_g12a --bl3sig  --input bl33.bin              --output bl33.bin.enc          --level v3 --type bl33
# --compress lz4
./aml_encrypt_g12a --bootmk                                --output u-boot.bin            --level v3 \
               --bl2 bl2.n.bin.sig --bl30 bl30_new.bin.enc --bl31 bl31.img.enc     --bl33 bl33.bin.enc \
               --ddrfw1 ddr4_1d.fw   --ddrfw2 ddr4_2d.fw   --ddrfw3 ddr3_1d.fw     --ddrfw4 piei.fw \
               --ddrfw5 lpddr4_1d.fw --ddrfw6 lpddr4_2d.fw --ddrfw7 diag_lpddr4.fw --ddrfw8 aml_ddr.fw

This are devices that should be redirected from Windows to VirtualBox on next steps so Debian could find radxa zero board and flash the bootloader (otherwise you will get errors):


reboot board and press USB button (add Amilogic GX-CHIP to VirtualBox)

lsusb

Bus 001 Device 008: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

If Amlogic, Inc. GX-CHIP is present:

boot-g12.py /home/pol/fip/radxa-zero/u-boot.bin

Output

root@debian:/home/pol/fip/radxa-zero# boot-g12.py /home/pol/fip/radxa-zero/u-boot.bin
Firmware Version :
ROM: 3.2 Stage: 0.0
Need Password: 0 Password OK: 1
Writing /home/pol/fip/radxa-zero/u-boot.bin at 0xfffa0000…
[DONE]
Running at 0xfffa0000…
[DONE]
AMLC dataSize=16384, offset=65536, seq=0…
[DONE]
AMLC dataSize=49152, offset=393216, seq=1…
[DONE]
AMLC dataSize=16384, offset=229376, seq=2…
[DONE]
AMLC dataSize=49152, offset=245760, seq=3…
[DONE]
AMLC dataSize=49152, offset=294912, seq=4…
[DONE]
AMLC dataSize=16384, offset=65536, seq=5…
[DONE]
AMLC dataSize=1324912, offset=81920, seq=6…
[DONE]
[BL2 END]

reboot board and press USB button once more (Amilogic GX-CHIP to VirtualBox should be added)

wget https://dl.radxa.com/zero/images/loader/rz-fastboot-loader.bin
boot-g12.py /home/pol/fip/radxa-zero/rz-fastboot-loader.bin

Output

root@debian:/home/pol/fip/radxa-zero# boot-g12.py /home/pol/fip/radxa-zero/rz-fastboot-loader.bin
Firmware Version :
ROM: 3.2 Stage: 0.0
Need Password: 0 Password OK: 1
Writing /home/pol/fip/radxa-zero/rz-fastboot-loader.bin at 0xfffa0000…
[DONE]
Running at 0xfffa0000…
[DONE]
AMLC dataSize=16384, offset=65536, seq=0…
[DONE]
AMLC dataSize=49152, offset=393216, seq=1…
[DONE]
AMLC dataSize=16384, offset=229376, seq=2…
[DONE]
AMLC dataSize=49152, offset=245760, seq=3…
[DONE]
AMLC dataSize=49152, offset=294912, seq=4…
[DONE]
AMLC dataSize=16384, offset=65536, seq=5…
[DONE]
AMLC dataSize=1406320, offset=81920, seq=6…
[DONE]
[BL2 END]

make shure board gets in fastboot mode and host see it (add Radxa USB download gadget to VirtualBox)

fastboot flash 0x200 /home/pol/fip/radxa-zero/u-boot.bin
fastboot reboot

Output

root@debian:/home/pol/fip/radxa-zero# fastboot flash 0x200 /home/pol/fip/radxa-zero/u-boot.bin
< waiting for any device >
Sending ‘0x200’ (1373 KB) OKAY [ 0.522s]
Writing ‘0x200’ OKAY [ 0.080s]
Finished. Total time: 0.637s
root@debian:/home/pol/fip/radxa-zero# fastboot reboot
Rebooting OKAY [ 0.012s]
Finished. Total time: 0.941s

Switch board power and you are good to go.
Now you have your own environment to edit some Linux stuff. I hope this instruction was helpful to someone. If you get errors on some stages - fill free to asking the questions cuz that forums are for! :wink:
If you need *bin files only. Link.

PS

Creation of this instruction inspired by some post-soviet trolls offended by life and people I guess, they are disrespecting and discrediting open source and knowledge sharing philosophy… So let’s show them that they are wrong… :stuck_out_tongue_winking_eye:

6 Likes