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