linuxOS_D21X/target/d211/common/env.txt
2025-06-05 14:33:02 +08:00

174 lines
5.7 KiB
Plaintext

#===============================================================================
# Common parameter configuration
#-------------------------------------------------------------------------------
earlycon=sbi
init=/init
# ramfs_dbg
# - 0: Don't stop in initramfs, normal boot to rootfs
# - 1: Stop in initramfs for debug
ramfs_dbg=0
# bootdelay:
# >= 0: uboot wait <delay value> second, and will stop booting if any key input is detected
# = -1: uboot always stop booting and run to command line
# = -2: uboot skip boot delay phase, directly to run boot command
# = -3: uboot only stop booting when the input is "CTRL + C"
bootdelay=-3
baudrate=115200
preboot=
verify=no
#silent=no
knl_addr=0x41200000
dtb_addr=0x42200000
fdt_high=0xFFFFFFFFFFFFFFFF
# Kernel decompress working buffer and size
kernel_comp_addr_r=0x41200000
kernel_comp_size=0x1000000
# Common boot args
# Case 1: Mount initramfs, and then switch to rootfs
# set_commonargs=setenv bootargs earlycon=${earlycon} earlyprintk rdinit=${init} initramfs_dbg=${ramfs_dbg}
set_commonargs_recovery=setenv bootargs earlycon=${earlycon} earlyprintk rdinit=/linuxrc
# Case 2: Mount rootfs directly
set_commonargs=setenv bootargs quiet earlycon=${earlycon} earlyprintk init=/linuxrc firmware_class.path=/etc/firmware
#===============================================================================
# NAND boot configuration
#-------------------------------------------------------------------------------
# NAND flash rootfs, please use the correct ubi device
nand_root=ubi0:rootfs
nand_rootfstype=ubifs
# RootFS's mtd device number
ubi_rootfs_mtd=10
boot_partition=kernel
# Set the number of MTD partition that will be used during boot.
# It is used to filter-out MTD partitions not using during boot, so that u-boot
# no need to perform bad block checking for those partitions(big), and reduce
# boot time.
# Default it is set to 0, all partitions will be checked, but it will be updated
# in nand_boot script.
# Clear variable mtdparts, force u-boot get mtdparts in runtime from
# board_mtdparts_default()
# Cmd falcon_save kernel device tree snapshot to spinand/spinor/emmc falcon part
set_nand_mtdargs=env delete mtdparts
set_nand_bootargs=run set_nand_mtdargs; \
run set_commonargs; \
setenv bootargs ${bootargs} mtdparts=${MTD} ubi.mtd=${ubi_rootfs_mtd} root=${nand_root} rootfstype=${nand_rootfstype}
set_nand_bootargs_recovery=run set_nand_mtdargs; \
run set_commonargs_recovery; \
setenv bootargs ${bootargs} mtdparts=${MTD}
nand_boot=echo "Try to boot from nand flash..."; \
if test ${boot_partition} = kernel; then \
run set_nand_bootargs; \
loadknl mtd kernel ${knl_addr}; \
falcon_save; \
else \
run set_nand_bootargs_recovery; \
loadknl mtd recovery ${knl_addr}; \
fi; \
bootm ${knl_addr};
#===============================================================================
# NOR boot configuration
#-------------------------------------------------------------------------------
# NOR flash rootfs device
nor_root=/dev/mtdblock8
nor_rootfstype=squashfs
set_nor_mtdargs=env delete mtdparts
set_nor_args=run set_nor_mtdargs; \
run set_commonargs; \
setenv bootargs ${bootargs} mtdparts=${MTD} root=${nor_root} rootfstype=${nor_rootfstype}
nor_boot=echo "Try to boot from nor flash..."; \
sf probe; \
run set_nor_args; \
loadknl mtd kernel ${knl_addr}; \
falcon_save; \
bootm ${knl_addr};
#===============================================================================
# SD/eMMC boot configuration
#-------------------------------------------------------------------------------
# eMMC/SDCard rootfs device
mmc_rootfstype=ext4
## Get "rootfs" partition number in decimal, and set var "mmc_root"
## Variable "boot_devnum" is set during board_lat_init()
set_mmc_root=part number mmc ${boot_devnum} rootfs rootfs_part; \
setexpr rootfs_part fmt %d ${rootfs_part}; \
setenv mmc_root "/dev/mmcblk${boot_devnum}p${rootfs_part}";
set_mmc_bootargs=run set_commonargs; \
run set_mmc_root; \
setenv bootargs "${bootargs}" root=${mmc_root} rootwait rootfstype=${mmc_rootfstype};
set_mmc_bootargs_recovery=run set_commonargs_recovery; \
run set_mmc_root; \
setenv bootargs "${bootargs}";
mmc_boot=echo "Try to boot from MMC..."; \
if test ${boot_partition} = kernel; then \
run set_mmc_bootargs; \
loadknl mmc ${boot_devnum} kernel ${knl_addr}; \
falcon_save; \
else \
run set_mmc_bootargs_recovery; \
loadknl mmc ${boot_devnum} recovery ${knl_addr}; \
fi; \
bootm ${knl_addr};
#===============================================================================
# Boot script
#-------------------------------------------------------------------------------
# U-boot autoboot script: try to boot from device
# Variable "boot_device" is set in board_late_init()
boot_from_media=if test ${boot_device} = nand; then \
run nand_boot; \
elif test ${boot_device} = nor; then \
run nor_boot; \
elif test ${boot_device} = mmc; then \
run mmc_boot; \
fi;
autoboot=upg_detect; \
if test $? -eq 1; then \
if test ${upg_type} = usb; then \
echo "Run USB upgrade program"; \
aicupg usb 0; \
if test $? -eq 1; then \
run boot_from_media; \
fi; \
elif test ${upg_type} = sdcard; then \
echo "Run sdcard fat32 upgrade program"; \
aicupg fat mmc 1; \
elif test ${upg_type} = udisk; then \
echo "Run udisk fat32 upgrade program"; \
aicupg fat udisk 0; \
if test $? -eq 1; then \
run boot_from_media; \
fi; \
fi; \
else \
run boot_from_media; \
fi;
bootcmd=run autoboot;