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