1 From 0bc16c6a8744a1c0293a31253020205b312895d3 Mon Sep 17 00:00:00 2001
2 From: Tianling Shen <cnsztl@gmail.com>
3 Date: Sat, 23 Dec 2023 12:00:07 +0800
4 Subject: [PATCH] board: rockchip: Add support for FriendlyARM NanoPi R2C Plus
6 The NanoPi R2C Plus is a small variant of NanoPi R2C with a on-board
7 eMMC flash (8G) included.
9 The device tree is taken from the kernel v6.5.
11 Signed-off-by: Tianling Shen <cnsztl@gmail.com>
12 Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
14 arch/arm/dts/Makefile | 1 +
15 .../dts/rk3328-nanopi-r2c-plus-u-boot.dtsi | 9 ++
16 arch/arm/dts/rk3328-nanopi-r2c-plus.dts | 33 +++++
17 board/rockchip/evb_rk3328/MAINTAINERS | 6 +
18 configs/nanopi-r2c-plus-rk3328_defconfig | 114 ++++++++++++++++++
19 5 files changed, 163 insertions(+)
20 create mode 100644 arch/arm/dts/rk3328-nanopi-r2c-plus-u-boot.dtsi
21 create mode 100644 arch/arm/dts/rk3328-nanopi-r2c-plus.dts
22 create mode 100644 configs/nanopi-r2c-plus-rk3328_defconfig
24 --- a/arch/arm/dts/Makefile
25 +++ b/arch/arm/dts/Makefile
26 @@ -126,6 +126,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \
27 dtb-$(CONFIG_ROCKCHIP_RK3328) += \
29 rk3328-nanopi-r2c.dtb \
30 + rk3328-nanopi-r2c-plus.dtb \
31 rk3328-nanopi-r2s.dtb \
32 rk3328-orangepi-r1-plus.dtb \
33 rk3328-orangepi-r1-plus-lts.dtb \
35 +++ b/arch/arm/dts/rk3328-nanopi-r2c-plus-u-boot.dtsi
37 +// SPDX-License-Identifier: GPL-2.0-or-later
39 +#include "rk3328-nanopi-r2c-u-boot.dtsi"
43 + u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc;
47 +++ b/arch/arm/dts/rk3328-nanopi-r2c-plus.dts
49 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
51 + * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd.
52 + * (http://www.friendlyarm.com)
54 + * Copyright (c) 2023 Tianling Shen <cnsztl@gmail.com>
58 +#include "rk3328-nanopi-r2c.dts"
61 + model = "FriendlyElec NanoPi R2C Plus";
62 + compatible = "friendlyarm,nanopi-r2c-plus", "rockchip,rk3328";
72 + max-frequency = <150000000>;
76 + pinctrl-names = "default";
77 + pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
78 + vmmc-supply = <&vcc_io_33>;
79 + vqmmc-supply = <&vcc18_emmc>;
82 --- a/board/rockchip/evb_rk3328/MAINTAINERS
83 +++ b/board/rockchip/evb_rk3328/MAINTAINERS
84 @@ -11,6 +11,12 @@ S: Maintained
85 F: configs/nanopi-r2c-rk3328_defconfig
86 F: arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi
88 +NANOPI-R2C-PLUS-RK3328
89 +M: Tianling Shen <cnsztl@gmail.com>
91 +F: configs/nanopi-r2c-plus-rk3328_defconfig
92 +F: arch/arm/dts/rk3328-nanopi-r2c-plus-u-boot.dtsi
95 M: David Bauer <mail@david-bauer.net>
98 +++ b/configs/nanopi-r2c-plus-rk3328_defconfig
101 +CONFIG_SKIP_LOWLEVEL_INIT=y
102 +CONFIG_COUNTER_FREQUENCY=24000000
103 +CONFIG_ARCH_ROCKCHIP=y
104 +CONFIG_TEXT_BASE=0x00200000
106 +CONFIG_NR_DRAM_BANKS=1
107 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
108 +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
109 +CONFIG_SF_DEFAULT_SPEED=20000000
110 +CONFIG_ENV_OFFSET=0x3F8000
111 +CONFIG_DEFAULT_DEVICE_TREE="rk3328-nanopi-r2c-plus"
113 +CONFIG_ROCKCHIP_RK3328=y
114 +CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
115 +CONFIG_TPL_LIBCOMMON_SUPPORT=y
116 +CONFIG_TPL_LIBGENERIC_SUPPORT=y
117 +CONFIG_SPL_DRIVERS_MISC=y
118 +CONFIG_SPL_STACK_R_ADDR=0x600000
119 +CONFIG_SPL_STACK=0x400000
120 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x800
121 +CONFIG_DEBUG_UART_BASE=0xFF130000
122 +CONFIG_DEBUG_UART_CLOCK=24000000
123 +CONFIG_SYS_LOAD_ADDR=0x800800
125 +# CONFIG_ANDROID_BOOT_IMAGE is not set
127 +CONFIG_FIT_VERBOSE=y
128 +CONFIG_SPL_LOAD_FIT=y
129 +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-nanopi-r2c-plus.dtb"
130 +# CONFIG_DISPLAY_CPUINFO is not set
131 +CONFIG_DISPLAY_BOARDINFO_LATE=y
132 +CONFIG_MISC_INIT_R=y
133 +CONFIG_SPL_MAX_SIZE=0x40000
134 +CONFIG_SPL_PAD_TO=0x7f8000
135 +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
136 +CONFIG_SPL_BSS_START_ADDR=0x2000000
137 +CONFIG_SPL_BSS_MAX_SIZE=0x2000
138 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
139 +# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
140 +CONFIG_SPL_STACK_R=y
144 +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
145 +CONFIG_TPL_SYS_MALLOC_SIMPLE=y
150 +# CONFIG_CMD_SETEXPR is not set
152 +CONFIG_SPL_OF_CONTROL=y
153 +CONFIG_TPL_OF_CONTROL=y
154 +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
155 +CONFIG_TPL_OF_PLATDATA=y
156 +CONFIG_ENV_IS_IN_MMC=y
157 +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
158 +CONFIG_SYS_MMC_ENV_DEV=1
159 +CONFIG_NET_RANDOM_ETHADDR=y
169 +CONFIG_FASTBOOT_BUF_ADDR=0x800800
170 +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
171 +CONFIG_ROCKCHIP_GPIO=y
172 +CONFIG_SYS_I2C_ROCKCHIP=y
175 +CONFIG_MMC_DW_ROCKCHIP=y
176 +CONFIG_ETH_DESIGNWARE=y
177 +CONFIG_GMAC_ROCKCHIP=y
178 +CONFIG_PHY_ROCKCHIP_INNO_USB2=y
180 +CONFIG_SPL_PINCTRL=y
183 +CONFIG_SPL_PMIC_RK8XX=y
184 +CONFIG_SPL_DM_REGULATOR=y
185 +CONFIG_REGULATOR_PWM=y
186 +CONFIG_DM_REGULATOR_FIXED=y
187 +CONFIG_SPL_DM_REGULATOR_FIXED=y
188 +CONFIG_REGULATOR_RK8XX=y
189 +CONFIG_PWM_ROCKCHIP=y
193 +CONFIG_BAUDRATE=1500000
194 +CONFIG_DEBUG_UART_SHIFT=2
195 +CONFIG_SYS_NS16550_MEM32=y
198 +# CONFIG_TPL_SYSRESET is not set
200 +CONFIG_USB_XHCI_HCD=y
201 +CONFIG_USB_EHCI_HCD=y
202 +CONFIG_USB_EHCI_GENERIC=y
203 +CONFIG_USB_OHCI_HCD=y
204 +CONFIG_USB_OHCI_GENERIC=y
207 +# CONFIG_USB_DWC3_GADGET is not set
208 +CONFIG_USB_DWC3_GENERIC=y
210 +CONFIG_USB_GADGET_DWC2_OTG=y
211 +CONFIG_SPL_TINY_MEMSET=y
212 +CONFIG_TPL_TINY_MEMSET=y