mmc: dw_mmc: Calculate timeout from transfer length
[oweals/u-boot.git] / drivers / mmc / Kconfig
1 menu "MMC Host controller Support"
2
3 config MMC
4         bool "MMC/SD/SDIO card support"
5         default ARM || PPC || SANDBOX
6         select HAVE_BLOCK_DEVICE
7         help
8           This selects MultiMediaCard, Secure Digital and Secure
9           Digital I/O support.
10
11           If you want MMC/SD/SDIO support, you should say Y here and
12           also to your specific host controller driver.
13
14 config MMC_WRITE
15         bool "support for MMC/SD write operations"
16         depends on MMC
17         default y
18         help
19           Enable write access to MMC and SD Cards
20
21 config MMC_BROKEN_CD
22         bool "Poll for broken card detection case"
23         help
24           If card  detection feature is broken, just poll to detect.
25
26 config DM_MMC
27         bool "Enable MMC controllers using Driver Model"
28         depends on DM
29         help
30           This enables the MultiMediaCard (MMC) uclass which supports MMC and
31           Secure Digital I/O (SDIO) cards. Both removable (SD, micro-SD, etc.)
32           and non-removable (e.g. eMMC chip) devices are supported. These
33           appear as block devices in U-Boot and can support filesystems such
34           as EXT4 and FAT.
35
36 config SPL_DM_MMC
37         bool "Enable MMC controllers using Driver Model in SPL"
38         depends on SPL_DM && DM_MMC
39         default y
40         help
41           This enables the MultiMediaCard (MMC) uclass which supports MMC and
42           Secure Digital I/O (SDIO) cards. Both removable (SD, micro-SD, etc.)
43           and non-removable (e.g. eMMC chip) devices are supported. These
44           appear as block devices in U-Boot and can support filesystems such
45           as EXT4 and FAT.
46
47 if MMC
48
49 config ARM_PL180_MMCI
50         bool "ARM AMBA Multimedia Card Interface and compatible support"
51         depends on DM_MMC && OF_CONTROL
52         help
53           This selects the ARM(R) AMBA(R) PrimeCell Multimedia Card
54           Interface (PL180, PL181 and compatible) support.
55           If you have an ARM(R) platform with a Multimedia Card slot,
56           say Y or M here.
57
58 config MMC_QUIRKS
59         bool "Enable quirks"
60         default y
61         help
62           Some cards and hosts may sometimes behave unexpectedly (quirks).
63           This option enable workarounds to handle those quirks. Some of them
64           are enabled by default, other may require additionnal flags or are
65           enabled by the host driver.
66
67 config MMC_HW_PARTITIONING
68         bool "Support for HW partitioning command(eMMC)"
69         default y
70         help
71           This adds a command and an API to do hardware partitioning on eMMC
72           devices.
73
74 config SUPPORT_EMMC_RPMB
75         bool "Support eMMC replay protected memory block (RPMB)"
76         imply CMD_MMC_RPMB
77         help
78           Enable support for reading, writing and programming the
79           key for the Replay Protection Memory Block partition in eMMC.
80
81 config MMC_IO_VOLTAGE
82         bool "Support IO voltage configuration"
83         help
84           IO voltage configuration allows selecting the voltage level of the IO
85           lines (not the level of main supply). This is required for UHS
86           support. For eMMC this not mandatory, but not enabling this option may
87           prevent the driver of using the faster modes.
88
89 config SPL_MMC_IO_VOLTAGE
90         bool "Support IO voltage configuration in SPL"
91         default n
92         help
93           IO voltage configuration allows selecting the voltage level of the IO
94           lines (not the level of main supply). This is required for UHS
95           support. For eMMC this not mandatory, but not enabling this option may
96           prevent the driver of using the faster modes.
97
98 config MMC_UHS_SUPPORT
99         bool "enable UHS support"
100         depends on MMC_IO_VOLTAGE
101         help
102           The Ultra High Speed (UHS) bus is available on some SDHC and SDXC
103           cards. The IO voltage must be switchable from 3.3v to 1.8v. The bus
104           frequency can go up to 208MHz (SDR104)
105
106 config SPL_MMC_UHS_SUPPORT
107         bool "enable UHS support in SPL"
108         depends on SPL_MMC_IO_VOLTAGE
109         help
110           The Ultra High Speed (UHS) bus is available on some SDHC and SDXC
111           cards. The IO voltage must be switchable from 3.3v to 1.8v. The bus
112           frequency can go up to 208MHz (SDR104)
113
114 config MMC_HS400_SUPPORT
115         bool "enable HS400 support"
116         select MMC_HS200_SUPPORT
117         help
118           The HS400 mode is support by some eMMC. The bus frequency is up to
119           200MHz. This mode requires tuning the IO.
120
121 config SPL_MMC_HS400_SUPPORT
122         bool "enable HS400 support in SPL"
123         help
124           The HS400 mode is support by some eMMC. The bus frequency is up to
125           200MHz. This mode requires tuning the IO.
126
127 config MMC_HS200_SUPPORT
128         bool "enable HS200 support"
129         help
130           The HS200 mode is support by some eMMC. The bus frequency is up to
131           200MHz. This mode requires tuning the IO.
132
133
134 config SPL_MMC_HS200_SUPPORT
135         bool "enable HS200 support in SPL"
136         help
137           The HS200 mode is support by some eMMC. The bus frequency is up to
138           200MHz. This mode requires tuning the IO.
139
140 config MMC_VERBOSE
141         bool "Output more information about the MMC"
142         default y
143         help
144           Enable the output of more information about the card such as the
145           operating mode.
146
147 config MMC_TRACE
148         bool "MMC debugging"
149         default n
150         help
151           This is an option for use by developer. Enable MMC core debugging.
152
153           If you need to see the MMC core message, say Y.
154
155 config SPL_MMC_TINY
156         bool "Tiny MMC framework in SPL"
157         help
158           Enable MMC framework tinification support. This option is useful if
159           if your SPL is extremely size constrained. Heed the warning, enable
160           this option if and only if you know exactly what you are doing, if
161           you are reading this help text, you most likely have no idea :-)
162
163           The MMC framework is reduced to bare minimum to be useful. No malloc
164           support is needed for the MMC framework operation with this option
165           enabled. The framework supports exactly one MMC device and exactly
166           one MMC driver. The MMC driver can be adjusted to avoid any malloc
167           operations too, which can remove the need for malloc support in SPL
168           and thus further reduce footprint.
169
170 config MMC_DAVINCI
171         bool "TI DAVINCI Multimedia Card Interface support"
172         depends on ARCH_DAVINCI
173         default y
174         help
175           This selects the TI DAVINCI Multimedia card Interface.
176           If you have an DAVINCI board with a Multimedia Card slot,
177           say Y here.  If unsure, say N.
178
179 config MMC_DW
180         bool "Synopsys DesignWare Memory Card Interface"
181         select BOUNCE_BUFFER
182         help
183           This selects support for the Synopsys DesignWare Mobile Storage IP
184           block, this provides host support for SD and MMC interfaces, in both
185           PIO, internal DMA mode and external DMA mode.
186
187 config MMC_DW_EXYNOS
188         bool "Exynos specific extensions for Synopsys DW Memory Card Interface"
189         depends on ARCH_EXYNOS
190         depends on MMC_DW
191         default y
192         help
193           This selects support for Samsung Exynos SoC specific extensions to the
194           Synopsys DesignWare Memory Card Interface driver. Select this option
195           for platforms based on Exynos4 and Exynos5 SoC's.
196
197 config MMC_DW_K3
198         bool "K3 specific extensions for Synopsys DW Memory Card Interface"
199         depends on MMC_DW
200         help
201           This selects support for Hisilicon K3 SoC specific extensions to the
202           Synopsys DesignWare Memory Card Interface driver. Select this option
203           for platforms based on Hisilicon K3 SoC's.
204
205 config MMC_DW_ROCKCHIP
206         bool "Rockchip SD/MMC controller support"
207         depends on DM_MMC && OF_CONTROL
208         depends on MMC_DW
209         help
210           This enables support for the Rockchip SD/MMM controller, which is
211           based on Designware IP. The device is compatible with at least
212           SD 3.0, SDIO 3.0 and MMC 4.5 and supports common eMMC chips as well
213           as removeable SD and micro-SD cards.
214
215 config MMC_DW_SOCFPGA
216         bool "SOCFPGA specific extensions for Synopsys DW Memory Card Interface"
217         depends on ARCH_SOCFPGA
218         depends on MMC_DW
219         default y
220         help
221           This selects support for Altera SOCFPGA specific extensions to the
222           Synopsys DesignWare Memory Card Interface driver. Select this option
223           for platforms based on Altera SOCFPGA.
224
225 config MMC_DW_SNPS
226         bool "Extensions for DW Memory Card Interface used in Synopsys ARC devboards"
227         depends on MMC_DW
228         depends on DM_MMC
229         depends on OF_CONTROL
230         depends on CLK
231         help
232           This selects support for Synopsys DesignWare Memory Card Interface driver
233           extensions used in various Synopsys ARC devboards.
234
235 config MMC_MESON_GX
236         bool "Meson GX EMMC controller support"
237         depends on DM_MMC && BLK && ARCH_MESON
238         help
239          Support for EMMC host controller on Meson GX ARM SoCs platform (S905)
240
241 config MMC_MXC
242         bool "Freescale i.MX21/27/31 or MPC512x Multimedia Card support"
243         help
244           This selects the Freescale i.MX21, i.MX27, i.MX31 or MPC512x
245           Multimedia Card Interface. If you have an i.MX or MPC512x platform
246           with a Multimedia Card slot, say Y here.
247
248           If unsure, say N.
249
250 config MMC_MXS
251         bool "Freescale MXS Multimedia Card Interface support"
252         depends on MX23 || MX28 || MX6 || MX7
253         select BOUNCE_BUFFER
254         select APBH_DMA
255         select APBH_DMA_BURST if ARCH_MX6 || ARCH_MX7
256         select APBH_DMA_BURST8 if ARCH_MX6 || ARCH_MX7
257         help
258           This selects the Freescale SSP MMC controller found on MXS based
259           platforms like mx23/28.
260
261           If unsure, say N.
262
263 config MMC_PCI
264         bool "Support for MMC controllers on PCI"
265         help
266           This selects PCI-based MMC controllers.
267           If you have an MMC controller on a PCI bus, say Y here.
268
269           If unsure, say N.
270
271 config MMC_OMAP_HS
272         bool "TI OMAP High Speed Multimedia Card Interface support"
273         select DM_REGULATOR_PBIAS if DM_MMC && DM_REGULATOR
274         select DM_REGULATOR_PBIAS if DM_MMC && DM_REGULATOR
275         help
276           This selects the TI OMAP High Speed Multimedia card Interface.
277           If you have an omap2plus board with a Multimedia Card slot,
278           say Y here.
279
280           If unsure, say N.
281
282 config MMC_OMAP_HS_ADMA
283         bool "ADMA support for OMAP HS MMC"
284         depends on MMC_OMAP_HS && !OMAP34XX
285         default y if !AM33XX
286         help
287           This enables support for the ADMA2 controller (SDA3.00 Part A2 DMA
288           controller). If supported by the hardware, selecting this option will
289           increase performances.
290
291 config MMC_OMAP36XX_PINS
292         bool "Enable MMC1 on OMAP36xx/37xx"
293         depends on OMAP34XX && MMC_OMAP_HS
294         help
295           This enables extended-drain in the MMC/SD/SDIO1I/O and
296           GPIO-associated I/O cells (gpio_126, gpio_127, and gpio_129)
297           specific to the OMAP36xx/37xx using MMC1
298
299           If you have a controller with this interface, say Y here.
300
301           If unsure, say N.
302
303 config SH_SDHI
304         bool "SuperH/Renesas ARM SoCs on-chip SDHI host controller support"
305         depends on ARCH_RMOBILE
306         help
307           Support for the on-chip SDHI host controller on SuperH/Renesas ARM SoCs platform
308
309 config SH_MMCIF
310         bool "SuperH/Renesas ARM SoCs on-chip MMCIF host controller support"
311         depends on ARCH_RMOBILE || SH
312         help
313           Support for the on-chip MMCIF host controller on SuperH/Renesas ARM SoCs platform
314
315 config MMC_UNIPHIER
316         bool "UniPhier SD/MMC Host Controller support"
317         depends on ARCH_UNIPHIER
318         depends on BLK && DM_MMC
319         depends on OF_CONTROL
320         help
321           This selects support for the Matsushita SD/MMC Host Controller on
322           SocioNext UniPhier SoCs.
323
324 config RENESAS_SDHI
325         bool "Renesas R-Car SD/MMC Host Controller support"
326         depends on ARCH_RMOBILE
327         depends on BLK && DM_MMC
328         depends on OF_CONTROL
329         help
330           This selects support for the Matsushita SD/MMC Host Controller on
331           Renesas R-Car SoCs.
332
333 config MMC_BCM2835
334         bool "BCM2835 family custom SD/MMC Host Controller support"
335         depends on ARCH_BCM283X
336         depends on BLK && DM_MMC
337         depends on OF_CONTROL
338         default y
339         help
340           This selects support for the custom SD host controller in the BCM2835
341           family of devices.
342
343           If you have a BCM2835 platform with SD or MMC devices, say Y here.
344
345           If unsure, say N.
346
347 config JZ47XX_MMC
348         bool "Ingenic JZ47xx SD/MMC Host Controller support"
349         depends on ARCH_JZ47XX
350         help
351           This selects support for the SD Card Controller on Ingenic JZ47xx SoCs.
352
353 config MMC_SANDBOX
354         bool "Sandbox MMC support"
355         depends on SANDBOX
356         depends on BLK && DM_MMC && OF_CONTROL
357         help
358           This select a dummy sandbox MMC driver. At present this does nothing
359           other than allow sandbox to be build with MMC support. This
360           improves build coverage for sandbox and makes it easier to detect
361           MMC build errors with sandbox.
362
363 config MMC_SDHCI
364         bool "Secure Digital Host Controller Interface support"
365         help
366           This selects the generic Secure Digital Host Controller Interface.
367           It is used by manufacturers such as Texas Instruments(R), Ricoh(R)
368           and Toshiba(R). Most controllers found in laptops are of this type.
369
370           If you have a controller with this interface, say Y here.
371
372           If unsure, say N.
373
374 config MMC_SDHCI_IO_ACCESSORS
375         bool
376         depends on MMC_SDHCI
377         help
378           This is silent Kconfig symbol that is selected by the drivers that
379           need to overwrite SDHCI IO memory accessors.
380
381 config MMC_SDHCI_SDMA
382         bool "Support SDHCI SDMA"
383         depends on MMC_SDHCI
384         help
385           This enables support for the SDMA (Single Operation DMA) defined
386           in the SD Host Controller Standard Specification Version 1.00 .
387
388 config MMC_SDHCI_ATMEL
389         bool "Atmel SDHCI controller support"
390         depends on ARCH_AT91
391         depends on DM_MMC && BLK && ARCH_AT91
392         depends on MMC_SDHCI
393         help
394           This enables support for the Atmel SDHCI controller, which supports
395           the embedded MultiMedia Card (e.MMC) Specification V4.51, the SD
396           Memory Card Specification V3.0, and the SDIO V3.0 specification.
397           It is compliant with the SD Host Controller Standard V3.0
398           specification.
399
400 config MMC_SDHCI_BCM2835
401         tristate "SDHCI support for the BCM2835 SD/MMC Controller"
402         depends on ARCH_BCM283X
403         depends on MMC_SDHCI
404         select MMC_SDHCI_IO_ACCESSORS
405         help
406           This selects the BCM2835 SD/MMC controller.
407
408           If you have a BCM2835 platform with SD or MMC devices,
409           say Y here.
410
411           If unsure, say N.
412
413 config MMC_SDHCI_BCMSTB
414         tristate "SDHCI support for the BCMSTB SD/MMC Controller"
415         depends on MMC_SDHCI
416         help
417           This selects the Broadcom set-top box SD/MMC controller.
418
419           If you have a BCMSTB platform with SD or MMC devices,
420           say Y here.
421
422           If unsure, say N.
423
424 config MMC_SDHCI_CADENCE
425         bool "SDHCI support for the Cadence SD/SDIO/eMMC controller"
426         depends on BLK && DM_MMC
427         depends on MMC_SDHCI
428         depends on OF_CONTROL
429         help
430           This selects the Cadence SD/SDIO/eMMC driver.
431
432           If you have a controller with this interface, say Y here.
433
434           If unsure, say N.
435
436 config MMC_SDHCI_K3_ARASAN
437         bool "Arasan SDHCI controller for TI's K3 based SoCs"
438         depends on ARCH_K3
439         depends on MMC_SDHCI
440         depends on DM_MMC && OF_CONTROL && BLK
441         help
442           Support for Arasan SDHCI host controller on Texas Instruments'
443           K3 family based SoC platforms
444
445 config MMC_SDHCI_KONA
446         bool "SDHCI support on Broadcom KONA platform"
447         depends on MMC_SDHCI
448         help
449           This selects the Broadcom Kona Secure Digital Host Controller
450           Interface(SDHCI) support.
451           This is used in Broadcom mobile SoCs.
452
453           If you have a controller with this interface, say Y here.
454
455 config MMC_SDHCI_MSM
456         bool "Qualcomm SDHCI controller"
457         depends on BLK && DM_MMC
458         depends on MMC_SDHCI
459         help
460           Enables support for SDHCI 2.0 controller present on some Qualcomm
461           Snapdragon devices. This device is compatible with eMMC v4.5 and
462           SD 3.0 specifications. Both SD and eMMC devices are supported.
463           Card-detect gpios are not supported.
464
465 config MMC_SDHCI_MV
466         bool "SDHCI support on Marvell platform"
467         depends on ARCH_MVEBU
468         depends on MMC_SDHCI
469         help
470           This selects the Secure Digital Host Controller Interface on
471           Marvell platform.
472
473           If you have a controller with this interface, say Y here.
474
475           If unsure, say N.
476
477 config MMC_SDHCI_PIC32
478         bool "Microchip PIC32 on-chip SDHCI support"
479         depends on DM_MMC && MACH_PIC32
480         depends on MMC_SDHCI
481         help
482           Support for Microchip PIC32 SDHCI controller.
483
484 config MMC_SDHCI_ROCKCHIP
485         bool "Arasan SDHCI controller for Rockchip support"
486         depends on ARCH_ROCKCHIP
487         depends on DM_MMC && BLK
488         depends on MMC_SDHCI
489         help
490           Support for Arasan SDHCI host controller on Rockchip ARM SoCs platform
491
492 config MMC_SDHCI_S5P
493         bool "SDHCI support on Samsung S5P SoC"
494         depends on MMC_SDHCI
495         help
496           This selects the Secure Digital Host Controller Interface (SDHCI)
497           on Samsung S5P SoCs.
498
499           If you have a controller with this interface, say Y here.
500
501           If unsure, say N.
502
503 config MMC_SDHCI_SPEAR
504         bool "SDHCI support on ST SPEAr platform"
505         depends on MMC_SDHCI
506         help
507           This selects the Secure Digital Host Controller Interface (SDHCI)
508           often referrered to as the HSMMC block in some of the ST SPEAR range
509           of SoC
510
511           If you have a controller with this interface, say Y here.
512
513           If unsure, say N.
514
515 config MMC_SDHCI_STI
516         bool "SDHCI support for STMicroelectronics SoC"
517         depends on MMC_SDHCI && OF_CONTROL
518         help
519           This selects the Secure Digital Host Controller Interface (SDHCI)
520           on STMicroelectronics STiH410 SoC.
521
522 config MMC_SDHCI_XENON
523         bool "SDHCI support for the Xenon SDHCI controller"
524         depends on MMC_SDHCI && DM_MMC && OF_CONTROL
525         help
526           Support for Xenon SDHCI host controller on Marvell Armada 3700
527           7k/8k ARM SoCs platforms
528
529           If you have a controller with this interface, say Y here.
530
531           If unsure, say N.
532
533 config MMC_SDHCI_TANGIER
534         bool "Tangier SDHCI controller support"
535         depends on DM_MMC && BLK
536         depends on MMC_SDHCI
537         help
538           This selects support for SDHCI controller on Tanginer
539           SoC. Note that this controller does not sit on PCI bus and,
540           hence, cannot be enumerated by standard PCI means.
541
542           If you're using an Intel Tangier SoC (available on Intel
543           Edison board), say Y here.
544
545           If unsure, say N.
546
547 config MMC_SDHCI_TEGRA
548         bool "SDHCI platform support for the Tegra SD/MMC Controller"
549         depends on TEGRA
550         select BOUNCE_BUFFER
551         default y
552         help
553           This selects the Tegra SD/MMC controller. If you have a Tegra
554           platform with SD or MMC devices, say Y here.
555
556           If unsure, say N.
557
558 config MMC_SDHCI_ZYNQ
559         bool "Arasan SDHCI controller support"
560         depends on ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
561         depends on DM_MMC && OF_CONTROL && BLK
562         depends on MMC_SDHCI
563         help
564           Support for Arasan SDHCI host controller on Zynq/ZynqMP ARM SoCs platform
565
566 config ZYNQ_SDHCI_MAX_FREQ
567         int "Set the maximum frequency of the controller"
568         depends on MMC_SDHCI_ZYNQ
569         help
570           Set the maximum frequency of the controller.
571
572 config ZYNQ_SDHCI_MIN_FREQ
573         int "Set the minimum frequency of the controller"
574         depends on MMC_SDHCI_ZYNQ
575         default 0
576         help
577           Set the minimum frequency of the controller.
578
579 config MMC_SUNXI
580         bool "Allwinner sunxi SD/MMC Host Controller support"
581         depends on ARCH_SUNXI && !UART0_PORT_F
582         default y
583         help
584           This selects support for the SD/MMC Host Controller on
585           Allwinner sunxi SoCs.
586
587 config MMC_SUNXI_HAS_NEW_MODE
588         bool
589         depends on MMC_SUNXI
590
591 config MMC_SUNXI_HAS_MODE_SWITCH
592         bool
593         depends on MMC_SUNXI
594
595 config GENERIC_ATMEL_MCI
596         bool "Atmel Multimedia Card Interface support"
597         depends on DM_MMC && BLK && ARCH_AT91
598         help
599           This enables support for Atmel High Speed Multimedia Card Interface
600           (HSMCI), which supports the MultiMedia Card (MMC) Specification V4.3,
601           the SD Memory Card Specification V2.0, the SDIO V2.0 specification
602           and CE-ATA V1.1.
603
604 config STM32_SDMMC2
605         bool "STMicroelectronics STM32H7 SD/MMC Host Controller support"
606         depends on DM_MMC && BLK && OF_CONTROL
607         help
608           This selects support for the SD/MMC controller on STM32H7 SoCs.
609           If you have a board based on such a SoC and with a SD/MMC slot,
610           say Y or M here.
611
612 config FTSDC010
613         bool "Ftsdc010 SD/MMC controller Support"
614         help
615           This SD/MMC controller is present in Andestech SoCs which is based on Faraday IP.
616
617 config FTSDC010_SDIO
618         bool "Support ftsdc010 sdio"
619         default n
620         depends on FTSDC010
621         help
622                 This can enable ftsdc010 sdio function.
623
624 config MMC_MTK
625         bool "MediaTek SD/MMC Card Interface support"
626         depends on ARCH_MEDIATEK
627         depends on BLK && DM_MMC
628         depends on OF_CONTROL
629         help
630           This selects the MediaTek(R) Secure digital and Multimedia card Interface.
631           If you have a machine with a integrated SD/MMC card reader, say Y or M here.
632           This is needed if support for any SD/SDIO/MMC devices is required.
633           If unsure, say N.
634
635 endif
636
637 config TEGRA124_MMC_DISABLE_EXT_LOOPBACK
638         bool "Disable external clock loopback"
639         depends on MMC_SDHCI_TEGRA && TEGRA124
640         help
641           Disable the external clock loopback and use the internal one on SDMMC3
642           as per the SDMMC_VENDOR_MISC_CNTRL_0 register's SDMMC_SPARE1 bits
643           being set to 0xfffd according to the TRM.
644
645           TODO(marcel.ziswiler@toradex.com): Move to device tree controlled
646           approach once proper kernel integration made it mainline.
647
648 config FSL_ESDHC
649         bool "Freescale/NXP eSDHC controller support"
650         help
651           This selects support for the eSDHC (enhanced secure digital host
652           controller) found on numerous Freescale/NXP SoCs.
653
654 endmenu
655
656 config SYS_FSL_ERRATUM_ESDHC111
657         bool
658
659 config SYS_FSL_ERRATUM_ESDHC13
660         bool
661
662 config SYS_FSL_ERRATUM_ESDHC135
663         bool
664
665 config SYS_FSL_ERRATUM_ESDHC_A001
666         bool