ba00a5c9dee0e6b4c716e6b71869aee4102bf5a0
[openwrt/staging/ansuel.git] /
1 From f59d40aa5598063396164b3248f0f8ed6591e3db Mon Sep 17 00:00:00 2001
2 From: Sebastian Kropatsch <seb-dev@mail.de>
3 Date: Thu, 11 Jul 2024 12:15:17 +0200
4 Subject: [PATCH] board: rockchip: Add FriendlyElec NanoPi R6C
5
6 The NanoPi R6C is a SBC by FriendlyElec based on the Rockchip RK3588s.
7 It comes with 4GB or 8GB of RAM, a microSD card slot, optional 32GB eMMC
8 storage, one M.2 M-Key connector, one RTL8211F 1GbE and one RTL8125
9 2.5GbE Ethernet port, one USB 2.0 Type-A and one USB 3.0 Type-A port, a
10 HDMI port, a 30-pin GPIO header as well as multiple buttons and LEDs.
11
12 Add initial support for this board using the upstream devicetree sources.
13
14 Tested in U-Boot proper:
15 - Booting from eMMC works
16 - 1GbE Ethernet works using the eth_eqos driver (tested by ping)
17 - 2.5GbE Ethernet works using the eth_rtl8169 driver (tested by ping),
18 but the status LEDs on this specific port currently aren't working
19 - NVMe SSD in M.2 socket does get recognized (tested with `nvme scan`
20 followed by `nvme details`)
21
22 Kernel commit:
23 d5f1d7437451 ("arm64: dts: rockchip: Add support for NanoPi R6C")
24
25 Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
26 Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
27 Signed-off-by: Sebastian Kropatsch <seb-dev@mail.de>
28 ---
29 arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi | 3 +
30 arch/arm/mach-rockchip/rk3588/Kconfig | 13 +++
31 board/friendlyelec/nanopi-r6c-rk3588s/Kconfig | 12 +++
32 .../nanopi-r6c-rk3588s/MAINTAINERS | 7 ++
33 configs/nanopi-r6c-rk3588s_defconfig | 83 +++++++++++++++++++
34 doc/board/rockchip/rockchip.rst | 1 +
35 include/configs/nanopi-r6c-rk3588s.h | 12 +++
36 7 files changed, 131 insertions(+)
37 create mode 100644 arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi
38 create mode 100644 board/friendlyelec/nanopi-r6c-rk3588s/Kconfig
39 create mode 100644 board/friendlyelec/nanopi-r6c-rk3588s/MAINTAINERS
40 create mode 100644 configs/nanopi-r6c-rk3588s_defconfig
41 create mode 100644 include/configs/nanopi-r6c-rk3588s.h
42
43 --- /dev/null
44 +++ b/arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi
45 @@ -0,0 +1,3 @@
46 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
47 +
48 +#include "rk3588s-u-boot.dtsi"
49 --- a/arch/arm/mach-rockchip/rk3588/Kconfig
50 +++ b/arch/arm/mach-rockchip/rk3588/Kconfig
51 @@ -90,6 +90,18 @@ config TARGET_NANOPI_R6S_RK3588S
52 12-pin GPIO FPC connector, a fan connector, IR receiver as well
53 as some buttons and LEDs.
54
55 +config TARGET_NANOPI_R6C_RK3588S
56 + bool "FriendlyElec NanoPi R6C"
57 + select BOARD_LATE_INIT
58 + help
59 + The NanoPi R6C is a SBC by FriendlyElec based on the Rockchip
60 + RK3588s.
61 + It comes with 4GB or 8GB of RAM, a microSD card slot, optional 32GB
62 + eMMC storage, one M.2 M-Key connector, one RTL8211F 1GbE and one
63 + RTL8125 2.5GbE Ethernet port, one USB 2.0 Type-A and one USB 3.0
64 + Type-A port, a HDMI port, a 30-pin GPIO header as well as some
65 + buttons and LEDs.
66 +
67 config TARGET_NOVA_RK3588
68 bool "Indiedroid Nova RK3588"
69 select BOARD_LATE_INIT
70 @@ -245,6 +257,7 @@ config TEXT_BASE
71 source "board/edgeble/neural-compute-module-6/Kconfig"
72 source "board/friendlyelec/nanopc-t6-rk3588/Kconfig"
73 source "board/friendlyelec/nanopi-r6s-rk3588s/Kconfig"
74 +source "board/friendlyelec/nanopi-r6c-rk3588s/Kconfig"
75 source "board/indiedroid/nova/Kconfig"
76 source "board/pine64/quartzpro64-rk3588/Kconfig"
77 source "board/turing/turing-rk1-rk3588/Kconfig"
78 --- /dev/null
79 +++ b/board/friendlyelec/nanopi-r6c-rk3588s/Kconfig
80 @@ -0,0 +1,12 @@
81 +if TARGET_NANOPI_R6C_RK3588S
82 +
83 +config SYS_BOARD
84 + default "nanopi-r6c-rk3588s"
85 +
86 +config SYS_VENDOR
87 + default "friendlyelec"
88 +
89 +config SYS_CONFIG_NAME
90 + default "nanopi-r6c-rk3588s"
91 +
92 +endif
93 --- /dev/null
94 +++ b/board/friendlyelec/nanopi-r6c-rk3588s/MAINTAINERS
95 @@ -0,0 +1,7 @@
96 +NANOPI-R6C
97 +M: Sebastian Kropatsch <seb-dev@mail.de>
98 +S: Maintained
99 +F: arch/arm/dts/rk3588s-nanopi-r6c-u-boot.dtsi
100 +F: board/friendlyelec/nanopi-r6c-rk3588s
101 +F: configs/nanopi-r6c-rk3588s_defconfig
102 +F: include/configs/nanopi-r6c-rk3588s.h
103 --- /dev/null
104 +++ b/configs/nanopi-r6c-rk3588s_defconfig
105 @@ -0,0 +1,83 @@
106 +CONFIG_ARM=y
107 +CONFIG_SKIP_LOWLEVEL_INIT=y
108 +CONFIG_SYS_HAS_NONCACHED_MEMORY=y
109 +CONFIG_COUNTER_FREQUENCY=24000000
110 +CONFIG_ARCH_ROCKCHIP=y
111 +CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588s-nanopi-r6c"
112 +CONFIG_ROCKCHIP_RK3588=y
113 +CONFIG_SPL_SERIAL=y
114 +CONFIG_TARGET_NANOPI_R6C_RK3588S=y
115 +CONFIG_DEBUG_UART_BASE=0xFEB50000
116 +CONFIG_DEBUG_UART_CLOCK=24000000
117 +CONFIG_SYS_LOAD_ADDR=0xc00800
118 +CONFIG_PCI=y
119 +CONFIG_DEBUG_UART=y
120 +CONFIG_FIT=y
121 +CONFIG_FIT_VERBOSE=y
122 +CONFIG_SPL_FIT_SIGNATURE=y
123 +CONFIG_SPL_LOAD_FIT=y
124 +CONFIG_LEGACY_IMAGE_FORMAT=y
125 +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588s-nanopi-r6c.dtb"
126 +# CONFIG_DISPLAY_CPUINFO is not set
127 +CONFIG_DISPLAY_BOARDINFO_LATE=y
128 +CONFIG_SPL_MAX_SIZE=0x40000
129 +CONFIG_SPL_PAD_TO=0x7f8000
130 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
131 +CONFIG_SPL_ATF=y
132 +CONFIG_CMD_GPIO=y
133 +CONFIG_CMD_PWM=y
134 +CONFIG_CMD_GPT=y
135 +CONFIG_CMD_I2C=y
136 +CONFIG_CMD_MMC=y
137 +CONFIG_CMD_PCI=y
138 +CONFIG_CMD_USB=y
139 +CONFIG_CMD_ROCKUSB=y
140 +# CONFIG_CMD_SETEXPR is not set
141 +CONFIG_CMD_REGULATOR=y
142 +# CONFIG_SPL_DOS_PARTITION is not set
143 +CONFIG_SPL_OF_CONTROL=y
144 +CONFIG_OF_LIVE=y
145 +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
146 +CONFIG_SPL_DM_SEQ_ALIAS=y
147 +CONFIG_SPL_REGMAP=y
148 +CONFIG_SPL_SYSCON=y
149 +CONFIG_SPL_CLK=y
150 +# CONFIG_USB_FUNCTION_FASTBOOT is not set
151 +CONFIG_ROCKCHIP_GPIO=y
152 +CONFIG_SYS_I2C_ROCKCHIP=y
153 +CONFIG_MISC=y
154 +CONFIG_SUPPORT_EMMC_RPMB=y
155 +CONFIG_MMC_DW=y
156 +CONFIG_MMC_DW_ROCKCHIP=y
157 +CONFIG_MMC_SDHCI=y
158 +CONFIG_MMC_SDHCI_SDMA=y
159 +CONFIG_MMC_SDHCI_ROCKCHIP=y
160 +# CONFIG_SPI_FLASH is not set
161 +CONFIG_PHY_REALTEK=y
162 +CONFIG_DWC_ETH_QOS=y
163 +CONFIG_DWC_ETH_QOS_ROCKCHIP=y
164 +CONFIG_RTL8169=y
165 +CONFIG_NVME_PCI=y
166 +CONFIG_PCIE_DW_ROCKCHIP=y
167 +CONFIG_PHY_ROCKCHIP_INNO_USB2=y
168 +CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
169 +CONFIG_PHY_ROCKCHIP_USBDP=y
170 +CONFIG_SPL_PINCTRL=y
171 +CONFIG_PWM_ROCKCHIP=y
172 +CONFIG_SPL_RAM=y
173 +CONFIG_BAUDRATE=1500000
174 +CONFIG_DEBUG_UART_SHIFT=2
175 +CONFIG_SYS_NS16550_MEM32=y
176 +CONFIG_SYSRESET=y
177 +CONFIG_USB=y
178 +CONFIG_USB_XHCI_HCD=y
179 +CONFIG_USB_EHCI_HCD=y
180 +CONFIG_USB_EHCI_GENERIC=y
181 +CONFIG_USB_OHCI_HCD=y
182 +CONFIG_USB_OHCI_GENERIC=y
183 +CONFIG_USB_DWC3=y
184 +CONFIG_USB_DWC3_GENERIC=y
185 +CONFIG_USB_GADGET=y
186 +CONFIG_USB_GADGET_DOWNLOAD=y
187 +CONFIG_USB_FUNCTION_ROCKUSB=y
188 +CONFIG_ERRNO_STR=y
189 --- a/doc/board/rockchip/rockchip.rst
190 +++ b/doc/board/rockchip/rockchip.rst
191 @@ -126,6 +126,7 @@ List of mainline supported Rockchip boar
192 - Edgeble Neural Compute Module 6A SoM - Neu6a (neu6a-io-rk3588)
193 - Edgeble Neural Compute Module 6B SoM - Neu6b (neu6b-io-rk3588)
194 - FriendlyElec NanoPC-T6 (nanopc-t6-rk3588)
195 + - FriendlyElec NanoPi R6C (nanopi-r6c-rk3588s)
196 - Generic RK3588S/RK3588 (generic-rk3588)
197 - Indiedroid Nova (nova-rk3588s)
198 - Pine64 QuartzPro64 (quartzpro64-rk3588)
199 --- /dev/null
200 +++ b/include/configs/nanopi-r6c-rk3588s.h
201 @@ -0,0 +1,12 @@
202 +/* SPDX-License-Identifier: GPL-2.0+ */
203 +
204 +#ifndef __NANOPI_R6C_RK3588S_H
205 +#define __NANOPI_R6C_RK3588S_H
206 +
207 +#define ROCKCHIP_DEVICE_SETTINGS \
208 + "stdout=serial,vidconsole\0" \
209 + "stderr=serial,vidconsole\0"
210 +
211 +#include <configs/rk3588_common.h>
212 +
213 +#endif /* __NANOPI_R6C_RK3588S_H */