ae74e11664
Protect script when ram_freq is not set Safely load PSCI DTO to enable CPUidle driver: psci_idle The PSCI DTO shall only be applied if TF-A & Crust support CPU idle states [0]. Otherwise the CPU usage will be at 100%. This will not be visible in top, lead to overheating and battery drain. Worst case scenario would lead to a fried chip if the CPU thermal_zone does not work or is not enabled in DTS. [0] https://gitlab.com/postmarketOS/pmaports/-/issues/1901#note_1238456920
61 lines
1.5 KiB
Batchfile
61 lines
1.5 KiB
Batchfile
gpio set 98
|
|
gpio set 114
|
|
|
|
if test ${mmc_bootdev} -eq 0 ; then
|
|
echo "Booting from SD";
|
|
setenv bootdev 0;
|
|
else
|
|
echo "Booting from eMMC";
|
|
setenv bootdev 2;
|
|
fi;
|
|
|
|
setenv bootargs init=/init.sh rw console=tty0 console=ttyS0,115200 earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1 PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE pmos_boot=/dev/mmcblk${bootdev}p1 pmos_root=/dev/mmcblk${bootdev}p2
|
|
|
|
printenv
|
|
|
|
echo Detecting psci idle state
|
|
fdt addr ${fdtcontroladdr}
|
|
fdt get name pscifdt /cpus/idle-states /
|
|
if test $? -eq 0; then
|
|
echo PSCI idle state enabled;
|
|
setenv iscpscienabled 1;
|
|
else
|
|
echo PSCI idle state disabled;
|
|
fi
|
|
|
|
echo Loading DTB
|
|
load mmc ${mmc_bootdev}:1 ${fdt_addr_r} ${fdtfile}
|
|
fdt addr ${fdt_addr_r}
|
|
fdt resize 2048
|
|
|
|
if printenv ram_freq; then
|
|
echo Adding FTD RAM clock
|
|
fdt mknode / memory
|
|
fdt set /memory ram_freq ${ram_freq}
|
|
fi
|
|
|
|
if test ${iscpscienabled} -eq 1; then
|
|
echo Applying PSCI DTBO;
|
|
load mmc ${mmc_bootdev}:1 ${fdtoverlay_addr_r} sun50i-a64-psci.dtbo
|
|
fdt apply ${fdtoverlay_addr_r}
|
|
fi
|
|
|
|
echo Loading Initramfs
|
|
load mmc ${mmc_bootdev}:1 ${ramdisk_addr_r} initramfs
|
|
setenv ramdisk_size ${filesize}
|
|
|
|
echo Loading Kernel
|
|
load mmc ${mmc_bootdev}:1 ${kernel_addr_r} vmlinuz
|
|
|
|
gpio set 115
|
|
|
|
|
|
echo Loading user script
|
|
setenv user_scriptaddr 0x50700000
|
|
load mmc ${mmc_bootdev}:1 ${user_scriptaddr} user.scr
|
|
if test $? -eq 0; then source ${user_scriptaddr}; else echo No user script found; fi
|
|
|
|
echo Booting kernel
|
|
gpio set 116
|
|
gpio clear 98
|
|
booti ${kernel_addr_r} ${ramdisk_addr_r}:${ramdisk_size} ${fdt_addr_r}
|