1 From b1549087ecd1eb53f6173b17b473134fd6cca157 Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Fri, 20 May 2022 11:22:26 +0800
4 Subject: [PATCH 06/25] mips: mtmips: add two reference boards for mt7621
6 The mt7621_rfb board supports integrated giga PHYs plus one external
7 giga PHYs. It also has up to 512MiB DDR3, 16MB SPI-NOR, 3 mini PCI-e x1
10 The mt7621_nand_rfb board is almost the same as mt7621_rfb board, but it
11 uses NAND flash and SDXC is not available.
13 Reviewed-by: Stefan Roese <sr@denx.de>
14 Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
15 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
17 arch/mips/dts/Makefile | 2 +
18 arch/mips/dts/mediatek,mt7621-nand-rfb.dts | 67 +++++++++++++++++
19 arch/mips/dts/mediatek,mt7621-rfb.dts | 82 +++++++++++++++++++++
20 arch/mips/mach-mtmips/mt7621/Kconfig | 20 +++++
21 board/mediatek/mt7621/MAINTAINERS | 8 ++
22 board/mediatek/mt7621/Makefile | 3 +
23 board/mediatek/mt7621/board.c | 6 ++
24 configs/mt7621_nand_rfb_defconfig | 85 ++++++++++++++++++++++
25 configs/mt7621_rfb_defconfig | 82 +++++++++++++++++++++
26 9 files changed, 355 insertions(+)
27 create mode 100644 arch/mips/dts/mediatek,mt7621-nand-rfb.dts
28 create mode 100644 arch/mips/dts/mediatek,mt7621-rfb.dts
29 create mode 100644 board/mediatek/mt7621/MAINTAINERS
30 create mode 100644 board/mediatek/mt7621/Makefile
31 create mode 100644 board/mediatek/mt7621/board.c
32 create mode 100644 configs/mt7621_nand_rfb_defconfig
33 create mode 100644 configs/mt7621_rfb_defconfig
35 diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
36 index 95144b24dc..1b179116c9 100644
37 --- a/arch/mips/dts/Makefile
38 +++ b/arch/mips/dts/Makefile
39 @@ -16,6 +16,8 @@ dtb-$(CONFIG_BOARD_COMTREND_WAP5813N) += comtrend,wap-5813n.dtb
40 dtb-$(CONFIG_BOARD_HUAWEI_HG556A) += huawei,hg556a.dtb
41 dtb-$(CONFIG_BOARD_MT7620_RFB) += mediatek,mt7620-rfb.dtb
42 dtb-$(CONFIG_BOARD_MT7620_MT7530_RFB) += mediatek,mt7620-mt7530-rfb.dtb
43 +dtb-$(CONFIG_BOARD_MT7621_RFB) += mediatek,mt7621-rfb.dtb
44 +dtb-$(CONFIG_BOARD_MT7621_NAND_RFB) += mediatek,mt7621-nand-rfb.dtb
45 dtb-$(CONFIG_BOARD_MT7628_RFB) += mediatek,mt7628-rfb.dtb
46 dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688) += gardena-smart-gateway-mt7688.dtb
47 dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb
48 diff --git a/arch/mips/dts/mediatek,mt7621-nand-rfb.dts b/arch/mips/dts/mediatek,mt7621-nand-rfb.dts
50 index 0000000000..67ba298b0a
52 +++ b/arch/mips/dts/mediatek,mt7621-nand-rfb.dts
54 +// SPDX-License-Identifier: GPL-2.0
56 + * Copyright (C) 2022 MediaTek Inc. All rights reserved.
58 + * Author: Weijie Gao <weijie.gao@mediatek.com>
63 +#include "mt7621.dtsi"
66 + compatible = "mediatek,mt7621-nand-rfb", "mediatek,mt7621-soc";
67 + model = "MediaTek MT7621 RFB (NAND)";
74 + stdout-path = &uart0;
79 + state_default: pin_state {
81 + groups = "spi", "sdxc";
86 + groups = "i2c", "uart3", "pcie reset";
92 + function = "wdt rst";
121 diff --git a/arch/mips/dts/mediatek,mt7621-rfb.dts b/arch/mips/dts/mediatek,mt7621-rfb.dts
123 index 0000000000..ff7eaf0f20
125 +++ b/arch/mips/dts/mediatek,mt7621-rfb.dts
127 +// SPDX-License-Identifier: GPL-2.0
129 + * Copyright (C) 2022 MediaTek Inc. All rights reserved.
131 + * Author: Weijie Gao <weijie.gao@mediatek.com>
136 +#include "mt7621.dtsi"
139 + compatible = "mediatek,mt7621-rfb", "mediatek,mt7621-soc";
140 + model = "MediaTek MT7621 RFB (SPI-NOR)";
148 + stdout-path = &uart0;
153 + state_default: pin_state {
155 + groups = "i2c", "uart3", "pcie reset";
161 + function = "wdt rst";
184 + #address-cells = <1>;
186 + compatible = "jedec,spi-nor";
187 + spi-max-frequency = <25000000>;
209 diff --git a/arch/mips/mach-mtmips/mt7621/Kconfig b/arch/mips/mach-mtmips/mt7621/Kconfig
210 index 37d512c68f..008a28f991 100644
211 --- a/arch/mips/mach-mtmips/mt7621/Kconfig
212 +++ b/arch/mips/mach-mtmips/mt7621/Kconfig
213 @@ -79,6 +79,26 @@ config MT7621_BOOT_FROM_NAND
215 prompt "Board select"
217 +config BOARD_MT7621_RFB
218 + bool "MediaTek MT7621 RFB (SPI-NOR)"
220 + The reference design of MT7621A (WS3010) booting from SPI-NOR flash.
221 + The board can be configured with DDR2 (64MiB~256MiB) or DDR3
222 + (128MiB~512MiB). The board has 16 MiB SPI-NOR flash, built-in MT7530
223 + GbE switch, 1 UART, 1 USB 2.0 host, 1 USB 3.0 host, 1 SDXC, 3 PCIe
224 + sockets, 1 RGMII to external GbE PHY, 2 audio jacks (in/out),
225 + JTAG pins and expansion GPIO pins.
227 +config BOARD_MT7621_NAND_RFB
228 + bool "MediaTek MT7621 RFB (NAND)"
230 + The reference design of MT7621A (WS3010) booting from NAND flash.
231 + The board can be configured with DDR2 (64MiB~256MiB) or DDR3
232 + (128MiB~512MiB). The board has 128 MiB parallel NAND flash, built-in
233 + MT7530 GbE switch, 1 UART, 1 USB 2.0 host, 1 USB 3.0 host, 3 PCIe
234 + sockets, 1 RGMII to external GbE PHY, 2 audio jacks (in/out),
235 + JTAG pins and expansion GPIO pins.
239 config SYS_CONFIG_NAME
240 diff --git a/board/mediatek/mt7621/MAINTAINERS b/board/mediatek/mt7621/MAINTAINERS
242 index 0000000000..f83141cea1
244 +++ b/board/mediatek/mt7621/MAINTAINERS
247 +M: Weijie Gao <weijie.gao@mediatek.com>
249 +F: board/mediatek/mt7621
250 +F: configs/mt7621_rfb_defconfig
251 +F: configs/mt7621_nand_rfb_defconfig
252 +F: arch/mips/dts/mediatek,mt7621-rfb.dts
253 +F: arch/mips/dts/mediatek,mt7621-nand-rfb.dts
254 diff --git a/board/mediatek/mt7621/Makefile b/board/mediatek/mt7621/Makefile
256 index 0000000000..db129c5aba
258 +++ b/board/mediatek/mt7621/Makefile
260 +# SPDX-License-Identifier: GPL-2.0
263 diff --git a/board/mediatek/mt7621/board.c b/board/mediatek/mt7621/board.c
265 index 0000000000..0496f3f806
267 +++ b/board/mediatek/mt7621/board.c
269 +// SPDX-License-Identifier: GPL-2.0
271 + * Copyright (C) 2022 MediaTek Inc. All rights reserved.
273 + * Author: Weijie Gao <weijie.gao@mediatek.com>
275 diff --git a/configs/mt7621_nand_rfb_defconfig b/configs/mt7621_nand_rfb_defconfig
277 index 0000000000..fe8543df49
279 +++ b/configs/mt7621_nand_rfb_defconfig
282 +CONFIG_SYS_MALLOC_LEN=0x100000
283 +CONFIG_SPL_LIBCOMMON_SUPPORT=y
284 +CONFIG_SPL_LIBGENERIC_SUPPORT=y
285 +CONFIG_NR_DRAM_BANKS=1
286 +CONFIG_ENV_SIZE=0x1000
287 +CONFIG_DEFAULT_DEVICE_TREE="mediatek,mt7621-nand-rfb"
289 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x100000
291 +CONFIG_DEBUG_UART_BASE=0xbe000c00
292 +CONFIG_DEBUG_UART_CLOCK=50000000
293 +CONFIG_SYS_LOAD_ADDR=0x83000000
294 +CONFIG_ARCH_MTMIPS=y
296 +CONFIG_MT7621_BOOT_FROM_NAND=y
297 +CONFIG_BOARD_MT7621_NAND_RFB=y
298 +# CONFIG_MIPS_CACHE_SETUP is not set
299 +# CONFIG_MIPS_CACHE_DISABLE is not set
300 +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
301 +CONFIG_MIPS_BOOT_FDT=y
304 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
305 +CONFIG_SYS_CONSOLE_INFO_QUIET=y
306 +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
307 +CONFIG_SPL_NAND_SUPPORT=y
308 +CONFIG_SPL_NAND_BASE=y
309 +CONFIG_SPL_NAND_IDENT=y
310 +# CONFIG_BOOTM_NETBSD is not set
311 +# CONFIG_BOOTM_PLAN9 is not set
312 +# CONFIG_BOOTM_RTEMS is not set
313 +# CONFIG_BOOTM_VXWORKS is not set
314 +# CONFIG_CMD_ELF is not set
315 +# CONFIG_CMD_XIMG is not set
316 +# CONFIG_CMD_CRC32 is not set
317 +# CONFIG_CMD_DM is not set
318 +# CONFIG_CMD_FLASH is not set
320 +# CONFIG_CMD_LOADS is not set
324 +# CONFIG_CMD_PINMUX is not set
326 +# CONFIG_CMD_NFS is not set
328 +CONFIG_CMD_FS_GENERIC=y
329 +# CONFIG_SPL_DOS_PARTITION is not set
330 +# CONFIG_ISO_PARTITION is not set
331 +CONFIG_EFI_PARTITION=y
332 +# CONFIG_SPL_EFI_PARTITION is not set
333 +CONFIG_PARTITION_TYPE_GUID=y
334 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
335 +CONFIG_NET_RANDOM_ETHADDR=y
336 +# CONFIG_I2C is not set
337 +# CONFIG_INPUT is not set
339 +# CONFIG_MMC_QUIRKS is not set
340 +# CONFIG_MMC_HW_PARTITIONING is not set
344 +CONFIG_MTD_RAW_NAND=y
345 +CONFIG_NAND_MT7621=y
346 +CONFIG_SYS_NAND_ONFI_DETECTION=y
347 +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
348 +CONFIG_SYS_NAND_U_BOOT_OFFS=0x0
349 +CONFIG_MEDIATEK_ETH=y
351 +CONFIG_PHY_MTK_TPHY=y
352 +CONFIG_DEBUG_UART_SHIFT=2
354 +CONFIG_SYSRESET_RESETCTL=y
356 +CONFIG_USB_XHCI_HCD=y
357 +CONFIG_USB_XHCI_MTK=y
358 +CONFIG_USB_STORAGE=y
362 +# CONFIG_BINMAN_FDT is not set
364 +# CONFIG_GZIP is not set
366 diff --git a/configs/mt7621_rfb_defconfig b/configs/mt7621_rfb_defconfig
368 index 0000000000..ae62360e63
370 +++ b/configs/mt7621_rfb_defconfig
373 +CONFIG_SYS_MALLOC_LEN=0x100000
374 +CONFIG_SPL_LIBCOMMON_SUPPORT=y
375 +CONFIG_SPL_LIBGENERIC_SUPPORT=y
376 +CONFIG_NR_DRAM_BANKS=1
377 +CONFIG_ENV_SIZE=0x1000
378 +CONFIG_DEFAULT_DEVICE_TREE="mediatek,mt7621-rfb"
380 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x40000
382 +CONFIG_DEBUG_UART_BASE=0xbe000c00
383 +CONFIG_DEBUG_UART_CLOCK=50000000
384 +CONFIG_SYS_LOAD_ADDR=0x83000000
385 +CONFIG_ARCH_MTMIPS=y
387 +# CONFIG_MIPS_CACHE_SETUP is not set
388 +# CONFIG_MIPS_CACHE_DISABLE is not set
389 +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
390 +CONFIG_MIPS_BOOT_FDT=y
392 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x1000
394 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
395 +CONFIG_SYS_CONSOLE_INFO_QUIET=y
396 +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
397 +CONFIG_SPL_NOR_SUPPORT=y
399 +# CONFIG_TPL_FRAMEWORK is not set
400 +# CONFIG_BOOTM_NETBSD is not set
401 +# CONFIG_BOOTM_PLAN9 is not set
402 +# CONFIG_BOOTM_RTEMS is not set
403 +# CONFIG_BOOTM_VXWORKS is not set
404 +# CONFIG_CMD_ELF is not set
405 +# CONFIG_CMD_XIMG is not set
406 +# CONFIG_CMD_CRC32 is not set
407 +# CONFIG_CMD_DM is not set
409 +# CONFIG_CMD_LOADS is not set
412 +# CONFIG_CMD_PINMUX is not set
414 +# CONFIG_CMD_NFS is not set
415 +CONFIG_DOS_PARTITION=y
416 +# CONFIG_SPL_DOS_PARTITION is not set
417 +# CONFIG_ISO_PARTITION is not set
418 +CONFIG_EFI_PARTITION=y
419 +# CONFIG_SPL_EFI_PARTITION is not set
420 +CONFIG_PARTITION_TYPE_GUID=y
421 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
422 +CONFIG_NET_RANDOM_ETHADDR=y
423 +# CONFIG_I2C is not set
424 +# CONFIG_INPUT is not set
426 +# CONFIG_MMC_QUIRKS is not set
427 +# CONFIG_MMC_HW_PARTITIONING is not set
429 +CONFIG_SF_DEFAULT_SPEED=20000000
430 +CONFIG_SPI_FLASH_BAR=y
431 +CONFIG_SPI_FLASH_EON=y
432 +CONFIG_SPI_FLASH_GIGADEVICE=y
433 +CONFIG_SPI_FLASH_ISSI=y
434 +CONFIG_SPI_FLASH_MACRONIX=y
435 +CONFIG_SPI_FLASH_SPANSION=y
436 +CONFIG_SPI_FLASH_STMICRO=y
437 +CONFIG_SPI_FLASH_WINBOND=y
438 +CONFIG_SPI_FLASH_XMC=y
439 +CONFIG_SPI_FLASH_XTX=y
440 +CONFIG_MEDIATEK_ETH=y
442 +CONFIG_PHY_MTK_TPHY=y
443 +CONFIG_DEBUG_UART_SHIFT=2
447 +CONFIG_SYSRESET_RESETCTL=y
450 +# CONFIG_BINMAN_FDT is not set
452 +# CONFIG_GZIP is not set