aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices-da8xx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 16:05:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 16:05:40 -0500
commit13dda80e48439b446d0bc9bab34b91484bc8f533 (patch)
treee8037122d65fe2a5dd8f633a7648b2597640a2ce /arch/arm/mach-davinci/devices-da8xx.c
parent379e3a820da171cb1d97e8dccd736a69cebfb7c0 (diff)
parent5f19daa16ffca55db5b0253eba2bd0f71ee7f7f4 (diff)
Merge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci
* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: (40 commits) DaVinci DM365: Adding support for SPI EEPROM DaVinci DM365: Adding DM365 SPI support DaVinci DM355: Modifications to DM355 SPI support DaVinci: SPI: Adding header file for SPI support. davinci: dm646x: CDCE clocks: davinci_clk converted to clk_lookup davinci: clkdev cleanup: remove clk_lookup wrapper, use clkdev_add_table() DaVinci: DM365: Voice codec support for the DM365 SoC davinci: clock: let clk->set_rate function sleep Add SDA and SCL pin numbers to i2c platform data davinci: da8xx/omap-l1xx: Add EDMA platform data for da850/omap-l138 davinci: build list of unused EDMA events dynamically davinci: Fix edma_alloc_channel api for EDMA_CHANNEL_ANY case davinci: Keep count of channel controllers on a platform davinci: Correct return value of edma_alloc_channel api davinci: add CDCE949 support on DM6467 EVM davinci: add support for CDCE949 clock synthesizer davinci: da850/omap-l138 EVM: register for suspend support davinci: da850/omap-l138: add support for SoC suspend davinci: add power management support DaVinci: DM365: Changing default queue for DM365. ...
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c146
1 files changed, 131 insertions, 15 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index a5105f03fd86..0a96791d3b0f 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -24,8 +24,10 @@
24#include "clock.h" 24#include "clock.h"
25 25
26#define DA8XX_TPCC_BASE 0x01c00000 26#define DA8XX_TPCC_BASE 0x01c00000
27#define DA850_TPCC1_BASE 0x01e30000
27#define DA8XX_TPTC0_BASE 0x01c08000 28#define DA8XX_TPTC0_BASE 0x01c08000
28#define DA8XX_TPTC1_BASE 0x01c08400 29#define DA8XX_TPTC1_BASE 0x01c08400
30#define DA850_TPTC2_BASE 0x01e38000
29#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ 31#define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */
30#define DA8XX_I2C0_BASE 0x01c22000 32#define DA8XX_I2C0_BASE 0x01c22000
31#define DA8XX_RTC_BASE 0x01C23000 33#define DA8XX_RTC_BASE 0x01C23000
@@ -42,7 +44,8 @@
42#define DA8XX_MDIO_REG_OFFSET 0x4000 44#define DA8XX_MDIO_REG_OFFSET 0x4000
43#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K 45#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K
44 46
45void __iomem *da8xx_syscfg_base; 47void __iomem *da8xx_syscfg0_base;
48void __iomem *da8xx_syscfg1_base;
46 49
47static struct plat_serial8250_port da8xx_serial_pdata[] = { 50static struct plat_serial8250_port da8xx_serial_pdata[] = {
48 { 51 {
@@ -82,11 +85,6 @@ struct platform_device da8xx_serial_device = {
82 }, 85 },
83}; 86};
84 87
85static const s8 da8xx_dma_chan_no_event[] = {
86 20, 21,
87 -1
88};
89
90static const s8 da8xx_queue_tc_mapping[][2] = { 88static const s8 da8xx_queue_tc_mapping[][2] = {
91 /* {event queue no, TC no} */ 89 /* {event queue no, TC no} */
92 {0, 0}, 90 {0, 0},
@@ -101,20 +99,52 @@ static const s8 da8xx_queue_priority_mapping[][2] = {
101 {-1, -1} 99 {-1, -1}
102}; 100};
103 101
104static struct edma_soc_info da8xx_edma_info[] = { 102static const s8 da850_queue_tc_mapping[][2] = {
103 /* {event queue no, TC no} */
104 {0, 0},
105 {-1, -1}
106};
107
108static const s8 da850_queue_priority_mapping[][2] = {
109 /* {event queue no, Priority} */
110 {0, 3},
111 {-1, -1}
112};
113
114static struct edma_soc_info da830_edma_info[] = {
105 { 115 {
106 .n_channel = 32, 116 .n_channel = 32,
107 .n_region = 4, 117 .n_region = 4,
108 .n_slot = 128, 118 .n_slot = 128,
109 .n_tc = 2, 119 .n_tc = 2,
110 .n_cc = 1, 120 .n_cc = 1,
111 .noevent = da8xx_dma_chan_no_event,
112 .queue_tc_mapping = da8xx_queue_tc_mapping, 121 .queue_tc_mapping = da8xx_queue_tc_mapping,
113 .queue_priority_mapping = da8xx_queue_priority_mapping, 122 .queue_priority_mapping = da8xx_queue_priority_mapping,
114 }, 123 },
115}; 124};
116 125
117static struct resource da8xx_edma_resources[] = { 126static struct edma_soc_info da850_edma_info[] = {
127 {
128 .n_channel = 32,
129 .n_region = 4,
130 .n_slot = 128,
131 .n_tc = 2,
132 .n_cc = 1,
133 .queue_tc_mapping = da8xx_queue_tc_mapping,
134 .queue_priority_mapping = da8xx_queue_priority_mapping,
135 },
136 {
137 .n_channel = 32,
138 .n_region = 4,
139 .n_slot = 128,
140 .n_tc = 1,
141 .n_cc = 1,
142 .queue_tc_mapping = da850_queue_tc_mapping,
143 .queue_priority_mapping = da850_queue_priority_mapping,
144 },
145};
146
147static struct resource da830_edma_resources[] = {
118 { 148 {
119 .name = "edma_cc0", 149 .name = "edma_cc0",
120 .start = DA8XX_TPCC_BASE, 150 .start = DA8XX_TPCC_BASE,
@@ -145,19 +175,91 @@ static struct resource da8xx_edma_resources[] = {
145 }, 175 },
146}; 176};
147 177
148static struct platform_device da8xx_edma_device = { 178static struct resource da850_edma_resources[] = {
179 {
180 .name = "edma_cc0",
181 .start = DA8XX_TPCC_BASE,
182 .end = DA8XX_TPCC_BASE + SZ_32K - 1,
183 .flags = IORESOURCE_MEM,
184 },
185 {
186 .name = "edma_tc0",
187 .start = DA8XX_TPTC0_BASE,
188 .end = DA8XX_TPTC0_BASE + SZ_1K - 1,
189 .flags = IORESOURCE_MEM,
190 },
191 {
192 .name = "edma_tc1",
193 .start = DA8XX_TPTC1_BASE,
194 .end = DA8XX_TPTC1_BASE + SZ_1K - 1,
195 .flags = IORESOURCE_MEM,
196 },
197 {
198 .name = "edma_cc1",
199 .start = DA850_TPCC1_BASE,
200 .end = DA850_TPCC1_BASE + SZ_32K - 1,
201 .flags = IORESOURCE_MEM,
202 },
203 {
204 .name = "edma_tc2",
205 .start = DA850_TPTC2_BASE,
206 .end = DA850_TPTC2_BASE + SZ_1K - 1,
207 .flags = IORESOURCE_MEM,
208 },
209 {
210 .name = "edma0",
211 .start = IRQ_DA8XX_CCINT0,
212 .flags = IORESOURCE_IRQ,
213 },
214 {
215 .name = "edma0_err",
216 .start = IRQ_DA8XX_CCERRINT,
217 .flags = IORESOURCE_IRQ,
218 },
219 {
220 .name = "edma1",
221 .start = IRQ_DA850_CCINT1,
222 .flags = IORESOURCE_IRQ,
223 },
224 {
225 .name = "edma1_err",
226 .start = IRQ_DA850_CCERRINT1,
227 .flags = IORESOURCE_IRQ,
228 },
229};
230
231static struct platform_device da830_edma_device = {
149 .name = "edma", 232 .name = "edma",
150 .id = -1, 233 .id = -1,
151 .dev = { 234 .dev = {
152 .platform_data = da8xx_edma_info, 235 .platform_data = da830_edma_info,
153 }, 236 },
154 .num_resources = ARRAY_SIZE(da8xx_edma_resources), 237 .num_resources = ARRAY_SIZE(da830_edma_resources),
155 .resource = da8xx_edma_resources, 238 .resource = da830_edma_resources,
239};
240
241static struct platform_device da850_edma_device = {
242 .name = "edma",
243 .id = -1,
244 .dev = {
245 .platform_data = da850_edma_info,
246 },
247 .num_resources = ARRAY_SIZE(da850_edma_resources),
248 .resource = da850_edma_resources,
156}; 249};
157 250
158int __init da8xx_register_edma(void) 251int __init da8xx_register_edma(void)
159{ 252{
160 return platform_device_register(&da8xx_edma_device); 253 struct platform_device *pdev;
254
255 if (cpu_is_davinci_da830())
256 pdev = &da830_edma_device;
257 else if (cpu_is_davinci_da850())
258 pdev = &da850_edma_device;
259 else
260 return -ENODEV;
261
262 return platform_device_register(pdev);
161} 263}
162 264
163static struct resource da8xx_i2c_resources0[] = { 265static struct resource da8xx_i2c_resources0[] = {
@@ -495,6 +597,19 @@ int da8xx_register_rtc(void)
495 return ret; 597 return ret;
496} 598}
497 599
600static void __iomem *da8xx_ddr2_ctlr_base;
601void __iomem * __init da8xx_get_mem_ctlr(void)
602{
603 if (da8xx_ddr2_ctlr_base)
604 return da8xx_ddr2_ctlr_base;
605
606 da8xx_ddr2_ctlr_base = ioremap(DA8XX_DDR2_CTL_BASE, SZ_32K);
607 if (!da8xx_ddr2_ctlr_base)
608 pr_warning("%s: Unable to map DDR2 controller", __func__);
609
610 return da8xx_ddr2_ctlr_base;
611}
612
498static struct resource da8xx_cpuidle_resources[] = { 613static struct resource da8xx_cpuidle_resources[] = {
499 { 614 {
500 .start = DA8XX_DDR2_CTL_BASE, 615 .start = DA8XX_DDR2_CTL_BASE,
@@ -520,6 +635,7 @@ static struct platform_device da8xx_cpuidle_device = {
520 635
521int __init da8xx_register_cpuidle(void) 636int __init da8xx_register_cpuidle(void)
522{ 637{
638 da8xx_cpuidle_pdata.ddr2_ctlr_base = da8xx_get_mem_ctlr();
639
523 return platform_device_register(&da8xx_cpuidle_device); 640 return platform_device_register(&da8xx_cpuidle_device);
524} 641}
525