-
Notifications
You must be signed in to change notification settings - Fork 22
/
uEnv_r64.txt
92 lines (76 loc) · 3.98 KB
/
uEnv_r64.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
## uEnv.txt
#
bpi=bananapi
board=bpi-r64
chip=mt7622
service=linux
#
device=mmc
partition=1:1
#
kernel=uImage_nodt
fdt=bpi-r64.dtb
fit=bpi-r64.itb
#
kaddr=0x44000000
loadaddr=0x44000000
rdaddr=0x46000000
dtaddr=0x47000000
#
root=/dev/mmcblk1p2 rootfstype=ext4 rootwait
console=ttyS0,115200n1 earlyprintk
bootopts=debug=7 initcall_debug=0 androidboot.hardware=mt7622 swiotlb=512
#
#local
lsdtb=ls ${device} ${partition} ${bpi}/${board}/${service}/dtb
lskernel=ls ${device} ${partition} ${bpi}/${board}/${service};
loaddt=fatload $device $partition $dtaddr ${bpi}/${board}/${service}/dtb/${fdt}
loadkernel=fatload $device $partition $kaddr ${bpi}/${board}/${service}/${kernel}
checksd=mmc dev 1
checkgpt=if gpt guid $device $devnum;then setenv partnum 4;setenv root "/dev/mmcblk1p5 rootfstype=ext4 rootwait";else setenv partnum 1;fi
checkfat=fatinfo $device $devnum:$partnum
selectmmc=if run checksd; then echo Boot from SD ; setenv devnum 1;else echo Boot from eMMC; setenv devnum 0; fi;run checkgpt;setenv partition $devnum:$partnum;
bootenv=uEnv.txt
checkenv=test -e ${device} ${partition} ${bpi}/${board}/${service}/${bootenv}
loadenvfile=if fatload ${device} ${partition} ${loadaddr} ${bpi}/${board}/${service}/${bootenv};then env import -t ${loadaddr} ${filesize};else echo "fatload (${bootenv}) failed";fi
loadenv=if run checkenv;then run loadenvfile;fi
resetenv=env default -a;printenv;
buildargs=setenv bootargs "board=${board} console=${console} root=${root} service=${service} ${bootopts}"
newboot=run buildargs;if printenv fit;then setenv kernel ${fit};if run loadkernel; then bootm ${kaddr}; fi; else if run loadkernel; then if run loaddt; then bootm ${kaddr} - ${dtaddr};fi;fi;fi
#netboot
ipaddr=192.168.0.19
netmask=255.255.255.0
serverip=192.168.0.10
#bootfile=uImage_5.4.0-r64-main_mt7531-sata
#bootdtbfile=5.4.0-r64-main_mt7531-sata.dtb
lstftp=if tftp ${loadaddr} ${serverip}:files.lst;then setexpr listend ${loadaddr} + ${filesize};mw.b ${listend} 00 2;strings ${loadaddr};else echo "tftp download failed";fi
lstftpdt=if tftp ${loadaddr} ${serverip}:dtfiles.lst;then setexpr listend ${loadaddr} + ${filesize};mw.b ${listend} 00 2;strings ${loadaddr};else echo "tftp download failed";fi
lstftpu=if tftp ${loadaddr} ${serverip}:bootfiles.lst;then setexpr listend ${loadaddr} + ${filesize};mw.b ${listend} 00 2;strings ${loadaddr};else echo "tftp download failed";fi
bootnet=run buildargs;if tftp $kaddr ${bootfile}; then if tftp $dtaddr ${bootdtbfile}; then bootm $kaddr - $dtaddr;fi;fi
bootnetfit=run buildargs;if tftp $kaddr ${bootfile}; then bootm $kaddr;fi
#load uboot-mtk.bin
#ufile=u-boot-r64-2019-10.bin
#ufile=u-boot_2020.01-rc4-bpi-r64-v1.bin
uaddr=0x41E00000
umtkaddr=0x41dffe00
ubootnet=if tftp ${uaddr} ${ufile}; then dcache off;icache off; go $uaddr;fi
uboot64net=if tftp ${umtkaddr} ${ufile};then go64 $uaddr;fi
#asking user which file to load
askkernel=askenv kernelinput "enter uImage-name:";
askdtb=askenv dtbinput "enter dtb-name:";
askuboot=askenv ubootinput "enter uboot-name:";
askboot=run lskernel askkernel;if printenv kernelinput; then setenv kernel "${kernelinput}"; run lsdtb askdtb; if printenv dtbinput; then setenv fdt "${dtbinput}";run newboot; fi;fi
askbootnet=run lstftp askkernel;if printenv kernelinput; then setenv bootfile "${kernelinput}"; run lstftpdt askdtb; if printenv dtbinput; then setenv bootdtbfile "${dtbinput}";run bootnet; fi;fi
askbootnetfit=run lstftp askkernel;if printenv kernelinput; then setenv bootfile "${kernelinput}"; run bootnetfit;fi
askubootnet=run lstftpu askuboot;if printenv ubootinput; then setenv ufile "${ubootinput}"; run ubootnet;fi
askuboot64net=run lstftpu askuboot;if printenv ubootinput ;then setenv ufile "${ubootinput}"; run uboot64net;fi
#bootmenu
bootmenu_0=1. Enter kernel-name to boot from SD/EMMC.=run askboot
bootmenu_1=2. Boot kernel from TFTP.=run askbootnetfit
bootmenu_2=3. Boot from SD/EMMC.=run newboot
bootmenu_default=2
reloadmenu=run selectmmc;run loadenv; bootmenu;
#automatic reload from sd/emmc
bootdelay=0
bootcmd=setenv bootdelay 3; run reloadmenu;