Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * TI DaVinci DM644x chip specific setup |
| 3 | * |
| 4 | * Author: Kevin Hilman, Deep Root Systems, LLC |
| 5 | * |
| 6 | * 2007 (c) Deep Root Systems, LLC. This file is licensed under |
| 7 | * the terms of the GNU General Public License version 2. This program |
| 8 | * is licensed "as is" without any warranty of any kind, whether express |
| 9 | * or implied. |
| 10 | */ |
Alexey Dobriyan | b7f080c | 2011-06-16 11:01:34 +0000 | [diff] [blame] | 11 | #include <linux/dma-mapping.h> |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 12 | #include <linux/init.h> |
| 13 | #include <linux/clk.h> |
Mark A. Greer | 65e866a | 2009-03-18 12:36:08 -0500 | [diff] [blame] | 14 | #include <linux/serial_8250.h> |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 15 | #include <linux/platform_device.h> |
| 16 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 17 | #include <asm/mach/map.h> |
| 18 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 19 | #include <mach/dm646x.h> |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 20 | #include <mach/cputype.h> |
| 21 | #include <mach/edma.h> |
| 22 | #include <mach/irqs.h> |
| 23 | #include <mach/psc.h> |
| 24 | #include <mach/mux.h> |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 25 | #include <mach/time.h> |
Mark A. Greer | 65e866a | 2009-03-18 12:36:08 -0500 | [diff] [blame] | 26 | #include <mach/serial.h> |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 27 | #include <mach/common.h> |
Chaithrika U S | 25acf55 | 2009-06-05 06:28:08 -0400 | [diff] [blame] | 28 | #include <mach/asp.h> |
Linus Walleij | 5f3fcf9 | 2011-08-22 08:40:38 +0100 | [diff] [blame] | 29 | #include <mach/gpio-davinci.h> |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 30 | |
| 31 | #include "clock.h" |
| 32 | #include "mux.h" |
| 33 | |
Muralidharan Karicheri | 85609c1 | 2009-09-16 13:15:30 -0400 | [diff] [blame] | 34 | #define DAVINCI_VPIF_BASE (0x01C12000) |
| 35 | #define VDD3P3V_PWDN_OFFSET (0x48) |
| 36 | #define VSCLKDIS_OFFSET (0x6C) |
| 37 | |
| 38 | #define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\ |
| 39 | BIT_MASK(0)) |
| 40 | #define VSCLKDIS_MASK (BIT_MASK(11) | BIT_MASK(10) | BIT_MASK(9) |\ |
| 41 | BIT_MASK(8)) |
| 42 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 43 | /* |
| 44 | * Device specific clocks |
| 45 | */ |
Sekhar Nori | 56e580d | 2011-06-14 15:33:20 +0000 | [diff] [blame] | 46 | #define DM646X_REF_FREQ 27000000 |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 47 | #define DM646X_AUX_FREQ 24000000 |
| 48 | |
| 49 | static struct pll_data pll1_data = { |
| 50 | .num = 1, |
| 51 | .phys_base = DAVINCI_PLL1_BASE, |
| 52 | }; |
| 53 | |
| 54 | static struct pll_data pll2_data = { |
| 55 | .num = 2, |
| 56 | .phys_base = DAVINCI_PLL2_BASE, |
| 57 | }; |
| 58 | |
| 59 | static struct clk ref_clk = { |
| 60 | .name = "ref_clk", |
Sekhar Nori | 56e580d | 2011-06-14 15:33:20 +0000 | [diff] [blame] | 61 | .rate = DM646X_REF_FREQ, |
| 62 | .set_rate = davinci_simple_set_rate, |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 63 | }; |
| 64 | |
| 65 | static struct clk aux_clkin = { |
| 66 | .name = "aux_clkin", |
| 67 | .rate = DM646X_AUX_FREQ, |
| 68 | }; |
| 69 | |
| 70 | static struct clk pll1_clk = { |
| 71 | .name = "pll1", |
| 72 | .parent = &ref_clk, |
| 73 | .pll_data = &pll1_data, |
| 74 | .flags = CLK_PLL, |
| 75 | }; |
| 76 | |
| 77 | static struct clk pll1_sysclk1 = { |
| 78 | .name = "pll1_sysclk1", |
| 79 | .parent = &pll1_clk, |
| 80 | .flags = CLK_PLL, |
| 81 | .div_reg = PLLDIV1, |
| 82 | }; |
| 83 | |
| 84 | static struct clk pll1_sysclk2 = { |
| 85 | .name = "pll1_sysclk2", |
| 86 | .parent = &pll1_clk, |
| 87 | .flags = CLK_PLL, |
| 88 | .div_reg = PLLDIV2, |
| 89 | }; |
| 90 | |
| 91 | static struct clk pll1_sysclk3 = { |
| 92 | .name = "pll1_sysclk3", |
| 93 | .parent = &pll1_clk, |
| 94 | .flags = CLK_PLL, |
| 95 | .div_reg = PLLDIV3, |
| 96 | }; |
| 97 | |
| 98 | static struct clk pll1_sysclk4 = { |
| 99 | .name = "pll1_sysclk4", |
| 100 | .parent = &pll1_clk, |
| 101 | .flags = CLK_PLL, |
| 102 | .div_reg = PLLDIV4, |
| 103 | }; |
| 104 | |
| 105 | static struct clk pll1_sysclk5 = { |
| 106 | .name = "pll1_sysclk5", |
| 107 | .parent = &pll1_clk, |
| 108 | .flags = CLK_PLL, |
| 109 | .div_reg = PLLDIV5, |
| 110 | }; |
| 111 | |
| 112 | static struct clk pll1_sysclk6 = { |
| 113 | .name = "pll1_sysclk6", |
| 114 | .parent = &pll1_clk, |
| 115 | .flags = CLK_PLL, |
| 116 | .div_reg = PLLDIV6, |
| 117 | }; |
| 118 | |
| 119 | static struct clk pll1_sysclk8 = { |
| 120 | .name = "pll1_sysclk8", |
| 121 | .parent = &pll1_clk, |
| 122 | .flags = CLK_PLL, |
| 123 | .div_reg = PLLDIV8, |
| 124 | }; |
| 125 | |
| 126 | static struct clk pll1_sysclk9 = { |
| 127 | .name = "pll1_sysclk9", |
| 128 | .parent = &pll1_clk, |
| 129 | .flags = CLK_PLL, |
| 130 | .div_reg = PLLDIV9, |
| 131 | }; |
| 132 | |
| 133 | static struct clk pll1_sysclkbp = { |
| 134 | .name = "pll1_sysclkbp", |
| 135 | .parent = &pll1_clk, |
| 136 | .flags = CLK_PLL | PRE_PLL, |
| 137 | .div_reg = BPDIV, |
| 138 | }; |
| 139 | |
| 140 | static struct clk pll1_aux_clk = { |
| 141 | .name = "pll1_aux_clk", |
| 142 | .parent = &pll1_clk, |
| 143 | .flags = CLK_PLL | PRE_PLL, |
| 144 | }; |
| 145 | |
| 146 | static struct clk pll2_clk = { |
| 147 | .name = "pll2_clk", |
| 148 | .parent = &ref_clk, |
| 149 | .pll_data = &pll2_data, |
| 150 | .flags = CLK_PLL, |
| 151 | }; |
| 152 | |
| 153 | static struct clk pll2_sysclk1 = { |
| 154 | .name = "pll2_sysclk1", |
| 155 | .parent = &pll2_clk, |
| 156 | .flags = CLK_PLL, |
| 157 | .div_reg = PLLDIV1, |
| 158 | }; |
| 159 | |
| 160 | static struct clk dsp_clk = { |
| 161 | .name = "dsp", |
| 162 | .parent = &pll1_sysclk1, |
| 163 | .lpsc = DM646X_LPSC_C64X_CPU, |
| 164 | .flags = PSC_DSP, |
| 165 | .usecount = 1, /* REVISIT how to disable? */ |
| 166 | }; |
| 167 | |
| 168 | static struct clk arm_clk = { |
| 169 | .name = "arm", |
| 170 | .parent = &pll1_sysclk2, |
| 171 | .lpsc = DM646X_LPSC_ARM, |
| 172 | .flags = ALWAYS_ENABLED, |
| 173 | }; |
| 174 | |
Sudhakar Rajashekhara | 2bcb613 | 2009-06-02 03:38:26 -0400 | [diff] [blame] | 175 | static struct clk edma_cc_clk = { |
| 176 | .name = "edma_cc", |
| 177 | .parent = &pll1_sysclk2, |
| 178 | .lpsc = DM646X_LPSC_TPCC, |
| 179 | .flags = ALWAYS_ENABLED, |
| 180 | }; |
| 181 | |
| 182 | static struct clk edma_tc0_clk = { |
| 183 | .name = "edma_tc0", |
| 184 | .parent = &pll1_sysclk2, |
| 185 | .lpsc = DM646X_LPSC_TPTC0, |
| 186 | .flags = ALWAYS_ENABLED, |
| 187 | }; |
| 188 | |
| 189 | static struct clk edma_tc1_clk = { |
| 190 | .name = "edma_tc1", |
| 191 | .parent = &pll1_sysclk2, |
| 192 | .lpsc = DM646X_LPSC_TPTC1, |
| 193 | .flags = ALWAYS_ENABLED, |
| 194 | }; |
| 195 | |
| 196 | static struct clk edma_tc2_clk = { |
| 197 | .name = "edma_tc2", |
| 198 | .parent = &pll1_sysclk2, |
| 199 | .lpsc = DM646X_LPSC_TPTC2, |
| 200 | .flags = ALWAYS_ENABLED, |
| 201 | }; |
| 202 | |
| 203 | static struct clk edma_tc3_clk = { |
| 204 | .name = "edma_tc3", |
| 205 | .parent = &pll1_sysclk2, |
| 206 | .lpsc = DM646X_LPSC_TPTC3, |
| 207 | .flags = ALWAYS_ENABLED, |
| 208 | }; |
| 209 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 210 | static struct clk uart0_clk = { |
| 211 | .name = "uart0", |
| 212 | .parent = &aux_clkin, |
| 213 | .lpsc = DM646X_LPSC_UART0, |
| 214 | }; |
| 215 | |
| 216 | static struct clk uart1_clk = { |
| 217 | .name = "uart1", |
| 218 | .parent = &aux_clkin, |
| 219 | .lpsc = DM646X_LPSC_UART1, |
| 220 | }; |
| 221 | |
| 222 | static struct clk uart2_clk = { |
| 223 | .name = "uart2", |
| 224 | .parent = &aux_clkin, |
| 225 | .lpsc = DM646X_LPSC_UART2, |
| 226 | }; |
| 227 | |
| 228 | static struct clk i2c_clk = { |
| 229 | .name = "I2CCLK", |
| 230 | .parent = &pll1_sysclk3, |
| 231 | .lpsc = DM646X_LPSC_I2C, |
| 232 | }; |
| 233 | |
| 234 | static struct clk gpio_clk = { |
| 235 | .name = "gpio", |
| 236 | .parent = &pll1_sysclk3, |
| 237 | .lpsc = DM646X_LPSC_GPIO, |
| 238 | }; |
| 239 | |
Chaithrika U S | 75d0fa7 | 2009-05-28 05:09:21 -0400 | [diff] [blame] | 240 | static struct clk mcasp0_clk = { |
| 241 | .name = "mcasp0", |
| 242 | .parent = &pll1_sysclk3, |
| 243 | .lpsc = DM646X_LPSC_McASP0, |
| 244 | }; |
| 245 | |
| 246 | static struct clk mcasp1_clk = { |
| 247 | .name = "mcasp1", |
| 248 | .parent = &pll1_sysclk3, |
| 249 | .lpsc = DM646X_LPSC_McASP1, |
| 250 | }; |
| 251 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 252 | static struct clk aemif_clk = { |
| 253 | .name = "aemif", |
| 254 | .parent = &pll1_sysclk3, |
| 255 | .lpsc = DM646X_LPSC_AEMIF, |
| 256 | .flags = ALWAYS_ENABLED, |
| 257 | }; |
| 258 | |
| 259 | static struct clk emac_clk = { |
| 260 | .name = "emac", |
| 261 | .parent = &pll1_sysclk3, |
| 262 | .lpsc = DM646X_LPSC_EMAC, |
| 263 | }; |
| 264 | |
| 265 | static struct clk pwm0_clk = { |
| 266 | .name = "pwm0", |
| 267 | .parent = &pll1_sysclk3, |
| 268 | .lpsc = DM646X_LPSC_PWM0, |
| 269 | .usecount = 1, /* REVIST: disabling hangs system */ |
| 270 | }; |
| 271 | |
| 272 | static struct clk pwm1_clk = { |
| 273 | .name = "pwm1", |
| 274 | .parent = &pll1_sysclk3, |
| 275 | .lpsc = DM646X_LPSC_PWM1, |
| 276 | .usecount = 1, /* REVIST: disabling hangs system */ |
| 277 | }; |
| 278 | |
| 279 | static struct clk timer0_clk = { |
| 280 | .name = "timer0", |
| 281 | .parent = &pll1_sysclk3, |
| 282 | .lpsc = DM646X_LPSC_TIMER0, |
| 283 | }; |
| 284 | |
| 285 | static struct clk timer1_clk = { |
| 286 | .name = "timer1", |
| 287 | .parent = &pll1_sysclk3, |
| 288 | .lpsc = DM646X_LPSC_TIMER1, |
| 289 | }; |
| 290 | |
| 291 | static struct clk timer2_clk = { |
| 292 | .name = "timer2", |
| 293 | .parent = &pll1_sysclk3, |
| 294 | .flags = ALWAYS_ENABLED, /* no LPSC, always enabled; c.f. spruep9a */ |
| 295 | }; |
| 296 | |
Hemant Pedanekar | 3e25d5f | 2009-07-07 19:49:41 +0530 | [diff] [blame] | 297 | |
| 298 | static struct clk ide_clk = { |
| 299 | .name = "ide", |
| 300 | .parent = &pll1_sysclk4, |
| 301 | .lpsc = DAVINCI_LPSC_ATA, |
| 302 | }; |
| 303 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 304 | static struct clk vpif0_clk = { |
| 305 | .name = "vpif0", |
| 306 | .parent = &ref_clk, |
| 307 | .lpsc = DM646X_LPSC_VPSSMSTR, |
| 308 | .flags = ALWAYS_ENABLED, |
| 309 | }; |
| 310 | |
| 311 | static struct clk vpif1_clk = { |
| 312 | .name = "vpif1", |
| 313 | .parent = &ref_clk, |
| 314 | .lpsc = DM646X_LPSC_VPSSSLV, |
| 315 | .flags = ALWAYS_ENABLED, |
| 316 | }; |
| 317 | |
Kevin Hilman | 28552c2 | 2010-02-25 15:36:38 -0800 | [diff] [blame] | 318 | static struct clk_lookup dm646x_clks[] = { |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 319 | CLK(NULL, "ref", &ref_clk), |
| 320 | CLK(NULL, "aux", &aux_clkin), |
| 321 | CLK(NULL, "pll1", &pll1_clk), |
| 322 | CLK(NULL, "pll1_sysclk", &pll1_sysclk1), |
| 323 | CLK(NULL, "pll1_sysclk", &pll1_sysclk2), |
| 324 | CLK(NULL, "pll1_sysclk", &pll1_sysclk3), |
| 325 | CLK(NULL, "pll1_sysclk", &pll1_sysclk4), |
| 326 | CLK(NULL, "pll1_sysclk", &pll1_sysclk5), |
| 327 | CLK(NULL, "pll1_sysclk", &pll1_sysclk6), |
| 328 | CLK(NULL, "pll1_sysclk", &pll1_sysclk8), |
| 329 | CLK(NULL, "pll1_sysclk", &pll1_sysclk9), |
| 330 | CLK(NULL, "pll1_sysclk", &pll1_sysclkbp), |
| 331 | CLK(NULL, "pll1_aux", &pll1_aux_clk), |
| 332 | CLK(NULL, "pll2", &pll2_clk), |
| 333 | CLK(NULL, "pll2_sysclk1", &pll2_sysclk1), |
| 334 | CLK(NULL, "dsp", &dsp_clk), |
| 335 | CLK(NULL, "arm", &arm_clk), |
Sudhakar Rajashekhara | 2bcb613 | 2009-06-02 03:38:26 -0400 | [diff] [blame] | 336 | CLK(NULL, "edma_cc", &edma_cc_clk), |
| 337 | CLK(NULL, "edma_tc0", &edma_tc0_clk), |
| 338 | CLK(NULL, "edma_tc1", &edma_tc1_clk), |
| 339 | CLK(NULL, "edma_tc2", &edma_tc2_clk), |
| 340 | CLK(NULL, "edma_tc3", &edma_tc3_clk), |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 341 | CLK(NULL, "uart0", &uart0_clk), |
| 342 | CLK(NULL, "uart1", &uart1_clk), |
| 343 | CLK(NULL, "uart2", &uart2_clk), |
| 344 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
| 345 | CLK(NULL, "gpio", &gpio_clk), |
Kevin Hilman | 61aa073 | 2009-07-15 08:47:48 -0700 | [diff] [blame] | 346 | CLK("davinci-mcasp.0", NULL, &mcasp0_clk), |
| 347 | CLK("davinci-mcasp.1", NULL, &mcasp1_clk), |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 348 | CLK(NULL, "aemif", &aemif_clk), |
| 349 | CLK("davinci_emac.1", NULL, &emac_clk), |
| 350 | CLK(NULL, "pwm0", &pwm0_clk), |
| 351 | CLK(NULL, "pwm1", &pwm1_clk), |
| 352 | CLK(NULL, "timer0", &timer0_clk), |
| 353 | CLK(NULL, "timer1", &timer1_clk), |
| 354 | CLK("watchdog", NULL, &timer2_clk), |
Hemant Pedanekar | 3e25d5f | 2009-07-07 19:49:41 +0530 | [diff] [blame] | 355 | CLK("palm_bk3710", NULL, &ide_clk), |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 356 | CLK(NULL, "vpif0", &vpif0_clk), |
| 357 | CLK(NULL, "vpif1", &vpif1_clk), |
| 358 | CLK(NULL, NULL, NULL), |
| 359 | }; |
| 360 | |
Mark A. Greer | 972412b | 2009-04-15 12:40:56 -0700 | [diff] [blame] | 361 | static struct emac_platform_data dm646x_emac_pdata = { |
| 362 | .ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET, |
| 363 | .ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET, |
| 364 | .ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET, |
Mark A. Greer | 972412b | 2009-04-15 12:40:56 -0700 | [diff] [blame] | 365 | .ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE, |
| 366 | .version = EMAC_VERSION_2, |
| 367 | }; |
| 368 | |
Kevin Hilman | ac7b75b | 2009-05-07 06:19:40 -0700 | [diff] [blame] | 369 | static struct resource dm646x_emac_resources[] = { |
| 370 | { |
| 371 | .start = DM646X_EMAC_BASE, |
Cyril Chemparathy | d22960c | 2010-09-15 10:11:22 -0400 | [diff] [blame] | 372 | .end = DM646X_EMAC_BASE + SZ_16K - 1, |
Kevin Hilman | ac7b75b | 2009-05-07 06:19:40 -0700 | [diff] [blame] | 373 | .flags = IORESOURCE_MEM, |
| 374 | }, |
| 375 | { |
| 376 | .start = IRQ_DM646X_EMACRXTHINT, |
| 377 | .end = IRQ_DM646X_EMACRXTHINT, |
| 378 | .flags = IORESOURCE_IRQ, |
| 379 | }, |
| 380 | { |
| 381 | .start = IRQ_DM646X_EMACRXINT, |
| 382 | .end = IRQ_DM646X_EMACRXINT, |
| 383 | .flags = IORESOURCE_IRQ, |
| 384 | }, |
| 385 | { |
| 386 | .start = IRQ_DM646X_EMACTXINT, |
| 387 | .end = IRQ_DM646X_EMACTXINT, |
| 388 | .flags = IORESOURCE_IRQ, |
| 389 | }, |
| 390 | { |
| 391 | .start = IRQ_DM646X_EMACMISCINT, |
| 392 | .end = IRQ_DM646X_EMACMISCINT, |
| 393 | .flags = IORESOURCE_IRQ, |
| 394 | }, |
| 395 | }; |
| 396 | |
| 397 | static struct platform_device dm646x_emac_device = { |
| 398 | .name = "davinci_emac", |
| 399 | .id = 1, |
Mark A. Greer | 972412b | 2009-04-15 12:40:56 -0700 | [diff] [blame] | 400 | .dev = { |
| 401 | .platform_data = &dm646x_emac_pdata, |
| 402 | }, |
Kevin Hilman | ac7b75b | 2009-05-07 06:19:40 -0700 | [diff] [blame] | 403 | .num_resources = ARRAY_SIZE(dm646x_emac_resources), |
| 404 | .resource = dm646x_emac_resources, |
| 405 | }; |
| 406 | |
Cyril Chemparathy | d22960c | 2010-09-15 10:11:22 -0400 | [diff] [blame] | 407 | static struct resource dm646x_mdio_resources[] = { |
| 408 | { |
| 409 | .start = DM646X_EMAC_MDIO_BASE, |
| 410 | .end = DM646X_EMAC_MDIO_BASE + SZ_4K - 1, |
| 411 | .flags = IORESOURCE_MEM, |
| 412 | }, |
| 413 | }; |
| 414 | |
| 415 | static struct platform_device dm646x_mdio_device = { |
| 416 | .name = "davinci_mdio", |
| 417 | .id = 0, |
| 418 | .num_resources = ARRAY_SIZE(dm646x_mdio_resources), |
| 419 | .resource = dm646x_mdio_resources, |
| 420 | }; |
| 421 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 422 | /* |
| 423 | * Device specific mux setup |
| 424 | * |
| 425 | * soc description mux mode mode mux dbg |
| 426 | * reg offset mask mode |
| 427 | */ |
| 428 | static const struct mux_config dm646x_pins[] = { |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 429 | #ifdef CONFIG_DAVINCI_MUX |
Hemant Pedanekar | 3e25d5f | 2009-07-07 19:49:41 +0530 | [diff] [blame] | 430 | MUX_CFG(DM646X, ATAEN, 0, 0, 5, 1, true) |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 431 | |
| 432 | MUX_CFG(DM646X, AUDCK1, 0, 29, 1, 0, false) |
| 433 | |
| 434 | MUX_CFG(DM646X, AUDCK0, 0, 28, 1, 0, false) |
| 435 | |
| 436 | MUX_CFG(DM646X, CRGMUX, 0, 24, 7, 5, true) |
| 437 | |
| 438 | MUX_CFG(DM646X, STSOMUX_DISABLE, 0, 22, 3, 0, true) |
| 439 | |
| 440 | MUX_CFG(DM646X, STSIMUX_DISABLE, 0, 20, 3, 0, true) |
| 441 | |
| 442 | MUX_CFG(DM646X, PTSOMUX_DISABLE, 0, 18, 3, 0, true) |
| 443 | |
| 444 | MUX_CFG(DM646X, PTSIMUX_DISABLE, 0, 16, 3, 0, true) |
| 445 | |
| 446 | MUX_CFG(DM646X, STSOMUX, 0, 22, 3, 2, true) |
| 447 | |
| 448 | MUX_CFG(DM646X, STSIMUX, 0, 20, 3, 2, true) |
| 449 | |
| 450 | MUX_CFG(DM646X, PTSOMUX_PARALLEL, 0, 18, 3, 2, true) |
| 451 | |
| 452 | MUX_CFG(DM646X, PTSIMUX_PARALLEL, 0, 16, 3, 2, true) |
| 453 | |
| 454 | MUX_CFG(DM646X, PTSOMUX_SERIAL, 0, 18, 3, 3, true) |
| 455 | |
| 456 | MUX_CFG(DM646X, PTSIMUX_SERIAL, 0, 16, 3, 3, true) |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 457 | #endif |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 458 | }; |
| 459 | |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 460 | static u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = { |
| 461 | [IRQ_DM646X_VP_VERTINT0] = 7, |
| 462 | [IRQ_DM646X_VP_VERTINT1] = 7, |
| 463 | [IRQ_DM646X_VP_VERTINT2] = 7, |
| 464 | [IRQ_DM646X_VP_VERTINT3] = 7, |
| 465 | [IRQ_DM646X_VP_ERRINT] = 7, |
| 466 | [IRQ_DM646X_RESERVED_1] = 7, |
| 467 | [IRQ_DM646X_RESERVED_2] = 7, |
| 468 | [IRQ_DM646X_WDINT] = 7, |
| 469 | [IRQ_DM646X_CRGENINT0] = 7, |
| 470 | [IRQ_DM646X_CRGENINT1] = 7, |
| 471 | [IRQ_DM646X_TSIFINT0] = 7, |
| 472 | [IRQ_DM646X_TSIFINT1] = 7, |
| 473 | [IRQ_DM646X_VDCEINT] = 7, |
| 474 | [IRQ_DM646X_USBINT] = 7, |
| 475 | [IRQ_DM646X_USBDMAINT] = 7, |
| 476 | [IRQ_DM646X_PCIINT] = 7, |
| 477 | [IRQ_CCINT0] = 7, /* dma */ |
| 478 | [IRQ_CCERRINT] = 7, /* dma */ |
| 479 | [IRQ_TCERRINT0] = 7, /* dma */ |
| 480 | [IRQ_TCERRINT] = 7, /* dma */ |
| 481 | [IRQ_DM646X_TCERRINT2] = 7, |
| 482 | [IRQ_DM646X_TCERRINT3] = 7, |
| 483 | [IRQ_DM646X_IDE] = 7, |
| 484 | [IRQ_DM646X_HPIINT] = 7, |
| 485 | [IRQ_DM646X_EMACRXTHINT] = 7, |
| 486 | [IRQ_DM646X_EMACRXINT] = 7, |
| 487 | [IRQ_DM646X_EMACTXINT] = 7, |
| 488 | [IRQ_DM646X_EMACMISCINT] = 7, |
| 489 | [IRQ_DM646X_MCASP0TXINT] = 7, |
| 490 | [IRQ_DM646X_MCASP0RXINT] = 7, |
| 491 | [IRQ_AEMIFINT] = 7, |
| 492 | [IRQ_DM646X_RESERVED_3] = 7, |
| 493 | [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */ |
| 494 | [IRQ_TINT0_TINT34] = 7, /* clocksource */ |
| 495 | [IRQ_TINT1_TINT12] = 7, /* DSP timer */ |
| 496 | [IRQ_TINT1_TINT34] = 7, /* system tick */ |
| 497 | [IRQ_PWMINT0] = 7, |
| 498 | [IRQ_PWMINT1] = 7, |
| 499 | [IRQ_DM646X_VLQINT] = 7, |
| 500 | [IRQ_I2C] = 7, |
| 501 | [IRQ_UARTINT0] = 7, |
| 502 | [IRQ_UARTINT1] = 7, |
| 503 | [IRQ_DM646X_UARTINT2] = 7, |
| 504 | [IRQ_DM646X_SPINT0] = 7, |
| 505 | [IRQ_DM646X_SPINT1] = 7, |
| 506 | [IRQ_DM646X_DSP2ARMINT] = 7, |
| 507 | [IRQ_DM646X_RESERVED_4] = 7, |
| 508 | [IRQ_DM646X_PSCINT] = 7, |
| 509 | [IRQ_DM646X_GPIO0] = 7, |
| 510 | [IRQ_DM646X_GPIO1] = 7, |
| 511 | [IRQ_DM646X_GPIO2] = 7, |
| 512 | [IRQ_DM646X_GPIO3] = 7, |
| 513 | [IRQ_DM646X_GPIO4] = 7, |
| 514 | [IRQ_DM646X_GPIO5] = 7, |
| 515 | [IRQ_DM646X_GPIO6] = 7, |
| 516 | [IRQ_DM646X_GPIO7] = 7, |
| 517 | [IRQ_DM646X_GPIOBNK0] = 7, |
| 518 | [IRQ_DM646X_GPIOBNK1] = 7, |
| 519 | [IRQ_DM646X_GPIOBNK2] = 7, |
| 520 | [IRQ_DM646X_DDRINT] = 7, |
| 521 | [IRQ_DM646X_AEMIFINT] = 7, |
| 522 | [IRQ_COMMTX] = 7, |
| 523 | [IRQ_COMMRX] = 7, |
| 524 | [IRQ_EMUINT] = 7, |
| 525 | }; |
| 526 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 527 | /*----------------------------------------------------------------------*/ |
| 528 | |
Sudhakar Rajashekhara | 60902a2 | 2009-05-21 07:41:35 -0400 | [diff] [blame] | 529 | /* Four Transfer Controllers on DM646x */ |
| 530 | static const s8 |
| 531 | dm646x_queue_tc_mapping[][2] = { |
| 532 | /* {event queue no, TC no} */ |
| 533 | {0, 0}, |
| 534 | {1, 1}, |
| 535 | {2, 2}, |
| 536 | {3, 3}, |
| 537 | {-1, -1}, |
| 538 | }; |
| 539 | |
| 540 | static const s8 |
| 541 | dm646x_queue_priority_mapping[][2] = { |
| 542 | /* {event queue no, Priority} */ |
| 543 | {0, 4}, |
| 544 | {1, 0}, |
| 545 | {2, 5}, |
| 546 | {3, 1}, |
| 547 | {-1, -1}, |
| 548 | }; |
| 549 | |
Sekhar Nori | bc3ac9f | 2010-06-29 11:35:12 +0530 | [diff] [blame] | 550 | static struct edma_soc_info edma_cc0_info = { |
| 551 | .n_channel = 64, |
| 552 | .n_region = 6, /* 0-1, 4-7 */ |
| 553 | .n_slot = 512, |
| 554 | .n_tc = 4, |
| 555 | .n_cc = 1, |
| 556 | .queue_tc_mapping = dm646x_queue_tc_mapping, |
| 557 | .queue_priority_mapping = dm646x_queue_priority_mapping, |
Ido Yariv | f23fe85 | 2011-07-10 16:14:35 +0300 | [diff] [blame] | 558 | .default_queue = EVENTQ_1, |
Sekhar Nori | bc3ac9f | 2010-06-29 11:35:12 +0530 | [diff] [blame] | 559 | }; |
| 560 | |
| 561 | static struct edma_soc_info *dm646x_edma_info[EDMA_MAX_CC] = { |
| 562 | &edma_cc0_info, |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 563 | }; |
| 564 | |
| 565 | static struct resource edma_resources[] = { |
| 566 | { |
Sudhakar Rajashekhara | 60902a2 | 2009-05-21 07:41:35 -0400 | [diff] [blame] | 567 | .name = "edma_cc0", |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 568 | .start = 0x01c00000, |
| 569 | .end = 0x01c00000 + SZ_64K - 1, |
| 570 | .flags = IORESOURCE_MEM, |
| 571 | }, |
| 572 | { |
| 573 | .name = "edma_tc0", |
| 574 | .start = 0x01c10000, |
| 575 | .end = 0x01c10000 + SZ_1K - 1, |
| 576 | .flags = IORESOURCE_MEM, |
| 577 | }, |
| 578 | { |
| 579 | .name = "edma_tc1", |
| 580 | .start = 0x01c10400, |
| 581 | .end = 0x01c10400 + SZ_1K - 1, |
| 582 | .flags = IORESOURCE_MEM, |
| 583 | }, |
| 584 | { |
| 585 | .name = "edma_tc2", |
| 586 | .start = 0x01c10800, |
| 587 | .end = 0x01c10800 + SZ_1K - 1, |
| 588 | .flags = IORESOURCE_MEM, |
| 589 | }, |
| 590 | { |
| 591 | .name = "edma_tc3", |
| 592 | .start = 0x01c10c00, |
| 593 | .end = 0x01c10c00 + SZ_1K - 1, |
| 594 | .flags = IORESOURCE_MEM, |
| 595 | }, |
| 596 | { |
Sudhakar Rajashekhara | 60902a2 | 2009-05-21 07:41:35 -0400 | [diff] [blame] | 597 | .name = "edma0", |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 598 | .start = IRQ_CCINT0, |
| 599 | .flags = IORESOURCE_IRQ, |
| 600 | }, |
| 601 | { |
Sudhakar Rajashekhara | 60902a2 | 2009-05-21 07:41:35 -0400 | [diff] [blame] | 602 | .name = "edma0_err", |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 603 | .start = IRQ_CCERRINT, |
| 604 | .flags = IORESOURCE_IRQ, |
| 605 | }, |
| 606 | /* not using TC*_ERR */ |
| 607 | }; |
| 608 | |
| 609 | static struct platform_device dm646x_edma_device = { |
| 610 | .name = "edma", |
Sudhakar Rajashekhara | 60902a2 | 2009-05-21 07:41:35 -0400 | [diff] [blame] | 611 | .id = 0, |
| 612 | .dev.platform_data = dm646x_edma_info, |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 613 | .num_resources = ARRAY_SIZE(edma_resources), |
| 614 | .resource = edma_resources, |
| 615 | }; |
| 616 | |
Chaithrika U S | 25acf55 | 2009-06-05 06:28:08 -0400 | [diff] [blame] | 617 | static struct resource dm646x_mcasp0_resources[] = { |
| 618 | { |
| 619 | .name = "mcasp0", |
| 620 | .start = DAVINCI_DM646X_MCASP0_REG_BASE, |
| 621 | .end = DAVINCI_DM646X_MCASP0_REG_BASE + (SZ_1K << 1) - 1, |
| 622 | .flags = IORESOURCE_MEM, |
| 623 | }, |
| 624 | /* first TX, then RX */ |
| 625 | { |
| 626 | .start = DAVINCI_DM646X_DMA_MCASP0_AXEVT0, |
| 627 | .end = DAVINCI_DM646X_DMA_MCASP0_AXEVT0, |
| 628 | .flags = IORESOURCE_DMA, |
| 629 | }, |
| 630 | { |
| 631 | .start = DAVINCI_DM646X_DMA_MCASP0_AREVT0, |
| 632 | .end = DAVINCI_DM646X_DMA_MCASP0_AREVT0, |
| 633 | .flags = IORESOURCE_DMA, |
| 634 | }, |
| 635 | }; |
| 636 | |
| 637 | static struct resource dm646x_mcasp1_resources[] = { |
| 638 | { |
| 639 | .name = "mcasp1", |
| 640 | .start = DAVINCI_DM646X_MCASP1_REG_BASE, |
| 641 | .end = DAVINCI_DM646X_MCASP1_REG_BASE + (SZ_1K << 1) - 1, |
| 642 | .flags = IORESOURCE_MEM, |
| 643 | }, |
| 644 | /* DIT mode, only TX event */ |
| 645 | { |
| 646 | .start = DAVINCI_DM646X_DMA_MCASP1_AXEVT1, |
| 647 | .end = DAVINCI_DM646X_DMA_MCASP1_AXEVT1, |
| 648 | .flags = IORESOURCE_DMA, |
| 649 | }, |
| 650 | /* DIT mode, dummy entry */ |
| 651 | { |
| 652 | .start = -1, |
| 653 | .end = -1, |
| 654 | .flags = IORESOURCE_DMA, |
| 655 | }, |
| 656 | }; |
| 657 | |
| 658 | static struct platform_device dm646x_mcasp0_device = { |
| 659 | .name = "davinci-mcasp", |
| 660 | .id = 0, |
| 661 | .num_resources = ARRAY_SIZE(dm646x_mcasp0_resources), |
| 662 | .resource = dm646x_mcasp0_resources, |
| 663 | }; |
| 664 | |
| 665 | static struct platform_device dm646x_mcasp1_device = { |
| 666 | .name = "davinci-mcasp", |
| 667 | .id = 1, |
| 668 | .num_resources = ARRAY_SIZE(dm646x_mcasp1_resources), |
| 669 | .resource = dm646x_mcasp1_resources, |
| 670 | }; |
| 671 | |
| 672 | static struct platform_device dm646x_dit_device = { |
| 673 | .name = "spdif-dit", |
| 674 | .id = -1, |
| 675 | }; |
| 676 | |
Muralidharan Karicheri | 85609c1 | 2009-09-16 13:15:30 -0400 | [diff] [blame] | 677 | static u64 vpif_dma_mask = DMA_BIT_MASK(32); |
| 678 | |
| 679 | static struct resource vpif_resource[] = { |
| 680 | { |
| 681 | .start = DAVINCI_VPIF_BASE, |
| 682 | .end = DAVINCI_VPIF_BASE + 0x03ff, |
| 683 | .flags = IORESOURCE_MEM, |
| 684 | } |
| 685 | }; |
| 686 | |
| 687 | static struct platform_device vpif_dev = { |
| 688 | .name = "vpif", |
| 689 | .id = -1, |
| 690 | .dev = { |
| 691 | .dma_mask = &vpif_dma_mask, |
| 692 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 693 | }, |
| 694 | .resource = vpif_resource, |
| 695 | .num_resources = ARRAY_SIZE(vpif_resource), |
| 696 | }; |
| 697 | |
| 698 | static struct resource vpif_display_resource[] = { |
| 699 | { |
| 700 | .start = IRQ_DM646X_VP_VERTINT2, |
| 701 | .end = IRQ_DM646X_VP_VERTINT2, |
| 702 | .flags = IORESOURCE_IRQ, |
| 703 | }, |
| 704 | { |
| 705 | .start = IRQ_DM646X_VP_VERTINT3, |
| 706 | .end = IRQ_DM646X_VP_VERTINT3, |
| 707 | .flags = IORESOURCE_IRQ, |
| 708 | }, |
| 709 | }; |
| 710 | |
| 711 | static struct platform_device vpif_display_dev = { |
| 712 | .name = "vpif_display", |
| 713 | .id = -1, |
| 714 | .dev = { |
| 715 | .dma_mask = &vpif_dma_mask, |
| 716 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 717 | }, |
| 718 | .resource = vpif_display_resource, |
| 719 | .num_resources = ARRAY_SIZE(vpif_display_resource), |
| 720 | }; |
| 721 | |
| 722 | static struct resource vpif_capture_resource[] = { |
| 723 | { |
| 724 | .start = IRQ_DM646X_VP_VERTINT0, |
| 725 | .end = IRQ_DM646X_VP_VERTINT0, |
| 726 | .flags = IORESOURCE_IRQ, |
| 727 | }, |
| 728 | { |
| 729 | .start = IRQ_DM646X_VP_VERTINT1, |
| 730 | .end = IRQ_DM646X_VP_VERTINT1, |
| 731 | .flags = IORESOURCE_IRQ, |
| 732 | }, |
| 733 | }; |
| 734 | |
| 735 | static struct platform_device vpif_capture_dev = { |
| 736 | .name = "vpif_capture", |
| 737 | .id = -1, |
| 738 | .dev = { |
| 739 | .dma_mask = &vpif_dma_mask, |
| 740 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 741 | }, |
| 742 | .resource = vpif_capture_resource, |
| 743 | .num_resources = ARRAY_SIZE(vpif_capture_resource), |
| 744 | }; |
| 745 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 746 | /*----------------------------------------------------------------------*/ |
| 747 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 748 | static struct map_desc dm646x_io_desc[] = { |
| 749 | { |
| 750 | .virtual = IO_VIRT, |
| 751 | .pfn = __phys_to_pfn(IO_PHYS), |
| 752 | .length = IO_SIZE, |
| 753 | .type = MT_DEVICE |
| 754 | }, |
David Brownell | 0d04eb4 | 2009-04-30 17:35:48 -0700 | [diff] [blame] | 755 | { |
| 756 | .virtual = SRAM_VIRT, |
| 757 | .pfn = __phys_to_pfn(0x00010000), |
| 758 | .length = SZ_32K, |
Santosh Shilimkar | 2de5c00 | 2010-09-24 07:21:05 +0100 | [diff] [blame] | 759 | .type = MT_MEMORY_NONCACHED, |
David Brownell | 0d04eb4 | 2009-04-30 17:35:48 -0700 | [diff] [blame] | 760 | }, |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 761 | }; |
| 762 | |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 763 | /* Contents of JTAG ID register used to identify exact cpu type */ |
| 764 | static struct davinci_id dm646x_ids[] = { |
| 765 | { |
| 766 | .variant = 0x0, |
| 767 | .part_no = 0xb770, |
| 768 | .manufacturer = 0x017, |
| 769 | .cpu_id = DAVINCI_CPU_ID_DM6467, |
Hemant Pedanekar | f63dd12 | 2009-09-02 16:49:35 +0530 | [diff] [blame] | 770 | .name = "dm6467_rev1.x", |
| 771 | }, |
| 772 | { |
| 773 | .variant = 0x1, |
| 774 | .part_no = 0xb770, |
| 775 | .manufacturer = 0x017, |
| 776 | .cpu_id = DAVINCI_CPU_ID_DM6467, |
| 777 | .name = "dm6467_rev3.x", |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 778 | }, |
| 779 | }; |
| 780 | |
Cyril Chemparathy | e4c822c | 2010-05-07 17:06:36 -0400 | [diff] [blame] | 781 | static u32 dm646x_psc_bases[] = { DAVINCI_PWR_SLEEP_CNTRL_BASE }; |
Mark A. Greer | d81d188 | 2009-04-15 12:39:33 -0700 | [diff] [blame] | 782 | |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 783 | /* |
| 784 | * T0_BOT: Timer 0, bottom: clockevent source for hrtimers |
| 785 | * T0_TOP: Timer 0, top : clocksource for generic timekeeping |
| 786 | * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code) |
| 787 | * T1_TOP: Timer 1, top : <unused> |
| 788 | */ |
Kevin Hilman | 28552c2 | 2010-02-25 15:36:38 -0800 | [diff] [blame] | 789 | static struct davinci_timer_info dm646x_timer_info = { |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 790 | .timers = davinci_timer_instance, |
| 791 | .clockevent_id = T0_BOT, |
| 792 | .clocksource_id = T0_TOP, |
| 793 | }; |
| 794 | |
Mark A. Greer | 65e866a | 2009-03-18 12:36:08 -0500 | [diff] [blame] | 795 | static struct plat_serial8250_port dm646x_serial_platform_data[] = { |
| 796 | { |
| 797 | .mapbase = DAVINCI_UART0_BASE, |
| 798 | .irq = IRQ_UARTINT0, |
| 799 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
| 800 | UPF_IOREMAP, |
| 801 | .iotype = UPIO_MEM32, |
| 802 | .regshift = 2, |
| 803 | }, |
| 804 | { |
| 805 | .mapbase = DAVINCI_UART1_BASE, |
| 806 | .irq = IRQ_UARTINT1, |
| 807 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
| 808 | UPF_IOREMAP, |
| 809 | .iotype = UPIO_MEM32, |
| 810 | .regshift = 2, |
| 811 | }, |
| 812 | { |
| 813 | .mapbase = DAVINCI_UART2_BASE, |
| 814 | .irq = IRQ_DM646X_UARTINT2, |
| 815 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | |
| 816 | UPF_IOREMAP, |
| 817 | .iotype = UPIO_MEM32, |
| 818 | .regshift = 2, |
| 819 | }, |
| 820 | { |
| 821 | .flags = 0 |
| 822 | }, |
| 823 | }; |
| 824 | |
| 825 | static struct platform_device dm646x_serial_device = { |
| 826 | .name = "serial8250", |
| 827 | .id = PLAT8250_DEV_PLATFORM, |
| 828 | .dev = { |
| 829 | .platform_data = dm646x_serial_platform_data, |
| 830 | }, |
| 831 | }; |
| 832 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 833 | static struct davinci_soc_info davinci_soc_info_dm646x = { |
| 834 | .io_desc = dm646x_io_desc, |
| 835 | .io_desc_num = ARRAY_SIZE(dm646x_io_desc), |
Cyril Chemparathy | 3347db8 | 2010-05-07 17:06:34 -0400 | [diff] [blame] | 836 | .jtag_id_reg = 0x01c40028, |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 837 | .ids = dm646x_ids, |
| 838 | .ids_num = ARRAY_SIZE(dm646x_ids), |
Mark A. Greer | 66e0c39 | 2009-04-15 12:39:23 -0700 | [diff] [blame] | 839 | .cpu_clks = dm646x_clks, |
Mark A. Greer | d81d188 | 2009-04-15 12:39:33 -0700 | [diff] [blame] | 840 | .psc_bases = dm646x_psc_bases, |
| 841 | .psc_bases_num = ARRAY_SIZE(dm646x_psc_bases), |
Cyril Chemparathy | 779b0d5 | 2010-05-07 17:06:38 -0400 | [diff] [blame] | 842 | .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 843 | .pinmux_pins = dm646x_pins, |
| 844 | .pinmux_pins_num = ARRAY_SIZE(dm646x_pins), |
Cyril Chemparathy | bd80894 | 2010-05-07 17:06:37 -0400 | [diff] [blame] | 845 | .intc_base = DAVINCI_ARM_INTC_BASE, |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 846 | .intc_type = DAVINCI_INTC_TYPE_AINTC, |
| 847 | .intc_irq_prios = dm646x_default_priorities, |
| 848 | .intc_irq_num = DAVINCI_N_AINTC_IRQ, |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame] | 849 | .timer_info = &dm646x_timer_info, |
Cyril Chemparathy | 686b634 | 2010-05-01 18:37:54 -0400 | [diff] [blame] | 850 | .gpio_type = GPIO_TYPE_DAVINCI, |
Cyril Chemparathy | b8d4429 | 2010-05-07 17:06:32 -0400 | [diff] [blame] | 851 | .gpio_base = DAVINCI_GPIO_BASE, |
Mark A. Greer | a994955 | 2009-04-15 12:40:35 -0700 | [diff] [blame] | 852 | .gpio_num = 43, /* Only 33 usable */ |
| 853 | .gpio_irq = IRQ_DM646X_GPIOBNK0, |
Mark A. Greer | 65e866a | 2009-03-18 12:36:08 -0500 | [diff] [blame] | 854 | .serial_dev = &dm646x_serial_device, |
Mark A. Greer | 972412b | 2009-04-15 12:40:56 -0700 | [diff] [blame] | 855 | .emac_pdata = &dm646x_emac_pdata, |
David Brownell | 0d04eb4 | 2009-04-30 17:35:48 -0700 | [diff] [blame] | 856 | .sram_dma = 0x10010000, |
| 857 | .sram_len = SZ_32K, |
Cyril Chemparathy | c78a5bc | 2010-05-01 18:38:28 -0400 | [diff] [blame] | 858 | .reset_device = &davinci_wdt_device, |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 859 | }; |
| 860 | |
Chaithrika U S | 25acf55 | 2009-06-05 06:28:08 -0400 | [diff] [blame] | 861 | void __init dm646x_init_mcasp0(struct snd_platform_data *pdata) |
| 862 | { |
| 863 | dm646x_mcasp0_device.dev.platform_data = pdata; |
| 864 | platform_device_register(&dm646x_mcasp0_device); |
| 865 | } |
| 866 | |
| 867 | void __init dm646x_init_mcasp1(struct snd_platform_data *pdata) |
| 868 | { |
| 869 | dm646x_mcasp1_device.dev.platform_data = pdata; |
| 870 | platform_device_register(&dm646x_mcasp1_device); |
| 871 | platform_device_register(&dm646x_dit_device); |
| 872 | } |
| 873 | |
Muralidharan Karicheri | 85609c1 | 2009-09-16 13:15:30 -0400 | [diff] [blame] | 874 | void dm646x_setup_vpif(struct vpif_display_config *display_config, |
| 875 | struct vpif_capture_config *capture_config) |
| 876 | { |
| 877 | unsigned int value; |
| 878 | void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE); |
| 879 | |
| 880 | value = __raw_readl(base + VSCLKDIS_OFFSET); |
| 881 | value &= ~VSCLKDIS_MASK; |
| 882 | __raw_writel(value, base + VSCLKDIS_OFFSET); |
| 883 | |
| 884 | value = __raw_readl(base + VDD3P3V_PWDN_OFFSET); |
| 885 | value &= ~VDD3P3V_VID_MASK; |
| 886 | __raw_writel(value, base + VDD3P3V_PWDN_OFFSET); |
| 887 | |
| 888 | davinci_cfg_reg(DM646X_STSOMUX_DISABLE); |
| 889 | davinci_cfg_reg(DM646X_STSIMUX_DISABLE); |
| 890 | davinci_cfg_reg(DM646X_PTSOMUX_DISABLE); |
| 891 | davinci_cfg_reg(DM646X_PTSIMUX_DISABLE); |
| 892 | |
| 893 | vpif_display_dev.dev.platform_data = display_config; |
| 894 | vpif_capture_dev.dev.platform_data = capture_config; |
| 895 | platform_device_register(&vpif_dev); |
| 896 | platform_device_register(&vpif_display_dev); |
| 897 | platform_device_register(&vpif_capture_dev); |
| 898 | } |
| 899 | |
Rajashekhara, Sudhakar | cce3ddd | 2010-06-29 11:35:15 +0530 | [diff] [blame] | 900 | int __init dm646x_init_edma(struct edma_rsv_info *rsv) |
| 901 | { |
| 902 | edma_cc0_info.rsv = rsv; |
| 903 | |
| 904 | return platform_device_register(&dm646x_edma_device); |
| 905 | } |
| 906 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 907 | void __init dm646x_init(void) |
| 908 | { |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 909 | davinci_common_init(&davinci_soc_info_dm646x); |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | static int __init dm646x_init_devices(void) |
| 913 | { |
| 914 | if (!cpu_is_davinci_dm646x()) |
| 915 | return 0; |
| 916 | |
Cyril Chemparathy | d22960c | 2010-09-15 10:11:22 -0400 | [diff] [blame] | 917 | platform_device_register(&dm646x_mdio_device); |
Mark A. Greer | 972412b | 2009-04-15 12:40:56 -0700 | [diff] [blame] | 918 | platform_device_register(&dm646x_emac_device); |
Cyril Chemparathy | d22960c | 2010-09-15 10:11:22 -0400 | [diff] [blame] | 919 | clk_add_alias(NULL, dev_name(&dm646x_mdio_device.dev), |
| 920 | NULL, &dm646x_emac_device.dev); |
| 921 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 922 | return 0; |
| 923 | } |
| 924 | postcore_initcall(dm646x_init_devices); |