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 --- a/arch/mips/dts/Makefile
36 +++ b/arch/mips/dts/Makefile
37 @@ -16,6 +16,8 @@ dtb-$(CONFIG_BOARD_COMTREND_WAP5813N) +=
38 dtb-$(CONFIG_BOARD_HUAWEI_HG556A) += huawei,hg556a.dtb
39 dtb-$(CONFIG_BOARD_MT7620_RFB) += mediatek,mt7620-rfb.dtb
40 dtb-$(CONFIG_BOARD_MT7620_MT7530_RFB) += mediatek,mt7620-mt7530-rfb.dtb
41 +dtb-$(CONFIG_BOARD_MT7621_RFB) += mediatek,mt7621-rfb.dtb
42 +dtb-$(CONFIG_BOARD_MT7621_NAND_RFB) += mediatek,mt7621-nand-rfb.dtb
43 dtb-$(CONFIG_BOARD_MT7628_RFB) += mediatek,mt7628-rfb.dtb
44 dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688) += gardena-smart-gateway-mt7688.dtb
45 dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb
47 +++ b/arch/mips/dts/mediatek,mt7621-nand-rfb.dts
49 +// SPDX-License-Identifier: GPL-2.0
51 + * Copyright (C) 2022 MediaTek Inc. All rights reserved.
53 + * Author: Weijie Gao <weijie.gao@mediatek.com>
58 +#include "mt7621.dtsi"
61 + compatible = "mediatek,mt7621-nand-rfb", "mediatek,mt7621-soc";
62 + model = "MediaTek MT7621 RFB (NAND)";
69 + stdout-path = &uart0;
74 + state_default: pin_state {
76 + groups = "spi", "sdxc";
81 + groups = "i2c", "uart3", "pcie reset";
87 + function = "wdt rst";
117 +++ b/arch/mips/dts/mediatek,mt7621-rfb.dts
119 +// SPDX-License-Identifier: GPL-2.0
121 + * Copyright (C) 2022 MediaTek Inc. All rights reserved.
123 + * Author: Weijie Gao <weijie.gao@mediatek.com>
128 +#include "mt7621.dtsi"
131 + compatible = "mediatek,mt7621-rfb", "mediatek,mt7621-soc";
132 + model = "MediaTek MT7621 RFB (SPI-NOR)";
140 + stdout-path = &uart0;
145 + state_default: pin_state {
147 + groups = "i2c", "uart3", "pcie reset";
153 + function = "wdt rst";
176 + #address-cells = <1>;
178 + compatible = "jedec,spi-nor";
179 + spi-max-frequency = <25000000>;
201 --- a/arch/mips/mach-mtmips/mt7621/Kconfig
202 +++ b/arch/mips/mach-mtmips/mt7621/Kconfig
203 @@ -79,6 +79,26 @@ config MT7621_BOOT_FROM_NAND
205 prompt "Board select"
207 +config BOARD_MT7621_RFB
208 + bool "MediaTek MT7621 RFB (SPI-NOR)"
210 + The reference design of MT7621A (WS3010) booting from SPI-NOR flash.
211 + The board can be configured with DDR2 (64MiB~256MiB) or DDR3
212 + (128MiB~512MiB). The board has 16 MiB SPI-NOR flash, built-in MT7530
213 + GbE switch, 1 UART, 1 USB 2.0 host, 1 USB 3.0 host, 1 SDXC, 3 PCIe
214 + sockets, 1 RGMII to external GbE PHY, 2 audio jacks (in/out),
215 + JTAG pins and expansion GPIO pins.
217 +config BOARD_MT7621_NAND_RFB
218 + bool "MediaTek MT7621 RFB (NAND)"
220 + The reference design of MT7621A (WS3010) booting from NAND flash.
221 + The board can be configured with DDR2 (64MiB~256MiB) or DDR3
222 + (128MiB~512MiB). The board has 128 MiB parallel NAND flash, built-in
223 + MT7530 GbE switch, 1 UART, 1 USB 2.0 host, 1 USB 3.0 host, 3 PCIe
224 + sockets, 1 RGMII to external GbE PHY, 2 audio jacks (in/out),
225 + JTAG pins and expansion GPIO pins.
229 config SYS_CONFIG_NAME
231 +++ b/board/mediatek/mt7621/MAINTAINERS
234 +M: Weijie Gao <weijie.gao@mediatek.com>
236 +F: board/mediatek/mt7621
237 +F: configs/mt7621_rfb_defconfig
238 +F: configs/mt7621_nand_rfb_defconfig
239 +F: arch/mips/dts/mediatek,mt7621-rfb.dts
240 +F: arch/mips/dts/mediatek,mt7621-nand-rfb.dts
242 +++ b/board/mediatek/mt7621/Makefile
244 +# SPDX-License-Identifier: GPL-2.0
248 +++ b/board/mediatek/mt7621/board.c
250 +// SPDX-License-Identifier: GPL-2.0
252 + * Copyright (C) 2022 MediaTek Inc. All rights reserved.
254 + * Author: Weijie Gao <weijie.gao@mediatek.com>
257 +++ b/configs/mt7621_nand_rfb_defconfig
260 +CONFIG_SYS_MALLOC_LEN=0x100000
261 +CONFIG_SPL_LIBCOMMON_SUPPORT=y
262 +CONFIG_SPL_LIBGENERIC_SUPPORT=y
263 +CONFIG_NR_DRAM_BANKS=1
264 +CONFIG_ENV_SIZE=0x1000
265 +CONFIG_DEFAULT_DEVICE_TREE="mediatek,mt7621-nand-rfb"
267 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x100000
269 +CONFIG_DEBUG_UART_BASE=0xbe000c00
270 +CONFIG_DEBUG_UART_CLOCK=50000000
271 +CONFIG_SYS_LOAD_ADDR=0x83000000
272 +CONFIG_ARCH_MTMIPS=y
274 +CONFIG_MT7621_BOOT_FROM_NAND=y
275 +CONFIG_BOARD_MT7621_NAND_RFB=y
276 +# CONFIG_MIPS_CACHE_SETUP is not set
277 +# CONFIG_MIPS_CACHE_DISABLE is not set
278 +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
279 +CONFIG_MIPS_BOOT_FDT=y
282 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
283 +CONFIG_SYS_CONSOLE_INFO_QUIET=y
284 +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
285 +CONFIG_SPL_NAND_SUPPORT=y
286 +CONFIG_SPL_NAND_BASE=y
287 +CONFIG_SPL_NAND_IDENT=y
288 +# CONFIG_BOOTM_NETBSD is not set
289 +# CONFIG_BOOTM_PLAN9 is not set
290 +# CONFIG_BOOTM_RTEMS is not set
291 +# CONFIG_BOOTM_VXWORKS is not set
292 +# CONFIG_CMD_ELF is not set
293 +# CONFIG_CMD_XIMG is not set
294 +# CONFIG_CMD_CRC32 is not set
295 +# CONFIG_CMD_DM is not set
296 +# CONFIG_CMD_FLASH is not set
298 +# CONFIG_CMD_LOADS is not set
302 +# CONFIG_CMD_PINMUX is not set
304 +# CONFIG_CMD_NFS is not set
306 +CONFIG_CMD_FS_GENERIC=y
307 +# CONFIG_SPL_DOS_PARTITION is not set
308 +# CONFIG_ISO_PARTITION is not set
309 +CONFIG_EFI_PARTITION=y
310 +# CONFIG_SPL_EFI_PARTITION is not set
311 +CONFIG_PARTITION_TYPE_GUID=y
312 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
313 +CONFIG_NET_RANDOM_ETHADDR=y
314 +# CONFIG_I2C is not set
315 +# CONFIG_INPUT is not set
317 +# CONFIG_MMC_QUIRKS is not set
318 +# CONFIG_MMC_HW_PARTITIONING is not set
322 +CONFIG_MTD_RAW_NAND=y
323 +CONFIG_NAND_MT7621=y
324 +CONFIG_SYS_NAND_ONFI_DETECTION=y
325 +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
326 +CONFIG_SYS_NAND_U_BOOT_OFFS=0x0
327 +CONFIG_MEDIATEK_ETH=y
329 +CONFIG_PHY_MTK_TPHY=y
330 +CONFIG_DEBUG_UART_SHIFT=2
332 +CONFIG_SYSRESET_RESETCTL=y
334 +CONFIG_USB_XHCI_HCD=y
335 +CONFIG_USB_XHCI_MTK=y
336 +CONFIG_USB_STORAGE=y
340 +# CONFIG_BINMAN_FDT is not set
342 +# CONFIG_GZIP is not set
345 +++ b/configs/mt7621_rfb_defconfig
348 +CONFIG_SYS_MALLOC_LEN=0x100000
349 +CONFIG_SPL_LIBCOMMON_SUPPORT=y
350 +CONFIG_SPL_LIBGENERIC_SUPPORT=y
351 +CONFIG_NR_DRAM_BANKS=1
352 +CONFIG_ENV_SIZE=0x1000
353 +CONFIG_DEFAULT_DEVICE_TREE="mediatek,mt7621-rfb"
355 +CONFIG_SPL_SYS_MALLOC_F_LEN=0x40000
357 +CONFIG_DEBUG_UART_BASE=0xbe000c00
358 +CONFIG_DEBUG_UART_CLOCK=50000000
359 +CONFIG_SYS_LOAD_ADDR=0x83000000
360 +CONFIG_ARCH_MTMIPS=y
362 +# CONFIG_MIPS_CACHE_SETUP is not set
363 +# CONFIG_MIPS_CACHE_DISABLE is not set
364 +CONFIG_RESTORE_EXCEPTION_VECTOR_BASE=y
365 +CONFIG_MIPS_BOOT_FDT=y
367 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x1000
369 +# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
370 +CONFIG_SYS_CONSOLE_INFO_QUIET=y
371 +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
372 +CONFIG_SPL_NOR_SUPPORT=y
374 +# CONFIG_TPL_FRAMEWORK is not set
375 +# CONFIG_BOOTM_NETBSD is not set
376 +# CONFIG_BOOTM_PLAN9 is not set
377 +# CONFIG_BOOTM_RTEMS is not set
378 +# CONFIG_BOOTM_VXWORKS is not set
379 +# CONFIG_CMD_ELF is not set
380 +# CONFIG_CMD_XIMG is not set
381 +# CONFIG_CMD_CRC32 is not set
382 +# CONFIG_CMD_DM is not set
384 +# CONFIG_CMD_LOADS is not set
387 +# CONFIG_CMD_PINMUX is not set
389 +# CONFIG_CMD_NFS is not set
390 +CONFIG_DOS_PARTITION=y
391 +# CONFIG_SPL_DOS_PARTITION is not set
392 +# CONFIG_ISO_PARTITION is not set
393 +CONFIG_EFI_PARTITION=y
394 +# CONFIG_SPL_EFI_PARTITION is not set
395 +CONFIG_PARTITION_TYPE_GUID=y
396 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
397 +CONFIG_NET_RANDOM_ETHADDR=y
398 +# CONFIG_I2C is not set
399 +# CONFIG_INPUT is not set
401 +# CONFIG_MMC_QUIRKS is not set
402 +# CONFIG_MMC_HW_PARTITIONING is not set
404 +CONFIG_SF_DEFAULT_SPEED=20000000
405 +CONFIG_SPI_FLASH_BAR=y
406 +CONFIG_SPI_FLASH_EON=y
407 +CONFIG_SPI_FLASH_GIGADEVICE=y
408 +CONFIG_SPI_FLASH_ISSI=y
409 +CONFIG_SPI_FLASH_MACRONIX=y
410 +CONFIG_SPI_FLASH_SPANSION=y
411 +CONFIG_SPI_FLASH_STMICRO=y
412 +CONFIG_SPI_FLASH_WINBOND=y
413 +CONFIG_SPI_FLASH_XMC=y
414 +CONFIG_SPI_FLASH_XTX=y
415 +CONFIG_MEDIATEK_ETH=y
417 +CONFIG_PHY_MTK_TPHY=y
418 +CONFIG_DEBUG_UART_SHIFT=2
422 +CONFIG_SYSRESET_RESETCTL=y
425 +# CONFIG_BINMAN_FDT is not set
427 +# CONFIG_GZIP is not set