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 | */ |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/clk.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 16 | #include <asm/mach/map.h> |
| 17 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 18 | #include <mach/dm646x.h> |
| 19 | #include <mach/clock.h> |
| 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 | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 26 | #include <mach/common.h> |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 27 | |
| 28 | #include "clock.h" |
| 29 | #include "mux.h" |
| 30 | |
| 31 | /* |
| 32 | * Device specific clocks |
| 33 | */ |
| 34 | #define DM646X_REF_FREQ 27000000 |
| 35 | #define DM646X_AUX_FREQ 24000000 |
| 36 | |
| 37 | static struct pll_data pll1_data = { |
| 38 | .num = 1, |
| 39 | .phys_base = DAVINCI_PLL1_BASE, |
| 40 | }; |
| 41 | |
| 42 | static struct pll_data pll2_data = { |
| 43 | .num = 2, |
| 44 | .phys_base = DAVINCI_PLL2_BASE, |
| 45 | }; |
| 46 | |
| 47 | static struct clk ref_clk = { |
| 48 | .name = "ref_clk", |
| 49 | .rate = DM646X_REF_FREQ, |
| 50 | }; |
| 51 | |
| 52 | static struct clk aux_clkin = { |
| 53 | .name = "aux_clkin", |
| 54 | .rate = DM646X_AUX_FREQ, |
| 55 | }; |
| 56 | |
| 57 | static struct clk pll1_clk = { |
| 58 | .name = "pll1", |
| 59 | .parent = &ref_clk, |
| 60 | .pll_data = &pll1_data, |
| 61 | .flags = CLK_PLL, |
| 62 | }; |
| 63 | |
| 64 | static struct clk pll1_sysclk1 = { |
| 65 | .name = "pll1_sysclk1", |
| 66 | .parent = &pll1_clk, |
| 67 | .flags = CLK_PLL, |
| 68 | .div_reg = PLLDIV1, |
| 69 | }; |
| 70 | |
| 71 | static struct clk pll1_sysclk2 = { |
| 72 | .name = "pll1_sysclk2", |
| 73 | .parent = &pll1_clk, |
| 74 | .flags = CLK_PLL, |
| 75 | .div_reg = PLLDIV2, |
| 76 | }; |
| 77 | |
| 78 | static struct clk pll1_sysclk3 = { |
| 79 | .name = "pll1_sysclk3", |
| 80 | .parent = &pll1_clk, |
| 81 | .flags = CLK_PLL, |
| 82 | .div_reg = PLLDIV3, |
| 83 | }; |
| 84 | |
| 85 | static struct clk pll1_sysclk4 = { |
| 86 | .name = "pll1_sysclk4", |
| 87 | .parent = &pll1_clk, |
| 88 | .flags = CLK_PLL, |
| 89 | .div_reg = PLLDIV4, |
| 90 | }; |
| 91 | |
| 92 | static struct clk pll1_sysclk5 = { |
| 93 | .name = "pll1_sysclk5", |
| 94 | .parent = &pll1_clk, |
| 95 | .flags = CLK_PLL, |
| 96 | .div_reg = PLLDIV5, |
| 97 | }; |
| 98 | |
| 99 | static struct clk pll1_sysclk6 = { |
| 100 | .name = "pll1_sysclk6", |
| 101 | .parent = &pll1_clk, |
| 102 | .flags = CLK_PLL, |
| 103 | .div_reg = PLLDIV6, |
| 104 | }; |
| 105 | |
| 106 | static struct clk pll1_sysclk8 = { |
| 107 | .name = "pll1_sysclk8", |
| 108 | .parent = &pll1_clk, |
| 109 | .flags = CLK_PLL, |
| 110 | .div_reg = PLLDIV8, |
| 111 | }; |
| 112 | |
| 113 | static struct clk pll1_sysclk9 = { |
| 114 | .name = "pll1_sysclk9", |
| 115 | .parent = &pll1_clk, |
| 116 | .flags = CLK_PLL, |
| 117 | .div_reg = PLLDIV9, |
| 118 | }; |
| 119 | |
| 120 | static struct clk pll1_sysclkbp = { |
| 121 | .name = "pll1_sysclkbp", |
| 122 | .parent = &pll1_clk, |
| 123 | .flags = CLK_PLL | PRE_PLL, |
| 124 | .div_reg = BPDIV, |
| 125 | }; |
| 126 | |
| 127 | static struct clk pll1_aux_clk = { |
| 128 | .name = "pll1_aux_clk", |
| 129 | .parent = &pll1_clk, |
| 130 | .flags = CLK_PLL | PRE_PLL, |
| 131 | }; |
| 132 | |
| 133 | static struct clk pll2_clk = { |
| 134 | .name = "pll2_clk", |
| 135 | .parent = &ref_clk, |
| 136 | .pll_data = &pll2_data, |
| 137 | .flags = CLK_PLL, |
| 138 | }; |
| 139 | |
| 140 | static struct clk pll2_sysclk1 = { |
| 141 | .name = "pll2_sysclk1", |
| 142 | .parent = &pll2_clk, |
| 143 | .flags = CLK_PLL, |
| 144 | .div_reg = PLLDIV1, |
| 145 | }; |
| 146 | |
| 147 | static struct clk dsp_clk = { |
| 148 | .name = "dsp", |
| 149 | .parent = &pll1_sysclk1, |
| 150 | .lpsc = DM646X_LPSC_C64X_CPU, |
| 151 | .flags = PSC_DSP, |
| 152 | .usecount = 1, /* REVISIT how to disable? */ |
| 153 | }; |
| 154 | |
| 155 | static struct clk arm_clk = { |
| 156 | .name = "arm", |
| 157 | .parent = &pll1_sysclk2, |
| 158 | .lpsc = DM646X_LPSC_ARM, |
| 159 | .flags = ALWAYS_ENABLED, |
| 160 | }; |
| 161 | |
| 162 | static struct clk uart0_clk = { |
| 163 | .name = "uart0", |
| 164 | .parent = &aux_clkin, |
| 165 | .lpsc = DM646X_LPSC_UART0, |
| 166 | }; |
| 167 | |
| 168 | static struct clk uart1_clk = { |
| 169 | .name = "uart1", |
| 170 | .parent = &aux_clkin, |
| 171 | .lpsc = DM646X_LPSC_UART1, |
| 172 | }; |
| 173 | |
| 174 | static struct clk uart2_clk = { |
| 175 | .name = "uart2", |
| 176 | .parent = &aux_clkin, |
| 177 | .lpsc = DM646X_LPSC_UART2, |
| 178 | }; |
| 179 | |
| 180 | static struct clk i2c_clk = { |
| 181 | .name = "I2CCLK", |
| 182 | .parent = &pll1_sysclk3, |
| 183 | .lpsc = DM646X_LPSC_I2C, |
| 184 | }; |
| 185 | |
| 186 | static struct clk gpio_clk = { |
| 187 | .name = "gpio", |
| 188 | .parent = &pll1_sysclk3, |
| 189 | .lpsc = DM646X_LPSC_GPIO, |
| 190 | }; |
| 191 | |
| 192 | static struct clk aemif_clk = { |
| 193 | .name = "aemif", |
| 194 | .parent = &pll1_sysclk3, |
| 195 | .lpsc = DM646X_LPSC_AEMIF, |
| 196 | .flags = ALWAYS_ENABLED, |
| 197 | }; |
| 198 | |
| 199 | static struct clk emac_clk = { |
| 200 | .name = "emac", |
| 201 | .parent = &pll1_sysclk3, |
| 202 | .lpsc = DM646X_LPSC_EMAC, |
| 203 | }; |
| 204 | |
| 205 | static struct clk pwm0_clk = { |
| 206 | .name = "pwm0", |
| 207 | .parent = &pll1_sysclk3, |
| 208 | .lpsc = DM646X_LPSC_PWM0, |
| 209 | .usecount = 1, /* REVIST: disabling hangs system */ |
| 210 | }; |
| 211 | |
| 212 | static struct clk pwm1_clk = { |
| 213 | .name = "pwm1", |
| 214 | .parent = &pll1_sysclk3, |
| 215 | .lpsc = DM646X_LPSC_PWM1, |
| 216 | .usecount = 1, /* REVIST: disabling hangs system */ |
| 217 | }; |
| 218 | |
| 219 | static struct clk timer0_clk = { |
| 220 | .name = "timer0", |
| 221 | .parent = &pll1_sysclk3, |
| 222 | .lpsc = DM646X_LPSC_TIMER0, |
| 223 | }; |
| 224 | |
| 225 | static struct clk timer1_clk = { |
| 226 | .name = "timer1", |
| 227 | .parent = &pll1_sysclk3, |
| 228 | .lpsc = DM646X_LPSC_TIMER1, |
| 229 | }; |
| 230 | |
| 231 | static struct clk timer2_clk = { |
| 232 | .name = "timer2", |
| 233 | .parent = &pll1_sysclk3, |
| 234 | .flags = ALWAYS_ENABLED, /* no LPSC, always enabled; c.f. spruep9a */ |
| 235 | }; |
| 236 | |
| 237 | static struct clk vpif0_clk = { |
| 238 | .name = "vpif0", |
| 239 | .parent = &ref_clk, |
| 240 | .lpsc = DM646X_LPSC_VPSSMSTR, |
| 241 | .flags = ALWAYS_ENABLED, |
| 242 | }; |
| 243 | |
| 244 | static struct clk vpif1_clk = { |
| 245 | .name = "vpif1", |
| 246 | .parent = &ref_clk, |
| 247 | .lpsc = DM646X_LPSC_VPSSSLV, |
| 248 | .flags = ALWAYS_ENABLED, |
| 249 | }; |
| 250 | |
| 251 | struct davinci_clk dm646x_clks[] = { |
| 252 | CLK(NULL, "ref", &ref_clk), |
| 253 | CLK(NULL, "aux", &aux_clkin), |
| 254 | CLK(NULL, "pll1", &pll1_clk), |
| 255 | CLK(NULL, "pll1_sysclk", &pll1_sysclk1), |
| 256 | CLK(NULL, "pll1_sysclk", &pll1_sysclk2), |
| 257 | CLK(NULL, "pll1_sysclk", &pll1_sysclk3), |
| 258 | CLK(NULL, "pll1_sysclk", &pll1_sysclk4), |
| 259 | CLK(NULL, "pll1_sysclk", &pll1_sysclk5), |
| 260 | CLK(NULL, "pll1_sysclk", &pll1_sysclk6), |
| 261 | CLK(NULL, "pll1_sysclk", &pll1_sysclk8), |
| 262 | CLK(NULL, "pll1_sysclk", &pll1_sysclk9), |
| 263 | CLK(NULL, "pll1_sysclk", &pll1_sysclkbp), |
| 264 | CLK(NULL, "pll1_aux", &pll1_aux_clk), |
| 265 | CLK(NULL, "pll2", &pll2_clk), |
| 266 | CLK(NULL, "pll2_sysclk1", &pll2_sysclk1), |
| 267 | CLK(NULL, "dsp", &dsp_clk), |
| 268 | CLK(NULL, "arm", &arm_clk), |
| 269 | CLK(NULL, "uart0", &uart0_clk), |
| 270 | CLK(NULL, "uart1", &uart1_clk), |
| 271 | CLK(NULL, "uart2", &uart2_clk), |
| 272 | CLK("i2c_davinci.1", NULL, &i2c_clk), |
| 273 | CLK(NULL, "gpio", &gpio_clk), |
| 274 | CLK(NULL, "aemif", &aemif_clk), |
| 275 | CLK("davinci_emac.1", NULL, &emac_clk), |
| 276 | CLK(NULL, "pwm0", &pwm0_clk), |
| 277 | CLK(NULL, "pwm1", &pwm1_clk), |
| 278 | CLK(NULL, "timer0", &timer0_clk), |
| 279 | CLK(NULL, "timer1", &timer1_clk), |
| 280 | CLK("watchdog", NULL, &timer2_clk), |
| 281 | CLK(NULL, "vpif0", &vpif0_clk), |
| 282 | CLK(NULL, "vpif1", &vpif1_clk), |
| 283 | CLK(NULL, NULL, NULL), |
| 284 | }; |
| 285 | |
Kevin Hilman | ac7b75b | 2009-05-07 06:19:40 -0700 | [diff] [blame] | 286 | #if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE) |
| 287 | static struct resource dm646x_emac_resources[] = { |
| 288 | { |
| 289 | .start = DM646X_EMAC_BASE, |
| 290 | .end = DM646X_EMAC_BASE + 0x47ff, |
| 291 | .flags = IORESOURCE_MEM, |
| 292 | }, |
| 293 | { |
| 294 | .start = IRQ_DM646X_EMACRXTHINT, |
| 295 | .end = IRQ_DM646X_EMACRXTHINT, |
| 296 | .flags = IORESOURCE_IRQ, |
| 297 | }, |
| 298 | { |
| 299 | .start = IRQ_DM646X_EMACRXINT, |
| 300 | .end = IRQ_DM646X_EMACRXINT, |
| 301 | .flags = IORESOURCE_IRQ, |
| 302 | }, |
| 303 | { |
| 304 | .start = IRQ_DM646X_EMACTXINT, |
| 305 | .end = IRQ_DM646X_EMACTXINT, |
| 306 | .flags = IORESOURCE_IRQ, |
| 307 | }, |
| 308 | { |
| 309 | .start = IRQ_DM646X_EMACMISCINT, |
| 310 | .end = IRQ_DM646X_EMACMISCINT, |
| 311 | .flags = IORESOURCE_IRQ, |
| 312 | }, |
| 313 | }; |
| 314 | |
| 315 | static struct platform_device dm646x_emac_device = { |
| 316 | .name = "davinci_emac", |
| 317 | .id = 1, |
| 318 | .num_resources = ARRAY_SIZE(dm646x_emac_resources), |
| 319 | .resource = dm646x_emac_resources, |
| 320 | }; |
| 321 | |
| 322 | #endif |
| 323 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 324 | /* |
| 325 | * Device specific mux setup |
| 326 | * |
| 327 | * soc description mux mode mode mux dbg |
| 328 | * reg offset mask mode |
| 329 | */ |
| 330 | static const struct mux_config dm646x_pins[] = { |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 331 | #ifdef CONFIG_DAVINCI_MUX |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 332 | MUX_CFG(DM646X, ATAEN, 0, 0, 1, 1, true) |
| 333 | |
| 334 | MUX_CFG(DM646X, AUDCK1, 0, 29, 1, 0, false) |
| 335 | |
| 336 | MUX_CFG(DM646X, AUDCK0, 0, 28, 1, 0, false) |
| 337 | |
| 338 | MUX_CFG(DM646X, CRGMUX, 0, 24, 7, 5, true) |
| 339 | |
| 340 | MUX_CFG(DM646X, STSOMUX_DISABLE, 0, 22, 3, 0, true) |
| 341 | |
| 342 | MUX_CFG(DM646X, STSIMUX_DISABLE, 0, 20, 3, 0, true) |
| 343 | |
| 344 | MUX_CFG(DM646X, PTSOMUX_DISABLE, 0, 18, 3, 0, true) |
| 345 | |
| 346 | MUX_CFG(DM646X, PTSIMUX_DISABLE, 0, 16, 3, 0, true) |
| 347 | |
| 348 | MUX_CFG(DM646X, STSOMUX, 0, 22, 3, 2, true) |
| 349 | |
| 350 | MUX_CFG(DM646X, STSIMUX, 0, 20, 3, 2, true) |
| 351 | |
| 352 | MUX_CFG(DM646X, PTSOMUX_PARALLEL, 0, 18, 3, 2, true) |
| 353 | |
| 354 | MUX_CFG(DM646X, PTSIMUX_PARALLEL, 0, 16, 3, 2, true) |
| 355 | |
| 356 | MUX_CFG(DM646X, PTSOMUX_SERIAL, 0, 18, 3, 3, true) |
| 357 | |
| 358 | MUX_CFG(DM646X, PTSIMUX_SERIAL, 0, 16, 3, 3, true) |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 359 | #endif |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 360 | }; |
| 361 | |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 362 | static u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = { |
| 363 | [IRQ_DM646X_VP_VERTINT0] = 7, |
| 364 | [IRQ_DM646X_VP_VERTINT1] = 7, |
| 365 | [IRQ_DM646X_VP_VERTINT2] = 7, |
| 366 | [IRQ_DM646X_VP_VERTINT3] = 7, |
| 367 | [IRQ_DM646X_VP_ERRINT] = 7, |
| 368 | [IRQ_DM646X_RESERVED_1] = 7, |
| 369 | [IRQ_DM646X_RESERVED_2] = 7, |
| 370 | [IRQ_DM646X_WDINT] = 7, |
| 371 | [IRQ_DM646X_CRGENINT0] = 7, |
| 372 | [IRQ_DM646X_CRGENINT1] = 7, |
| 373 | [IRQ_DM646X_TSIFINT0] = 7, |
| 374 | [IRQ_DM646X_TSIFINT1] = 7, |
| 375 | [IRQ_DM646X_VDCEINT] = 7, |
| 376 | [IRQ_DM646X_USBINT] = 7, |
| 377 | [IRQ_DM646X_USBDMAINT] = 7, |
| 378 | [IRQ_DM646X_PCIINT] = 7, |
| 379 | [IRQ_CCINT0] = 7, /* dma */ |
| 380 | [IRQ_CCERRINT] = 7, /* dma */ |
| 381 | [IRQ_TCERRINT0] = 7, /* dma */ |
| 382 | [IRQ_TCERRINT] = 7, /* dma */ |
| 383 | [IRQ_DM646X_TCERRINT2] = 7, |
| 384 | [IRQ_DM646X_TCERRINT3] = 7, |
| 385 | [IRQ_DM646X_IDE] = 7, |
| 386 | [IRQ_DM646X_HPIINT] = 7, |
| 387 | [IRQ_DM646X_EMACRXTHINT] = 7, |
| 388 | [IRQ_DM646X_EMACRXINT] = 7, |
| 389 | [IRQ_DM646X_EMACTXINT] = 7, |
| 390 | [IRQ_DM646X_EMACMISCINT] = 7, |
| 391 | [IRQ_DM646X_MCASP0TXINT] = 7, |
| 392 | [IRQ_DM646X_MCASP0RXINT] = 7, |
| 393 | [IRQ_AEMIFINT] = 7, |
| 394 | [IRQ_DM646X_RESERVED_3] = 7, |
| 395 | [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */ |
| 396 | [IRQ_TINT0_TINT34] = 7, /* clocksource */ |
| 397 | [IRQ_TINT1_TINT12] = 7, /* DSP timer */ |
| 398 | [IRQ_TINT1_TINT34] = 7, /* system tick */ |
| 399 | [IRQ_PWMINT0] = 7, |
| 400 | [IRQ_PWMINT1] = 7, |
| 401 | [IRQ_DM646X_VLQINT] = 7, |
| 402 | [IRQ_I2C] = 7, |
| 403 | [IRQ_UARTINT0] = 7, |
| 404 | [IRQ_UARTINT1] = 7, |
| 405 | [IRQ_DM646X_UARTINT2] = 7, |
| 406 | [IRQ_DM646X_SPINT0] = 7, |
| 407 | [IRQ_DM646X_SPINT1] = 7, |
| 408 | [IRQ_DM646X_DSP2ARMINT] = 7, |
| 409 | [IRQ_DM646X_RESERVED_4] = 7, |
| 410 | [IRQ_DM646X_PSCINT] = 7, |
| 411 | [IRQ_DM646X_GPIO0] = 7, |
| 412 | [IRQ_DM646X_GPIO1] = 7, |
| 413 | [IRQ_DM646X_GPIO2] = 7, |
| 414 | [IRQ_DM646X_GPIO3] = 7, |
| 415 | [IRQ_DM646X_GPIO4] = 7, |
| 416 | [IRQ_DM646X_GPIO5] = 7, |
| 417 | [IRQ_DM646X_GPIO6] = 7, |
| 418 | [IRQ_DM646X_GPIO7] = 7, |
| 419 | [IRQ_DM646X_GPIOBNK0] = 7, |
| 420 | [IRQ_DM646X_GPIOBNK1] = 7, |
| 421 | [IRQ_DM646X_GPIOBNK2] = 7, |
| 422 | [IRQ_DM646X_DDRINT] = 7, |
| 423 | [IRQ_DM646X_AEMIFINT] = 7, |
| 424 | [IRQ_COMMTX] = 7, |
| 425 | [IRQ_COMMRX] = 7, |
| 426 | [IRQ_EMUINT] = 7, |
| 427 | }; |
| 428 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 429 | /*----------------------------------------------------------------------*/ |
| 430 | |
| 431 | static const s8 dma_chan_dm646x_no_event[] = { |
| 432 | 0, 1, 2, 3, 13, |
| 433 | 14, 15, 24, 25, 26, |
| 434 | 27, 30, 31, 54, 55, |
| 435 | 56, |
| 436 | -1 |
| 437 | }; |
| 438 | |
| 439 | static struct edma_soc_info dm646x_edma_info = { |
| 440 | .n_channel = 64, |
| 441 | .n_region = 6, /* 0-1, 4-7 */ |
| 442 | .n_slot = 512, |
| 443 | .n_tc = 4, |
| 444 | .noevent = dma_chan_dm646x_no_event, |
| 445 | }; |
| 446 | |
| 447 | static struct resource edma_resources[] = { |
| 448 | { |
| 449 | .name = "edma_cc", |
| 450 | .start = 0x01c00000, |
| 451 | .end = 0x01c00000 + SZ_64K - 1, |
| 452 | .flags = IORESOURCE_MEM, |
| 453 | }, |
| 454 | { |
| 455 | .name = "edma_tc0", |
| 456 | .start = 0x01c10000, |
| 457 | .end = 0x01c10000 + SZ_1K - 1, |
| 458 | .flags = IORESOURCE_MEM, |
| 459 | }, |
| 460 | { |
| 461 | .name = "edma_tc1", |
| 462 | .start = 0x01c10400, |
| 463 | .end = 0x01c10400 + SZ_1K - 1, |
| 464 | .flags = IORESOURCE_MEM, |
| 465 | }, |
| 466 | { |
| 467 | .name = "edma_tc2", |
| 468 | .start = 0x01c10800, |
| 469 | .end = 0x01c10800 + SZ_1K - 1, |
| 470 | .flags = IORESOURCE_MEM, |
| 471 | }, |
| 472 | { |
| 473 | .name = "edma_tc3", |
| 474 | .start = 0x01c10c00, |
| 475 | .end = 0x01c10c00 + SZ_1K - 1, |
| 476 | .flags = IORESOURCE_MEM, |
| 477 | }, |
| 478 | { |
| 479 | .start = IRQ_CCINT0, |
| 480 | .flags = IORESOURCE_IRQ, |
| 481 | }, |
| 482 | { |
| 483 | .start = IRQ_CCERRINT, |
| 484 | .flags = IORESOURCE_IRQ, |
| 485 | }, |
| 486 | /* not using TC*_ERR */ |
| 487 | }; |
| 488 | |
| 489 | static struct platform_device dm646x_edma_device = { |
| 490 | .name = "edma", |
| 491 | .id = -1, |
| 492 | .dev.platform_data = &dm646x_edma_info, |
| 493 | .num_resources = ARRAY_SIZE(edma_resources), |
| 494 | .resource = edma_resources, |
| 495 | }; |
| 496 | |
| 497 | /*----------------------------------------------------------------------*/ |
| 498 | |
Kevin Hilman | ac7b75b | 2009-05-07 06:19:40 -0700 | [diff] [blame] | 499 | #if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE) |
| 500 | |
| 501 | void dm646x_init_emac(struct emac_platform_data *pdata) |
| 502 | { |
| 503 | pdata->ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET; |
| 504 | pdata->ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET; |
| 505 | pdata->ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET; |
| 506 | pdata->mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET; |
| 507 | pdata->ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE; |
| 508 | pdata->version = EMAC_VERSION_2; |
| 509 | dm646x_emac_device.dev.platform_data = pdata; |
| 510 | platform_device_register(&dm646x_emac_device); |
| 511 | } |
| 512 | #else |
| 513 | |
| 514 | void dm646x_init_emac(struct emac_platform_data *unused) {} |
| 515 | |
| 516 | #endif |
| 517 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 518 | static struct map_desc dm646x_io_desc[] = { |
| 519 | { |
| 520 | .virtual = IO_VIRT, |
| 521 | .pfn = __phys_to_pfn(IO_PHYS), |
| 522 | .length = IO_SIZE, |
| 523 | .type = MT_DEVICE |
| 524 | }, |
| 525 | }; |
| 526 | |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 527 | /* Contents of JTAG ID register used to identify exact cpu type */ |
| 528 | static struct davinci_id dm646x_ids[] = { |
| 529 | { |
| 530 | .variant = 0x0, |
| 531 | .part_no = 0xb770, |
| 532 | .manufacturer = 0x017, |
| 533 | .cpu_id = DAVINCI_CPU_ID_DM6467, |
| 534 | .name = "dm6467", |
| 535 | }, |
| 536 | }; |
| 537 | |
Mark A. Greer | d81d188 | 2009-04-15 12:39:33 -0700 | [diff] [blame] | 538 | static void __iomem *dm646x_psc_bases[] = { |
| 539 | IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE), |
| 540 | }; |
| 541 | |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame^] | 542 | /* |
| 543 | * T0_BOT: Timer 0, bottom: clockevent source for hrtimers |
| 544 | * T0_TOP: Timer 0, top : clocksource for generic timekeeping |
| 545 | * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code) |
| 546 | * T1_TOP: Timer 1, top : <unused> |
| 547 | */ |
| 548 | struct davinci_timer_info dm646x_timer_info = { |
| 549 | .timers = davinci_timer_instance, |
| 550 | .clockevent_id = T0_BOT, |
| 551 | .clocksource_id = T0_TOP, |
| 552 | }; |
| 553 | |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 554 | static struct davinci_soc_info davinci_soc_info_dm646x = { |
| 555 | .io_desc = dm646x_io_desc, |
| 556 | .io_desc_num = ARRAY_SIZE(dm646x_io_desc), |
Mark A. Greer | b9ab127 | 2009-04-15 12:39:09 -0700 | [diff] [blame] | 557 | .jtag_id_base = IO_ADDRESS(0x01c40028), |
| 558 | .ids = dm646x_ids, |
| 559 | .ids_num = ARRAY_SIZE(dm646x_ids), |
Mark A. Greer | 66e0c39 | 2009-04-15 12:39:23 -0700 | [diff] [blame] | 560 | .cpu_clks = dm646x_clks, |
Mark A. Greer | d81d188 | 2009-04-15 12:39:33 -0700 | [diff] [blame] | 561 | .psc_bases = dm646x_psc_bases, |
| 562 | .psc_bases_num = ARRAY_SIZE(dm646x_psc_bases), |
Mark A. Greer | 0e58595 | 2009-04-15 12:39:48 -0700 | [diff] [blame] | 563 | .pinmux_base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE), |
| 564 | .pinmux_pins = dm646x_pins, |
| 565 | .pinmux_pins_num = ARRAY_SIZE(dm646x_pins), |
Mark A. Greer | 673dd36 | 2009-04-15 12:40:00 -0700 | [diff] [blame] | 566 | .intc_base = IO_ADDRESS(DAVINCI_ARM_INTC_BASE), |
| 567 | .intc_type = DAVINCI_INTC_TYPE_AINTC, |
| 568 | .intc_irq_prios = dm646x_default_priorities, |
| 569 | .intc_irq_num = DAVINCI_N_AINTC_IRQ, |
Mark A. Greer | f64691b | 2009-04-15 12:40:11 -0700 | [diff] [blame^] | 570 | .timer_info = &dm646x_timer_info, |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 571 | }; |
| 572 | |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 573 | void __init dm646x_init(void) |
| 574 | { |
Mark A. Greer | 79c3c0b | 2009-04-15 12:38:58 -0700 | [diff] [blame] | 575 | davinci_common_init(&davinci_soc_info_dm646x); |
Kevin Hilman | e38d92f | 2009-04-29 17:44:58 -0700 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | static int __init dm646x_init_devices(void) |
| 579 | { |
| 580 | if (!cpu_is_davinci_dm646x()) |
| 581 | return 0; |
| 582 | |
| 583 | platform_device_register(&dm646x_edma_device); |
| 584 | return 0; |
| 585 | } |
| 586 | postcore_initcall(dm646x_init_devices); |