2 +++ b/configs/mt7981_cmcc_rax3000m-emmc_defconfig
5 +CONFIG_POSITION_INDEPENDENT=y
6 +CONFIG_ARCH_MEDIATEK=y
7 +CONFIG_TARGET_MT7981=y
8 +CONFIG_TEXT_BASE=0x41e00000
9 +CONFIG_SYS_MALLOC_F_LEN=0x4000
10 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
11 +CONFIG_NR_DRAM_BANKS=1
12 +CONFIG_DEFAULT_DEVICE_TREE="mt7981-cmcc-rax3000m-emmc"
13 +CONFIG_DEFAULT_ENV_FILE="cmcc_rax3000m-emmc_env"
14 +CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-rax3000m-emmc.dtb"
15 +CONFIG_OF_LIBFDT_OVERLAY=y
16 +CONFIG_DEBUG_UART_BASE=0x11002000
17 +CONFIG_DEBUG_UART_CLOCK=40000000
19 +CONFIG_SYS_LOAD_ADDR=0x46000000
20 +CONFIG_SMBIOS_PRODUCT_NAME=""
21 +CONFIG_AUTOBOOT_KEYED=y
23 +CONFIG_AUTOBOOT_MENU_SHOW=y
24 +CONFIG_CFB_CONSOLE_ANSI=y
25 +CONFIG_BOARD_LATE_INIT=y
29 +CONFIG_CMD_ENV_FLAGS=y
31 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
37 +CONFIG_SYS_PROMPT="MT7981> "
38 +CONFIG_CMD_BOOTMENU=y
48 +CONFIG_CMD_ENV_READMEM=y
49 +CONFIG_CMD_ERASEENV=y
53 +CONFIG_CMD_FS_GENERIC=y
61 +CONFIG_CMD_LINK_LOCAL=y
62 +# CONFIG_CMD_MBR is not set
66 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
72 +CONFIG_CMD_TFTPBOOT=y
84 +CONFIG_DISPLAY_CPUINFO=y
86 +CONFIG_DM_REGULATOR=y
87 +CONFIG_DM_REGULATOR_FIXED=y
88 +CONFIG_DM_REGULATOR_GPIO=y
93 +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
94 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
95 +CONFIG_VERSION_VARIABLE=y
96 +CONFIG_PARTITION_UUIDS=y
109 +CONFIG_PHY_MTK_TPHY=y
113 +CONFIG_MEDIATEK_ETH=y
116 +CONFIG_PCIE_MEDIATEK=y
119 +CONFIG_PINCTRL_MT7622=y
120 +CONFIG_POWER_DOMAIN=y
121 +CONFIG_PRE_CONSOLE_BUFFER=y
122 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
123 +CONFIG_MTK_POWER_DOMAIN=y
128 +CONFIG_MMC_DEFAULT_DEV=1
129 +CONFIG_MMC_HS200_SUPPORT=y
131 +CONFIG_MMC_SUPPORTS_TUNING=y
132 +CONFIG_SUPPORT_EMMC_BOOT=y
134 +CONFIG_SYSRESET_WATCHDOG=y
139 +CONFIG_RANDOM_UUID=y
143 +CONFIG_USB_XHCI_HCD=y
144 +CONFIG_USB_XHCI_MTK=y
145 +CONFIG_USB_STORAGE=y
147 +CONFIG_ENV_OVERWRITE=y
148 +CONFIG_ENV_IS_IN_MMC=y
149 +CONFIG_ENV_OFFSET=0x400000
150 +CONFIG_ENV_OFFSET_REDUND=0x440000
151 +CONFIG_ENV_SIZE=0x40000
152 +CONFIG_ENV_SIZE_REDUND=0x40000
153 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
154 +CONFIG_NET_RANDOM_ETHADDR=y
158 +CONFIG_SUPPORT_EMMC_BOOT=y
161 +CONFIG_MEDIATEK_ETH=y
164 +CONFIG_PINCTRL_MT7981=y
165 +CONFIG_POWER_DOMAIN=y
166 +CONFIG_MTK_POWER_DOMAIN=y
167 +CONFIG_DM_REGULATOR=y
168 +CONFIG_DM_REGULATOR_FIXED=y
172 +CONFIG_USE_DEFAULT_ENV_FILE=y
174 +CONFIG_LMB_MAX_REGIONS=64
176 +CONFIG_IPADDR="192.168.1.1"
177 +CONFIG_USE_SERVERIP=y
178 +CONFIG_SERVERIP="192.168.1.254"
180 +++ b/configs/mt7981_cmcc_rax3000m-nand_defconfig
183 +CONFIG_POSITION_INDEPENDENT=y
184 +CONFIG_ARCH_MEDIATEK=y
185 +CONFIG_TARGET_MT7981=y
186 +CONFIG_TEXT_BASE=0x41e00000
187 +CONFIG_SYS_MALLOC_F_LEN=0x4000
188 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
189 +CONFIG_NR_DRAM_BANKS=1
190 +CONFIG_DEFAULT_DEVICE_TREE="mt7981-cmcc-rax3000m-nand"
191 +CONFIG_DEFAULT_ENV_FILE="cmcc_rax3000m-nand_env"
192 +CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981-cmcc-rax3000m-nand.dtb"
193 +CONFIG_OF_LIBFDT_OVERLAY=y
194 +CONFIG_DEBUG_UART_BASE=0x11002000
195 +CONFIG_DEBUG_UART_CLOCK=40000000
197 +CONFIG_SYS_LOAD_ADDR=0x46000000
198 +CONFIG_SMBIOS_PRODUCT_NAME=""
199 +CONFIG_AUTOBOOT_KEYED=y
201 +CONFIG_AUTOBOOT_MENU_SHOW=y
202 +CONFIG_CFB_CONSOLE_ANSI=y
203 +CONFIG_BOARD_LATE_INIT=y
205 +CONFIG_BUTTON_GPIO=y
207 +CONFIG_CMD_ENV_FLAGS=y
209 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
215 +CONFIG_SYS_PROMPT="MT7981> "
216 +CONFIG_CMD_BOOTMENU=y
226 +CONFIG_CMD_ENV_READMEM=y
227 +CONFIG_CMD_ERASEENV=y
231 +CONFIG_CMD_FS_GENERIC=y
232 +CONFIG_CMD_FS_UUID=y
238 +CONFIG_CMD_LICENSE=y
239 +CONFIG_CMD_LINK_LOCAL=y
240 +# CONFIG_CMD_MBR is not set
243 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
244 +CONFIG_CMD_SF_TEST=y
249 +CONFIG_CMD_TFTPBOOT=y
250 +CONFIG_CMD_TFTPSRV=y
252 +CONFIG_CMD_UBI_RENAME=y
257 +CONFIG_CMD_SETEXPR=y
261 +CONFIG_CMD_STRINGS=y
263 +CONFIG_DISPLAY_CPUINFO=y
265 +CONFIG_DM_REGULATOR=y
266 +CONFIG_DM_REGULATOR_FIXED=y
267 +CONFIG_DM_REGULATOR_GPIO=y
270 +CONFIG_HUSH_PARSER=y
271 +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
272 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
273 +CONFIG_VERSION_VARIABLE=y
274 +CONFIG_PARTITION_UUIDS=y
287 +CONFIG_PHY_MTK_TPHY=y
291 +CONFIG_MEDIATEK_ETH=y
293 +# CONFIG_MMC is not set
294 +# CONFIG_DM_MMC is not set
296 +CONFIG_MTD_UBI_FASTMAP=y
298 +CONFIG_PCIE_MEDIATEK=y
301 +CONFIG_PINCTRL_MT7622=y
302 +CONFIG_POWER_DOMAIN=y
303 +CONFIG_PRE_CONSOLE_BUFFER=y
304 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
305 +CONFIG_MTK_POWER_DOMAIN=y
311 +CONFIG_MTK_SPI_NAND=y
312 +CONFIG_MTK_SPI_NAND_MTD=y
313 +CONFIG_SYSRESET_WATCHDOG=y
318 +CONFIG_RANDOM_UUID=y
321 +CONFIG_ENV_OVERWRITE=y
322 +CONFIG_ENV_IS_IN_UBI=y
323 +CONFIG_ENV_UBI_PART="ubi"
324 +CONFIG_ENV_SIZE=0x1f000
325 +CONFIG_ENV_SIZE_REDUND=0x1f000
326 +CONFIG_ENV_UBI_VOLUME="ubootenv"
327 +CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
328 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
329 +CONFIG_NET_RANDOM_ETHADDR=y
335 +CONFIG_MEDIATEK_ETH=y
338 +CONFIG_PINCTRL_MT7981=y
339 +CONFIG_POWER_DOMAIN=y
340 +CONFIG_MTK_POWER_DOMAIN=y
341 +CONFIG_DM_REGULATOR=y
342 +CONFIG_DM_REGULATOR_FIXED=y
346 +CONFIG_USE_DEFAULT_ENV_FILE=y
347 +CONFIG_MTD_SPI_NAND=y
351 +CONFIG_CMD_NAND_TRIMFFS=y
352 +CONFIG_LMB_MAX_REGIONS=64
354 +CONFIG_IPADDR="192.168.1.1"
355 +CONFIG_USE_SERVERIP=y
356 +CONFIG_SERVERIP="192.168.1.254"
358 +++ b/arch/arm/dts/mt7981-cmcc-rax3000m.dtsi
360 +// SPDX-License-Identifier: GPL-2.0-only
362 + * Copyright (c) 2022 MediaTek Inc.
363 + * Author: Sam Shih <sam.shih@mediatek.com>
367 +#include "mt7981.dtsi"
368 +#include <dt-bindings/gpio/gpio.h>
369 +#include <dt-bindings/input/linux-event-codes.h>
372 + #address-cells = <1>;
374 + model = "CMCC RAX3000M";
375 + compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
378 + stdout-path = &uart0;
379 + tick-timer = &timer0;
383 + device_type = "memory";
384 + reg = <0x40000000 0x20000000>;
388 + compatible = "gpio-keys";
392 + linux,code = <KEY_RESTART>;
393 + gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
398 + linux,code = <BTN_9>;
399 + linux,input-type = <EV_SW>;
400 + gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
405 + compatible = "gpio-leds";
408 + label = "green:status";
409 + gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
413 + label = "blue:status";
414 + gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
418 + label = "red:status";
419 + gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
426 + mediatek,gmac-id = <0>;
427 + phy-mode = "2500base-x";
428 + mediatek,switch = "mt7531";
429 + reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
438 + mediatek,force-highspeed;
443 + status = "disabled";
446 +++ b/arch/arm/dts/mt7981-cmcc-rax3000m-emmc.dts
448 +// SPDX-License-Identifier: GPL-2.0-only
451 +#include "mt7981-cmcc-rax3000m.dtsi"
454 + reg_3p3v: regulator-3p3v {
455 + compatible = "regulator-fixed";
456 + regulator-name = "fixed-3.3V";
457 + regulator-min-microvolt = <3300000>;
458 + regulator-max-microvolt = <3300000>;
460 + regulator-always-on;
465 + pinctrl-names = "default";
466 + pinctrl-0 = <&mmc0_pins_default>;
467 + max-frequency = <26000000>;
470 + vmmc-supply = <®_3p3v>;
476 + mmc0_pins_default: mmc0default {
478 + function = "flash";
479 + groups = "emmc_45";
482 + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO",
483 + "SPI0_CS", "SPI0_HOLD", "SPI0_WP",
484 + "SPI1_CLK", "SPI1_MOSI", "SPI1_MISO";
486 + drive-strength = <MTK_DRIVE_4mA>;
487 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
491 + drive-strength = <MTK_DRIVE_6mA>;
492 + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
496 + drive-strength = <MTK_DRIVE_4mA>;
497 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
502 +++ b/arch/arm/dts/mt7981-cmcc-rax3000m-nand.dts
504 +// SPDX-License-Identifier: GPL-2.0-only
507 +#include "mt7981-cmcc-rax3000m.dtsi"
510 + spi_flash_pins: spi0-pins-func-1 {
512 + function = "flash";
513 + groups = "spi0", "spi0_wp_hold";
517 + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
518 + drive-strength = <MTK_DRIVE_8mA>;
519 + bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
523 + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
524 + drive-strength = <MTK_DRIVE_8mA>;
525 + bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
531 + #address-cells = <1>;
533 + pinctrl-names = "default";
534 + pinctrl-0 = <&spi_flash_pins>;
545 + compatible = "spi-nand";
547 + spi-max-frequency = <52000000>;
550 + compatible = "fixed-partitions";
551 + #address-cells = <1>;
556 + reg = <0x0 0x100000>;
560 + label = "orig-env";
561 + reg = <0x100000 0x80000>;
566 + reg = <0x180000 0x200000>;
571 + reg = <0x380000 0x200000>;
576 + reg = <0x580000 0x7200000>;
582 +++ b/cmcc_rax3000m-emmc_env
585 +serverip=192.168.1.254
587 +console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
588 +bootargs=root=/dev/mmcblk0p65
589 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
590 +bootconf=config-1#mt7981b-cmcc-rax3000m-emmc
592 +bootfile=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb
593 +bootfile_bl2=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-preloader.bin
594 +bootfile_fip=openwrt-mediatek-filogic-cmcc_rax3000m-emmc-bl31-uboot.fip
595 +bootfile_upg=openwrt-mediatek-filogic-cmcc_rax3000m-squashfs-sysupgrade.itb
596 +bootled_pwr=red:status
597 +bootled_rec=blue:status
598 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
601 +bootmenu_title=
\e[0;34m( ( (
\e[1;39mOpenWrt
\e[0;34m ) ) )
\e[0;36m[eMMC]
\e[0m
602 +bootmenu_0=Initialize environment.=run _firstboot
603 +bootmenu_0d=Run default boot command.=run boot_default
604 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
605 +bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
606 +bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
607 +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
608 +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
609 +bootmenu_6=
\e[31mLoad BL31+U-Boot FIP via TFTP then write to eMMC.
\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
610 +bootmenu_7=
\e[31mLoad BL2 preloader via TFTP then write to eMMC.
\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
611 +bootmenu_8=Reboot.=reset
612 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
613 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
614 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
615 +boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
616 +boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
617 +boot_emmc=run boot_production ; run boot_recovery
618 +boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
619 +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
620 +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
621 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
622 +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
623 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
624 +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
625 +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
626 +part_default=production
627 +part_recovery=recovery
628 +reset_factory=eraseenv && reset
629 +emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
630 +emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
631 +emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
632 +emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
633 +emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
634 +emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
635 +_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
636 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
637 +_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
638 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title
\e[33m$ver
\e[0m"
640 +++ b/cmcc_rax3000m-nand_env
643 +serverip=192.168.1.254
645 +console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
646 +bootconf=config-1#mt7981b-cmcc-rax3000m-nand
647 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi
649 +bootfile=openwrt-mediatek-filogic-cmcc_rax3000m-initramfs-recovery.itb
650 +bootfile_bl2=openwrt-mediatek-filogic-cmcc_rax3000m-nand-preloader.bin
651 +bootfile_fip=openwrt-mediatek-filogic-cmcc_rax3000m-nand-bl31-uboot.fip
652 +bootfile_upg=openwrt-mediatek-filogic-cmcc_rax3000m-squashfs-sysupgrade.itb
653 +bootled_pwr=red:status
654 +bootled_rec=blue:status
655 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
658 +bootmenu_title=
\e[0;34m( ( (
\e[1;39mOpenWrt
\e[0;34m ) ) )
\e[0;36m[SPI-NAND]
\e[0m
659 +bootmenu_0=Initialize environment.=run _firstboot
660 +bootmenu_0d=Run default boot command.=run boot_default
661 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
662 +bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return
663 +bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return
664 +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
665 +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
666 +bootmenu_6=
\e[31mLoad BL31+U-Boot FIP via TFTP then write to NAND.
\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
667 +bootmenu_7=
\e[31mLoad BL2 preloader via TFTP then write to NAND.
\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
668 +bootmenu_8=Reboot.=reset
669 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
670 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
671 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
672 +boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
673 +boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
674 +boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever
675 +boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
676 +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
677 +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
678 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
679 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory
680 +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2
681 +part_default=production
682 +part_recovery=recovery
683 +reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800
684 +mtd_write_fip=mtd erase fip && mtd write fip $loadaddr
685 +mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr
686 +ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 || run ubi_format
687 +ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset
688 +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
689 +ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs
690 +ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery
691 +ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data
692 +ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize
693 +ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize
694 +_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv
695 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
696 +_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
697 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title
\e[33m$ver
\e[0m"