Packages

Nerves System - Khadas VIM3 (Amlogic A311D)

Current section

Files

Jump to
nerves_system_vim3 uboot boot.cmd
Raw

uboot/boot.cmd

# U-Boot boot script for Khadas VIM3
# VIM3 SD card slot is connected to SDIO controller (mmc 1)
# Supports A/B partition switching via nerves_fw_active environment variable
echo "Loading kernel and device tree..."
fatload mmc 1:1 0x1080000 Image
fatload mmc 1:1 0x1000000 meson-g12b-a311d-khadas-vim3.dtb
# Select root partition based on nerves_fw_active
# Partition 2 = Rootfs A, Partition 3 = Rootfs B
if test "${nerves_fw_active}" = "b"; then
echo "Booting from partition B (rootfs B)..."
setenv rootpart /dev/mmcblk0p3
else
echo "Booting from partition A (rootfs A)..."
setenv rootpart /dev/mmcblk0p2
fi
echo "Setting boot arguments..."
setenv bootargs console=ttyAML0,115200 earlycon root=${rootpart} rootwait rootfstype=squashfs init=/sbin/init
echo "Booting kernel..."
booti 0x1080000 - 0x1000000