Skip to content

Make legacy DMA API available on ARCH_BCM2835 #945

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 4 commits into from
Apr 29, 2015
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
16 changes: 16 additions & 0 deletions arch/arm/boot/dts/bcm2708_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@

dma: dma@7e007000 {
compatible = "brcm,bcm2835-dma";
reg = <0x7e007000 0xf00>;
interrupts = <1 16>,
<1 17>,
<1 18>,
<1 19>,
<1 20>,
<1 21>,
<1 22>,
<1 23>,
<1 24>,
<1 25>,
<1 26>,
<1 27>,
<1 28>;

#dma-cells = <1>;
brcm,dma-channel-mask = <0x7f35>;
};

intc: interrupt-controller {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-bcm2708/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Makefile for the linux kernel.
#

obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o vcio.o power.o dma.o
obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o vcio.o power.o
obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
73 changes: 59 additions & 14 deletions arch/arm/mach-bcm2708/bcm2708.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include <asm/mach/map.h>

#include <mach/timex.h>
#include <mach/dma.h>
#include <mach/vcio.h>
#include <mach/system.h>

Expand Down Expand Up @@ -248,24 +247,71 @@ static struct amba_device *amba_devs[] __initdata = {
&uart0_device,
};

static struct resource bcm2708_dmaman_resources[] = {
static struct resource bcm2708_dmaengine_resources[] = {
{
.start = DMA_BASE,
.end = DMA_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
}
};

static struct platform_device bcm2708_dmaman_device = {
.name = BCM_DMAMAN_DRIVER_NAME,
.id = 0, /* first bcm2708_dma */
.resource = bcm2708_dmaman_resources,
.num_resources = ARRAY_SIZE(bcm2708_dmaman_resources),
.start = DMA_BASE,
.end = DMA_BASE + SZ_4K - 1,
.flags = IORESOURCE_MEM,
}, {
.start = IRQ_DMA0,
.end = IRQ_DMA0,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA1,
.end = IRQ_DMA1,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA2,
.end = IRQ_DMA2,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA3,
.end = IRQ_DMA3,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA4,
.end = IRQ_DMA4,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA5,
.end = IRQ_DMA5,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA6,
.end = IRQ_DMA6,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA7,
.end = IRQ_DMA7,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA8,
.end = IRQ_DMA8,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA9,
.end = IRQ_DMA9,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA10,
.end = IRQ_DMA10,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA11,
.end = IRQ_DMA11,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_DMA12,
.end = IRQ_DMA12,
.flags = IORESOURCE_IRQ,
}
};

static struct platform_device bcm2708_dmaengine_device = {
.name = "bcm2708-dmaengine",
.id = -1,
.resource = bcm2708_dmaengine_resources,
.num_resources = ARRAY_SIZE(bcm2708_dmaengine_resources),
};

#if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE)
Expand Down Expand Up @@ -858,7 +904,6 @@ void __init bcm2708_init(void)
bcm2708_init_clocks();
bcm2708_dt_init();

bcm_register_device(&bcm2708_dmaman_device);
bcm_register_device_dt(&bcm2708_dmaengine_device);
bcm_register_device(&bcm2708_vcio_device);
#ifdef CONFIG_BCM2708_GPIO
Expand Down
Loading