build/config/bootscripts/boot-meson-s4t7.cmd

81 lines
3.4 KiB
Batchfile
Raw Normal View History

# DO NOT EDIT THIS FILE
#
# Please edit /boot/armbianEnv.txt to set supported parameters
#
setenv overlay_error "false"
setenv console "both"
setenv verbosity "1"
setenv earlycon "off"
setenv bootlogo "false"
setenv earlyconuart "0xfe078000"
if test "${board_name}" = "kvim1s"; then setenv earlyconuart "0xfe07a000"; fi
# Show what uboot default fdtfile is
echo "U-boot default fdtfile: ${fdtfile}"
if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then
load ${devtype} ${devnum} ${loadaddr} ${prefix}armbianEnv.txt
env import -t ${loadaddr} ${filesize}
fi
if test "${console}" = "both"; then setenv console_serial "true"; setenv console_display "true"; fi
if test "${console}" = "serial"; then setenv console_serial "true"; fi
if test "${console}" = "display"; then setenv console_display "true"; fi
if test "${console_serial}" = "true"; then setenv consoleargs "console=ttyS0,921600"; fi
if test "${console_display}" = "true"; then setenv consoleargs "console=tty1 ${consoleargs}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon=aml-uart,${earlyconuart} ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then
setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}"
else
setenv consoleargs "splash=verbose ${consoleargs}"
fi
setenv displayargs "logo=${display_layer},loaded,${fb_addr} vout=${outputmode},${vout_init} panel_type=${panel_type} hdmitx=${cecconfig},${colorattribute} hdmimode=${hdmimode} hdmichecksum=${hdmichecksum} dolby_vision_on=${dolby_vision_on} hdr_policy=${hdr_policy} hdr_priority=${hdr_priority} frac_rate_policy=${frac_rate_policy} hdmi_read_edid=${hdmi_read_edid} cvbsmode=${cvbsmode} osd_reverse=${osd_reverse} video_reverse=${video_reverse}"
setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} no_console_suspend ${displayargs} loglevel=${verbosity} mac=${eth_mac} khadas.serial=${usid} partition_type=generic ${extraargs} ${extraboardargs}"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
fdt addr ${fdt_addr_r}
fdt resize 65536
for overlay_file in ${overlays}; do
if load ${devtype} ${devnum} ${scriptaddr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-${overlay_file}.dtbo; then
echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo"
fdt apply ${scriptaddr} || setenv overlay_error "true"
fi
done
for overlay_file in ${user_overlays}; do
if load ${devtype} ${devnum} ${scriptaddr} ${prefix}overlay-user/${overlay_file}.dtbo; then
echo "Applying user provided DT overlay ${overlay_file}.dtbo"
fdt apply ${scriptaddr} || setenv overlay_error "true"
fi
done
if test "${overlay_error}" = "true"; then
echo "Error applying DT overlays, restoring original DT"
load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
else
if load ${devtype} ${devnum} ${scriptaddr} ${prefix}dtb/amlogic/overlay/${overlay_prefix}-fixup.scr; then
echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)"
source ${scriptaddr}
fi
if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then
load ${devtype} ${devnum} ${scriptaddr} ${prefix}fixup.scr
echo "Applying user provided fixup script (fixup.scr)"
source ${scriptaddr}
fi
fi
load ${devtype} ${devnum} ${kernel_addr_r} /vmlinuz
load ${devtype} ${devnum} ${ramdisk_addr_r} /initrd.img
booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr