aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-imx/clock-imx25.c3
-rw-r--r--arch/arm/mach-imx/clock-imx31.c2
-rw-r--r--arch/arm/mach-imx/clock-imx35.c2
-rw-r--r--arch/arm/mach-imx/mm-imx25.c4
-rw-r--r--arch/arm/mach-imx/mm-imx31.c3
-rw-r--r--arch/arm/mach-imx/mm-imx35.c3
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c6
-rw-r--r--arch/arm/mach-mx5/mm.c8
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-dma.c4
-rw-r--r--arch/arm/plat-mxc/include/mach/devices-common.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/dma.h3
-rw-r--r--arch/arm/plat-mxc/include/mach/sdma.h2
-rw-r--r--drivers/dma/imx-sdma.c40
13 files changed, 51 insertions, 31 deletions
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index 991ccc94d6f7..0fc7ba56d616 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -308,7 +308,8 @@ static struct clk_lookup lookups[] = {
308 _REGISTER_CLOCK(NULL, "audmux", audmux_clk) 308 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
309 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) 309 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
310 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) 310 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
311 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 311 /* i.mx25 has the i.mx35 type sdma */
312 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
312}; 313};
313 314
314int __init mx25_clocks_init(void) 315int __init mx25_clocks_init(void)
diff --git a/arch/arm/mach-imx/clock-imx31.c b/arch/arm/mach-imx/clock-imx31.c
index 8d212a93ee7f..d973770b1f96 100644
--- a/arch/arm/mach-imx/clock-imx31.c
+++ b/arch/arm/mach-imx/clock-imx31.c
@@ -565,7 +565,7 @@ static struct clk_lookup lookups[] = {
565 _REGISTER_CLOCK(NULL, "ata", ata_clk) 565 _REGISTER_CLOCK(NULL, "ata", ata_clk)
566 _REGISTER_CLOCK(NULL, "rtic", rtic_clk) 566 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
567 _REGISTER_CLOCK(NULL, "rng", rng_clk) 567 _REGISTER_CLOCK(NULL, "rng", rng_clk)
568 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk1) 568 _REGISTER_CLOCK("imx31-sdma", NULL, sdma_clk1)
569 _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2) 569 _REGISTER_CLOCK(NULL, "sdma_ipg", sdma_clk2)
570 _REGISTER_CLOCK(NULL, "mstick", mstick1_clk) 570 _REGISTER_CLOCK(NULL, "mstick", mstick1_clk)
571 _REGISTER_CLOCK(NULL, "mstick", mstick2_clk) 571 _REGISTER_CLOCK(NULL, "mstick", mstick2_clk)
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c
index cecd63b5328e..88b62a071aea 100644
--- a/arch/arm/mach-imx/clock-imx35.c
+++ b/arch/arm/mach-imx/clock-imx35.c
@@ -482,7 +482,7 @@ static struct clk_lookup lookups[] = {
482 _REGISTER_CLOCK(NULL, "rtc", rtc_clk) 482 _REGISTER_CLOCK(NULL, "rtc", rtc_clk)
483 _REGISTER_CLOCK(NULL, "rtic", rtic_clk) 483 _REGISTER_CLOCK(NULL, "rtic", rtic_clk)
484 _REGISTER_CLOCK(NULL, "scc", scc_clk) 484 _REGISTER_CLOCK(NULL, "scc", scc_clk)
485 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 485 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
486 _REGISTER_CLOCK(NULL, "spba", spba_clk) 486 _REGISTER_CLOCK(NULL, "spba", spba_clk)
487 _REGISTER_CLOCK(NULL, "spdif", spdif_clk) 487 _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
488 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 488 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index 8bf029164652..cc4d152bd9bd 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -79,7 +79,6 @@ static struct sdma_script_start_addrs imx25_sdma_script __initdata = {
79}; 79};
80 80
81static struct sdma_platform_data imx25_sdma_pdata __initdata = { 81static struct sdma_platform_data imx25_sdma_pdata __initdata = {
82 .sdma_version = 2,
83 .fw_name = "sdma-imx25.bin", 82 .fw_name = "sdma-imx25.bin",
84 .script_addrs = &imx25_sdma_script, 83 .script_addrs = &imx25_sdma_script,
85}; 84};
@@ -92,5 +91,6 @@ void __init imx25_soc_init(void)
92 mxc_register_gpio("imx31-gpio", 2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0); 91 mxc_register_gpio("imx31-gpio", 2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0);
93 mxc_register_gpio("imx31-gpio", 3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0); 92 mxc_register_gpio("imx31-gpio", 3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0);
94 93
95 imx_add_imx_sdma(MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata); 94 /* i.mx25 has the i.mx35 type sdma */
95 imx_add_imx_sdma("imx35-sdma", MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
96} 96}
diff --git a/arch/arm/mach-imx/mm-imx31.c b/arch/arm/mach-imx/mm-imx31.c
index 61bff38cb955..b7c55e7db000 100644
--- a/arch/arm/mach-imx/mm-imx31.c
+++ b/arch/arm/mach-imx/mm-imx31.c
@@ -69,7 +69,6 @@ static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = {
69}; 69};
70 70
71static struct sdma_platform_data imx31_sdma_pdata __initdata = { 71static struct sdma_platform_data imx31_sdma_pdata __initdata = {
72 .sdma_version = 1,
73 .fw_name = "sdma-imx31-to2.bin", 72 .fw_name = "sdma-imx31-to2.bin",
74 .script_addrs = &imx31_to2_sdma_script, 73 .script_addrs = &imx31_to2_sdma_script,
75}; 74};
@@ -88,5 +87,5 @@ void __init imx31_soc_init(void)
88 imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script; 87 imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script;
89 } 88 }
90 89
91 imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata); 90 imx_add_imx_sdma("imx31-sdma", MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
92} 91}
diff --git a/arch/arm/mach-imx/mm-imx35.c b/arch/arm/mach-imx/mm-imx35.c
index 98769ae34377..f49bac7a1ede 100644
--- a/arch/arm/mach-imx/mm-imx35.c
+++ b/arch/arm/mach-imx/mm-imx35.c
@@ -86,7 +86,6 @@ static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = {
86}; 86};
87 87
88static struct sdma_platform_data imx35_sdma_pdata __initdata = { 88static struct sdma_platform_data imx35_sdma_pdata __initdata = {
89 .sdma_version = 2,
90 .fw_name = "sdma-imx35-to2.bin", 89 .fw_name = "sdma-imx35-to2.bin",
91 .script_addrs = &imx35_to2_sdma_script, 90 .script_addrs = &imx35_to2_sdma_script,
92}; 91};
@@ -106,5 +105,5 @@ void __init imx35_soc_init(void)
106 imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script; 105 imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script;
107 } 106 }
108 107
109 imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata); 108 imx_add_imx_sdma("imx35-sdma", MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
110} 109}
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index e3d3eb55e3f8..7f20308c4dbd 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1448,7 +1448,8 @@ static struct clk_lookup mx51_lookups[] = {
1448 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1448 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1449 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1449 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1450 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk) 1450 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
1451 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 1451 /* i.mx51 has the i.mx35 type sdma */
1452 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
1452 _REGISTER_CLOCK(NULL, "ckih", ckih_clk) 1453 _REGISTER_CLOCK(NULL, "ckih", ckih_clk)
1453 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk) 1454 _REGISTER_CLOCK(NULL, "ckih2", ckih2_clk)
1454 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk) 1455 _REGISTER_CLOCK(NULL, "gpt_32k", gpt_32k_clk)
@@ -1496,7 +1497,8 @@ static struct clk_lookup mx53_lookups[] = {
1496 _REGISTER_CLOCK("sdhci-esdhc-imx53.3", NULL, esdhc4_mx53_clk) 1497 _REGISTER_CLOCK("sdhci-esdhc-imx53.3", NULL, esdhc4_mx53_clk)
1497 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) 1498 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
1498 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk) 1499 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
1499 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk) 1500 /* i.mx53 has the i.mx35 type sdma */
1501 _REGISTER_CLOCK("imx35-sdma", NULL, sdma_clk)
1500 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1502 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1501 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1503 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
1502 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk) 1504 _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index ef8aec9319b6..baea6e5cddd9 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -115,7 +115,6 @@ static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
115}; 115};
116 116
117static struct sdma_platform_data imx51_sdma_pdata __initdata = { 117static struct sdma_platform_data imx51_sdma_pdata __initdata = {
118 .sdma_version = 2,
119 .fw_name = "sdma-imx51.bin", 118 .fw_name = "sdma-imx51.bin",
120 .script_addrs = &imx51_sdma_script, 119 .script_addrs = &imx51_sdma_script,
121}; 120};
@@ -135,7 +134,6 @@ static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
135}; 134};
136 135
137static struct sdma_platform_data imx53_sdma_pdata __initdata = { 136static struct sdma_platform_data imx53_sdma_pdata __initdata = {
138 .sdma_version = 2,
139 .fw_name = "sdma-imx53.bin", 137 .fw_name = "sdma-imx53.bin",
140 .script_addrs = &imx53_sdma_script, 138 .script_addrs = &imx53_sdma_script,
141}; 139};
@@ -148,7 +146,8 @@ void __init imx51_soc_init(void)
148 mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH); 146 mxc_register_gpio("imx31-gpio", 2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
149 mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH); 147 mxc_register_gpio("imx31-gpio", 3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
150 148
151 imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata); 149 /* i.mx51 has the i.mx35 type sdma */
150 imx_add_imx_sdma("imx35-sdma", MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
152} 151}
153 152
154void __init imx53_soc_init(void) 153void __init imx53_soc_init(void)
@@ -162,5 +161,6 @@ void __init imx53_soc_init(void)
162 mxc_register_gpio("imx31-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH); 161 mxc_register_gpio("imx31-gpio", 5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
163 mxc_register_gpio("imx31-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH); 162 mxc_register_gpio("imx31-gpio", 6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
164 163
165 imx_add_imx_sdma(MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata); 164 /* i.mx53 has the i.mx35 type sdma */
165 imx_add_imx_sdma("imx35-sdma", MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
166} 166}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c
index 2b0fdb23beb8..7fa7e9c92468 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c
@@ -14,7 +14,7 @@ struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
14 "imx-dma", -1, NULL, 0, NULL, 0); 14 "imx-dma", -1, NULL, 0, NULL, 0);
15} 15}
16 16
17struct platform_device __init __maybe_unused *imx_add_imx_sdma( 17struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
18 resource_size_t iobase, int irq, struct sdma_platform_data *pdata) 18 resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
19{ 19{
20 struct resource res[] = { 20 struct resource res[] = {
@@ -29,6 +29,6 @@ struct platform_device __init __maybe_unused *imx_add_imx_sdma(
29 }, 29 },
30 }; 30 };
31 31
32 return platform_device_register_resndata(&mxc_ahb_bus, "imx-sdma", 32 return platform_device_register_resndata(&mxc_ahb_bus, name,
33 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 33 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
34} 34}
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h
index 3beef7729788..524538aabc4b 100644
--- a/arch/arm/plat-mxc/include/mach/devices-common.h
+++ b/arch/arm/plat-mxc/include/mach/devices-common.h
@@ -299,5 +299,5 @@ struct platform_device *__init imx_add_spi_imx(
299 const struct spi_imx_master *pdata); 299 const struct spi_imx_master *pdata);
300 300
301struct platform_device *imx_add_imx_dma(void); 301struct platform_device *imx_add_imx_dma(void);
302struct platform_device *imx_add_imx_sdma( 302struct platform_device *imx_add_imx_sdma(char *name,
303 resource_size_t iobase, int irq, struct sdma_platform_data *pdata); 303 resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
diff --git a/arch/arm/plat-mxc/include/mach/dma.h b/arch/arm/plat-mxc/include/mach/dma.h
index ef7751546f5f..233d0a5e2d68 100644
--- a/arch/arm/plat-mxc/include/mach/dma.h
+++ b/arch/arm/plat-mxc/include/mach/dma.h
@@ -60,7 +60,8 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
60 60
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan) 61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{ 62{
63 return !strcmp(dev_name(chan->device->dev), "imx-sdma") || 63 return !strcmp(dev_name(chan->device->dev), "imx31-sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx35-sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx-dma"); 65 !strcmp(dev_name(chan->device->dev), "imx-dma");
65} 66}
66 67
diff --git a/arch/arm/plat-mxc/include/mach/sdma.h b/arch/arm/plat-mxc/include/mach/sdma.h
index f495c87c113f..3a3942823c20 100644
--- a/arch/arm/plat-mxc/include/mach/sdma.h
+++ b/arch/arm/plat-mxc/include/mach/sdma.h
@@ -48,12 +48,10 @@ struct sdma_script_start_addrs {
48/** 48/**
49 * struct sdma_platform_data - platform specific data for SDMA engine 49 * struct sdma_platform_data - platform specific data for SDMA engine
50 * 50 *
51 * @sdma_version The version of this SDMA engine
52 * @fw_name The firmware name 51 * @fw_name The firmware name
53 * @script_addrs SDMA scripts addresses in SDMA ROM 52 * @script_addrs SDMA scripts addresses in SDMA ROM
54 */ 53 */
55struct sdma_platform_data { 54struct sdma_platform_data {
56 int sdma_version;
57 char *fw_name; 55 char *fw_name;
58 struct sdma_script_start_addrs *script_addrs; 56 struct sdma_script_start_addrs *script_addrs;
59}; 57};
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 1ea47db2ff06..a7708b481eab 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -65,8 +65,8 @@
65#define SDMA_ONCE_RTB 0x060 65#define SDMA_ONCE_RTB 0x060
66#define SDMA_XTRIG_CONF1 0x070 66#define SDMA_XTRIG_CONF1 0x070
67#define SDMA_XTRIG_CONF2 0x074 67#define SDMA_XTRIG_CONF2 0x074
68#define SDMA_CHNENBL0_V2 0x200 68#define SDMA_CHNENBL0_IMX35 0x200
69#define SDMA_CHNENBL0_V1 0x080 69#define SDMA_CHNENBL0_IMX31 0x080
70#define SDMA_CHNPRI_0 0x100 70#define SDMA_CHNPRI_0 0x100
71 71
72/* 72/*
@@ -299,13 +299,18 @@ struct sdma_firmware_header {
299 u32 ram_code_size; 299 u32 ram_code_size;
300}; 300};
301 301
302enum sdma_devtype {
303 IMX31_SDMA, /* runs on i.mx31 */
304 IMX35_SDMA, /* runs on i.mx35 and later */
305};
306
302struct sdma_engine { 307struct sdma_engine {
303 struct device *dev; 308 struct device *dev;
304 struct device_dma_parameters dma_parms; 309 struct device_dma_parameters dma_parms;
305 struct sdma_channel channel[MAX_DMA_CHANNELS]; 310 struct sdma_channel channel[MAX_DMA_CHANNELS];
306 struct sdma_channel_control *channel_control; 311 struct sdma_channel_control *channel_control;
307 void __iomem *regs; 312 void __iomem *regs;
308 unsigned int version; 313 enum sdma_devtype devtype;
309 unsigned int num_events; 314 unsigned int num_events;
310 struct sdma_context_data *context; 315 struct sdma_context_data *context;
311 dma_addr_t context_phys; 316 dma_addr_t context_phys;
@@ -314,6 +319,19 @@ struct sdma_engine {
314 struct sdma_script_start_addrs *script_addrs; 319 struct sdma_script_start_addrs *script_addrs;
315}; 320};
316 321
322static struct platform_device_id sdma_devtypes[] = {
323 {
324 .name = "imx31-sdma",
325 .driver_data = IMX31_SDMA,
326 }, {
327 .name = "imx35-sdma",
328 .driver_data = IMX35_SDMA,
329 }, {
330 /* sentinel */
331 }
332};
333MODULE_DEVICE_TABLE(platform, sdma_devtypes);
334
317#define SDMA_H_CONFIG_DSPDMA (1 << 12) /* indicates if the DSPDMA is used */ 335#define SDMA_H_CONFIG_DSPDMA (1 << 12) /* indicates if the DSPDMA is used */
318#define SDMA_H_CONFIG_RTD_PINS (1 << 11) /* indicates if Real-Time Debug pins are enabled */ 336#define SDMA_H_CONFIG_RTD_PINS (1 << 11) /* indicates if Real-Time Debug pins are enabled */
319#define SDMA_H_CONFIG_ACR (1 << 4) /* indicates if AHB freq /core freq = 2 or 1 */ 337#define SDMA_H_CONFIG_ACR (1 << 4) /* indicates if AHB freq /core freq = 2 or 1 */
@@ -321,8 +339,8 @@ struct sdma_engine {
321 339
322static inline u32 chnenbl_ofs(struct sdma_engine *sdma, unsigned int event) 340static inline u32 chnenbl_ofs(struct sdma_engine *sdma, unsigned int event)
323{ 341{
324 u32 chnenbl0 = (sdma->version == 2 ? SDMA_CHNENBL0_V2 : SDMA_CHNENBL0_V1); 342 u32 chnenbl0 = (sdma->devtype == IMX31_SDMA ? SDMA_CHNENBL0_IMX31 :
325 343 SDMA_CHNENBL0_IMX35);
326 return chnenbl0 + event * 4; 344 return chnenbl0 + event * 4;
327} 345}
328 346
@@ -1162,15 +1180,16 @@ static int __init sdma_init(struct sdma_engine *sdma)
1162 int i, ret; 1180 int i, ret;
1163 dma_addr_t ccb_phys; 1181 dma_addr_t ccb_phys;
1164 1182
1165 switch (sdma->version) { 1183 switch (sdma->devtype) {
1166 case 1: 1184 case IMX31_SDMA:
1167 sdma->num_events = 32; 1185 sdma->num_events = 32;
1168 break; 1186 break;
1169 case 2: 1187 case IMX35_SDMA:
1170 sdma->num_events = 48; 1188 sdma->num_events = 48;
1171 break; 1189 break;
1172 default: 1190 default:
1173 dev_err(sdma->dev, "Unknown version %d. aborting\n", sdma->version); 1191 dev_err(sdma->dev, "Unknown sdma type %d. aborting\n",
1192 sdma->devtype);
1174 return -ENODEV; 1193 return -ENODEV;
1175 } 1194 }
1176 1195
@@ -1284,7 +1303,7 @@ static int __init sdma_probe(struct platform_device *pdev)
1284 if (!sdma->script_addrs) 1303 if (!sdma->script_addrs)
1285 goto err_alloc; 1304 goto err_alloc;
1286 1305
1287 sdma->version = pdata->sdma_version; 1306 sdma->devtype = pdev->id_entry->driver_data;
1288 1307
1289 dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask); 1308 dma_cap_set(DMA_SLAVE, sdma->dma_device.cap_mask);
1290 dma_cap_set(DMA_CYCLIC, sdma->dma_device.cap_mask); 1309 dma_cap_set(DMA_CYCLIC, sdma->dma_device.cap_mask);
@@ -1366,6 +1385,7 @@ static struct platform_driver sdma_driver = {
1366 .driver = { 1385 .driver = {
1367 .name = "imx-sdma", 1386 .name = "imx-sdma",
1368 }, 1387 },
1388 .id_table = sdma_devtypes,
1369 .remove = __exit_p(sdma_remove), 1389 .remove = __exit_p(sdma_remove),
1370}; 1390};
1371 1391