Skip to content

add alternative MMC driver and support scatter/gather transfers in dmaengine #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion arch/arm/configs/bcmrpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,9 @@ CONFIG_USB_ISIGHTFW=m
CONFIG_USB_YUREX=m
CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_BCM2835=y
CONFIG_MMC_BCM2835_DMA=y
CONFIG_MMC_BCM2835_PIO_DMA_BARRIER=2
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_BCM2708=y
Expand Down Expand Up @@ -945,7 +948,7 @@ CONFIG_RTC_DRV_DS3234=m
CONFIG_RTC_DRV_PCF2123=m
CONFIG_RTC_DRV_RX4581=m
CONFIG_DMADEVICES=y
CONFIG_DMA_BCM2708=m
CONFIG_DMA_BCM2708=y
CONFIG_UIO=m
CONFIG_UIO_PDRV_GENIRQ=m
CONFIG_STAGING=y
Expand Down
37 changes: 36 additions & 1 deletion arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static unsigned disk_led_active_low = 1;
static unsigned reboot_part = 0;
static unsigned w1_gpio_pin = W1_GPIO;
static unsigned w1_gpio_pullup = W1_PULLUP;
static unsigned bcm2835_mmc = 0;

static void __init bcm2708_init_led(void);

Expand Down Expand Up @@ -452,6 +453,34 @@ struct platform_device bcm2708_emmc_device = {
};
#endif /* CONFIG_MMC_SDHCI_BCM2708 */

#ifdef CONFIG_MMC_BCM2835 /* Arasan emmc SD (new) */
static struct resource bcm2835_emmc_resources[] = {
[0] = {
.start = EMMC_BASE,
.end = EMMC_BASE + SZ_256 - 1, /* we only need this area */
/* the memory map actually makes SZ_4K available */
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_ARASANSDIO,
.end = IRQ_ARASANSDIO,
.flags = IORESOURCE_IRQ,
},
};

static u64 bcm2835_emmc_dmamask = 0xffffffffUL;

struct platform_device bcm2835_emmc_device = {
.name = "mmc-bcm2835",
.id = 0,
.num_resources = ARRAY_SIZE(bcm2835_emmc_resources),
.resource = bcm2835_emmc_resources,
.dev = {
.dma_mask = &bcm2835_emmc_dmamask,
.coherent_dma_mask = 0xffffffffUL},
};
#endif /* CONFIG_MMC_BCM2835 */

static struct resource bcm2708_powerman_resources[] = {
[0] = {
.start = PM_BASE,
Expand Down Expand Up @@ -806,7 +835,12 @@ void __init bcm2708_init(void)
bcm_register_device(&bcm2708_powerman_device);

#ifdef CONFIG_MMC_SDHCI_BCM2708
bcm_register_device(&bcm2708_emmc_device);
if (!bcm2835_mmc)
bcm_register_device(&bcm2708_emmc_device);
#endif
#ifdef CONFIG_MMC_BCM2835
if (bcm2835_mmc)
bcm_register_device(&bcm2835_emmc_device);
#endif
bcm2708_init_led();
for (i = 0; i < ARRAY_SIZE(bcm2708_alsa_devices); i++)
Expand Down Expand Up @@ -1030,3 +1064,4 @@ module_param(disk_led_active_low, uint, 0644);
module_param(reboot_part, uint, 0644);
module_param(w1_gpio_pin, uint, 0644);
module_param(w1_gpio_pullup, uint, 0644);
module_param(bcm2835_mmc, uint, 0644);
2 changes: 2 additions & 0 deletions arch/arm/mach-bcm2708/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ static void vc_dmaman_init(struct vc_dmaman *dmaman, void __iomem *dma_base,
dmaman->chan_available = chans_available;
dmaman->has_feature[BCM_DMA_FEATURE_FAST_ORD] = 0x0c; /* chans 2 & 3 */
dmaman->has_feature[BCM_DMA_FEATURE_BULK_ORD] = 0x01; /* chan 0 */
dmaman->has_feature[BCM_DMA_FEATURE_NORMAL_ORD] = 0xfe; /* chans 1 to 7 */
dmaman->has_feature[BCM_DMA_FEATURE_LITE_ORD] = 0x7f00; /* chans 8 to 14 */
}

static int vc_dmaman_chan_alloc(struct vc_dmaman *dmaman,
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-bcm2708/include/mach/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ extern int /*rc*/ bcm_dma_abort(void __iomem *dma_chan_base);
those with higher priority smaller ordinal numbers */
#define BCM_DMA_FEATURE_FAST_ORD 0
#define BCM_DMA_FEATURE_BULK_ORD 1
#define BCM_DMA_FEATURE_NORMAL_ORD 2
#define BCM_DMA_FEATURE_LITE_ORD 3
#define BCM_DMA_FEATURE_FAST (1<<BCM_DMA_FEATURE_FAST_ORD)
#define BCM_DMA_FEATURE_BULK (1<<BCM_DMA_FEATURE_BULK_ORD)
#define BCM_DMA_FEATURE_COUNT 2
#define BCM_DMA_FEATURE_NORMAL (1<<BCM_DMA_FEATURE_NORMAL_ORD)
#define BCM_DMA_FEATURE_LITE (1<<BCM_DMA_FEATURE_LITE_ORD)
#define BCM_DMA_FEATURE_COUNT 4

/* return channel no or -ve error */
extern int bcm_dma_chan_alloc(unsigned preferred_feature_set,
Expand Down
Loading