1 From d5841f8707dcb7a1f73607de67ab45dba93a56a4 Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Fri, 29 Jul 2022 17:04:12 +0800
4 Subject: [PATCH 55/71] board: mt7981: add reference board using new spi-nand
7 Add a new reference board using new spi-nand driver for SPI-NAND flash on
10 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
12 arch/arm/dts/Makefile | 1 +
13 arch/arm/dts/mt7981-snfi-nand-rfb.dts | 132 +++++++++++++++++++++++++
14 configs/mt7981_snfi_nand_rfb_defconfig | 57 +++++++++++
15 3 files changed, 190 insertions(+)
16 create mode 100644 arch/arm/dts/mt7981-snfi-nand-rfb.dts
17 create mode 100644 configs/mt7981_snfi_nand_rfb_defconfig
19 --- a/arch/arm/dts/Makefile
20 +++ b/arch/arm/dts/Makefile
21 @@ -1266,6 +1266,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
22 mt7623n-bananapi-bpi-r2.dtb \
25 + mt7981-snfi-nand-rfb.dtb \
30 +++ b/arch/arm/dts/mt7981-snfi-nand-rfb.dts
32 +// SPDX-License-Identifier: GPL-2.0
34 + * Copyright (c) 2021 MediaTek Inc.
35 + * Author: Sam Shih <sam.shih@mediatek.com>
39 +#include "mt7981.dtsi"
40 +#include <dt-bindings/gpio/gpio.h>
43 + #address-cells = <1>;
45 + model = "mt7981-rfb";
46 + compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
48 + stdout-path = &uart0;
49 + tick-timer = &timer0;
58 + pinctrl-names = "default";
59 + pinctrl-0 = <&uart1_pins>;
60 + status = "disabled";
65 + mediatek,gmac-id = <0>;
67 + mediatek,switch = "mt7531";
68 + reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
77 + snfi_pins: snfi-pins-func-1 {
85 + drive-strength = <MTK_DRIVE_8mA>;
86 + bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
90 + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
91 + drive-strength = <MTK_DRIVE_6mA>;
92 + bias-pull-up = <MTK_PUPD_SET_R1R0_00>;
96 + pins = "SPI0_MOSI", "SPI0_MISO";
97 + drive-strength = <MTK_DRIVE_6mA>;
98 + bias-pull-down = <MTK_PUPD_SET_R1R0_00>;
102 + spic_pins: spi1-pins-func-1 {
109 + uart1_pins: spi1-pins-func-3 {
112 + groups = "uart1_2";
116 + /* pin15 as pwm0 */
117 + one_pwm_pins: one-pwm-pins {
124 + /* pin15 as pwm0 and pin14 as pwm1 */
125 + two_pwm_pins: two-pwm-pins {
128 + groups = "pwm0_1", "pwm1_0";
132 + /* pin15 as pwm0, pin14 as pwm1, pin7 as pwm2 */
133 + three_pwm_pins: three-pwm-pins {
136 + groups = "pwm0_1", "pwm1_0", "pwm2";
140 + mmc0_pins_default: mmc0default {
142 + function = "flash";
143 + groups = "emmc_45";
149 + pinctrl-names = "default";
150 + pinctrl-0 = <&snfi_pins>;
156 + pinctrl-names = "default";
157 + pinctrl-0 = <&two_pwm_pins>;
162 + status = "disabled";
165 +++ b/configs/mt7981_snfi_nand_rfb_defconfig
168 +CONFIG_POSITION_INDEPENDENT=y
169 +CONFIG_ARCH_MEDIATEK=y
170 +CONFIG_SYS_TEXT_BASE=0x41e00000
171 +CONFIG_SYS_MALLOC_F_LEN=0x4000
172 +CONFIG_NR_DRAM_BANKS=1
173 +CONFIG_ENV_SIZE=0x20000
174 +CONFIG_DEFAULT_DEVICE_TREE="mt7981-snfi-nand-rfb"
175 +CONFIG_TARGET_MT7981=y
176 +CONFIG_DEBUG_UART_BASE=0x11002000
177 +CONFIG_DEBUG_UART_CLOCK=40000000
178 +CONFIG_SYS_LOAD_ADDR=0x46000000
180 +# CONFIG_AUTOBOOT is not set
181 +CONFIG_DEFAULT_FDT_FILE="mt7981-snfi-nand-rfb"
184 +CONFIG_SYS_PROMPT="MT7981> "
185 +CONFIG_SYS_CBSIZE=512
186 +CONFIG_SYS_PBSIZE=1049
187 +# CONFIG_BOOTM_NETBSD is not set
188 +# CONFIG_BOOTM_PLAN9 is not set
189 +# CONFIG_BOOTM_RTEMS is not set
190 +# CONFIG_BOOTM_VXWORKS is not set
191 +# CONFIG_CMD_ELF is not set
192 +# CONFIG_CMD_UNLZ4 is not set
193 +# CONFIG_CMD_UNZIP is not set
198 +CONFIG_MTDIDS_DEFAULT="spi-nand0=spi-nand0"
199 +CONFIG_MTDPARTS_DEFAULT="spi-nand0:1024k(bl2),512k(u-boot-env),2048k(factory),2048k(fip),65536k(ubi)"
201 +CONFIG_CMD_UBI_RENAME=y
202 +CONFIG_ENV_OVERWRITE=y
203 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
204 +CONFIG_NET_RANDOM_ETHADDR=y
208 +# CONFIG_MMC is not set
211 +CONFIG_MTK_SPI_NAND=y
212 +CONFIG_MTK_SPI_NAND_MTD=y
215 +CONFIG_MEDIATEK_ETH=y
218 +CONFIG_PINCTRL_MT7981=y
219 +CONFIG_POWER_DOMAIN=y
220 +CONFIG_MTK_POWER_DOMAIN=y