image: add CONFIG_EXTRA_IMAGE_NAME
[openwrt/openwrt.git] / package / boot / uboot-mediatek / patches / 442-add-bpi-r3-mini.patch
1 --- /dev/null
2 +++ b/configs/mt7986a_bpi-r3-mini-emmc_defconfig
3 @@ -0,0 +1,145 @@
4 +CONFIG_ARM=y
5 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
6 +CONFIG_POSITION_INDEPENDENT=y
7 +CONFIG_ARCH_MEDIATEK=y
8 +CONFIG_TEXT_BASE=0x41e00000
9 +CONFIG_SYS_MALLOC_F_LEN=0x4000
10 +CONFIG_NR_DRAM_BANKS=1
11 +CONFIG_ENV_SIZE=0x40000
12 +CONFIG_ENV_OFFSET=0x400000
13 +CONFIG_DEFAULT_DEVICE_TREE="mt7986a-bpi-r3-mini"
14 +CONFIG_OF_LIBFDT_OVERLAY=y
15 +CONFIG_TARGET_MT7986=y
16 +CONFIG_SYS_LOAD_ADDR=0x46000000
17 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
18 +CONFIG_DEBUG_UART_BASE=0x11002000
19 +CONFIG_DEBUG_UART_CLOCK=40000000
20 +CONFIG_ENV_OFFSET_REDUND=0x440000
21 +CONFIG_PCI=y
22 +CONFIG_DEBUG_UART=y
23 +CONFIG_AHCI=y
24 +CONFIG_FIT=y
25 +CONFIG_BOOTDELAY=30
26 +CONFIG_AUTOBOOT_KEYED=y
27 +CONFIG_AUTOBOOT_MENU_SHOW=y
28 +CONFIG_OF_SYSTEM_SETUP=y
29 +CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-bpi-r3-mini.dtb"
30 +CONFIG_LOGLEVEL=7
31 +CONFIG_PRE_CONSOLE_BUFFER=y
32 +CONFIG_LOG=y
33 +# CONFIG_BOARD_INIT is not set
34 +CONFIG_BOARD_LATE_INIT=y
35 +CONFIG_HUSH_PARSER=y
36 +CONFIG_SYS_PROMPT="MT7986> "
37 +CONFIG_CMD_CPU=y
38 +CONFIG_CMD_LICENSE=y
39 +# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
40 +CONFIG_CMD_BOOTMENU=y
41 +CONFIG_CMD_ASKENV=y
42 +CONFIG_CMD_ERASEENV=y
43 +CONFIG_CMD_ENV_FLAGS=y
44 +CONFIG_CMD_STRINGS=y
45 +CONFIG_CMD_DM=y
46 +CONFIG_CMD_GPIO=y
47 +CONFIG_CMD_PWM=y
48 +CONFIG_CMD_GPT=y
49 +CONFIG_CMD_MMC=y
50 +CONFIG_CMD_MTD=y
51 +CONFIG_CMD_PART=y
52 +CONFIG_CMD_PCI=y
53 +CONFIG_CMD_SF_TEST=y
54 +CONFIG_CMD_USB=y
55 +CONFIG_CMD_TFTPSRV=y
56 +CONFIG_CMD_RARP=y
57 +CONFIG_CMD_CDP=y
58 +CONFIG_CMD_SNTP=y
59 +CONFIG_CMD_LINK_LOCAL=y
60 +CONFIG_CMD_DHCP=y
61 +CONFIG_CMD_DNS=y
62 +CONFIG_CMD_MII=y
63 +CONFIG_CMD_PING=y
64 +CONFIG_CMD_PXE=y
65 +CONFIG_CMD_CACHE=y
66 +CONFIG_CMD_PSTORE=y
67 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
68 +CONFIG_CMD_UUID=y
69 +CONFIG_CMD_HASH=y
70 +CONFIG_CMD_SMC=y
71 +CONFIG_CMD_EXT4=y
72 +CONFIG_CMD_FAT=y
73 +CONFIG_CMD_FS_GENERIC=y
74 +CONFIG_CMD_FS_UUID=y
75 +CONFIG_CMD_UBI=y
76 +CONFIG_CMD_UBI_RENAME=y
77 +CONFIG_OF_EMBED=y
78 +CONFIG_ENV_OVERWRITE=y
79 +CONFIG_ENV_IS_IN_MMC=y
80 +CONFIG_ENV_REDUNDANT=y
81 +CONFIG_ENV_RELOC_GD_ENV_ADDR=y
82 +CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
83 +CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/bananapi_bpi-r3-mini_emmc_env"
84 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
85 +CONFIG_VERSION_VARIABLE=y
86 +CONFIG_NETCONSOLE=y
87 +CONFIG_USE_IPADDR=y
88 +CONFIG_IPADDR="192.168.1.1"
89 +CONFIG_USE_SERVERIP=y
90 +CONFIG_SERVERIP="192.168.1.254"
91 +CONFIG_NET_RANDOM_ETHADDR=y
92 +CONFIG_SCSI_AHCI=y
93 +CONFIG_AHCI_PCI=y
94 +CONFIG_MTK_AHCI=y
95 +CONFIG_BUTTON=y
96 +CONFIG_BUTTON_GPIO=y
97 +CONFIG_CLK=y
98 +CONFIG_GPIO_HOG=y
99 +CONFIG_LED=y
100 +CONFIG_LED_BLINK=y
101 +CONFIG_LED_GPIO=y
102 +CONFIG_SUPPORT_EMMC_BOOT=y
103 +CONFIG_MMC_HS200_SUPPORT=y
104 +CONFIG_MMC_MTK=y
105 +CONFIG_MTD=y
106 +CONFIG_DM_MTD=y
107 +CONFIG_MTD_SPI_NAND=y
108 +CONFIG_DM_SPI_FLASH=y
109 +CONFIG_SPI_FLASH_WINBOND=y
110 +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
111 +CONFIG_SPI_FLASH_MTD=y
112 +CONFIG_MTD_UBI_FASTMAP=y
113 +CONFIG_PHY_AIROHA=y
114 +CONFIG_PHY_AIROHA_EN8811H=y
115 +CONFIG_PHY_AIROHA_FW_IN_MMC=y
116 +CONFIG_PHY_ETHERNET_ID=y
117 +CONFIG_PHY_FIXED=y
118 +CONFIG_DM_MDIO=y
119 +CONFIG_DM_ETH_PHY=y
120 +CONFIG_MEDIATEK_ETH=y
121 +CONFIG_PCIE_MEDIATEK=y
122 +CONFIG_PHY=y
123 +CONFIG_PHY_MTK_TPHY=y
124 +CONFIG_PINCTRL=y
125 +CONFIG_PINCONF=y
126 +CONFIG_PINCTRL_MT7622=y
127 +CONFIG_PINCTRL_MT7986=y
128 +CONFIG_POWER_DOMAIN=y
129 +CONFIG_MTK_POWER_DOMAIN=y
130 +CONFIG_DM_REGULATOR=y
131 +CONFIG_DM_REGULATOR_FIXED=y
132 +CONFIG_DM_REGULATOR_GPIO=y
133 +CONFIG_DM_PWM=y
134 +CONFIG_PWM_MTK=y
135 +CONFIG_RAM=y
136 +CONFIG_SCSI=y
137 +CONFIG_DM_SERIAL=y
138 +CONFIG_SERIAL_RX_BUFFER=y
139 +CONFIG_MTK_SERIAL=y
140 +CONFIG_SPI=y
141 +CONFIG_DM_SPI=y
142 +CONFIG_MTK_SPIM=y
143 +CONFIG_USB=y
144 +CONFIG_USB_XHCI_HCD=y
145 +CONFIG_USB_XHCI_MTK=y
146 +CONFIG_USB_STORAGE=y
147 +CONFIG_ZSTD=y
148 +CONFIG_HEXDUMP=y
149 --- /dev/null
150 +++ b/configs/mt7986a_bpi-r3-mini-snand_defconfig
151 @@ -0,0 +1,138 @@
152 +CONFIG_ARM=y
153 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
154 +CONFIG_POSITION_INDEPENDENT=y
155 +CONFIG_ARCH_MEDIATEK=y
156 +CONFIG_TEXT_BASE=0x41e00000
157 +CONFIG_SYS_MALLOC_F_LEN=0x4000
158 +CONFIG_NR_DRAM_BANKS=1
159 +CONFIG_DEFAULT_DEVICE_TREE="mt7986a-bpi-r3-mini"
160 +CONFIG_OF_LIBFDT_OVERLAY=y
161 +CONFIG_TARGET_MT7986=y
162 +CONFIG_SYS_LOAD_ADDR=0x46000000
163 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
164 +CONFIG_DEBUG_UART_BASE=0x11002000
165 +CONFIG_DEBUG_UART_CLOCK=40000000
166 +CONFIG_PCI=y
167 +CONFIG_DEBUG_UART=y
168 +CONFIG_AHCI=y
169 +CONFIG_FIT=y
170 +CONFIG_BOOTDELAY=30
171 +CONFIG_AUTOBOOT_KEYED=y
172 +CONFIG_AUTOBOOT_MENU_SHOW=y
173 +CONFIG_OF_SYSTEM_SETUP=y
174 +CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-bpi-r3-mini.dtb"
175 +CONFIG_LOGLEVEL=7
176 +CONFIG_PRE_CONSOLE_BUFFER=y
177 +CONFIG_LOG=y
178 +# CONFIG_BOARD_INIT is not set
179 +CONFIG_BOARD_LATE_INIT=y
180 +CONFIG_HUSH_PARSER=y
181 +CONFIG_SYS_PROMPT="MT7986> "
182 +CONFIG_CMD_CPU=y
183 +CONFIG_CMD_LICENSE=y
184 +# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
185 +CONFIG_CMD_BOOTMENU=y
186 +CONFIG_CMD_ASKENV=y
187 +CONFIG_CMD_ERASEENV=y
188 +CONFIG_CMD_ENV_FLAGS=y
189 +CONFIG_CMD_STRINGS=y
190 +CONFIG_CMD_DM=y
191 +CONFIG_CMD_GPIO=y
192 +CONFIG_CMD_PWM=y
193 +CONFIG_CMD_GPT=y
194 +CONFIG_CMD_MMC=y
195 +CONFIG_CMD_MTD=y
196 +CONFIG_CMD_PART=y
197 +CONFIG_CMD_PCI=y
198 +CONFIG_CMD_USB=y
199 +CONFIG_CMD_TFTPSRV=y
200 +CONFIG_CMD_RARP=y
201 +CONFIG_CMD_CDP=y
202 +CONFIG_CMD_SNTP=y
203 +CONFIG_CMD_LINK_LOCAL=y
204 +CONFIG_CMD_DHCP=y
205 +CONFIG_CMD_DNS=y
206 +CONFIG_CMD_MII=y
207 +CONFIG_CMD_PING=y
208 +CONFIG_CMD_PXE=y
209 +CONFIG_CMD_CACHE=y
210 +CONFIG_CMD_PSTORE=y
211 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
212 +CONFIG_CMD_UUID=y
213 +CONFIG_CMD_HASH=y
214 +CONFIG_CMD_SMC=y
215 +CONFIG_CMD_EXT4=y
216 +CONFIG_CMD_FAT=y
217 +CONFIG_CMD_FS_GENERIC=y
218 +CONFIG_CMD_FS_UUID=y
219 +CONFIG_CMD_UBI=y
220 +CONFIG_CMD_UBI_RENAME=y
221 +CONFIG_OF_EMBED=y
222 +CONFIG_ENV_OVERWRITE=y
223 +CONFIG_ENV_IS_IN_UBI=y
224 +CONFIG_ENV_REDUNDANT=y
225 +CONFIG_ENV_UBI_PART="ubi"
226 +CONFIG_ENV_UBI_VOLUME="ubootenv"
227 +CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
228 +CONFIG_ENV_RELOC_GD_ENV_ADDR=y
229 +CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
230 +CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/bananapi_bpi-r3-mini_snand_env"
231 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
232 +CONFIG_VERSION_VARIABLE=y
233 +CONFIG_NETCONSOLE=y
234 +CONFIG_USE_IPADDR=y
235 +CONFIG_IPADDR="192.168.1.1"
236 +CONFIG_USE_SERVERIP=y
237 +CONFIG_NET_RANDOM_ETHADDR=y
238 +CONFIG_SCSI_AHCI=y
239 +CONFIG_AHCI_PCI=y
240 +CONFIG_MTK_AHCI=y
241 +CONFIG_BUTTON=y
242 +CONFIG_BUTTON_GPIO=y
243 +CONFIG_CLK=y
244 +CONFIG_GPIO_HOG=y
245 +CONFIG_LED=y
246 +CONFIG_LED_BLINK=y
247 +CONFIG_LED_GPIO=y
248 +CONFIG_SUPPORT_EMMC_BOOT=y
249 +CONFIG_MMC_HS200_SUPPORT=y
250 +CONFIG_MMC_MTK=y
251 +CONFIG_MTD=y
252 +CONFIG_DM_MTD=y
253 +CONFIG_MTD_SPI_NAND=y
254 +CONFIG_MTD_UBI_FASTMAP=y
255 +CONFIG_PHY_AIROHA=y
256 +CONFIG_PHY_AIROHA_EN8811H=y
257 +CONFIG_PHY_ETHERNET_ID=y
258 +CONFIG_PHY_FIXED=y
259 +CONFIG_DM_MDIO=y
260 +CONFIG_DM_ETH_PHY=y
261 +CONFIG_MEDIATEK_ETH=y
262 +CONFIG_PCIE_MEDIATEK=y
263 +CONFIG_PHY=y
264 +CONFIG_PHY_MTK_TPHY=y
265 +CONFIG_PINCTRL=y
266 +CONFIG_PINCONF=y
267 +CONFIG_PINCTRL_MT7622=y
268 +CONFIG_PINCTRL_MT7986=y
269 +CONFIG_POWER_DOMAIN=y
270 +CONFIG_MTK_POWER_DOMAIN=y
271 +CONFIG_DM_REGULATOR=y
272 +CONFIG_DM_REGULATOR_FIXED=y
273 +CONFIG_DM_REGULATOR_GPIO=y
274 +CONFIG_DM_PWM=y
275 +CONFIG_PWM_MTK=y
276 +CONFIG_RAM=y
277 +CONFIG_SCSI=y
278 +CONFIG_DM_SERIAL=y
279 +CONFIG_SERIAL_RX_BUFFER=y
280 +CONFIG_MTK_SERIAL=y
281 +CONFIG_SPI=y
282 +CONFIG_DM_SPI=y
283 +CONFIG_MTK_SPIM=y
284 +CONFIG_USB=y
285 +CONFIG_USB_XHCI_HCD=y
286 +CONFIG_USB_XHCI_MTK=y
287 +CONFIG_USB_STORAGE=y
288 +CONFIG_ZSTD=y
289 +CONFIG_HEXDUMP=y
290 --- /dev/null
291 +++ b/defenvs/bananapi_bpi-r3-mini_snand_env
292 @@ -0,0 +1,61 @@
293 +ipaddr=192.168.1.1
294 +serverip=192.168.1.254
295 +loadaddr=0x46000000
296 +console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
297 +bootargs=root=ubi.block=0,fit root=/dev/fit0 rootwait
298 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
299 +bootconf=config-mt7986a-bananapi-bpi-r3-mini
300 +bootdelay=0
301 +bootfile=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
302 +bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-preloader.bin
303 +bootfile_fip=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-snand-bl31-uboot.fip
304 +bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
305 +bootfile_en8811h_fw=EthMD32.bin
306 +bootled_pwr=green:status
307 +bootled_rec=blue:status
308 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
309 +bootmenu_default=0
310 +bootmenu_delay=0
311 +bootmenu_title= \e[0;34m( ( ( \e[1;39mOpenWrt\e[0;34m ) ) ) \e[0;36m[SPI-NAND]\e[0m
312 +bootmenu_0=Initialize environment.=run _firstboot
313 +bootmenu_0d=Run default boot command.=run boot_default
314 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
315 +bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
316 +bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
317 +bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
318 +bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
319 +bootmenu_6=\e[31mLoad Airoha EN8811H firmware via TFTP then write to NAND.\e[0m=run boot_tftp_write_en8811h_fw ; run bootmenu_confirm_return
320 +bootmenu_7=\e[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
321 +bootmenu_8=\e[31mLoad BL2 preloader via TFTP then write to NAND.\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
322 +bootmenu_9=Reboot.=reset
323 +bootmenu_10=Reset all settings to factory defaults.=run reset_factory ; reset
324 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
325 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
326 +boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
327 +boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
328 +boot_ubi=run boot_production ; run boot_recovery
329 +boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
330 +boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
331 +boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
332 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
333 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run ubi_write_fip && run reset_factory
334 +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run snand_write_bl2
335 +boot_tftp_write_en8811h_fw=tftpboot $loadaddr $bootfile_en8811h_fw && run ubi_write_en8811h_fw
336 +part_default=production
337 +part_recovery=recovery
338 +reset_factory=mw $loadaddr 0xff 0x1f000 ; ubi write $loadaddr ubootenv 0x1f000 ; ubi write $loadaddr ubootenv2 0x1f000 ; ubi remove rootfs_data
339 +snand_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr 0x0 0x40000 && mtd write bl2 $loadaddr 0x40000 0x40000 && mtd write bl2 $loadaddr 0x80000 0x40000 && mtd write bl2 $loadaddr 0xc0000 0x40000
340 +ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x1f000 dynamic ; ubi check ubootenv2 || ubi create ubootenv2 0x1f000 dynamic
341 +ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi
342 +ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
343 +ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
344 +ubi_read_emmc_install=ubi check emmc_install && ubi read $loadaddr emmc_install
345 +ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
346 +ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip 0x200000 static ; ubi write $loadaddr fip 0x200000
347 +ubi_write_en8811h_fw=ubi check en8811h-fw && ubi remove en8811h-fw ; ubi create en8811h-fw 0x24000 static ; ubi write $loadaddr en8811h-fw 0x24000
348 +ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize
349 +ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize
350 +_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
351 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
352 +_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
353 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
354 --- /dev/null
355 +++ b/defenvs/bananapi_bpi-r3-mini_emmc_env
356 @@ -0,0 +1,59 @@
357 +ipaddr=192.168.1.1
358 +serverip=192.168.1.254
359 +loadaddr=0x46000000
360 +console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
361 +bootargs=root=/dev/fit0 rootwait
362 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
363 +bootconf=config-mt7986a-bananapi-bpi-r3-mini
364 +bootdelay=0
365 +bootfile=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-initramfs-recovery.itb
366 +bootfile_bl2=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-preloader.bin
367 +bootfile_fip=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-emmc-bl31-uboot.fip
368 +bootfile_upg=openwrt-mediatek-filogic-bananapi_bpi-r3-mini-squashfs-sysupgrade.itb
369 +bootfile_en8811h_fw=EthMD32.bin
370 +bootled_pwr=green:status
371 +bootled_rec=blue:status
372 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
373 +bootmenu_default=0
374 +bootmenu_delay=0
375 +bootmenu_title= \e[0;34m( ( ( \e[1;39mOpenWrt\e[0;34m ) ) ) \e[0;36m[eMMC]\e[0m
376 +bootmenu_0=Initialize environment.=run _firstboot
377 +bootmenu_0d=Run default boot command.=run boot_default
378 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
379 +bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
380 +bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
381 +bootmenu_4=Load production system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
382 +bootmenu_5=Load recovery system via TFTP then write to eMMC.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
383 +bootmenu_6=\e[31mLoad Airoha EN8811H firmware via TFTP then write to eMMC.\e[0m=run boot_tftp_write_en8811h_fw ; run bootmenu_confirm_return
384 +bootmenu_7=\e[31mLoad BL31+U-Boot FIP via TFTP then write to eMMC.\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
385 +bootmenu_8=\e[31mLoad BL2 preloader via TFTP then write to eMMC.\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
386 +bootmenu_9=Reboot.=reset
387 +bootmenu_10=Reset all settings to factory defaults.=run reset_factory ; reset
388 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
389 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
390 +boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
391 +boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
392 +boot_emmc=run boot_production ; run boot_recovery
393 +boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
394 +boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run emmc_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
395 +boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run emmc_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi
396 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
397 +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
398 +boot_tftp_write_en8811h_fw=tftpboot $loadaddr $bootfile_en8811h_fw && run emmc_write_en8811h_fw
399 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
400 +mmc_write_vol=imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc erase 0x$part_addr 0x$image_size && mmc write $loadaddr 0x$part_addr 0x$image_size
401 +mmc_read_vol=mmc read $loadaddr $part_addr 0x100 && imszb $loadaddr image_size && test 0x$image_size -le 0x$part_size && mmc read $loadaddr 0x$part_addr 0x$image_size && setexpr filesize $image_size * 0x200
402 +part_default=production
403 +part_recovery=recovery
404 +reset_factory=eraseenv && reset
405 +emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
406 +emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
407 +emmc_write_en8811h_fw=mmc partconf 0 1 2 2 && mmc erase 0x0 0x120 && mmc write $fileaddr 0x0 0x120 ; mmc partconf 0 1 1 0
408 +emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
409 +emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
410 +emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
411 +emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
412 +_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
413 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
414 +_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
415 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
416 --- /dev/null
417 +++ b/arch/arm/dts/mt7986a-bpi-r3-mini.dts
418 @@ -0,0 +1,238 @@
419 +// SPDX-License-Identifier: GPL-2.0-or-later
420 +
421 +/dts-v1/;
422 +#include "mt7986.dtsi"
423 +#include <dt-bindings/gpio/gpio.h>
424 +#include <dt-bindings/input/linux-event-codes.h>
425 +
426 +/ {
427 + #address-cells = <1>;
428 + #size-cells = <1>;
429 + model = "Bananapi BPi-R3 Mini";
430 + compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";
431 +
432 + chosen {
433 + stdout-path = &uart0;
434 + tick-timer = &timer0;
435 + };
436 +
437 + memory@40000000 {
438 + device_type = "memory";
439 + reg = <0x40000000 0x80000000>;
440 + };
441 +
442 + gpio-keys {
443 + compatible = "gpio-keys";
444 +
445 + button-reset {
446 + label = "reset";
447 + linux,code = <KEY_RESTART>;
448 + gpios = <&pio 7 GPIO_ACTIVE_LOW>;
449 + };
450 + };
451 +
452 + leds {
453 + compatible = "gpio-leds";
454 +
455 + status_led: led-0 {
456 + label = "green:status";
457 + gpios = <&pio 19 GPIO_ACTIVE_HIGH>;
458 + };
459 +
460 + led-1 {
461 + label = "blue:wlan2g";
462 + gpios = <&pio 1 GPIO_ACTIVE_HIGH>;
463 + };
464 +
465 + led-2 {
466 + label = "blue:wlan5g";
467 + gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
468 + };
469 + };
470 +
471 + reg_1p8v: regulator-1p8v {
472 + compatible = "regulator-fixed";
473 + regulator-name = "fixed-1.8V";
474 + regulator-min-microvolt = <1800000>;
475 + regulator-max-microvolt = <1800000>;
476 + regulator-boot-on;
477 + regulator-always-on;
478 + };
479 +
480 + reg_3p3v: regulator-3p3v {
481 + compatible = "regulator-fixed";
482 + regulator-name = "fixed-3.3V";
483 + regulator-min-microvolt = <3300000>;
484 + regulator-max-microvolt = <3300000>;
485 + regulator-boot-on;
486 + regulator-always-on;
487 + };
488 +};
489 +
490 +&eth {
491 + status = "okay";
492 + pinctrl-names = "default";
493 + pinctrl-0 = <&mdio_pins>;
494 +
495 + mediatek,gmac-id = <0>;
496 + phy-mode = "2500base-x";
497 + phy-handle = <&phy14>;
498 +
499 + phy14: eth-phy@e {
500 + compatible = "ethernet-phy-id03a2.a411";
501 + reg = <14>;
502 +
503 + airoha,pnswap-rx;
504 +
505 + reset-gpios = <&pio 49 GPIO_ACTIVE_LOW>;
506 + reset-assert-us = <10000>;
507 + reset-deassert-us = <20000>;
508 + };
509 +};
510 +
511 +&mmc0 {
512 + pinctrl-names = "default";
513 + pinctrl-0 = <&mmc0_pins_default>;
514 + bus-width = <8>;
515 + max-frequency = <200000000>;
516 + cap-mmc-highspeed;
517 + cap-mmc-hw-reset;
518 + vmmc-supply = <&reg_3p3v>;
519 + vqmmc-supply = <&reg_1p8v>;
520 + non-removable;
521 + status = "okay";
522 +};
523 +
524 +&pio {
525 + mdio_pins: mdio-pins {
526 + mux {
527 + function = "eth";
528 + groups = "mdc_mdio";
529 + };
530 +
531 + conf-en8811-pwr-a {
532 + pins = "GPIO_11";
533 + drive-strength = <MTK_DRIVE_8mA>;
534 + bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
535 + output-low;
536 + };
537 +
538 + conf-en8811-pwr-b {
539 + pins = "GPIO_12";
540 + drive-strength = <MTK_DRIVE_8mA>;
541 + bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
542 + output-low;
543 + };
544 + };
545 +
546 + mmc0_pins_default: mmc0default {
547 + mux {
548 + function = "flash";
549 + groups = "emmc_51";
550 + };
551 +
552 + conf-cmd-dat {
553 + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
554 + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
555 + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
556 + input-enable;
557 + drive-strength = <MTK_DRIVE_4mA>;
558 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
559 + };
560 +
561 + conf-clk {
562 + pins = "EMMC_CK";
563 + drive-strength = <MTK_DRIVE_6mA>;
564 + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
565 + };
566 +
567 + conf-dsl {
568 + pins = "EMMC_DSL";
569 + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
570 + };
571 +
572 + conf-rst {
573 + pins = "EMMC_RSTB";
574 + drive-strength = <MTK_DRIVE_4mA>;
575 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
576 + };
577 + };
578 +
579 + spi_flash_pins: spi0-pins-func-1 {
580 + mux {
581 + function = "flash";
582 + groups = "spi0", "spi0_wp_hold";
583 + };
584 +
585 + conf-pu {
586 + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
587 + drive-strength = <MTK_DRIVE_8mA>;
588 + bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
589 + };
590 +
591 + conf-pd {
592 + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
593 + drive-strength = <MTK_DRIVE_8mA>;
594 + bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
595 + };
596 + };
597 +
598 + pwm_pins: pwm0-pins-func-1 {
599 + mux {
600 + function = "pwm";
601 + groups = "pwm0";
602 + };
603 + };
604 +};
605 +
606 +&pwm {
607 + pinctrl-names = "default";
608 + pinctrl-0 = <&pwm_pins>;
609 + status = "okay";
610 +};
611 +
612 +&spi0 {
613 + #address-cells = <1>;
614 + #size-cells = <0>;
615 + pinctrl-names = "default";
616 + pinctrl-0 = <&spi_flash_pins>;
617 + status = "okay";
618 + must_tx;
619 + enhance_timing;
620 + dma_ext;
621 + ipm_design;
622 + support_quad;
623 + tick_dly = <1>;
624 + sample_sel = <0>;
625 +
626 + spi_nand@0 {
627 + compatible = "spi-nand";
628 + reg = <0>;
629 + spi-max-frequency = <20000000>;
630 +
631 + partitions {
632 + compatible = "fixed-partitions";
633 + #address-cells = <1>;
634 + #size-cells = <1>;
635 +
636 + partition@0 {
637 + label = "bl2";
638 + reg = <0x0 0x200000>;
639 + };
640 +
641 + partition@200000 {
642 + label = "ubi";
643 + reg = <0x200000 0x7e00000>;
644 + };
645 + };
646 + };
647 +
648 +};
649 +
650 +&uart0 {
651 + status = "okay";
652 +};
653 +
654 +&watchdog {
655 + status = "disabled";
656 +};