Skip to content

Commit

Permalink
SPEAr: Add PL080 DMA support for 3xx and 6xx
Browse files Browse the repository at this point in the history
Both SPEAr3xx and SPEAr6xx families have one instance of ARM PL080 DMA
controller. This patch adds in support for that.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
  • Loading branch information
Viresh Kumar authored and Arnd Bergmann committed Apr 22, 2012
1 parent c5fa4fd commit 0b7ee71
Show file tree
Hide file tree
Showing 17 changed files with 1,104 additions and 4 deletions.
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/spear300-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
status = "okay";
};

dma@fc400000 {
status = "okay";
};

fsmc: flash@94000000 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/spear310-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
};

ahb {
dma@fc400000 {
status = "okay";
};

fsmc: flash@44000000 {
status = "okay";
};
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/spear320-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
status = "okay";
};

dma@fc400000 {
status = "okay";
};

fsmc: flash@4c000000 {
status = "okay";
};
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/spear3xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
#interrupt-cells = <1>;
};

dma@fc400000 {
compatible = "arm,pl080", "arm,primecell";
reg = <0xfc400000 0x1000>;
interrupt-parent = <&vic>;
interrupts = <8>;
status = "disabled";
};

gmac: eth@e0800000 {
compatible = "st,spear600-gmac";
reg = <0xe0800000 0x8000>;
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/dts/spear600-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
};

ahb {
dma@fc400000 {
status = "okay";
};

gmac: ethernet@e0800000 {
phy-mode = "gmii";
status = "okay";
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/spear600.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
#interrupt-cells = <1>;
};

dma@fc400000 {
compatible = "arm,pl080", "arm,primecell";
reg = <0xfc400000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <10>;
status = "disabled";
};

gmac: ethernet@e0800000 {
compatible = "st,spear600-gmac";
reg = <0xe0800000 0x8000>;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-spear3xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ static struct clk_lookup spear_clk_lookups[] = {
/* clock derived from ahb clk */
CLKDEV_INIT(NULL, "apb_clk", &apb_clk),
CLKDEV_INIT("d0180000.i2c", NULL, &i2c_clk),
CLKDEV_INIT("dma", NULL, &dma_clk),
CLKDEV_INIT("fc400000.dma", NULL, &dma_clk),
CLKDEV_INIT("jpeg", NULL, &jpeg_clk),
CLKDEV_INIT("e0800000.eth", NULL, &gmac_clk),
CLKDEV_INIT("fc000000.flash", NULL, &smi_clk),
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-spear3xx/include/mach/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#ifndef __MACH_GENERIC_H
#define __MACH_GENERIC_H

#include <linux/amba/pl08x.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/amba/bus.h>
Expand All @@ -33,6 +34,7 @@
/* Add spear3xx family device structure declarations here */
extern struct sys_timer spear3xx_timer;
extern struct pl022_ssp_controller pl022_plat_data;
extern struct pl08x_platform_data pl080_plat_data;

/* Add spear3xx family function declarations here */
void __init spear_setup_timer(void);
Expand Down
193 changes: 193 additions & 0 deletions arch/arm/mach-spear3xx/spear300.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#define pr_fmt(fmt) "SPEAr300: " fmt

#include <linux/amba/pl08x.h>
#include <linux/of_platform.h>
#include <asm/hardware/vic.h>
#include <asm/mach/arch.h>
Expand Down Expand Up @@ -440,17 +441,209 @@ static struct pmx_dev *spear300_evb_pmx_devs[] = {
&spear300_pmx_gpio1,
};

/* DMAC platform data's slave info */
struct pl08x_channel_data spear300_dma_info[] = {
{
.bus_id = "uart0_rx",
.min_signal = 2,
.max_signal = 2,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "uart0_tx",
.min_signal = 3,
.max_signal = 3,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ssp0_rx",
.min_signal = 8,
.max_signal = 8,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ssp0_tx",
.min_signal = 9,
.max_signal = 9,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "i2c_rx",
.min_signal = 10,
.max_signal = 10,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "i2c_tx",
.min_signal = 11,
.max_signal = 11,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "irda",
.min_signal = 12,
.max_signal = 12,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "adc",
.min_signal = 13,
.max_signal = 13,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "to_jpeg",
.min_signal = 14,
.max_signal = 14,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "from_jpeg",
.min_signal = 15,
.max_signal = 15,
.muxval = 0,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras0_rx",
.min_signal = 0,
.max_signal = 0,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras0_tx",
.min_signal = 1,
.max_signal = 1,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras1_rx",
.min_signal = 2,
.max_signal = 2,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras1_tx",
.min_signal = 3,
.max_signal = 3,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras2_rx",
.min_signal = 4,
.max_signal = 4,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras2_tx",
.min_signal = 5,
.max_signal = 5,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras3_rx",
.min_signal = 6,
.max_signal = 6,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras3_tx",
.min_signal = 7,
.max_signal = 7,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras4_rx",
.min_signal = 8,
.max_signal = 8,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras4_tx",
.min_signal = 9,
.max_signal = 9,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras5_rx",
.min_signal = 10,
.max_signal = 10,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras5_tx",
.min_signal = 11,
.max_signal = 11,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras6_rx",
.min_signal = 12,
.max_signal = 12,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras6_tx",
.min_signal = 13,
.max_signal = 13,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras7_rx",
.min_signal = 14,
.max_signal = 14,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
}, {
.bus_id = "ras7_tx",
.min_signal = 15,
.max_signal = 15,
.muxval = 1,
.cctl = 0,
.periph_buses = PL08X_AHB1,
},
};

/* Add SPEAr300 auxdata to pass platform data */
static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL,
&pl022_plat_data),
OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL,
&pl080_plat_data),
{}
};

static void __init spear300_dt_init(void)
{
int ret = -EINVAL;

pl080_plat_data.slave_channels = spear300_dma_info;
pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info);

of_platform_populate(NULL, of_default_bus_match_table,
spear300_auxdata_lookup, NULL);

Expand Down
Loading

0 comments on commit 0b7ee71

Please sign in to comment.