Skip to content

Commit e846aff

Browse files
weiszgpopcornmix
authored andcommitted
MMC: added alternative MMC driver
mmc: Disable CMD23 transfers on all cards Pending wire-level investigation of these types of transfers and associated errors on bcm2835-mmc, disable for now. Fallback of CMD18/CMD25 transfers will be used automatically by the MMC layer. Reported/Tested-by: Gellert Weisz <[email protected]> mmc: bcm2835-mmc: enable DT support for all architectures Both ARCH_BCM2835 and ARCH_BCM270x are built with OF now. Enable Device Tree support for all architectures. Signed-off-by: Noralf Trønnes <[email protected]> mmc: bcm2835-mmc: fix probe error handling Probe error handling is broken in several places. Simplify error handling by using device managed functions. Replace pr_{err,info} with dev_{err,info}. Signed-off-by: Noralf Trønnes <[email protected]> bcm2835-mmc: Add locks when accessing sdhost registers bcm2835-mmc: Add range of debug options for slowing things down bcm2835-mmc: Add option to disable some delays bcm2835-mmc: Add option to disable MMC_QUIRK_BLK_NO_CMD23 bcm2835-mmc: Default to disabling MMC_QUIRK_BLK_NO_CMD23 bcm2835-mmc: Adding overclocking option Allow a different clock speed to be substitued for a requested 50MHz. This option is exposed using the "overclock_50" DT parameter. Note that the mmc interface is restricted to EVEN integer divisions of 250MHz, and the highest sensible option is 63 (250/4 = 62.5), the next being 125 (250/2) which is much too high. Use at your own risk. bcm2835-mmc: Round up the overclock, so 62 works for 62.5Mhz Also only warn once for each overclock setting. mmc: bcm2835-mmc: Make available on ARCH_BCM2835 Make the bcm2835-mmc driver available for use on ARCH_BCM2835. Signed-off-by: Noralf Trønnes <[email protected]> BCM270x_DT: add bcm2835-mmc entry Add Device Tree entry for bcm2835-mmc. In non-DT mode, don't add the device in the board file. Signed-off-by: Noralf Trønnes <[email protected]> bcm2835-mmc: Don't overwrite MMC capabilities from DT bcm2835-mmc: Don't override bus width capabilities from devicetree Take out the force setting of the MMC_CAP_4_BIT_DATA host capability so that the result read from devicetree via mmc_of_parse() is preserved. bcm2835-mmc: Only claim one DMA channel With both MMC controllers enabled there are few DMA channels left. The bcm2835-mmc driver only uses DMA in one direction at a time, so it doesn't need to claim two channels. See: #1327 Signed-off-by: Phil Elwell <[email protected]>
1 parent c9e7cf3 commit e846aff

File tree

4 files changed

+1611
-0
lines changed

4 files changed

+1611
-0
lines changed

drivers/mmc/core/quirks.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ static const struct mmc_fixup mmc_fixup_methods[] = {
5353

5454
void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table)
5555
{
56+
#ifdef CONFIG_MMC_BCM2835
57+
extern unsigned mmc_debug;
58+
#endif
5659
const struct mmc_fixup *f;
5760
u64 rev = cid_rev_card(card);
5861

@@ -79,5 +82,12 @@ void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table)
7982
f->vendor_fixup(card, f->data);
8083
}
8184
}
85+
/* SDHCI on BCM2708 - bug causes a certain sequence of CMD23 operations to fail.
86+
* Disable this flag for all cards (fall-back to CMD25/CMD18 multi-block transfers).
87+
*/
88+
#ifdef CONFIG_MMC_BCM2835
89+
if (mmc_debug & (1<<13))
90+
card->quirks |= MMC_QUIRK_BLK_NO_CMD23;
91+
#endif
8292
}
8393
EXPORT_SYMBOL(mmc_fixup_device);

drivers/mmc/host/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,35 @@
44

55
comment "MMC/SD/SDIO Host Controller Drivers"
66

7+
config MMC_BCM2835
8+
tristate "MMC support on BCM2835"
9+
depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
10+
help
11+
This selects the MMC Interface on BCM2835.
12+
13+
If you have a controller with this interface, say Y or M here.
14+
15+
If unsure, say N.
16+
17+
config MMC_BCM2835_DMA
18+
bool "DMA support on BCM2835 Arasan controller"
19+
depends on MMC_BCM2835
20+
help
21+
Enable DMA support on the Arasan SDHCI controller in Broadcom 2708
22+
based chips.
23+
24+
If unsure, say N.
25+
26+
config MMC_BCM2835_PIO_DMA_BARRIER
27+
int "Block count limit for PIO transfers"
28+
depends on MMC_BCM2835 && MMC_BCM2835_DMA
29+
range 0 256
30+
default 2
31+
help
32+
The inclusive limit in bytes under which PIO will be used instead of DMA
33+
34+
If unsure, say 2 here.
35+
736
config MMC_ARMMMCI
837
tristate "ARM AMBA Multimedia Card Interface support"
938
depends on ARM_AMBA

drivers/mmc/host/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o
1818
obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o
1919
obj-$(CONFIG_MMC_SDHCI_F_SDH30) += sdhci_f_sdh30.o
2020
obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o
21+
obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o
2122
obj-$(CONFIG_MMC_WBSD) += wbsd.o
2223
obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
2324
obj-$(CONFIG_MMC_MTK) += mtk-sd.o

0 commit comments

Comments
 (0)