blob: f90029787104c145f0e0b757fd1e81e7c2fa9714 [file] [log] [blame]
Tom Rinid8564e92022-06-13 22:57:34 -04001/* SPDX-License-Identifier: GPL-2.0+ */
2
3/*
4 * Copyright (C) 2017 Armadeus Systems
5 */
6
7/* Environment is stored in the eMMC boot partition */
8
9env_version=100
10consoledev=ttymxc0
11board_name=opos6ul
12fdt_addr=0x88000000
13fdt_high=0xffffffff
14fdt_name=opos6uldev
15initrd_high=0xffffffff
16ip_dyn=yes
17stdin=serial
18stdout=serial
19stderr=serial
20mmcdev=0
21mmcpart=2
22mmcroot=/dev/mmcblk0p2 ro
23mmcrootfstype=ext4 rootwait
24kernelimg=opos6ul-linux.bin
25splashpos=0,0
26splashimage=CONFIG_SYS_LOAD_ADDR
27videomode=video=ctfb:x:800,y:480,depth:18,pclk:33033,le:96,ri:96,up:20,lo:21,hs:64,vs:4,sync:0,vmode:0
28check_env=if test -n ${flash_env_version};
29 then env default env_version;
30 else env set flash_env_version ${env_version}; env save;
31 fi;
32 if itest ${flash_env_version} != ${env_version}; then
33 echo "*** Warning - Environment version
34 change suggests: run flash_reset_env; reset";
35 env default flash_reset_env;
36 else exit; fi;
37flash_reset_env=env default -f -a && saveenv &&
38 echo Environment variables erased!
39download_uboot_spl=tftpboot ${loadaddr} ${board_name}-u-boot.spl
40flash_uboot_spl=
41 if mmc dev 0 1; then
42 setexpr sz ${filesize} / 0x200;
43 setexpr sz ${sz} + 1;
44 if mmc write ${loadaddr} 0x2 ${sz}; then
Michal Simekbb922ca2023-06-05 13:58:59 +020045 echo Flashing of U-Boot SPL succeed;
46 else echo Flashing of U-Boot SPL failed;
Tom Rinid8564e92022-06-13 22:57:34 -040047 fi;
48 fi;
49download_uboot_img=tftpboot ${loadaddr} ${board_name}-u-boot.img
50flash_uboot_img=
51 if mmc dev 0 1; then
52 setexpr sz ${filesize} / 0x200;
53 setexpr sz ${sz} + 1;
54 if mmc write ${loadaddr} 0x8a ${sz}; then
Michal Simekbb922ca2023-06-05 13:58:59 +020055 echo Flashing of U-Boot image succeed;
56 else echo Flashing of U-Boot image failed;
Tom Rinid8564e92022-06-13 22:57:34 -040057 fi;
58 fi;
59update_uboot=run download_uboot_spl flash_uboot_spl
60 download_uboot_img flash_uboot_img
61download_kernel=tftpboot ${loadaddr} ${kernelimg}
62flash_kernel=
63 if ext4write mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} ${filesize}; then
64 echo kernel update succeed;
65 else echo kernel update failed;
66 fi;
67update_kernel=run download_kernel flash_kernel
68download_dtb=tftpboot ${fdt_addr} imx6ul-${fdt_name}.dtb
69flash_dtb=
70 if ext4write mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb ${filesize}; then
71 echo dtb update succeed;
72 else echo dtb update in failed;
73 fi;
74update_dtb=run download_dtb flash_dtb
75download_rootfs=tftpboot ${loadaddr} ${board_name}-rootfs.ext4
76flash_rootfs=
77 if mmc dev 0 0; then
78 setexpr nbblocks ${filesize} / 0x200;
79 setexpr nbblocks ${nbblocks} + 1;
80 if mmc write ${loadaddr} 0x40800 ${nbblocks}; then
81 echo Flashing of rootfs image succeed;
82 else echo Flashing of rootfs image failed;
83 fi;
84 fi;
85update_rootfs=run download_rootfs flash_rootfs
86flash_failsafe=
87 if mmc dev 0 0; then
88 setexpr nbblocks ${filesize} / 0x200;
89 setexpr nbblocks ${nbblocks} + 1;
90 if mmc write ${loadaddr} 0x800 ${nbblocks}; then
91 echo Flashing of rootfs image in failsafe partition succeed;
92 else echo Flashing of rootfs image in failsafe partition failed;
93 fi;
94 fi;
95update_failsafe=run download_rootfs flash_failsafe
96download_userdata=tftpboot ${loadaddr} ${board_name}-user_data.ext4
97flash_userdata=
98 if mmc dev 0 0; then
99 setexpr nbblocks ${filesize} / 0x200;
100 setexpr nbblocks ${nbblocks} + 1;
101 if mmc write ${loadaddr} 0 ${nbblocks}; then
102 echo Flashing of user_data image succeed;
103 else echo Flashing of user_data image failed;
104 fi;
105 fi;
106update_userdata=run download_userdata flash_userdata; mmc rescan
107erase_userdata=
108 if mmc dev 0 0; then
109 echo Erasing eMMC User Data partition, no way out...;
110 mw ${loadaddr} 0 0x200000;
111 mmc write ${loadaddr} 0 0x1000;
112 mmc write ${loadaddr} 0x800 0x1000;
113 mmc write ${loadaddr} 0x40800 0x1000;
114 mmc write ${loadaddr} 0x440800 0x1000;
115 fi;
116 mmc rescan
117update_all=run update_rootfs update_uboot
118initargs=setenv bootargs console=${consoledev},${baudrate} ${extrabootargs}
119addipargs=setenv bootargs ${bootargs}
120 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off
121addmmcargs=setenv bootargs ${bootargs} root=${mmcroot}
122 rootfstype=${mmcrootfstype}
123emmcboot=run initargs; run addmmcargs;
124 load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${kernelimg} &&
125 load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/imx6ul-${fdt_name}.dtb &&
126 bootz ${loadaddr} - ${fdt_addr};
127emmcsafeboot=setenv mmcpart 1; setenv mmcroot /dev/mmcblk0p1 ro; run emmcboot;
128addnfsargs=setenv bootargs ${bootargs} root=/dev/nfs rw
129 nfsroot=${serverip}:${rootpath}
130nfsboot=run initargs; run addnfsargs addipargs;
131 nfs ${loadaddr} ${serverip}:${rootpath}/boot/${kernelimg} &&
132 nfs ${fdt_addr} ${serverip}:${rootpath}/boot/imx6ul-${fdt_name}.dtb &&
133 bootz ${loadaddr} - ${fdt_addr};