1if ARCH_ROCKCHIP
2
3config ROCKCHIP_PX30
4	bool "Support Rockchip PX30"
5	select ARM64
6	select SUPPORT_SPL
7	select SUPPORT_TPL
8	select SPL
9	select TPL
10	select TPL_TINY_FRAMEWORK if TPL
11	select TPL_NEEDS_SEPARATE_STACK if TPL
12	imply SPL_SEPARATE_BSS
13	select SPL_SERIAL
14	select TPL_SERIAL
15	select DEBUG_UART_BOARD_INIT
16	imply ROCKCHIP_COMMON_BOARD
17	imply SPL_ROCKCHIP_COMMON_BOARD
18	help
19	  The Rockchip PX30 is a ARM-based SoC with a quad-core Cortex-A35
20	  including NEON and GPU, Mali-400 graphics, several DDR3 options
21	  and video codec support. Peripherals include Gigabit Ethernet,
22	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
23
24config ROCKCHIP_RK3036
25	bool "Support Rockchip RK3036"
26	select CPU_V7A
27	select SUPPORT_SPL
28	select SPL
29	imply USB_FUNCTION_ROCKUSB
30	imply CMD_ROCKUSB
31	imply ROCKCHIP_COMMON_BOARD
32	help
33	  The Rockchip RK3036 is a ARM-based SoC with a dual-core Cortex-A7
34	  including NEON and GPU, Mali-400 graphics, several DDR3 options
35	  and video codec support. Peripherals include Gigabit Ethernet,
36	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
37
38config ROCKCHIP_RK3066
39	bool "Support Rockchip RK3066"
40	select CPU_V7A
41	select SPL_BOARD_INIT if SPL
42	select SUPPORT_SPL
43	select SUPPORT_TPL
44	select SPL
45	select TPL
46	select TPL_ROCKCHIP_BACK_TO_BROM
47	select TPL_ROCKCHIP_EARLYRETURN_TO_BROM
48	imply ROCKCHIP_COMMON_BOARD
49	imply SPL_ROCKCHIP_COMMON_BOARD
50	imply SPL_SERIAL
51	imply TPL_ROCKCHIP_COMMON_BOARD
52	imply TPL_SERIAL
53	help
54	  The Rockchip RK3066 is a ARM-based SoC with a dual-core Cortex-A9
55	  including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
56	  video interfaces, several memory options and video codec support.
57	  Peripherals include Fast Ethernet, USB2 host and OTG, SDIO, I2S,
58	  UART, SPI, I2C and PWMs.
59
60config ROCKCHIP_RK3128
61	bool "Support Rockchip RK3128"
62	select CPU_V7A
63	imply ROCKCHIP_COMMON_BOARD
64	help
65	  The Rockchip RK3128 is a ARM-based SoC with a quad-core Cortex-A7
66	  including NEON and GPU, Mali-400 graphics, several DDR3 options
67	  and video codec support. Peripherals include Gigabit Ethernet,
68	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
69
70config ROCKCHIP_RK3188
71	bool "Support Rockchip RK3188"
72	select CPU_V7A
73	select SPL_BOARD_INIT if SPL
74	select SUPPORT_SPL
75	select SPL
76	select SPL_CLK
77	select SPL_REGMAP
78	select SPL_SYSCON
79	select SPL_RAM
80	select SPL_DRIVERS_MISC
81	select SPL_ROCKCHIP_EARLYRETURN_TO_BROM
82	select SPL_ROCKCHIP_BACK_TO_BROM
83	select BOARD_LATE_INIT
84	imply ROCKCHIP_COMMON_BOARD
85	imply SPL_ROCKCHIP_COMMON_BOARD
86	help
87	  The Rockchip RK3188 is a ARM-based SoC with a quad-core Cortex-A9
88	  including NEON and GPU, 512KB L2 cache, Mali-400 graphics, two
89	  video interfaces, several memory options and video codec support.
90	  Peripherals include Fast Ethernet, USB2 host and OTG, SDIO, I2S,
91	  UART, SPI, I2C and PWMs.
92
93config ROCKCHIP_RK322X
94	bool "Support Rockchip RK3228/RK3229"
95	select CPU_V7A
96	select SUPPORT_SPL
97	select SUPPORT_TPL
98	select SPL
99	select SPL_DM
100	select SPL_OF_LIBFDT
101	select TPL
102	select TPL_DM
103	select TPL_OF_LIBFDT
104	select TPL_NEEDS_SEPARATE_STACK if TPL
105	select SPL_DRIVERS_MISC
106	imply ROCKCHIP_COMMON_BOARD
107	imply SPL_SERIAL
108	imply SPL_ROCKCHIP_COMMON_BOARD
109	imply TPL_SERIAL
110	imply TPL_ROCKCHIP_COMMON_BOARD
111	select TPL_LIBCOMMON_SUPPORT
112	select TPL_LIBGENERIC_SUPPORT
113	help
114	  The Rockchip RK3229 is a ARM-based SoC with a dual-core Cortex-A7
115	  including NEON and GPU, Mali-400 graphics, several DDR3 options
116	  and video codec support. Peripherals include Gigabit Ethernet,
117	  USB2 host and OTG, SDIO, I2S, UART, SPI, I2C and PWMs.
118
119config ROCKCHIP_RK3288
120	bool "Support Rockchip RK3288"
121	select CPU_V7A
122	select OF_SYSTEM_SETUP
123	select SKIP_LOWLEVEL_INIT_ONLY
124	select SUPPORT_SPL
125	select SPL
126	select SUPPORT_TPL
127	imply PRE_CONSOLE_BUFFER
128	imply ROCKCHIP_COMMON_BOARD
129	imply SPL_ROCKCHIP_COMMON_BOARD
130	imply TPL_CLK
131	imply TPL_DM
132	imply TPL_DRIVERS_MISC
133	imply TPL_LIBCOMMON_SUPPORT
134	imply TPL_LIBGENERIC_SUPPORT
135	imply TPL_NEEDS_SEPARATE_STACK
136	imply TPL_OF_CONTROL
137	imply TPL_OF_PLATDATA
138	imply TPL_RAM
139	imply TPL_REGMAP
140	imply TPL_ROCKCHIP_COMMON_BOARD
141	imply TPL_SERIAL
142	imply TPL_SYSCON
143	imply USB_FUNCTION_ROCKUSB
144	imply CMD_ROCKUSB
145	help
146	  The Rockchip RK3288 is a ARM-based SoC with a quad-core Cortex-A17
147	  including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
148	  video interfaces supporting HDMI and eDP, several DDR3 options
149	  and video codec support. Peripherals include Gigabit Ethernet,
150	  USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
151
152config ROCKCHIP_RK3308
153	bool "Support Rockchip RK3308"
154	select ARM64
155	select DEBUG_UART_BOARD_INIT
156	select SUPPORT_SPL
157	select SUPPORT_TPL
158	select SPL
159	select SPL_ATF
160	select SPL_ATF_NO_PLATFORM_PARAM
161	select SPL_LOAD_FIT
162	imply ROCKCHIP_COMMON_BOARD
163	imply SPL_ROCKCHIP_COMMON_BOARD
164	imply SPL_CLK
165	imply SPL_REGMAP
166	imply SPL_SYSCON
167	imply SPL_RAM
168	imply SPL_SERIAL
169	imply TPL_SERIAL
170	imply SPL_SEPARATE_BSS
171	help
172	  The Rockchip RK3308 is a ARM-based Soc which embedded with quad
173	  Cortex-A35 and highly integrated audio interfaces.
174
175config ROCKCHIP_RK3328
176	bool "Support Rockchip RK3328"
177	select ARM64
178	select SUPPORT_SPL
179	select SPL
180	select SUPPORT_TPL
181	select TPL
182	select TPL_NEEDS_SEPARATE_STACK if TPL
183	imply ROCKCHIP_COMMON_BOARD
184	imply ROCKCHIP_SDRAM_COMMON
185	imply SPL_ROCKCHIP_COMMON_BOARD
186	imply SPL_SERIAL
187	imply TPL_SERIAL
188	imply SPL_SEPARATE_BSS
189	select ENABLE_ARM_SOC_BOOT0_HOOK
190	select DEBUG_UART_BOARD_INIT
191	select SYS_NS16550
192	help
193	  The Rockchip RK3328 is a ARM-based SoC with a quad-core Cortex-A53.
194	  including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
195	  video interfaces supporting HDMI and eDP, several DDR3 options
196	  and video codec support. Peripherals include Gigabit Ethernet,
197	  USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
198
199config ROCKCHIP_RK3368
200	bool "Support Rockchip RK3368"
201	select ARM64
202	select SUPPORT_SPL
203	select SUPPORT_TPL
204	select TPL_NEEDS_SEPARATE_STACK if TPL
205	imply ROCKCHIP_COMMON_BOARD
206	imply SPL_ROCKCHIP_COMMON_BOARD
207	imply SPL_SEPARATE_BSS
208	imply SPL_SERIAL
209	imply TPL_SERIAL
210	imply TPL_ROCKCHIP_COMMON_BOARD
211	help
212	  The Rockchip RK3368 is a ARM-based SoC with a octa-core (organised
213	  into a big and little cluster with 4 cores each) Cortex-A53 including
214	  AdvSIMD, 512KB L2 cache (for the big cluster) and 256 KB L2 cache
215	  (for the little cluster), PowerVR G6110 based graphics, one video
216	  output processor supporting LVDS/HDMI/eDP, several DDR3 options and
217	  video codec support.
218
219	  On-chip peripherals include Gigabit Ethernet, USB2 host and OTG, SDIO,
220	  I2S, UARTs, SPI, I2C and PWMs.
221
222config ROCKCHIP_RK3399
223	bool "Support Rockchip RK3399"
224	select ARM64
225	select SUPPORT_SPL
226	select SUPPORT_TPL
227	select SPL
228	select SPL_ATF
229	select SPL_BOARD_INIT if SPL
230	select SPL_LOAD_FIT
231	select SPL_CLK if SPL
232	select SPL_PINCTRL if SPL
233	select SPL_RAM if SPL
234	select SPL_REGMAP if SPL
235	select SPL_SYSCON if SPL
236	select TPL_NEEDS_SEPARATE_STACK if TPL
237	select SPL_SEPARATE_BSS
238	select SPL_SERIAL
239	select SPL_DRIVERS_MISC
240	select CLK
241	select FIT
242	select PINCTRL
243	select RAM
244	select REGMAP
245	select SYSCON
246	select DM_PMIC
247	select DM_REGULATOR_FIXED
248	select BOARD_LATE_INIT
249	imply PARTITION_TYPE_GUID
250	imply PRE_CONSOLE_BUFFER
251	imply ROCKCHIP_COMMON_BOARD
252	imply ROCKCHIP_SDRAM_COMMON
253	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
254	imply SPL_ROCKCHIP_COMMON_BOARD
255	imply TPL_SERIAL
256	imply TPL_LIBCOMMON_SUPPORT
257	imply TPL_LIBGENERIC_SUPPORT
258	imply TPL_SYS_MALLOC_SIMPLE
259	imply TPL_DRIVERS_MISC
260	imply TPL_OF_CONTROL
261	imply TPL_DM
262	imply TPL_REGMAP
263	imply TPL_SYSCON
264	imply TPL_RAM
265	imply TPL_CLK
266	imply TPL_TINY_MEMSET
267	imply TPL_ROCKCHIP_COMMON_BOARD
268	imply SYS_BOOTCOUNT_SINGLEWORD if BOOTCOUNT_LIMIT
269	imply CMD_BOOTCOUNT if BOOTCOUNT_LIMIT
270	help
271	  The Rockchip RK3399 is a ARM-based SoC with a dual-core Cortex-A72
272	  and quad-core Cortex-A53.
273	  including NEON and GPU, 1MB L2 cache, Mali-T7 graphics, two
274	  video interfaces supporting HDMI and eDP, several DDR3 options
275	  and video codec support. Peripherals include Gigabit Ethernet,
276	  USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
277
278config ROCKCHIP_RK3568
279	bool "Support Rockchip RK3568"
280	select ARM64
281	select SUPPORT_SPL
282	select SPL
283	select CLK
284	select PINCTRL
285	select RAM
286	select REGMAP
287	select SYSCON
288	select BOARD_LATE_INIT
289	select DM_REGULATOR_FIXED
290	select DM_RESET
291	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
292	imply ROCKCHIP_COMMON_BOARD
293	imply OF_LIBFDT_OVERLAY
294	imply ROCKCHIP_OTP
295	imply MISC_INIT_R
296	help
297	  The Rockchip RK3568 is a ARM-based SoC with quad-core Cortex-A55,
298	  including NEON and GPU, 512K L3 cache, Mali-G52 based graphics,
299	  two video interfaces supporting HDMI and eDP, several DDR3 options
300	  and video codec support. Peripherals include Gigabit Ethernet,
301	  USB2 host and OTG, SDIO, I2S, UARTs, SPI, I2C and PWMs.
302
303config ROCKCHIP_RK3588
304	bool "Support Rockchip RK3588"
305	select ARM64
306	select SUPPORT_SPL
307	select SPL
308	select CLK
309	select PINCTRL
310	select RAM
311	select REGMAP
312	select SYSCON
313	select BOARD_LATE_INIT
314	select DM_REGULATOR_FIXED
315	select DM_RESET
316	imply SPL_ATF_NO_PLATFORM_PARAM if SPL_ATF
317	imply ROCKCHIP_COMMON_BOARD
318	imply OF_LIBFDT_OVERLAY
319	imply ROCKCHIP_OTP
320	imply MISC_INIT_R
321	imply CLK_SCMI
322	imply SCMI_FIRMWARE
323	help
324	  The Rockchip RK3588 is a ARM-based SoC with quad-core Cortex-A76 and
325	  quad-core Cortex-A55 including NEON and GPU, 6TOPS NPU, Mali-G610 MP4,
326	  HDMI Out, HDMI In, DP, eDP, MIPI DSI, MIPI CSI2, LPDDR4/4X/5, eMMC5.1,
327	  SD3.0/MMC4.5, USB OTG 3.0, Type-C, USB 2.0, PCIe 3.0, SATA 3, Ethernet,
328	  SDIO3.0 I2C, UART, SPI, GPIO and PWM.
329
330config ROCKCHIP_RV1108
331	bool "Support Rockchip RV1108"
332	select CPU_V7A
333	imply ROCKCHIP_COMMON_BOARD
334	help
335	  The Rockchip RV1108 is a ARM-based SoC with a single-core Cortex-A7
336	  and a DSP.
337
338config ROCKCHIP_RV1126
339	bool "Support Rockchip RV1126"
340	select CPU_V7A
341	select SKIP_LOWLEVEL_INIT_ONLY
342	select TPL
343	select SUPPORT_TPL
344	select TPL_NEEDS_SEPARATE_STACK
345	select TPL_ROCKCHIP_BACK_TO_BROM
346	select SPL
347	select SUPPORT_SPL
348	select SPL_STACK_R
349	select CLK
350	select FIT
351	select PINCTRL
352	select RAM
353	select ROCKCHIP_SDRAM_COMMON
354	select REGMAP
355	select SYSCON
356	select DM_PMIC
357	select DM_REGULATOR_FIXED
358	select DM_RESET
359	select REGULATOR_RK8XX
360	select PMIC_RK8XX
361	select BOARD_LATE_INIT
362	imply ROCKCHIP_COMMON_BOARD
363	imply TPL_DM
364	imply TPL_LIBCOMMON_SUPPORT
365	imply TPL_LIBGENERIC_SUPPORT
366	imply TPL_OF_CONTROL
367	imply TPL_OF_PLATDATA
368	imply TPL_RAM
369	imply TPL_ROCKCHIP_COMMON_BOARD
370	imply TPL_SERIAL
371	imply SPL_CLK
372	imply SPL_DM
373	imply SPL_DRIVERS_MISC
374	imply SPL_LIBCOMMON_SUPPORT
375	imply SPL_LIBGENERIC_SUPPORT
376	imply SPL_OF_CONTROL
377	imply SPL_RAM
378	imply SPL_REGMAP
379	imply SPL_ROCKCHIP_COMMON_BOARD
380	imply SPL_SERIAL
381	imply SPL_SYSCON
382
383config ROCKCHIP_USB_UART
384	bool "Route uart output to usb pins"
385	help
386	  Rockchip SoCs have the ability to route the signals of the debug
387	  uart through the d+ and d- pins of a specific usb phy to enable
388	  some form of closed-case debugging. With this option supported
389	  SoCs will enable this routing as a debug measure.
390
391config SPL_ROCKCHIP_BACK_TO_BROM
392	bool "SPL returns to bootrom"
393	default y if ROCKCHIP_RK3036
394	select ROCKCHIP_BROM_HELPER
395	select SPL_BOOTROM_SUPPORT
396	depends on SPL
397	help
398	  Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
399          SPL will return to the boot rom, which will then load the U-Boot
400          binary to keep going on.
401
402config TPL_ROCKCHIP_BACK_TO_BROM
403	bool "TPL returns to bootrom"
404	default y
405	select ROCKCHIP_BROM_HELPER
406	select TPL_BOOTROM_SUPPORT
407	depends on TPL
408	help
409	  Rockchip SoCs have ability to load SPL & U-Boot binary. If enabled,
410          SPL will return to the boot rom, which will then load the U-Boot
411          binary to keep going on.
412
413config ROCKCHIP_COMMON_BOARD
414	bool "Rockchip common board file"
415	help
416	  Rockchip SoCs have similar boot process, Common board file is mainly
417	  in charge of common process of board_init() and board_late_init() for
418	  U-Boot proper.
419
420config SPL_ROCKCHIP_COMMON_BOARD
421	bool "Rockchip SPL common board file"
422	depends on SPL
423	help
424	  Rockchip SoCs have similar boot process, SPL is mainly in charge of
425	  load and boot Trust ATF/U-Boot firmware, and DRAM init if there is
426	  no TPL for the board.
427
428config TPL_ROCKCHIP_COMMON_BOARD
429	bool "Rockchip TPL common board file"
430	depends on TPL
431	help
432	  Rockchip SoCs have similar boot process, prefer to use TPL for DRAM
433	  init and back to bootrom, and SPL as Trust ATF/U-Boot loader. TPL
434	  common board is a basic TPL board init which can be shared for most
435	  of SoCs to avoid copy-paste for different SoCs.
436
437config ROCKCHIP_EXTERNAL_TPL
438	bool "Use external TPL binary"
439	default y if ROCKCHIP_RK3568 || ROCKCHIP_RK3588
440	help
441	  Some Rockchip SoCs require an external TPL to initialize DRAM.
442	  Enable this option and build with ROCKCHIP_TPL=/path/to/ddr.bin to
443	  include the external TPL in the image built by binman.
444
445config ROCKCHIP_BOOT_MODE_REG
446	hex "Rockchip boot mode flag register address"
447	help
448	  The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
449	  according to the value from this register.
450
451config ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON
452	bool "Disable device boot on power plug-in"
453	depends on PMIC_RK8XX
454	default n
455	---help---
456	  Say Y here to prevent the device from booting up because of a plug-in
457	  event. When set, the device will boot briefly to determine why it was
458	  powered on, and if it was determined because of a plug-in event
459	  instead of a button press event it will shut back off.
460
461config ROCKCHIP_STIMER
462	bool "Rockchip STIMER support"
463	default y
464	help
465	  Enable Rockchip STIMER support.
466
467config ROCKCHIP_STIMER_BASE
468	hex
469	depends on ROCKCHIP_STIMER
470
471config ROCKCHIP_SPL_RESERVE_IRAM
472	hex "Size of IRAM reserved in SPL"
473	default 0
474	help
475	  SPL may need reserve memory for firmware loaded by SPL, whose load
476	  address is in IRAM and may overlay with SPL text area if not
477	  reserved.
478
479config ROCKCHIP_BROM_HELPER
480	bool
481
482config SPL_ROCKCHIP_EARLYRETURN_TO_BROM
483        bool "SPL requires early-return (for RK3188-style BROM) to BROM"
484	depends on SPL && ENABLE_ARM_SOC_BOOT0_HOOK
485	help
486	  Some Rockchip BROM variants (e.g. on the RK3188) load the
487	  first stage in segments and enter multiple times. E.g. on
488	  the RK3188, the first 1KB of the first stage are loaded
489	  first and entered; after returning to the BROM, the
490	  remainder of the first stage is loaded, but the BROM
491	  re-enters at the same address/to the same code as previously.
492
493	  This enables support code in the BOOT0 hook for the SPL stage
494	  to allow multiple entries.
495
496config TPL_ROCKCHIP_EARLYRETURN_TO_BROM
497        bool "TPL requires early-return (for RK3188-style BROM) to BROM"
498	depends on TPL && ENABLE_ARM_SOC_BOOT0_HOOK
499	help
500	  Some Rockchip BROM variants (e.g. on the RK3188) load the
501	  first stage in segments and enter multiple times. E.g. on
502	  the RK3188, the first 1KB of the first stage are loaded
503	  first and entered; after returning to the BROM, the
504	  remainder of the first stage is loaded, but the BROM
505	  re-enters at the same address/to the same code as previously.
506
507	  This enables support code in the BOOT0 hook for the TPL stage
508	  to allow multiple entries.
509
510config SPL_MMC
511	default y if !SPL_ROCKCHIP_BACK_TO_BROM
512
513config ROCKCHIP_SPI_IMAGE
514	bool "Build a SPI image for rockchip"
515	help
516	  Some Rockchip SoCs support booting from SPI flash. Enable this
517	  option to produce a SPI-flash image containing U-Boot. The image
518	  is built by binman. U-Boot sits near the start of the image.
519
520config LNX_KRNL_IMG_TEXT_OFFSET_BASE
521	default TEXT_BASE
522
523source "arch/arm/mach-rockchip/px30/Kconfig"
524source "arch/arm/mach-rockchip/rk3036/Kconfig"
525source "arch/arm/mach-rockchip/rk3066/Kconfig"
526source "arch/arm/mach-rockchip/rk3128/Kconfig"
527source "arch/arm/mach-rockchip/rk3188/Kconfig"
528source "arch/arm/mach-rockchip/rk322x/Kconfig"
529source "arch/arm/mach-rockchip/rk3288/Kconfig"
530source "arch/arm/mach-rockchip/rk3308/Kconfig"
531source "arch/arm/mach-rockchip/rk3328/Kconfig"
532source "arch/arm/mach-rockchip/rk3368/Kconfig"
533source "arch/arm/mach-rockchip/rk3399/Kconfig"
534source "arch/arm/mach-rockchip/rk3568/Kconfig"
535source "arch/arm/mach-rockchip/rk3588/Kconfig"
536source "arch/arm/mach-rockchip/rv1108/Kconfig"
537source "arch/arm/mach-rockchip/rv1126/Kconfig"
538endif
539