forked from frank-w/u-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuEnv.txt
98 lines (76 loc) · 4.19 KB
/
uEnv.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
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
kernel419_nodt=uImage_4.19.13-main_nodt
fdt419=4.19.13-main.dtb
dtolist419=bpi-r2-mac.dtb
console=earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200
root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootopts=vmalloc=496M debug=7 initcall_debug=0
graphic=video=1920x1080 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
#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=tftp ${loadaddr} ${serverip}:files.lst;setexpr listend ${loadaddr} + ${filesize};mw.b ${listend} 00 2;strings ${loadaddr};
lstftpu=tftp ${loadaddr} ${serverip}:bootfiles.lst;setexpr listend ${loadaddr} + ${filesize};mw.b ${listend} 00 2;strings ${loadaddr};
#md.b ${loadaddr} 60;
#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";
ubootaddr=0x81E00000
bootnet=run lstftp;run askkernel;if printenv kernelinput ;then setenv bootfile "${kernelinput}"; fi;printenv; setenv bootargs "${netbootargs} ${console} ${graphic}";tftp ${loadaddr} ${bootfile};bootm
ubootnet=run lstftpu;run askuboot;if printenv ubootinput ;then setenv ubootfile "${ubootinput}"; fi; tftp ${ubootaddr} ${ubootfile};icache off;dcache off;go ${ubootaddr}
bootnfs=run setnfsargs bootnet
#separate fdt+dto
dtaddr=0x83f00000
fdt_high=0xffffffff
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;
#automatic reload from sd/emmc
bootdelay=0
bootcmd=setenv bootdelay 3; run reloadmenu;