1if ARCH_SUNXI
2
3config SPL_LDSCRIPT
4	default "arch/arm/cpu/armv7/sunxi/u-boot-spl.lds" if !ARM64
5
6config IDENT_STRING
7	default " Allwinner Technology"
8
9config DRAM_SUN4I
10	bool
11	help
12	  Select this dram controller driver for Sun4/5/7i platforms,
13	  like A10/A13/A20.
14
15config DRAM_SUN6I
16	bool
17	help
18	  Select this dram controller driver for Sun6i platforms,
19	  like A31/A31s.
20
21config DRAM_SUN8I_A23
22	bool
23	help
24	  Select this dram controller driver for Sun8i platforms,
25	  for A23 SOC.
26
27config DRAM_SUN8I_A33
28	bool
29	help
30	  Select this dram controller driver for Sun8i platforms,
31	  for A33 SOC.
32
33config DRAM_SUN8I_A83T
34	bool
35	help
36	  Select this dram controller driver for Sun8i platforms,
37	  for A83T SOC.
38
39config DRAM_SUN9I
40	bool
41	help
42	  Select this dram controller driver for Sun9i platforms,
43	  like A80.
44
45config DRAM_SUN50I_H6
46	bool
47	help
48	  Select this dram controller driver for some sun50i platforms,
49	  like H6.
50
51config DRAM_SUN50I_H616
52	bool
53	help
54	  Select this dram controller driver for some sun50i platforms,
55	  like H616.
56
57if DRAM_SUN50I_H616
58config DRAM_SUN50I_H616_WRITE_LEVELING
59	bool "H616 DRAM write leveling"
60	---help---
61	  Select this when DRAM on your H616 board needs write leveling.
62
63config DRAM_SUN50I_H616_READ_CALIBRATION
64	bool "H616 DRAM read calibration"
65	---help---
66	  Select this when DRAM on your H616 board needs read calibration.
67
68config DRAM_SUN50I_H616_READ_TRAINING
69	bool "H616 DRAM read training"
70	---help---
71	  Select this when DRAM on your H616 board needs read training.
72
73config DRAM_SUN50I_H616_WRITE_TRAINING
74	bool "H616 DRAM write training"
75	---help---
76	  Select this when DRAM on your H616 board needs write training.
77
78config DRAM_SUN50I_H616_BIT_DELAY_COMPENSATION
79	bool "H616 DRAM bit delay compensation"
80	---help---
81	  Select this when DRAM on your H616 board needs bit delay
82	  compensation.
83
84config DRAM_SUN50I_H616_UNKNOWN_FEATURE
85	bool "H616 DRAM unknown feature"
86	---help---
87	  Select this when DRAM on your H616 board needs this unknown
88	  feature.
89endif
90
91config SUN6I_P2WI
92	bool "Allwinner sun6i internal P2WI controller"
93	help
94	  If you say yes to this option, support will be included for the
95	  P2WI (Push/Pull 2 Wire Interface) controller embedded in some sunxi
96	  SOCs.
97	  The P2WI looks like an SMBus controller (which supports only byte
98	  accesses), except that it only supports one slave device.
99	  This interface is used to connect to specific PMIC devices (like the
100	  AXP221).
101
102config SUN6I_PRCM
103	bool
104	help
105	  Support for the PRCM (Power/Reset/Clock Management) unit available
106	  in A31 SoC.
107
108config AXP_PMIC_BUS
109	bool "Sunxi AXP PMIC bus access helpers"
110	help
111	  Select this PMIC bus access helpers for Sunxi platform PRCM or other
112	  AXP family PMIC devices.
113
114config SUN8I_RSB
115	bool "Allwinner sunXi Reduced Serial Bus Driver"
116	help
117	  Say y here to enable support for Allwinner's Reduced Serial Bus
118	  (RSB) support. This controller is responsible for communicating
119	  with various RSB based devices, such as AXP223, AXP8XX PMICs,
120	  and AC100/AC200 ICs.
121
122config SUNXI_SRAM_ADDRESS
123	hex
124	default 0x10000 if MACH_SUN9I || MACH_SUN50I || MACH_SUN50I_H5
125	default 0x20000 if SUN50I_GEN_H6
126	default 0x0
127	---help---
128	Older Allwinner SoCs have their mask boot ROM mapped just below 4GB,
129	with the first SRAM region being located at address 0.
130	Some newer SoCs map the boot ROM at address 0 instead and move the
131	SRAM to a different address.
132
133config SUNXI_A64_TIMER_ERRATUM
134	bool
135
136# Note only one of these may be selected at a time! But hidden choices are
137# not supported by Kconfig
138config SUNXI_GEN_SUN4I
139	bool
140	---help---
141	Select this for sunxi SoCs which have resets and clocks set up
142	as the original A10 (mach-sun4i).
143
144config SUNXI_GEN_SUN6I
145	bool
146	---help---
147	Select this for sunxi SoCs which have sun6i like periphery, like
148	separate ahb reset control registers, custom pmic bus, new style
149	watchdog, etc.
150
151config SUN50I_GEN_H6
152	bool
153	select FIT
154	select SPL_LOAD_FIT
155	select SUPPORT_SPL
156	---help---
157	Select this for sunxi SoCs which have H6 like peripherals, clocks
158	and memory map.
159
160config SUNXI_DRAM_DW
161	bool
162	---help---
163	Select this for sunxi SoCs which uses a DRAM controller like the
164	DesignWare controller used in H3, mainly SoCs after H3, which do
165	not have official open-source DRAM initialization code, but can
166	use modified H3 DRAM initialization code.
167
168if SUNXI_DRAM_DW
169config SUNXI_DRAM_DW_16BIT
170	bool
171	---help---
172	Select this for sunxi SoCs with DesignWare DRAM controller and
173	have only 16-bit memory buswidth.
174
175config SUNXI_DRAM_DW_32BIT
176	bool
177	---help---
178	Select this for sunxi SoCs with DesignWare DRAM controller with
179	32-bit memory buswidth.
180endif
181
182config MACH_SUNXI_H3_H5
183	bool
184	select DM_I2C
185	select PHY_SUN4I_USB
186	select SUNXI_DE2
187	select SUNXI_DRAM_DW
188	select SUNXI_DRAM_DW_32BIT
189	select SUNXI_GEN_SUN6I
190	select SUPPORT_SPL
191
192# TODO: try out A80's 8GiB DRAM space
193# TODO: H616 supports 4 GiB DRAM space
194config SUNXI_DRAM_MAX_SIZE
195	hex
196	default 0xC0000000 if MACH_SUN50I || MACH_SUN50I_H5 || MACH_SUN50I_H6 || MACH_SUN50I_H616
197	default 0x80000000
198
199choice
200	prompt "Sunxi SoC Variant"
201	optional
202
203config MACH_SUN4I
204	bool "sun4i (Allwinner A10)"
205	select CPU_V7A
206	select ARM_CORTEX_CPU_IS_UP
207	select PHY_SUN4I_USB
208	select DRAM_SUN4I
209	select SUNXI_GEN_SUN4I
210	select SUPPORT_SPL
211
212config MACH_SUN5I
213	bool "sun5i (Allwinner A13)"
214	select CPU_V7A
215	select ARM_CORTEX_CPU_IS_UP
216	select DRAM_SUN4I
217	select PHY_SUN4I_USB
218	select SUNXI_GEN_SUN4I
219	select SUPPORT_SPL
220	imply CONS_INDEX_2 if !DM_SERIAL
221
222config MACH_SUN6I
223	bool "sun6i (Allwinner A31)"
224	select CPU_V7A
225	select CPU_V7_HAS_NONSEC
226	select CPU_V7_HAS_VIRT
227	select ARCH_SUPPORT_PSCI
228	select DRAM_SUN6I
229	select PHY_SUN4I_USB
230	select SUN6I_P2WI
231	select SUN6I_PRCM
232	select SUNXI_GEN_SUN6I
233	select SUPPORT_SPL
234	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
235
236config MACH_SUN7I
237	bool "sun7i (Allwinner A20)"
238	select CPU_V7A
239	select CPU_V7_HAS_NONSEC
240	select CPU_V7_HAS_VIRT
241	select ARCH_SUPPORT_PSCI
242	select DRAM_SUN4I
243	select PHY_SUN4I_USB
244	select SUNXI_GEN_SUN4I
245	select SUPPORT_SPL
246	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
247
248config MACH_SUN8I_A23
249	bool "sun8i (Allwinner A23)"
250	select CPU_V7A
251	select CPU_V7_HAS_NONSEC
252	select CPU_V7_HAS_VIRT
253	select ARCH_SUPPORT_PSCI
254	select DRAM_SUN8I_A23
255	select PHY_SUN4I_USB
256	select SUNXI_GEN_SUN6I
257	select SUPPORT_SPL
258	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
259	imply CONS_INDEX_5 if !DM_SERIAL
260
261config MACH_SUN8I_A33
262	bool "sun8i (Allwinner A33)"
263	select CPU_V7A
264	select CPU_V7_HAS_NONSEC
265	select CPU_V7_HAS_VIRT
266	select ARCH_SUPPORT_PSCI
267	select DRAM_SUN8I_A33
268	select PHY_SUN4I_USB
269	select SUNXI_GEN_SUN6I
270	select SUPPORT_SPL
271	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
272	imply CONS_INDEX_5 if !DM_SERIAL
273
274config MACH_SUN8I_A83T
275	bool "sun8i (Allwinner A83T)"
276	select CPU_V7A
277	select DRAM_SUN8I_A83T
278	select PHY_SUN4I_USB
279	select SUNXI_GEN_SUN6I
280	select MMC_SUNXI_HAS_NEW_MODE
281	select MMC_SUNXI_HAS_MODE_SWITCH
282	select SUPPORT_SPL
283
284config MACH_SUN8I_H3
285	bool "sun8i (Allwinner H3)"
286	select CPU_V7A
287	select CPU_V7_HAS_NONSEC
288	select CPU_V7_HAS_VIRT
289	select ARCH_SUPPORT_PSCI
290	select MACH_SUNXI_H3_H5
291	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
292
293config MACH_SUN8I_R40
294	bool "sun8i (Allwinner R40)"
295	select CPU_V7A
296	select CPU_V7_HAS_NONSEC
297	select CPU_V7_HAS_VIRT
298	select ARCH_SUPPORT_PSCI
299	select SUNXI_GEN_SUN6I
300	select SUPPORT_SPL
301	select SUNXI_DRAM_DW
302	select SUNXI_DRAM_DW_32BIT
303	select PHY_SUN4I_USB
304
305config MACH_SUN8I_V3S
306	bool "sun8i (Allwinner V3/V3s/S3/S3L)"
307	select CPU_V7A
308	select CPU_V7_HAS_NONSEC
309	select CPU_V7_HAS_VIRT
310	select ARCH_SUPPORT_PSCI
311	select SUNXI_GEN_SUN6I
312	select SUNXI_DRAM_DW
313	select SUNXI_DRAM_DW_16BIT
314	select SUPPORT_SPL
315	select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
316
317config MACH_SUN9I
318	bool "sun9i (Allwinner A80)"
319	select CPU_V7A
320	select DRAM_SUN9I
321	select SUN6I_PRCM
322	select SUNXI_GEN_SUN6I
323	select SUN8I_RSB
324	select SUPPORT_SPL
325
326config MACH_SUN50I
327	bool "sun50i (Allwinner A64)"
328	select ARM64
329	select SPI
330	select DM_I2C
331	select DM_SPI if SPI
332	select DM_SPI_FLASH
333	select PHY_SUN4I_USB
334	select SUN6I_PRCM
335	select SUNXI_DE2
336	select SUNXI_GEN_SUN6I
337	select MMC_SUNXI_HAS_NEW_MODE
338	select SUPPORT_SPL
339	select SUNXI_DRAM_DW
340	select SUNXI_DRAM_DW_32BIT
341	select FIT
342	select SPL_LOAD_FIT
343	select SUNXI_A64_TIMER_ERRATUM
344
345config MACH_SUN50I_H5
346	bool "sun50i (Allwinner H5)"
347	select ARM64
348	select MACH_SUNXI_H3_H5
349	select FIT
350	select SPL_LOAD_FIT
351
352config MACH_SUN50I_H6
353	bool "sun50i (Allwinner H6)"
354	select ARM64
355	select PHY_SUN4I_USB
356	select DRAM_SUN50I_H6
357	select SUN50I_GEN_H6
358
359config MACH_SUN50I_H616
360	bool "sun50i (Allwinner H616)"
361	select ARM64
362	select DRAM_SUN50I_H616
363	select SUN50I_GEN_H6
364
365endchoice
366
367# The sun8i SoCs share a lot, this helps to avoid a lot of "if A23 || A33"
368config MACH_SUN8I
369	bool
370	select SUN8I_RSB
371	select SUN6I_PRCM
372	default y if MACH_SUN8I_A23
373	default y if MACH_SUN8I_A33
374	default y if MACH_SUN8I_A83T
375	default y if MACH_SUNXI_H3_H5
376	default y if MACH_SUN8I_R40
377	default y if MACH_SUN8I_V3S
378
379config RESERVE_ALLWINNER_BOOT0_HEADER
380	bool "reserve space for Allwinner boot0 header"
381	select ENABLE_ARM_SOC_BOOT0_HOOK
382	---help---
383	Prepend a 1536 byte (empty) header to the U-Boot image file, to be
384	filled with magic values post build. The Allwinner provided boot0
385	blob relies on this information to load and execute U-Boot.
386	Only needed on 64-bit Allwinner boards so far when using boot0.
387
388config ARM_BOOT_HOOK_RMR
389	bool
390	depends on ARM64
391	default y
392	select ENABLE_ARM_SOC_BOOT0_HOOK
393	---help---
394	Insert some ARM32 code at the very beginning of the U-Boot binary
395	which uses an RMR register write to bring the core into AArch64 mode.
396	The very first instruction acts as a switch, since it's carefully
397	chosen to be a NOP in one mode and a branch in the other, so the
398	code would only be executed if not already in AArch64.
399	This allows both the SPL and the U-Boot proper to be entered in
400	either mode and switch to AArch64 if needed.
401
402if SUNXI_DRAM_DW || DRAM_SUN50I_H6
403config SUNXI_DRAM_DDR3
404	bool
405
406config SUNXI_DRAM_DDR2
407	bool
408
409config SUNXI_DRAM_LPDDR3
410	bool
411
412choice
413	prompt "DRAM Type and Timing"
414	default SUNXI_DRAM_DDR3_1333 if !MACH_SUN8I_V3S
415	default SUNXI_DRAM_DDR2_V3S if MACH_SUN8I_V3S
416
417config SUNXI_DRAM_DDR3_1333
418	bool "DDR3 1333"
419	select SUNXI_DRAM_DDR3
420	---help---
421	This option is the original only supported memory type, which suits
422	many H3/H5/A64 boards available now.
423
424config SUNXI_DRAM_LPDDR3_STOCK
425	bool "LPDDR3 with Allwinner stock configuration"
426	select SUNXI_DRAM_LPDDR3
427	---help---
428	This option is the LPDDR3 timing used by the stock boot0 by
429	Allwinner.
430
431config SUNXI_DRAM_H6_LPDDR3
432	bool "LPDDR3 DRAM chips on the H6 DRAM controller"
433	select SUNXI_DRAM_LPDDR3
434	depends on DRAM_SUN50I_H6
435	---help---
436	This option is the LPDDR3 timing used by the stock boot0 by
437	Allwinner.
438
439config SUNXI_DRAM_H6_DDR3_1333
440	bool "DDR3-1333 boot0 timings on the H6 DRAM controller"
441	select SUNXI_DRAM_DDR3
442	depends on DRAM_SUN50I_H6
443	---help---
444	This option is the DDR3 timing used by the boot0 on H6 TV boxes
445	which use a DDR3-1333 timing.
446
447config SUNXI_DRAM_DDR2_V3S
448	bool "DDR2 found in V3s chip"
449	select SUNXI_DRAM_DDR2
450	depends on MACH_SUN8I_V3S
451	---help---
452	This option is only for the DDR2 memory chip which is co-packaged in
453	Allwinner V3s SoC.
454
455endchoice
456endif
457
458config DRAM_TYPE
459	int "sunxi dram type"
460	depends on MACH_SUN8I_A83T
461	default 3
462	---help---
463	Set the dram type, 3: DDR3, 7: LPDDR3
464
465config DRAM_CLK
466	int "sunxi dram clock speed"
467	default 792 if MACH_SUN9I
468	default 648 if MACH_SUN8I_R40
469	default 312 if MACH_SUN6I || MACH_SUN8I
470	default 360 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || \
471		       MACH_SUN8I_V3S
472	default 672 if MACH_SUN50I
473	default 744 if MACH_SUN50I_H6
474	default 720 if MACH_SUN50I_H616
475	---help---
476	Set the dram clock speed, valid range 240 - 480 (prior to sun9i),
477	must be a multiple of 24. For the sun9i (A80), the tested values
478	(for DDR3-1600) are 312 to 792.
479
480if MACH_SUN5I || MACH_SUN7I
481config DRAM_MBUS_CLK
482	int "sunxi mbus clock speed"
483	default 300
484	---help---
485	Set the mbus clock speed. The maximum on sun5i hardware is 300MHz.
486
487endif
488
489config DRAM_ZQ
490	int "sunxi dram zq value"
491	depends on !MACH_SUN50I_H616
492	default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || \
493		       MACH_SUN8I_A23 || MACH_SUN8I_A33 || MACH_SUN8I_A83T
494	default 127 if MACH_SUN7I
495	default 14779 if MACH_SUN8I_V3S
496	default 3881979 if MACH_SUNXI_H3_H5 || MACH_SUN8I_R40 || MACH_SUN50I_H6
497	default 4145117 if MACH_SUN9I
498	default 3881915 if MACH_SUN50I
499	---help---
500	Set the dram zq value.
501
502config DRAM_ODT_EN
503	bool "sunxi dram odt enable"
504	default y if MACH_SUN8I_A23
505	default y if MACH_SUNXI_H3_H5
506	default y if MACH_SUN8I_R40
507	default y if MACH_SUN50I
508	default y if MACH_SUN50I_H6
509	default y if MACH_SUN50I_H616
510	---help---
511	Select this to enable dram odt (on die termination).
512
513if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
514config DRAM_EMR1
515	int "sunxi dram emr1 value"
516	default 0 if MACH_SUN4I
517	default 4 if MACH_SUN5I || MACH_SUN7I
518	---help---
519	Set the dram controller emr1 value.
520
521config DRAM_TPR3
522	hex "sunxi dram tpr3 value"
523	default 0
524	---help---
525	Set the dram controller tpr3 parameter. This parameter configures
526	the delay on the command lane and also phase shifts, which are
527	applied for sampling incoming read data. The default value 0
528	means that no phase/delay adjustments are necessary. Properly
529	configuring this parameter increases reliability at high DRAM
530	clock speeds.
531
532config DRAM_DQS_GATING_DELAY
533	hex "sunxi dram dqs_gating_delay value"
534	default 0
535	---help---
536	Set the dram controller dqs_gating_delay parmeter. Each byte
537	encodes the DQS gating delay for each byte lane. The delay
538	granularity is 1/4 cycle. For example, the value 0x05060606
539	means that the delay is 5 quarter-cycles for one lane (1.25
540	cycles) and 6 quarter-cycles (1.5 cycles) for 3 other lanes.
541	The default value 0 means autodetection. The results of hardware
542	autodetection are not very reliable and depend on the chip
543	temperature (sometimes producing different results on cold start
544	and warm reboot). But the accuracy of hardware autodetection
545	is usually good enough, unless running at really high DRAM
546	clocks speeds (up to 600MHz). If unsure, keep as 0.
547
548choice
549	prompt "sunxi dram timings"
550	default DRAM_TIMINGS_VENDOR_MAGIC
551	---help---
552	Select the timings of the DDR3 chips.
553
554config DRAM_TIMINGS_VENDOR_MAGIC
555	bool "Magic vendor timings from Android"
556	---help---
557	The same DRAM timings as in the Allwinner boot0 bootloader.
558
559config DRAM_TIMINGS_DDR3_1066F_1333H
560	bool "JEDEC DDR3-1333H with down binning to DDR3-1066F"
561	---help---
562	Use the timings of the standard JEDEC DDR3-1066F speed bin for
563	DRAM_CLK <= 533MHz and the timings of the DDR3-1333H speed bin
564	for DRAM_CLK > 533MHz. This covers the majority of DDR3 chips
565	used in Allwinner A10/A13/A20 devices. In the case of DDR3-1333
566	or DDR3-1600 chips, be sure to check the DRAM datasheet to confirm
567	that down binning to DDR3-1066F is supported (because DDR3-1066F
568	uses a bit faster timings than DDR3-1333H).
569
570config DRAM_TIMINGS_DDR3_800E_1066G_1333J
571	bool "JEDEC DDR3-800E / DDR3-1066G / DDR3-1333J"
572	---help---
573	Use the timings of the slowest possible JEDEC speed bin for the
574	selected DRAM_CLK. Depending on the DRAM_CLK value, it may be
575	DDR3-800E, DDR3-1066G or DDR3-1333J.
576
577endchoice
578
579endif
580
581if MACH_SUN8I_A23
582config DRAM_ODT_CORRECTION
583	int "sunxi dram odt correction value"
584	default 0
585	---help---
586	Set the dram odt correction value (range -255 - 255). In allwinner
587	fex files, this option is found in bits 8-15 of the u32 odt_en variable
588	in the [dram] section. When bit 31 of the odt_en variable is set
589	then the correction is negative. Usually the value for this is 0.
590endif
591
592config SYS_CLK_FREQ
593	default 1008000000 if MACH_SUN4I
594	default 1008000000 if MACH_SUN5I
595	default 1008000000 if MACH_SUN6I
596	default 912000000 if MACH_SUN7I
597	default 816000000 if MACH_SUN50I || MACH_SUN50I_H5
598	default 1008000000 if MACH_SUN8I
599	default 1008000000 if MACH_SUN9I
600	default 888000000 if MACH_SUN50I_H6
601	default 1008000000 if MACH_SUN50I_H616
602
603config SYS_CONFIG_NAME
604	default "sun4i" if MACH_SUN4I
605	default "sun5i" if MACH_SUN5I
606	default "sun6i" if MACH_SUN6I
607	default "sun7i" if MACH_SUN7I
608	default "sun8i" if MACH_SUN8I
609	default "sun9i" if MACH_SUN9I
610	default "sun50i" if MACH_SUN50I
611	default "sun50i" if MACH_SUN50I_H6
612	default "sun50i" if MACH_SUN50I_H616
613
614config SYS_BOARD
615	default "sunxi"
616
617config SYS_SOC
618	default "sunxi"
619
620config UART0_PORT_F
621	bool "UART0 on MicroSD breakout board"
622	default n
623	---help---
624	Repurpose the SD card slot for getting access to the UART0 serial
625	console. Primarily useful only for low level u-boot debugging on
626	tablets, where normal UART0 is difficult to access and requires
627	device disassembly and/or soldering. As the SD card can't be used
628	at the same time, the system can be only booted in the FEL mode.
629	Only enable this if you really know what you are doing.
630
631config OLD_SUNXI_KERNEL_COMPAT
632	bool "Enable workarounds for booting old kernels"
633	default n
634	---help---
635	Set this to enable various workarounds for old kernels, this results in
636	sub-optimal settings for newer kernels, only enable if needed.
637
638config MACPWR
639	string "MAC power pin"
640	default ""
641	help
642	  Set the pin used to power the MAC. This takes a string in the format
643	  understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
644
645config MMC0_CD_PIN
646	string "Card detect pin for mmc0"
647	default "PF6" if MACH_SUN8I_A83T || MACH_SUNXI_H3_H5 || MACH_SUN50I
648	default ""
649	---help---
650	Set the card detect pin for mmc0, leave empty to not use cd. This
651	takes a string in the format understood by sunxi_name_to_gpio, e.g.
652	PH1 for pin 1 of port H.
653
654config MMC1_CD_PIN
655	string "Card detect pin for mmc1"
656	default ""
657	---help---
658	See MMC0_CD_PIN help text.
659
660config MMC2_CD_PIN
661	string "Card detect pin for mmc2"
662	default ""
663	---help---
664	See MMC0_CD_PIN help text.
665
666config MMC3_CD_PIN
667	string "Card detect pin for mmc3"
668	default ""
669	---help---
670	See MMC0_CD_PIN help text.
671
672config MMC1_PINS
673	string "Pins for mmc1"
674	default ""
675	---help---
676	Set the pins used for mmc1, when applicable. This takes a string in the
677	format understood by sunxi_name_to_gpio_bank, e.g. PH for port H.
678
679config MMC2_PINS
680	string "Pins for mmc2"
681	default ""
682	---help---
683	See MMC1_PINS help text.
684
685config MMC3_PINS
686	string "Pins for mmc3"
687	default ""
688	---help---
689	See MMC1_PINS help text.
690
691config MMC_SUNXI_SLOT_EXTRA
692	int "mmc extra slot number"
693	default -1
694	---help---
695	sunxi builds always enable mmc0, some boards also have a second sdcard
696	slot or emmc on mmc1 - mmc3. Setting this to 1, 2 or 3 will enable
697	support for this.
698
699config INITIAL_USB_SCAN_DELAY
700	int "delay initial usb scan by x ms to allow builtin devices to init"
701	default 0
702	---help---
703	Some boards have on board usb devices which need longer than the
704	USB spec's 1 second to connect from board powerup. Set this config
705	option to a non 0 value to add an extra delay before the first usb
706	bus scan.
707
708config USB0_VBUS_PIN
709	string "Vbus enable pin for usb0 (otg)"
710	default ""
711	---help---
712	Set the Vbus enable pin for usb0 (otg). This takes a string in the
713	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
714
715config USB0_VBUS_DET
716	string "Vbus detect pin for usb0 (otg)"
717	default ""
718	---help---
719	Set the Vbus detect pin for usb0 (otg). This takes a string in the
720	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
721
722config USB0_ID_DET
723	string "ID detect pin for usb0 (otg)"
724	default ""
725	---help---
726	Set the ID detect pin for usb0 (otg). This takes a string in the
727	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
728
729config USB1_VBUS_PIN
730	string "Vbus enable pin for usb1 (ehci0)"
731	default "PH6" if MACH_SUN4I || MACH_SUN7I
732	default "PH27" if MACH_SUN6I
733	---help---
734	Set the Vbus enable pin for usb1 (ehci0, usb0 is the otg). This takes
735	a string in the format understood by sunxi_name_to_gpio, e.g.
736	PH1 for pin 1 of port H.
737
738config USB2_VBUS_PIN
739	string "Vbus enable pin for usb2 (ehci1)"
740	default "PH3" if MACH_SUN4I || MACH_SUN7I
741	default "PH24" if MACH_SUN6I
742	---help---
743	See USB1_VBUS_PIN help text.
744
745config USB3_VBUS_PIN
746	string "Vbus enable pin for usb3 (ehci2)"
747	default ""
748	---help---
749	See USB1_VBUS_PIN help text.
750
751config I2C0_ENABLE
752	bool "Enable I2C/TWI controller 0"
753	default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUN8I_R40
754	default n if MACH_SUN6I || MACH_SUN8I
755	select CMD_I2C
756	---help---
757	This allows enabling I2C/TWI controller 0 by muxing its pins, enabling
758	its clock and setting up the bus. This is especially useful on devices
759	with slaves connected to the bus or with pins exposed through e.g. an
760	expansion port/header.
761
762config I2C1_ENABLE
763	bool "Enable I2C/TWI controller 1"
764	default n
765	select CMD_I2C
766	---help---
767	See I2C0_ENABLE help text.
768
769config I2C2_ENABLE
770	bool "Enable I2C/TWI controller 2"
771	default n
772	select CMD_I2C
773	---help---
774	See I2C0_ENABLE help text.
775
776if MACH_SUN6I || MACH_SUN7I
777config I2C3_ENABLE
778	bool "Enable I2C/TWI controller 3"
779	default n
780	select CMD_I2C
781	---help---
782	See I2C0_ENABLE help text.
783endif
784
785if SUNXI_GEN_SUN6I || SUN50I_GEN_H6
786config R_I2C_ENABLE
787	bool "Enable the PRCM I2C/TWI controller"
788	# This is used for the pmic on H3
789	default y if SY8106A_POWER
790	select CMD_I2C
791	---help---
792	Set this to y to enable the I2C controller which is part of the PRCM.
793endif
794
795if MACH_SUN7I
796config I2C4_ENABLE
797	bool "Enable I2C/TWI controller 4"
798	default n
799	select CMD_I2C
800	---help---
801	See I2C0_ENABLE help text.
802endif
803
804config AXP_GPIO
805	bool "Enable support for gpio-s on axp PMICs"
806	default n
807	---help---
808	Say Y here to enable support for the gpio pins of the axp PMIC ICs.
809
810config VIDEO_SUNXI
811	bool "Enable graphical uboot console on HDMI, LCD or VGA"
812	depends on !MACH_SUN8I_A83T
813	depends on !MACH_SUNXI_H3_H5
814	depends on !MACH_SUN8I_R40
815	depends on !MACH_SUN8I_V3S
816	depends on !MACH_SUN9I
817	depends on !MACH_SUN50I
818	depends on !SUN50I_GEN_H6
819	select DM_VIDEO
820	select DISPLAY
821	imply VIDEO_DT_SIMPLEFB
822	default y
823	---help---
824	Say Y here to add support for using a graphical console on the HDMI,
825	LCD or VGA output found on older sunxi devices. This will also provide
826	a simple_framebuffer device for Linux.
827
828config VIDEO_HDMI
829	bool "HDMI output support"
830	depends on VIDEO_SUNXI && !MACH_SUN8I
831	default y
832	---help---
833	Say Y here to add support for outputting video over HDMI.
834
835config VIDEO_VGA
836	bool "VGA output support"
837	depends on VIDEO_SUNXI && (MACH_SUN4I || MACH_SUN7I)
838	default n
839	---help---
840	Say Y here to add support for outputting video over VGA.
841
842config VIDEO_VGA_VIA_LCD
843	bool "VGA via LCD controller support"
844	depends on VIDEO_SUNXI && (MACH_SUN5I || MACH_SUN6I || MACH_SUN8I)
845	default n
846	---help---
847	Say Y here to add support for external DACs connected to the parallel
848	LCD interface driving a VGA connector, such as found on the
849	Olimex A13 boards.
850
851config VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH
852	bool "Force sync active high for VGA via LCD controller support"
853	depends on VIDEO_VGA_VIA_LCD
854	default n
855	---help---
856	Say Y here if you've a board which uses opendrain drivers for the vga
857	hsync and vsync signals. Opendrain drivers cannot generate steep enough
858	positive edges for a stable video output, so on boards with opendrain
859	drivers the sync signals must always be active high.
860
861config VIDEO_VGA_EXTERNAL_DAC_EN
862	string "LCD panel power enable pin"
863	depends on VIDEO_VGA_VIA_LCD
864	default ""
865	---help---
866	Set the enable pin for the external VGA DAC. This takes a string in the
867	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
868
869config VIDEO_COMPOSITE
870	bool "Composite video output support"
871	depends on VIDEO_SUNXI && (MACH_SUN4I || MACH_SUN5I || MACH_SUN7I)
872	default n
873	---help---
874	Say Y here to add support for outputting composite video.
875
876config VIDEO_LCD_MODE
877	string "LCD panel timing details"
878	depends on VIDEO_SUNXI
879	default ""
880	---help---
881	LCD panel timing details string, leave empty if there is no LCD panel.
882	This is in drivers/video/videomodes.c: video_get_params() format, e.g.
883	x:800,y:480,depth:18,pclk_khz:33000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:0,vmode:0
884	Also see: http://linux-sunxi.org/LCD
885
886config VIDEO_LCD_DCLK_PHASE
887	int "LCD panel display clock phase"
888	depends on VIDEO_SUNXI || DM_VIDEO
889	default 1
890	---help---
891	Select LCD panel display clock phase shift, range 0-3.
892
893config VIDEO_LCD_POWER
894	string "LCD panel power enable pin"
895	depends on VIDEO_SUNXI
896	default ""
897	---help---
898	Set the power enable pin for the LCD panel. This takes a string in the
899	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
900
901config VIDEO_LCD_RESET
902	string "LCD panel reset pin"
903	depends on VIDEO_SUNXI
904	default ""
905	---help---
906	Set the reset pin for the LCD panel. This takes a string in the format
907	understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
908
909config VIDEO_LCD_BL_EN
910	string "LCD panel backlight enable pin"
911	depends on VIDEO_SUNXI
912	default ""
913	---help---
914	Set the backlight enable pin for the LCD panel. This takes a string in the
915	the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of
916	port H.
917
918config VIDEO_LCD_BL_PWM
919	string "LCD panel backlight pwm pin"
920	depends on VIDEO_SUNXI
921	default ""
922	---help---
923	Set the backlight pwm pin for the LCD panel. This takes a string in the
924	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
925
926config VIDEO_LCD_BL_PWM_ACTIVE_LOW
927	bool "LCD panel backlight pwm is inverted"
928	depends on VIDEO_SUNXI
929	default y
930	---help---
931	Set this if the backlight pwm output is active low.
932
933config VIDEO_LCD_PANEL_I2C
934	bool "LCD panel needs to be configured via i2c"
935	depends on VIDEO_SUNXI
936	default n
937	select CMD_I2C
938	---help---
939	Say y here if the LCD panel needs to be configured via i2c. This
940	will add a bitbang i2c controller using gpios to talk to the LCD.
941
942config VIDEO_LCD_PANEL_I2C_SDA
943	string "LCD panel i2c interface SDA pin"
944	depends on VIDEO_LCD_PANEL_I2C
945	default "PG12"
946	---help---
947	Set the SDA pin for the LCD i2c interface. This takes a string in the
948	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
949
950config VIDEO_LCD_PANEL_I2C_SCL
951	string "LCD panel i2c interface SCL pin"
952	depends on VIDEO_LCD_PANEL_I2C
953	default "PG10"
954	---help---
955	Set the SCL pin for the LCD i2c interface. This takes a string in the
956	format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
957
958
959# Note only one of these may be selected at a time! But hidden choices are
960# not supported by Kconfig
961config VIDEO_LCD_IF_PARALLEL
962	bool
963
964config VIDEO_LCD_IF_LVDS
965	bool
966
967config SUNXI_DE2
968	bool
969	default n
970
971config VIDEO_DE2
972	bool "Display Engine 2 video driver"
973	depends on SUNXI_DE2
974	select DM_VIDEO
975	select DISPLAY
976	select VIDEO_DW_HDMI
977	imply VIDEO_DT_SIMPLEFB
978	default y
979	---help---
980	Say y here if you want to build DE2 video driver which is present on
981	newer SoCs. Currently only HDMI output is supported.
982
983
984choice
985	prompt "LCD panel support"
986	depends on VIDEO_SUNXI
987	---help---
988	Select which type of LCD panel to support.
989
990config VIDEO_LCD_PANEL_PARALLEL
991	bool "Generic parallel interface LCD panel"
992	select VIDEO_LCD_IF_PARALLEL
993
994config VIDEO_LCD_PANEL_LVDS
995	bool "Generic lvds interface LCD panel"
996	select VIDEO_LCD_IF_LVDS
997
998config VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828
999	bool "MIPI 4-lane, 513Mbps LCD panel via SSD2828 bridge chip"
1000	select VIDEO_LCD_SSD2828
1001	select VIDEO_LCD_IF_PARALLEL
1002	---help---
1003	7.85" 768x1024 LCD panels, such as LG LP079X01 or AUO B079XAN01.0
1004
1005config VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804
1006	bool "eDP 4-lane, 1.62G LCD panel via ANX9804 bridge chip"
1007	select VIDEO_LCD_ANX9804
1008	select VIDEO_LCD_IF_PARALLEL
1009	select VIDEO_LCD_PANEL_I2C
1010	---help---
1011	Select this for eDP LCD panels with 4 lanes running at 1.62G,
1012	connected via an ANX9804 bridge chip.
1013
1014config VIDEO_LCD_PANEL_HITACHI_TX18D42VM
1015	bool "Hitachi tx18d42vm LCD panel"
1016	select VIDEO_LCD_HITACHI_TX18D42VM
1017	select VIDEO_LCD_IF_LVDS
1018	---help---
1019	7.85" 1024x768 Hitachi tx18d42vm LCD panel support
1020
1021config VIDEO_LCD_TL059WV5C0
1022	bool "tl059wv5c0 LCD panel"
1023	select VIDEO_LCD_PANEL_I2C
1024	select VIDEO_LCD_IF_PARALLEL
1025	---help---
1026	6" 480x800 tl059wv5c0 panel support, as used on the Utoo P66 and
1027	Aigo M60/M608/M606 tablets.
1028
1029endchoice
1030
1031config SATAPWR
1032	string "SATA power pin"
1033	default ""
1034	help
1035	  Set the pins used to power the SATA. This takes a string in the
1036	  format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of
1037	  port H.
1038
1039config GMAC_TX_DELAY
1040	int "GMAC Transmit Clock Delay Chain"
1041	default 0
1042	---help---
1043	Set the GMAC Transmit Clock Delay Chain value.
1044
1045config SPL_STACK_R_ADDR
1046	default 0x4fe00000 if MACH_SUN4I
1047	default 0x4fe00000 if MACH_SUN5I
1048	default 0x4fe00000 if MACH_SUN6I
1049	default 0x4fe00000 if MACH_SUN7I
1050	default 0x4fe00000 if MACH_SUN8I
1051	default 0x2fe00000 if MACH_SUN9I
1052	default 0x4fe00000 if MACH_SUN50I
1053	default 0x4fe00000 if SUN50I_GEN_H6
1054
1055config SPL_SPI_SUNXI
1056	bool "Support for SPI Flash on Allwinner SoCs in SPL"
1057	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || MACH_SUN50I_H6
1058	help
1059	  Enable support for SPI Flash. This option allows SPL to read from
1060	  sunxi SPI Flash. It uses the same method as the boot ROM, so does
1061	  not need any extra configuration.
1062
1063config PINE64_DT_SELECTION
1064	bool "Enable Pine64 device tree selection code"
1065	depends on MACH_SUN50I
1066	help
1067	  The original Pine A64 and Pine A64+ are similar but different
1068	  boards and can be differed by the DRAM size. Pine A64 has
1069	  512MiB DRAM, and Pine A64+ has 1GiB or 2GiB. By selecting this
1070	  option, the device tree selection code specific to Pine64 which
1071	  utilizes the DRAM size will be enabled.
1072
1073config PINEPHONE_DT_SELECTION
1074	bool "Enable PinePhone device tree selection code"
1075	depends on MACH_SUN50I
1076	help
1077	  Enable this option to automatically select the device tree for the
1078	  correct PinePhone hardware revision during boot.
1079
1080config BLUETOOTH_DT_DEVICE_FIXUP
1081	string "Fixup the Bluetooth controller address"
1082	default ""
1083	help
1084	  This option specifies the DT compatible name of the Bluetooth
1085	  controller for which to set the "local-bd-address" property.
1086	  Set this option if your device ships with the Bluetooth controller
1087	  default address.
1088	  The used address is "bdaddr" if set, and "ethaddr" with the LSB
1089	  flipped elsewise.
1090
1091endif
1092
1093config CHIP_DIP_SCAN
1094	bool "Enable DIPs detection for CHIP board"
1095	select SUPPORT_EXTENSION_SCAN
1096	select W1
1097	select W1_GPIO
1098	select W1_EEPROM
1099	select W1_EEPROM_DS24XXX
1100	select CMD_EXTENSION
1101