-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathuEnv_r2.txt
116 lines (89 loc) · 5.08 KB
/
uEnv_r2.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
scriptaddr=0x83000000
bpi=bananapi
board=bpi-r2
service=linux
device=mmc
partition=1:1
bootenv=uEnv.txt
kernel=uImage
loadaddr=0x80200000
#default bootargs will be overidden by buildargs
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait ip=dhcp
kernel414=uImage_4.14.91-main
console=earlyprintk console=ttyS0,115200
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootopts=vmalloc=496M debug=7 initcall_debug=0
graphic=video=1920x1080 console=tty1 fbcon=map:0 drm.debug=0x7
buildargs=setenv bootargs "board=${board} ${console} root=${root} ${bootopts} ${graphic}"
checkenv=test -e ${device} ${partition} ${bpi}/${board}/${service}/${bootenv}
importenv=env import -t ${scriptaddr} ${filesize}
loadbootenv=if fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv};then run importenv;else echo "fatload (${bootenv}) failed";fi
resetenv=env default -a;printenv;
checksd=fatinfo ${device} 1:1
selectmmc=if run checksd; then echo Boot from SD ; setenv partition 1:1;else echo Boot from eMMC; setenv partition 0:1 ; fi;
newboot=run buildargs;printenv bootargs;fatload ${device} ${partition} ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
reloadmenu=run selectmmc;if run checkenv; then run loadbootenv; else echo file not found; fi;bootmenu;
lskernel=ls ${device} ${partition} ${bpi}/${board}/${service};
lsdtb=ls ${device} ${partition} ${bpi}/${board}/${service}/dtb
askkernel=askenv kernelinput "enter uImage-name:";
askdtb=askenv dtbinput "enter dtb-name:";
askuboot=askenv ubootinput "enter uboot-name:";
#bootmenu
boot0=run lskernel;run askkernel;if printenv kernelinput ;then setenv kernel ${kernelinput};run lsdtb;run askdtb;if printenv dtbinput ;then setenv fdt ${dtbinput};fi; run newboot2; fi;
boot1=run selectmmc; run loadbootenv; run importenv; run newboot;
boot14=setenv kernel ${kernel414}; run newboot;
boot19=setenv kernel ${kernel419}; run newboot;
boot19_dt=setenv kernel ${kernel419_nodt}; setenv fdt ${fdt419}; setenv dtolist ${dtolist419}; run newboot2;
bootmenu_default=2
bootmenu_0=1. Enter kernel-name to boot from SD/EMMC.=run boot0
bootmenu_1=2. Boot kernel from TFTP.=run bootnet
bootmenu_2=3. Boot from SD/EMMC.=run boot1
bootmenu_3=4. Boot from SD/EMMC 4.14.=run boot14
bootmenu_4=5. Boot from SD/EMMC 4.19 (fdt/dto).=run boot19_dt
#automatic reload from sd/emmc
bootdelay=0
bootcmd=setenv bootdelay 3; run reloadmenu;
png=ping ${serverip}
#Netboot
ipaddr=192.168.0.11
netmask=255.255.255.0
serverip=192.168.0.10
bootfile=uImage
ubootfile=u-boot.bin
netbootargs=root=/dev/mmcblk0p2 rw rootwait
#ip=dhcp sets ip on eth0 instead of wan
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
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
#md.b ${loadaddr} 60;
ubootaddr=0x81E00000
bootnet=run lstftp;run askkernel;if printenv kernelinput ;then setenv bootfile "${kernelinput}"; fi;printenv; setenv bootargs "${netbootargs} ${console} ${graphic}";if tftp ${loadaddr} ${bootfile};then bootm;fi
ubootnet=run lstftpu;run askuboot;if printenv ubootinput ;then setenv ubootfile "${ubootinput}"; fi; if tftp ${ubootaddr} ${ubootfile};then icache off;dcache off;go ${ubootaddr};fi
#NFS
nfsip=192.168.0.10
nfsrfs=/var/nfs/bpi-r2
setnfsargs=setenv netbootargs "root=/dev/nfs rw nfsroot=${nfsip}:${nfsrfs},nfsvers=3,tcp nfsrootdebug";
bootnfs=run setnfsargs bootnet
#separate fdt+dto
dtaddr=0x83f00000
fdt_high=0xffffffff
kernel419_nodt=uImage_4.19.13-main_nodt
fdt419=4.19.13-main.dtb
dtolist419=bpi-r2-mac.dtb
loadfdt=fatload ${device} ${partition} ${dtaddr} ${bpi}/${board}/${service}/dtb/${fdt}
loadkernel=echo "loading kernel ${kernel}...";fatload ${device} ${partition} ${loadaddr} ${bpi}/${board}/${service}/${kernel}
loaddto=echo "loaddto:${dto}";fdt addr ${dtaddr};fdt resize 8192; setexpr fdtovaddr ${dtaddr} + F000;fatload ${device} ${partition} ${fdtovaddr} ${bpi}/${board}/${service}/dtb/${dto} && fdt apply ${fdtovaddr}
loaddtolist=for dto in ${dtolist} ; do run loaddto ; done
bootall=if printenv fdt; then run loadfdt; if printenv dtolist;then run loaddtolist;fi; bootm ${loadaddr} - ${dtaddr} ;else bootm; fi
newboot2=run buildargs; printenv bootargs; run loadkernel; run bootall;
#sata/ahci
initsata=pci enum;scsi scan;
partsata=0:1
dirsata=EFI/ubuntu
filesata=test.txt
kernelsata=uImage_4.14.117-main
loadfilesata=fatload scsi ${partsata} ${scriptaddr} ${dirsata}/${filesata};setexpr listend ${scriptaddr} + ${filesize};mw.b ${listend} 00 2;strings ${scriptaddr};
loadkernelsata=fatload scsi ${partsata} ${loadaddr} ${dirsata}/${kernelsata};bootm
lssata=ls scsi ${partsata} ${$dirsata}
askaddr=askenv addrinput "enter address:";
lsmem=run askaddr;if printenv addrinput;then setenv baseaddr ${addrinput};run listmem; fi
listmem=if printenv baseaddr;then setenv i 0;while test ${i} -lt 10;do setenv j 0;while test ${j} -lt 10;do setenv offset "${i}${j}00";setexpr addr $baseaddr + ${offset};md $addr;setexpr j ${j} + 1; done;setexpr i ${i} + 1;done;fi