2 +++ b/configs/mt7986a_jdcloud_re-cp-03_defconfig
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-jdcloud_re-cp-03"
14 +CONFIG_SYS_PROMPT="MT7986> "
15 +CONFIG_OF_LIBFDT_OVERLAY=y
16 +CONFIG_TARGET_MT7986=y
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_SYS_LOAD_ADDR=0x46000000
25 +CONFIG_AUTOBOOT_KEYED=y
26 +CONFIG_AUTOBOOT_MENU_SHOW=y
27 +CONFIG_DEFAULT_FDT_FILE="mediatek/mt7986a-jdcloud_re-cp-03.dtb"
29 +CONFIG_PRE_CONSOLE_BUFFER=y
31 +CONFIG_BOARD_LATE_INIT=y
35 +CONFIG_CMD_BOOTMENU=y
37 +CONFIG_CMD_ERASEENV=y
38 +CONFIG_CMD_ENV_FLAGS=y
53 +CONFIG_CMD_LINK_LOCAL=y
57 +CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
63 +CONFIG_CMD_FS_GENERIC=y
66 +CONFIG_ENV_OVERWRITE=y
67 +CONFIG_ENV_IS_IN_MMC=y
68 +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
69 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
70 +CONFIG_USE_DEFAULT_ENV_FILE=y
71 +CONFIG_DEFAULT_ENV_FILE="jdcloud_re-cp-03_env"
72 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
73 +CONFIG_VERSION_VARIABLE=y
74 +CONFIG_NET_RANDOM_ETHADDR=y
77 +CONFIG_IPADDR="192.168.1.1"
78 +CONFIG_USE_SERVERIP=y
79 +CONFIG_SERVERIP="192.168.1.254"
89 +CONFIG_SUPPORT_EMMC_BOOT=y
90 +CONFIG_MMC_HS200_SUPPORT=y
94 +CONFIG_MEDIATEK_ETH=y
96 +CONFIG_PHY_MTK_TPHY=y
99 +CONFIG_PINCTRL_MT7622=y
100 +CONFIG_PINCTRL_MT7986=y
101 +CONFIG_POWER_DOMAIN=y
102 +CONFIG_MTK_POWER_DOMAIN=y
103 +CONFIG_DM_REGULATOR=y
104 +CONFIG_DM_REGULATOR_FIXED=y
105 +CONFIG_DM_REGULATOR_GPIO=y
115 +CONFIG_LMB_MAX_REGIONS=64
117 +++ b/arch/arm/dts/mt7986a-jdcloud_re-cp-03.dts
119 +// SPDX-License-Identifier: GPL-2.0-or-later
122 +#include <dt-bindings/input/linux-event-codes.h>
123 +#include "mt7986.dtsi"
124 +#include <dt-bindings/gpio/gpio.h>
127 + #address-cells = <1>;
129 + model = "JDCloud RE-CP-03";
130 + compatible = "mediatek,mt7986", "mediatek,mt7986-rfb";
133 + stdout-path = &uart0;
134 + tick-timer = &timer0;
138 + device_type = "memory";
139 + reg = <0x40000000 0x40000000>;
143 + compatible = "gpio-keys";
147 + linux,code = <BTN_0>;
148 + gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
153 + linux,code = <KEY_RESTART>;
154 + gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
159 + compatible = "gpio-leds";
162 + label = "blue:status";
163 + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
164 + default-state = "off";
168 + label = "red:status";
169 + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
170 + default-state = "on";
174 + label = "green:status";
175 + gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
176 + default-state = "off";
180 + reg_1p8v: regulator-1p8v {
181 + compatible = "regulator-fixed";
182 + regulator-name = "fixed-1.8V";
183 + regulator-min-microvolt = <1800000>;
184 + regulator-max-microvolt = <1800000>;
186 + regulator-always-on;
189 + reg_3p3v: regulator-3p3v {
190 + compatible = "regulator-fixed";
191 + regulator-name = "fixed-3.3V";
192 + regulator-min-microvolt = <3300000>;
193 + regulator-max-microvolt = <3300000>;
195 + regulator-always-on;
201 + mediatek,gmac-id = <0>;
202 + phy-mode = "2500base-x";
203 + mediatek,switch = "mt7531";
204 + reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
216 + max-frequency = <200000000>;
218 + pinctrl-names = "default";
219 + pinctrl-0 = <&mmc0_pins_default>;
220 + vmmc-supply = <®_3p3v>;
221 + vqmmc-supply = <®_1p8v>;
226 + mmc0_pins_default: mmc0default {
228 + function = "flash";
229 + groups = "emmc_51";
233 + pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
234 + "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
235 + "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
237 + drive-strength = <MTK_DRIVE_4mA>;
238 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
243 + drive-strength = <MTK_DRIVE_6mA>;
244 + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
249 + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
253 + pins = "EMMC_RSTB";
254 + drive-strength = <MTK_DRIVE_4mA>;
255 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
265 + status = "disabled";
268 +++ b/jdcloud_re-cp-03_env
271 +serverip=192.168.1.254
273 +console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0
274 +bootargs=root=/dev/mmcblk0p65
275 +bootcmd=if pstore check ; then run boot_recovery ; else run boot_emmc ; fi
278 +bootfile=openwrt-mediatek-filogic-jdcloud_re-cp-03-initramfs-recovery.itb
279 +bootfile_bl2=openwrt-mediatek-filogic-jdcloud_re-cp-03-preloader.bin
280 +bootfile_fip=openwrt-mediatek-filogic-jdcloud_re-cp-03-bl31-uboot.fip
281 +bootfile_upg=openwrt-mediatek-filogic-jdcloud_re-cp-03-squashfs-sysupgrade.itb
282 +bootled_pwr=red:status
283 +bootled_rec=blue:status
284 +bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
287 +bootmenu_title=
\e[0;34m( ( (
\e[1;39mOpenWrt
\e[0;34m ) ) )
288 +bootmenu_0=Initialize environment.=run _firstboot
289 +bootmenu_0d=Run default boot command.=run boot_default
290 +bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return
291 +bootmenu_2=Boot production system from eMMC.=run boot_production ; run bootmenu_confirm_return
292 +bootmenu_3=Boot recovery system from eMMC.=run boot_recovery ; run bootmenu_confirm_return
293 +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
294 +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
295 +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
296 +bootmenu_7=
\e[31mLoad BL2 preloader via TFTP then write to eMMC.
\e[0m=run boot_tftp_write_bl2 ; run bootmenu_confirm_return
297 +bootmenu_8=Reboot.=reset
298 +bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset
299 +boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu
300 +boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever
301 +boot_production=led $bootled_pwr on ; run emmc_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off
302 +boot_recovery=led $bootled_rec on ; run emmc_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off
303 +boot_emmc=run boot_production ; run boot_recovery
304 +boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done
305 +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
306 +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
307 +boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run emmc_write_fip
308 +boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run emmc_write_bl2
309 +boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf
310 +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
311 +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
312 +part_default=production
313 +part_recovery=recovery
314 +reset_factory=eraseenv && reset
315 +emmc_read_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_read_vol
316 +emmc_read_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_read_vol
317 +emmc_write_bl2=mmc partconf 0 1 1 1 && mmc erase 0x0 0x400 && mmc write $fileaddr 0x0 0x400 ; mmc partconf 0 1 1 0
318 +emmc_write_fip=mmc erase 0x3400 0x2000 && mmc write $fileaddr 0x3400 0x2000 && mmc erase 0x2000 0x800
319 +emmc_write_production=part start mmc 0 $part_default part_addr && part size mmc 0 $part_default part_size && run mmc_write_vol
320 +emmc_write_recovery=part start mmc 0 $part_recovery part_addr && part size mmc 0 $part_recovery part_size && run mmc_write_vol
321 +_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv
322 +_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; run boot_first
323 +_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
324 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title
\e[33m$ver
\e[0m"