Skip to content

Commit 26bc0bb

Browse files
weiszgpopcornmix
authored andcommitted
MMC: added alternative MMC driver
1 parent 99c3635 commit 26bc0bb

File tree

4 files changed

+1612
-1
lines changed

4 files changed

+1612
-1
lines changed

arch/arm/mach-bcm2708/bcm2708.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ static unsigned disk_led_active_low = 1;
9292
static unsigned reboot_part = 0;
9393
static unsigned w1_gpio_pin = W1_GPIO;
9494
static unsigned w1_gpio_pullup = W1_PULLUP;
95+
static unsigned bcm2835_mmc = 0;
9596

9697
static void __init bcm2708_init_led(void);
9798

@@ -442,6 +443,34 @@ struct platform_device bcm2708_emmc_device = {
442443
};
443444
#endif /* CONFIG_MMC_SDHCI_BCM2708 */
444445

446+
#ifdef CONFIG_MMC_BCM2835 /* Arasan emmc SD (new) */
447+
static struct resource bcm2835_emmc_resources[] = {
448+
[0] = {
449+
.start = EMMC_BASE,
450+
.end = EMMC_BASE + SZ_256 - 1, /* we only need this area */
451+
/* the memory map actually makes SZ_4K available */
452+
.flags = IORESOURCE_MEM,
453+
},
454+
[1] = {
455+
.start = IRQ_ARASANSDIO,
456+
.end = IRQ_ARASANSDIO,
457+
.flags = IORESOURCE_IRQ,
458+
},
459+
};
460+
461+
static u64 bcm2835_emmc_dmamask = 0xffffffffUL;
462+
463+
struct platform_device bcm2835_emmc_device = {
464+
.name = "mmc-bcm2835",
465+
.id = 0,
466+
.num_resources = ARRAY_SIZE(bcm2835_emmc_resources),
467+
.resource = bcm2835_emmc_resources,
468+
.dev = {
469+
.dma_mask = &bcm2835_emmc_dmamask,
470+
.coherent_dma_mask = 0xffffffffUL},
471+
};
472+
#endif /* CONFIG_MMC_BCM2835 */
473+
445474
static struct resource bcm2708_powerman_resources[] = {
446475
[0] = {
447476
.start = PM_BASE,
@@ -823,7 +852,12 @@ void __init bcm2708_init(void)
823852
bcm_register_device(&bcm2708_powerman_device);
824853

825854
#ifdef CONFIG_MMC_SDHCI_BCM2708
826-
bcm_register_device(&bcm2708_emmc_device);
855+
if (!bcm2835_mmc)
856+
bcm_register_device(&bcm2708_emmc_device);
857+
#endif
858+
#ifdef CONFIG_MMC_BCM2835
859+
if (bcm2835_mmc)
860+
bcm_register_device(&bcm2835_emmc_device);
827861
#endif
828862
bcm2708_init_led();
829863
for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
@@ -1053,3 +1087,4 @@ module_param(disk_led_active_low, uint, 0644);
10531087
module_param(reboot_part, uint, 0644);
10541088
module_param(w1_gpio_pin, uint, 0644);
10551089
module_param(w1_gpio_pullup, uint, 0644);
1090+
module_param(bcm2835_mmc, uint, 0644);

drivers/mmc/host/Kconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,35 @@ config MMC_MOXART
311311
be found on some embedded hardware such as UC-7112-LX.
312312
If you have a controller with this interface, say Y here.
313313

314+
config MMC_BCM2835
315+
tristate "MMC support on BCM2835"
316+
depends on MACH_BCM2708
317+
help
318+
This selects the MMC Interface on BCM2835.
319+
320+
If you have a controller with this interface, say Y or M here.
321+
322+
If unsure, say N.
323+
324+
config MMC_BCM2835_DMA
325+
bool "DMA support on BCM2835 Arasan controller"
326+
depends on MMC_BCM2835
327+
help
328+
Enable DMA support on the Arasan SDHCI controller in Broadcom 2708
329+
based chips.
330+
331+
If unsure, say N.
332+
333+
config MMC_BCM2835_PIO_DMA_BARRIER
334+
int "Block count limit for PIO transfers"
335+
depends on MMC_BCM2835 && MMC_BCM2835_DMA
336+
range 0 256
337+
default 2
338+
help
339+
The inclusive limit in bytes under which PIO will be used instead of DMA
340+
341+
If unsure, say 2 here.
342+
314343
config MMC_OMAP
315344
tristate "TI OMAP Multimedia Card Interface support"
316345
depends on ARCH_OMAP

drivers/mmc/host/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o
1717
obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o
1818
obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o
1919
obj-$(CONFIG_MMC_SDHCI_BCM2708) += sdhci-bcm2708.o
20+
obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o
2021
obj-$(CONFIG_MMC_WBSD) += wbsd.o
2122
obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
2223
obj-$(CONFIG_MMC_OMAP) += omap.o

0 commit comments

Comments
 (0)