baudrate=115200

bootcmd=run check_temp; run storeboot; run do_usb_burning;

check_button=if gpio input GPIOA_3; then run do_usb_burning; elif gpio input GPIOA_2; then run start_shell; fi;

check_charger=mw 0xFF6346DC 0x33000000;mw.b 0x1337DEAD 0x00 1;mw.b 0x1330DEAD 0x12 1;mw.b 0x1331DEAD 0x13 1;mw.b 0x1332DEAD 0x15 1;mw.b 0x1333DEAD 0x16 1;i2c dev 2;i2c read 0x35 0x3 1 0x1337DEAD;if cmp.b 0x1337DEAD 0x1330DEAD 1; then run storeboot;elif cmp.b 0x1337DEAD 0x1331DEAD 1; then run storeboot;elif cmp.b 0x1337DEAD 0x1332DEAD 1; then run storeboot;elif cmp.b 0x1337DEAD 0x1333DEAD 1; then run storeboot;else osd open;osd clear;imgread pic logo bad_charger $loadaddr;bmp display $bad_charger_offset;bmp scale;vout output ${outputmode};while true; do sleep 1; if gpio input GPIOAO_3; then run splash_boot; fi; i2c read 0x35 0x3 1 0x1337DEAD;if cmp.b 0x1337DEAD 0x1330DEAD 1; then run splash_boot;elif cmp.b 0x1337DEAD 0x1331DEAD 1; then run splash_boot;elif cmp.b 0x1337DEAD 0x1332DEAD 1; then run splash_boot;elif cmp.b 0x1337DEAD 0x1333DEAD 1; then run splash_boot;fi;i2c mw 0x35 0x09 0x8F 1;done;fi;

check_temp=boot_cooling

do_usb_burning=osd open;osd clear;imgread pic logo burn_mode $loadaddr;bmp display $burn_mode_offset;bmp scale;vout output ${outputmode}; update 1000;

firstboot=1

get_boot_slot=if test $active_slot = _a; then setenv sys_part mmcblk0p14 ;elif test $active_slot = _b; then setenv sys_part mmcblk0p15; fi

initargs=init=/sbin/pre-init ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 rootfstype=ext4 console=ttyS0,115200n8 no_console_suspend earlycon=aml-uart,0xff803000

init_display=if test ${display_init} = 1; then osd open;osd clear;imgread pic logo bootup_spotify $loadaddr;bmp display $bootup_spotify_offset;bmp scale;vout output ${outputmode};fi;

jtag=enable

preboot=run init_display; run storeargs; run check_button; 

reboot_mode_android=normal

silent=off

splash_boot=imgread pic logo bootup_spotify $loadaddr;bmp display $bootup_spotify_offset;bmp scale;run storeboot;

start_shell=osd open;osd clear;imgread pic logo shell_mode $loadaddr;bmp display $shell_mode_offset;bmp scale;vout output ${outputmode}; update 1; setenv bootcmd "amlmmc env";

storeargs=setenv bootargs ${initargs} root=/dev/${sys_part} ${fs_type} reboot_mode_android=${reboot_mode_android} logo=${display_layer},loaded,${fb_addr} fb_width=${fb_width} fb_height=${fb_height} vout=${outputmode},enable panel_type=${panel_type} frac_rate_policy=${frac_rate_policy} osd_reverse=${osd_reverse} video_reverse=${video_reverse} irq_check_en=${Irq_check_en} androidboot.selinux=${EnableSelinux} androidboot.firstboot=${firstboot} jtag=${jtag} uboot_version=${gitver};setenv bootargs ${bootargs} androidboot.hardware=amlogic; setenv avb2 0;

storeboot=boot_cooling; run get_boot_slot;run storeargs;get_valid_slot;setenv bootargs ${bootargs} androidboot.slot_suffix=${active_slot};consume_boot_try;if imgread kernel ${boot_part} ${loadaddr}; then bootm ${loadaddr}; fi;run do_usb_burning;

