2 +++ b/configs/mt7622_ubnt_unifi-6-lr-v1_defconfig
5 +CONFIG_POSITION_INDEPENDENT=y
6 +CONFIG_ARCH_MEDIATEK=y
7 +CONFIG_TARGET_MT7622=y
8 +CONFIG_TEXT_BASE=0x41e00000
9 +CONFIG_SYS_MALLOC_F_LEN=0x4000
10 +CONFIG_SYS_LOAD_ADDR=0x40080000
11 +CONFIG_USE_DEFAULT_ENV_FILE=y
12 +CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:128k(bl2),640k(fip),64k(u-boot-env),256k(factory),64k(eeprom),15232k(recovery),-(firmware)"
13 +CONFIG_ENV_IS_IN_MTD=y
14 +CONFIG_ENV_MTD_NAME="nor0"
15 +CONFIG_ENV_SIZE_REDUND=0x4000
16 +CONFIG_ENV_SIZE=0x4000
17 +CONFIG_ENV_OFFSET=0xc0000
18 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
19 +CONFIG_BOARD_LATE_INIT=y
20 +CONFIG_RESET_BUTTON_SETTLE_DELAY=400
21 +CONFIG_BOOTP_SEND_HOSTNAME=y
22 +CONFIG_DEFAULT_ENV_FILE="ubnt_unifi-6-lr_env"
23 +CONFIG_DEBUG_UART_BASE=0x11002000
24 +CONFIG_DEBUG_UART_CLOCK=25000000
25 +CONFIG_DEFAULT_DEVICE_TREE="mt7622-ubnt-unifi-6-lr"
27 +CONFIG_SMBIOS_PRODUCT_NAME=""
28 +CONFIG_AUTOBOOT_KEYED=y
30 +CONFIG_AUTOBOOT_MENU_SHOW=y
31 +CONFIG_CFB_CONSOLE_ANSI=y
35 +CONFIG_CMD_ENV_FLAGS=y
37 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
40 +CONFIG_DEFAULT_FDT_FILE="mt7622-ubnt-unifi-6-lr"
41 +CONFIG_SYS_PROMPT="MT7622> "
42 +# CONFIG_LEGACY_IMAGE_FORMAT is not set
43 +# CONFIG_BOOTM_PLAN9 is not set
44 +# CONFIG_BOOTM_RTEMS is not set
45 +# CONFIG_BOOTM_VXWORKS is not set
46 +# CONFIG_EFI is not set
47 +# CONFIG_EFI_LOADER is not set
48 +CONFIG_CMD_BOOTMENU=y
49 +# CONFIG_CMD_BOOTEFI is not set
56 +# CONFIG_CMD_ELF is not set
57 +# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
58 +CONFIG_CMD_ENV_READMEM=y
59 +CONFIG_CMD_ERASEENV=y
64 +CONFIG_CMD_LINK_LOCAL=y
65 +# CONFIG_CMD_MBR is not set
67 +CONFIG_CMD_MTDPARTS=y
68 +# CONFIG_CMD_PCI is not set
73 +CONFIG_CMD_TFTPBOOT=y
75 +# CONFIG_CMD_UNLZ4 is not set
78 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
84 +CONFIG_DISPLAY_CPUINFO=y
90 +CONFIG_DM_REGULATOR=y
91 +CONFIG_DM_REGULATOR_FIXED=y
92 +CONFIG_DM_REGULATOR_GPIO=y
93 +# CONFIG_DM_MMC is not set
96 +CONFIG_DM_SPI_FLASH=y
98 +# CONFIG_PARTITION_UUIDS is not set
99 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
100 +# CONFIG_LED is not set
101 +# CONFIG_LZ4 is not set
102 +CONFIG_VERSION_VARIABLE=y
110 +CONFIG_PHY_AQUANTIA=y
111 +CONFIG_PHY_ADDR_ENABLE=y
113 +CONFIG_MEDIATEK_ETH=y
115 +# CONFIG_MMC is not set
118 +CONFIG_PINCTRL_MT7622=y
119 +CONFIG_POWER_DOMAIN=y
120 +CONFIG_PRE_CONSOLE_BUFFER=y
121 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
122 +CONFIG_MTK_POWER_DOMAIN=y
126 +CONFIG_MTK_SNFI_SPI=y
128 +CONFIG_SYSRESET_WATCHDOG=y
131 +CONFIG_RANDOM_UUID=y
134 +CONFIG_SPI_FLASH_BAR=y
135 +CONFIG_SPI_FLASH_MTD=y
136 +CONFIG_SPI_FLASH_UNLOCK_ALL=y
137 +CONFIG_SPI_FLASH_EON=y
138 +CONFIG_SPI_FLASH_GIGADEVICE=y
139 +CONFIG_SPI_FLASH_MACRONIX=y
140 +CONFIG_SPI_FLASH_SPANSION=y
141 +CONFIG_SPI_FLASH_STMICRO=y
142 +CONFIG_SPI_FLASH_SST=y
143 +CONFIG_SPI_FLASH_WINBOND=y
144 +CONFIG_SPI_FLASH_XMC=y
145 +CONFIG_SPI_FLASH_USE_4K_SECTORS=y
146 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
148 +CONFIG_IPADDR="192.168.1.1"
149 +CONFIG_USE_SERVERIP=y
150 +CONFIG_SERVERIP="192.168.1.254"
152 +++ b/configs/mt7622_ubnt_unifi-6-lr-v2_defconfig
155 +CONFIG_POSITION_INDEPENDENT=y
156 +CONFIG_ARCH_MEDIATEK=y
157 +CONFIG_TARGET_MT7622=y
158 +CONFIG_TEXT_BASE=0x41e00000
159 +CONFIG_SYS_MALLOC_F_LEN=0x4000
160 +CONFIG_SYS_LOAD_ADDR=0x40080000
161 +CONFIG_USE_DEFAULT_ENV_FILE=y
162 +CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:128k(bl2),640k(fip),64k(u-boot-env),256k(factory),64k(eeprom),15232k(recovery),-(firmware)"
163 +CONFIG_ENV_IS_IN_MTD=y
164 +CONFIG_ENV_MTD_NAME="nor0"
165 +CONFIG_ENV_SIZE_REDUND=0x4000
166 +CONFIG_ENV_SIZE=0x4000
167 +CONFIG_ENV_OFFSET=0xc0000
168 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
169 +CONFIG_BOARD_LATE_INIT=y
170 +CONFIG_RESET_BUTTON_SETTLE_DELAY=400
171 +CONFIG_BOOTP_SEND_HOSTNAME=y
172 +CONFIG_DEFAULT_ENV_FILE="ubnt_unifi-6-lr-v2_env"
173 +CONFIG_DEBUG_UART_BASE=0x11002000
174 +CONFIG_DEBUG_UART_CLOCK=25000000
175 +CONFIG_DEFAULT_DEVICE_TREE="mt7622-ubnt-unifi-6-lr"
177 +CONFIG_SMBIOS_PRODUCT_NAME=""
178 +CONFIG_AUTOBOOT_KEYED=y
180 +CONFIG_AUTOBOOT_MENU_SHOW=y
181 +CONFIG_CFB_CONSOLE_ANSI=y
183 +CONFIG_BUTTON_GPIO=y
185 +CONFIG_CMD_ENV_FLAGS=y
187 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
190 +CONFIG_DEFAULT_FDT_FILE="mt7622-ubnt-unifi-6-lr"
191 +CONFIG_SYS_PROMPT="MT7622> "
192 +# CONFIG_LEGACY_IMAGE_FORMAT is not set
193 +# CONFIG_BOOTM_PLAN9 is not set
194 +# CONFIG_BOOTM_RTEMS is not set
195 +# CONFIG_BOOTM_VXWORKS is not set
196 +# CONFIG_EFI is not set
197 +# CONFIG_EFI_LOADER is not set
198 +CONFIG_CMD_BOOTMENU=y
199 +# CONFIG_CMD_BOOTEFI is not set
206 +# CONFIG_CMD_ELF is not set
207 +# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
208 +CONFIG_CMD_ENV_READMEM=y
209 +CONFIG_CMD_ERASEENV=y
214 +CONFIG_CMD_LINK_LOCAL=y
215 +# CONFIG_CMD_MBR is not set
217 +CONFIG_CMD_MTDPARTS=y
218 +# CONFIG_CMD_PCI is not set
219 +CONFIG_CMD_SF_TEST=y
223 +CONFIG_CMD_TFTPBOOT=y
224 +CONFIG_CMD_TFTPSRV=y
225 +# CONFIG_CMD_UNLZ4 is not set
228 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
230 +CONFIG_CMD_SETEXPR=y
234 +CONFIG_DISPLAY_CPUINFO=y
240 +CONFIG_DM_REGULATOR=y
241 +CONFIG_DM_REGULATOR_FIXED=y
242 +CONFIG_DM_REGULATOR_GPIO=y
243 +# CONFIG_DM_MMC is not set
246 +CONFIG_DM_SPI_FLASH=y
247 +CONFIG_HUSH_PARSER=y
248 +# CONFIG_PARTITION_UUIDS is not set
249 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
250 +# CONFIG_LED is not set
251 +# CONFIG_LZ4 is not set
252 +CONFIG_VERSION_VARIABLE=y
260 +CONFIG_PHY_AQUANTIA=y
261 +CONFIG_PHY_ADDR_ENABLE=y
263 +CONFIG_MEDIATEK_ETH=y
265 +# CONFIG_MMC is not set
268 +CONFIG_PINCTRL_MT7622=y
269 +CONFIG_POWER_DOMAIN=y
270 +CONFIG_PRE_CONSOLE_BUFFER=y
271 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
272 +CONFIG_MTK_POWER_DOMAIN=y
276 +CONFIG_MTK_SNFI_SPI=y
278 +CONFIG_SYSRESET_WATCHDOG=y
281 +CONFIG_RANDOM_UUID=y
284 +CONFIG_SPI_FLASH_BAR=y
285 +CONFIG_SPI_FLASH_MTD=y
286 +CONFIG_SPI_FLASH_UNLOCK_ALL=y
287 +CONFIG_SPI_FLASH_EON=y
288 +CONFIG_SPI_FLASH_GIGADEVICE=y
289 +CONFIG_SPI_FLASH_MACRONIX=y
290 +CONFIG_SPI_FLASH_SPANSION=y
291 +CONFIG_SPI_FLASH_STMICRO=y
292 +CONFIG_SPI_FLASH_SST=y
293 +CONFIG_SPI_FLASH_WINBOND=y
294 +CONFIG_SPI_FLASH_XMC=y
295 +CONFIG_SPI_FLASH_USE_4K_SECTORS=y
296 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
298 +CONFIG_IPADDR="192.168.1.1"
299 +CONFIG_USE_SERVERIP=y
300 +CONFIG_SERVERIP="192.168.1.254"
302 +++ b/configs/mt7622_ubnt_unifi-6-lr-v3_defconfig
305 +CONFIG_POSITION_INDEPENDENT=y
306 +CONFIG_ARCH_MEDIATEK=y
307 +CONFIG_TARGET_MT7622=y
308 +CONFIG_TEXT_BASE=0x41e00000
309 +CONFIG_SYS_MALLOC_F_LEN=0x4000
310 +CONFIG_SYS_LOAD_ADDR=0x40080000
311 +CONFIG_USE_DEFAULT_ENV_FILE=y
312 +CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:128k(bl2),640k(fip),64k(u-boot-env),256k(factory),64k(eeprom),15232k(recovery),-(firmware)"
313 +CONFIG_ENV_IS_IN_MTD=y
314 +CONFIG_ENV_MTD_NAME="nor0"
315 +CONFIG_ENV_SIZE_REDUND=0x4000
316 +CONFIG_ENV_SIZE=0x4000
317 +CONFIG_ENV_OFFSET=0xc0000
318 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
319 +CONFIG_BOARD_LATE_INIT=y
320 +CONFIG_RESET_BUTTON_SETTLE_DELAY=400
321 +CONFIG_BOOTP_SEND_HOSTNAME=y
322 +CONFIG_DEFAULT_ENV_FILE="ubnt_unifi-6-lr_env"
323 +CONFIG_DEBUG_UART_BASE=0x11002000
324 +CONFIG_DEBUG_UART_CLOCK=25000000
325 +CONFIG_DEFAULT_DEVICE_TREE="mt7622-ubnt-unifi-6-lr-v3"
327 +CONFIG_SMBIOS_PRODUCT_NAME=""
328 +CONFIG_AUTOBOOT_KEYED=y
330 +CONFIG_AUTOBOOT_MENU_SHOW=y
331 +CONFIG_CFB_CONSOLE_ANSI=y
333 +CONFIG_BUTTON_GPIO=y
335 +CONFIG_CMD_ENV_FLAGS=y
337 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
340 +CONFIG_DEFAULT_FDT_FILE="mt7622-ubnt-unifi-6-lr-v3"
341 +CONFIG_SYS_PROMPT="MT7622> "
342 +# CONFIG_LEGACY_IMAGE_FORMAT is not set
343 +# CONFIG_BOOTM_PLAN9 is not set
344 +# CONFIG_BOOTM_RTEMS is not set
345 +# CONFIG_BOOTM_VXWORKS is not set
346 +# CONFIG_EFI is not set
347 +# CONFIG_EFI_LOADER is not set
348 +CONFIG_CMD_BOOTMENU=y
349 +# CONFIG_CMD_BOOTEFI is not set
356 +# CONFIG_CMD_ELF is not set
357 +# CONFIG_CMD_BOOTEFI_BOOTMGR is not set
358 +CONFIG_CMD_ENV_READMEM=y
359 +CONFIG_CMD_ERASEENV=y
364 +CONFIG_CMD_LINK_LOCAL=y
365 +# CONFIG_CMD_MBR is not set
367 +CONFIG_CMD_MTDPARTS=y
368 +# CONFIG_CMD_PCI is not set
369 +CONFIG_CMD_SF_TEST=y
373 +CONFIG_CMD_TFTPBOOT=y
374 +CONFIG_CMD_TFTPSRV=y
375 +# CONFIG_CMD_UNLZ4 is not set
378 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
380 +CONFIG_CMD_SETEXPR=y
384 +CONFIG_DISPLAY_CPUINFO=y
390 +CONFIG_DM_REGULATOR=y
391 +CONFIG_DM_REGULATOR_FIXED=y
392 +CONFIG_DM_REGULATOR_GPIO=y
393 +# CONFIG_DM_MMC is not set
396 +CONFIG_DM_SPI_FLASH=y
397 +CONFIG_HUSH_PARSER=y
398 +# CONFIG_PARTITION_UUIDS is not set
399 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
400 +# CONFIG_LED is not set
401 +# CONFIG_LZ4 is not set
402 +CONFIG_VERSION_VARIABLE=y
409 +CONFIG_PHY_REALTEK=y
410 +CONFIG_PHY_ADDR_ENABLE=y
412 +CONFIG_MEDIATEK_ETH=y
414 +# CONFIG_MMC is not set
417 +CONFIG_PINCTRL_MT7622=y
418 +CONFIG_POWER_DOMAIN=y
419 +CONFIG_PRE_CONSOLE_BUFFER=y
420 +CONFIG_PRE_CON_BUF_ADDR=0x4007EF00
421 +CONFIG_MTK_POWER_DOMAIN=y
425 +CONFIG_MTK_SNFI_SPI=y
427 +CONFIG_SYSRESET_WATCHDOG=y
430 +CONFIG_RANDOM_UUID=y
433 +CONFIG_SPI_FLASH_BAR=y
434 +CONFIG_SPI_FLASH_MTD=y
435 +CONFIG_SPI_FLASH_UNLOCK_ALL=y
436 +CONFIG_SPI_FLASH_EON=y
437 +CONFIG_SPI_FLASH_GIGADEVICE=y
438 +CONFIG_SPI_FLASH_MACRONIX=y
439 +CONFIG_SPI_FLASH_SPANSION=y
440 +CONFIG_SPI_FLASH_STMICRO=y
441 +CONFIG_SPI_FLASH_SST=y
442 +CONFIG_SPI_FLASH_WINBOND=y
443 +CONFIG_SPI_FLASH_XMC=y
444 +CONFIG_SPI_FLASH_USE_4K_SECTORS=y
445 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
447 +CONFIG_IPADDR="192.168.1.1"
448 +CONFIG_USE_SERVERIP=y
449 +CONFIG_SERVERIP="192.168.1.254"
451 +++ b/arch/arm/dts/mt7622-ubnt-unifi-6-lr.dts
453 +// SPDX-License-Identifier: GPL-2.0
455 + * Copyright (c) 2019 MediaTek Inc.
456 + * Author: Sam Shih <sam.shih@mediatek.com>
460 +#include <dt-bindings/input/linux-event-codes.h>
461 +#include "mt7622.dtsi"
462 +#include "mt7622-u-boot.dtsi"
465 + #address-cells = <1>;
467 + model = "mt7622-ubnt-unifi-6-lr";
468 + compatible = "mediatek,mt7622", "ubnt,unifi-6-lr";
471 + stdout-path = &uart0;
472 + tick-timer = &timer0;
476 + device_type = "memory";
477 + reg = <0x40000000 0x20000000>;
485 + compatible = "gpio-keys";
489 + gpios = <&gpio 62 GPIO_ACTIVE_LOW>;
490 + linux,code = <KEY_RESTART>;
495 + device_type = "memory";
496 + reg = <0x40000000 0x20000000>;
499 + reg_1p8v: regulator-1p8v {
500 + compatible = "regulator-fixed";
501 + regulator-name = "fixed-1.8V";
502 + regulator-min-microvolt = <1800000>;
503 + regulator-max-microvolt = <1800000>;
505 + regulator-always-on;
508 + reg_3p3v: regulator-3p3v {
509 + compatible = "regulator-fixed";
510 + regulator-name = "fixed-3.3V";
511 + regulator-min-microvolt = <3300000>;
512 + regulator-max-microvolt = <3300000>;
514 + regulator-always-on;
517 + reg_5v: regulator-5v {
518 + compatible = "regulator-fixed";
519 + regulator-name = "fixed-5V";
520 + regulator-min-microvolt = <5000000>;
521 + regulator-max-microvolt = <5000000>;
523 + regulator-always-on;
528 + pinctrl-names = "default";
529 + pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
542 + eth_pins: eth-pins {
545 + groups = "mdc_mdio", "rgmii_via_gmac2";
549 + pcie0_pins: pcie0-pins {
552 + groups = "pcie0_pad_perst",
558 + pcie1_pins: pcie1-pins {
561 + groups = "pcie1_pad_perst",
567 + snfi_pins: snfi-pins {
569 + function = "flash";
574 + snor_pins: snor-pins {
576 + function = "flash";
577 + groups = "spi_nor";
581 + uart0_pins: uart0 {
584 + groups = "uart0_0_tx_rx" ;
588 + watchdog_pins: watchdog-default {
590 + function = "watchdog";
591 + groups = "watchdog";
597 + pinctrl-names = "default";
598 + pinctrl-0 = <&snor_pins>;
602 + compatible = "jedec,spi-nor";
604 + spi-tx-bus-width = <1>;
605 + spi-rx-bus-width = <4>;
606 + u-boot,dm-pre-reloc;
611 + mediatek,force-highspeed;
616 + pinctrl-names = "default";
617 + pinctrl-0 = <&watchdog_pins>;
623 + pinctrl-names = "default";
624 + pinctrl-0 = <ð_pins>;
626 + mediatek,gmac-id = <0>;
627 + phy-mode = "2500base-x";
628 + phy-handle = <&gphy>;
636 + #address-cells = <1>;
639 + gphy: ethernet-phy@8 {
640 + /* Marvell AQRate AQR112W - no driver */
641 + compatible = "ethernet-phy-ieee802.3-c45";
647 +++ b/arch/arm/dts/mt7622-ubnt-unifi-6-lr-v3.dts
649 +// SPDX-License-Identifier: GPL-2.0
651 + * Copyright (c) 2019 MediaTek Inc.
652 + * Author: Sam Shih <sam.shih@mediatek.com>
656 +#include <dt-bindings/input/linux-event-codes.h>
657 +#include "mt7622.dtsi"
658 +#include "mt7622-u-boot.dtsi"
661 + #address-cells = <1>;
663 + model = "mt7622-ubnt-unifi-6-lr-v3";
664 + compatible = "mediatek,mt7622", "ubnt,unifi-6-lr-v3";
667 + stdout-path = &uart0;
668 + tick-timer = &timer0;
672 + device_type = "memory";
673 + reg = <0x40000000 0x20000000>;
681 + compatible = "gpio-keys";
685 + gpios = <&gpio 62 GPIO_ACTIVE_LOW>;
686 + linux,code = <KEY_RESTART>;
691 + device_type = "memory";
692 + reg = <0x40000000 0x20000000>;
695 + reg_1p8v: regulator-1p8v {
696 + compatible = "regulator-fixed";
697 + regulator-name = "fixed-1.8V";
698 + regulator-min-microvolt = <1800000>;
699 + regulator-max-microvolt = <1800000>;
701 + regulator-always-on;
704 + reg_3p3v: regulator-3p3v {
705 + compatible = "regulator-fixed";
706 + regulator-name = "fixed-3.3V";
707 + regulator-min-microvolt = <3300000>;
708 + regulator-max-microvolt = <3300000>;
710 + regulator-always-on;
713 + reg_5v: regulator-5v {
714 + compatible = "regulator-fixed";
715 + regulator-name = "fixed-5V";
716 + regulator-min-microvolt = <5000000>;
717 + regulator-max-microvolt = <5000000>;
719 + regulator-always-on;
724 + pinctrl-names = "default";
725 + pinctrl-0 = <&pcie0_pins>, <&pcie1_pins>;
738 + eth_pins: eth-pins {
741 + groups = "mdc_mdio", "rgmii_via_gmac2";
745 + pcie0_pins: pcie0-pins {
748 + groups = "pcie0_pad_perst",
754 + pcie1_pins: pcie1-pins {
757 + groups = "pcie1_pad_perst",
763 + snfi_pins: snfi-pins {
765 + function = "flash";
770 + snor_pins: snor-pins {
772 + function = "flash";
773 + groups = "spi_nor";
777 + uart0_pins: uart0 {
780 + groups = "uart0_0_tx_rx" ;
784 + watchdog_pins: watchdog-default {
786 + function = "watchdog";
787 + groups = "watchdog";
793 + pinctrl-names = "default";
794 + pinctrl-0 = <&snor_pins>;
798 + compatible = "jedec,spi-nor";
800 + spi-tx-bus-width = <1>;
801 + spi-rx-bus-width = <4>;
802 + u-boot,dm-pre-reloc;
807 + mediatek,force-highspeed;
812 + pinctrl-names = "default";
813 + pinctrl-0 = <&watchdog_pins>;
819 + pinctrl-names = "default";
820 + pinctrl-0 = <ð_pins>;
822 + mediatek,gmac-id = <0>;
823 + phy-mode = "sgmii";
824 + phy-handle = <&gphy>;
832 + #address-cells = <1>;
835 + gphy: ethernet-phy@0 {
836 + /* RealTek RTL8211FS */
837 + compatible = "ethernet-phy-ieee802.3-c22";
842 --- a/arch/arm/dts/Makefile
843 +++ b/arch/arm/dts/Makefile
844 @@ -1306,6 +1306,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
845 mt7623a-unielec-u7623-02-emmc.dtb \
846 mt7622-bananapi-bpi-r64.dtb \
847 mt7622-linksys-e8450-ubi.dtb \
848 + mt7622-ubnt-unifi-6-lr.dtb \
849 + mt7622-ubnt-unifi-6-lr-v3.dtb \
850 mt7623n-bananapi-bpi-r2.dtb \
854 +++ b/ubnt_unifi-6-lr_env
856 +ethaddr_factory=mtd read nor0 $loadaddr 0x110000 0x10000 && env readmem -b ethaddr $loadaddr 0x6 ; setenv ethaddr_factory
858 +serverip=192.168.1.254
860 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_nor ; fi
862 +bootfile=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v1-ubootmod-initramfs-recovery.itb
863 +bootfile_bl2=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v1-ubootmod-preloader.bin
864 +bootfile_fip=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v1-ubootmod-bl31-uboot.fip
865 +bootfile_upg=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v1-ubootmod-squashfs-sysupgrade.itb
866 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
869 +bootmenu_title=
\e[0;34m( ( (
\e[1;39mOpenWrt
\e[0;34m ) ) )
\e[0m
870 +bootmenu_0=Initialize environment.=run _firstboot
871 +bootmenu_0d=Run default boot command.=run boot_default
872 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
873 +bootmenu_2=Boot production system from flash.=run boot_production ; run bootmenu_confirm_return
874 +bootmenu_3=Boot recovery system from flash.=run boot_recovery ; run bootmenu_confirm_return
875 +bootmenu_4=Load production system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
876 +bootmenu_5=Load recovery system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
877 +bootmenu_6=
\e[31mLoad BL31+U-Boot FIP via TFTP then write to flash.
\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
878 +bootmenu_7=
\e[31mLoad BL2 preloader via TFTP then write to flash.
\e[0m=run boot_tftp_write_preloader ; run bootmenu_confirm_return
879 +bootmenu_8=Reboot.=reset
880 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
881 +boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
882 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
883 +boot_production=run nor_read_production && bootm $loadaddr
884 +boot_recovery=run nor_read_recovery ; bootm $loadaddr
885 +boot_serial_write_fip=loadx $loadaddr 115200 && run boot_write_fip
886 +boot_serial_write_preloader=loadx $loadaddr 115200 && run boot_write_preloader
887 +boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done
888 +boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run nor_write_production ; if env exists noboot ; then else bootm $loadaddr ; fi
889 +boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run nor_write_recovery ; if env exists noboot ; then else bootm $loadaddr ; fi
890 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
891 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run boot_write_fip
892 +boot_tftp_write_preloader=tftpboot $loadaddr $bootfile_bl2 && run boot_write_preloader
893 +boot_nor=run boot_production ; run boot_recovery
894 +boot_write_fip=mtd erase nor0 0x20000 0x80000 && mtd write nor0 $loadaddr 0x20000 0x80000
895 +boot_write_preloader=mtd erase nor0 0x0 0x20000 && mtd write nor0 $loadaddr 0x0 0x20000
896 +reset_factory=mtd erase nor0 0xc0000 0x10000 && reset
897 +nor_read_production=mtd read nor0 $loadaddr 0x1000000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x1000000 $image_size
898 +nor_read_recovery=mtd read nor0 $loadaddr 0x120000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x120000 $image_size
899 +nor_pad_size=imsz $loadaddr image_size ; setexpr image_eb 0x$image_size / 0x1000 ; setexpr tmp1 0x$image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb 0x$image_eb + 1 ; setexpr image_eb 0x$image_eb * 0x1000
900 +nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x3000000 && mtd erase nor0 0x1000000 0x$image_eb && mtd write nor0 $loadaddr 0x1000000 $filesize
901 +nor_write_recovery=run nor_pad_size ; test 0x$image_eb -le 0xee0000 && mtd erase nor0 0x120000 0x$image_eb && mtd write nor0 $loadaddr 0x120000 $filesize
902 +_init_env=setenv _init_env ; saveenv
903 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
904 +_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
905 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title
\e[33m$ver
\e[0m"
907 +++ b/ubnt_unifi-6-lr-v2_env
909 +ethaddr_factory=mtd read nor0 $loadaddr 0x110000 0x10000 && env readmem -b ethaddr $loadaddr 0x6 ; setenv ethaddr_factory
911 +serverip=192.168.1.254
913 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_nor ; fi
915 +bootfile=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-initramfs-recovery.itb
916 +bootfile_bl2=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-preloader.bin
917 +bootfile_fip=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-bl31-uboot.fip
918 +bootfile_upg=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v2-ubootmod-squashfs-sysupgrade.itb
919 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
922 +bootmenu_title=
\e[0;34m( ( (
\e[1;39mOpenWrt
\e[0;34m ) ) )
\e[0m
923 +bootmenu_0=Initialize environment.=run _firstboot
924 +bootmenu_0d=Run default boot command.=run boot_default
925 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
926 +bootmenu_2=Boot production system from flash.=run boot_production ; run bootmenu_confirm_return
927 +bootmenu_3=Boot recovery system from flash.=run boot_recovery ; run bootmenu_confirm_return
928 +bootmenu_4=Load production system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
929 +bootmenu_5=Load recovery system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
930 +bootmenu_6=
\e[31mLoad BL31+U-Boot FIP via TFTP then write to flash.
\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
931 +bootmenu_7=
\e[31mLoad BL2 preloader via TFTP then write to flash.
\e[0m=run boot_tftp_write_preloader ; run bootmenu_confirm_return
932 +bootmenu_8=Reboot.=reset
933 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
934 +boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
935 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
936 +boot_production=run nor_read_production && bootm $loadaddr
937 +boot_recovery=run nor_read_recovery ; bootm $loadaddr
938 +boot_serial_write_fip=loadx $loadaddr 115200 && run boot_write_fip
939 +boot_serial_write_preloader=loadx $loadaddr 115200 && run boot_write_preloader
940 +boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done
941 +boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run nor_write_production ; if env exists noboot ; then else bootm $loadaddr ; fi
942 +boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run nor_write_recovery ; if env exists noboot ; then else bootm $loadaddr ; fi
943 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
944 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run boot_write_fip
945 +boot_tftp_write_preloader=tftpboot $loadaddr $bootfile_bl2 && run boot_write_preloader
946 +boot_nor=run boot_production ; run boot_recovery
947 +boot_write_fip=mtd erase nor0 0x20000 0x80000 && mtd write nor0 $loadaddr 0x20000 0x80000
948 +boot_write_preloader=mtd erase nor0 0x0 0x20000 && mtd write nor0 $loadaddr 0x0 0x20000
949 +reset_factory=mtd erase nor0 0xc0000 0x10000 && reset
950 +nor_read_production=mtd read nor0 $loadaddr 0x1000000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x1000000 $image_size
951 +nor_read_recovery=mtd read nor0 $loadaddr 0x120000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x120000 $image_size
952 +nor_pad_size=imsz $loadaddr image_size ; setexpr image_eb 0x$image_size / 0x1000 ; setexpr tmp1 0x$image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb 0x$image_eb + 1 ; setexpr image_eb 0x$image_eb * 0x1000
953 +nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x3000000 && mtd erase nor0 0x1000000 0x$image_eb && mtd write nor0 $loadaddr 0x1000000 $filesize
954 +nor_write_recovery=run nor_pad_size ; test 0x$image_eb -le 0xee0000 && mtd erase nor0 0x120000 0x$image_eb && mtd write nor0 $loadaddr 0x120000 $filesize
955 +_init_env=setenv _init_env ; saveenv
956 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
957 +_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
958 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title
\e[33m$ver
\e[0m"--- /dev/null
960 +++ b/ubnt_unifi-6-lr-v3_env
962 +ethaddr_factory=mtd read nor0 $loadaddr 0x110000 0x10000 && env readmem -b ethaddr $loadaddr 0x6 ; setenv ethaddr_factory
964 +serverip=192.168.1.254
966 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_nor ; fi
968 +bootfile=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-initramfs-recovery.itb
969 +bootfile_bl2=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-preloader.bin
970 +bootfile_fip=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-bl31-uboot.fip
971 +bootfile_upg=openwrt-mediatek-mt7622-ubnt_unifi-6-lr-v3-ubootmod-squashfs-sysupgrade.itb
972 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
975 +bootmenu_title=
\e[0;34m( ( (
\e[1;39mOpenWrt
\e[0;34m ) ) )
\e[0m
976 +bootmenu_0=Initialize environment.=run _firstboot
977 +bootmenu_0d=Run default boot command.=run boot_default
978 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
979 +bootmenu_2=Boot production system from flash.=run boot_production ; run bootmenu_confirm_return
980 +bootmenu_3=Boot recovery system from flash.=run boot_recovery ; run bootmenu_confirm_return
981 +bootmenu_4=Load production system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
982 +bootmenu_5=Load recovery system via TFTP then write to flash.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return
983 +bootmenu_6=
\e[31mLoad BL31+U-Boot FIP via TFTP then write to flash.
\e[0m=run boot_tftp_write_fip ; run bootmenu_confirm_return
984 +bootmenu_7=
\e[31mLoad BL2 preloader via TFTP then write to flash.
\e[0m=run boot_tftp_write_preloader ; run bootmenu_confirm_return
985 +bootmenu_8=Reboot.=reset
986 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
987 +boot_first=if button reset ; then run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
988 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
989 +boot_production=run nor_read_production && bootm $loadaddr
990 +boot_recovery=run nor_read_recovery ; bootm $loadaddr
991 +boot_serial_write_fip=loadx $loadaddr 115200 && run boot_write_fip
992 +boot_serial_write_preloader=loadx $loadaddr 115200 && run boot_write_preloader
993 +boot_tftp_forever=while true ; do run boot_tftp_recovery ; sleep 1 ; done
994 +boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run nor_write_production ; if env exists noboot ; then else bootm $loadaddr ; fi
995 +boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run nor_write_recovery ; if env exists noboot ; then else bootm $loadaddr ; fi
996 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr
997 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run boot_write_fip
998 +boot_tftp_write_preloader=tftpboot $loadaddr $bootfile_bl2 && run boot_write_preloader
999 +boot_nor=run boot_production ; run boot_recovery
1000 +boot_write_fip=mtd erase nor0 0x20000 0x80000 && mtd write nor0 $loadaddr 0x20000 0x80000
1001 +boot_write_preloader=mtd erase nor0 0x0 0x20000 && mtd write nor0 $loadaddr 0x0 0x20000
1002 +reset_factory=mtd erase nor0 0xc0000 0x10000 && reset
1003 +nor_read_production=mtd read nor0 $loadaddr 0x1000000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x1000000 $image_size
1004 +nor_read_recovery=mtd read nor0 $loadaddr 0x120000 0x1000 && imsz $loadaddr image_size && mtd read nor0 $loadaddr 0x120000 $image_size
1005 +nor_pad_size=imsz $loadaddr image_size ; setexpr image_eb 0x$image_size / 0x1000 ; setexpr tmp1 0x$image_size % 0x1000 ; test 0x$tmp1 -gt 0 && setexpr image_eb 0x$image_eb + 1 ; setexpr image_eb 0x$image_eb * 0x1000
1006 +nor_write_production=run nor_pad_size ; test 0x$image_eb -le 0x3000000 && mtd erase nor0 0x1000000 0x$image_eb && mtd write nor0 $loadaddr 0x1000000 $filesize
1007 +nor_write_recovery=run nor_pad_size ; test 0x$image_eb -le 0xee0000 && mtd erase nor0 0x120000 0x$image_eb && mtd write nor0 $loadaddr 0x120000 $filesize
1008 +_init_env=setenv _init_env ; saveenv
1009 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run ethaddr_factory ; run _init_env ; run boot_first
1010 +_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
1011 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title
\e[33m$ver
\e[0m"
1012 --- a/common/board_r.c
1013 +++ b/common/board_r.c
1015 #include <asm-generic/gpio.h>
1016 #include <efi_loader.h>
1017 #include <relocate.h>
1018 +#include <spi_flash.h>
1020 DECLARE_GLOBAL_DATA_PTR;
1022 @@ -412,6 +413,20 @@ static int initr_onenand(void)
1026 +#if defined(CONFIG_SPI_FLASH)
1027 +/* probe SPI FLASH */
1028 +static int initr_spiflash(void)
1030 + struct udevice *new;
1032 +spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS,
1033 + CONFIG_SF_DEFAULT_CS,
1041 static int initr_mmc(void)
1043 @@ -713,6 +728,9 @@ static init_fnc_t init_sequence_r[] = {
1044 #ifdef CONFIG_NMBM_MTD
1047 +#ifdef CONFIG_SPI_FLASH