blob: da21353cac450d2f8dddaa75a7291670220ba17c [file] [log] [blame]
Kevin Hilmane38d92f2009-04-29 17:44:58 -07001/*
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 Dobriyanb7f080c2011-06-16 11:01:34 +000011#include <linux/dma-mapping.h>
Peter Ujfalusi2137d542016-02-02 14:43:17 +020012#include <linux/dmaengine.h>
Kevin Hilmane38d92f2009-04-29 17:44:58 -070013#include <linux/init.h>
14#include <linux/clk.h>
Mark A. Greer65e866a2009-03-18 12:36:08 -050015#include <linux/serial_8250.h>
Kevin Hilmane38d92f2009-04-29 17:44:58 -070016#include <linux/platform_device.h>
Matt Porter3ad7a422013-03-06 11:15:31 -050017#include <linux/platform_data/edma.h>
Philip Avinash9cc15152013-08-18 10:49:00 +053018#include <linux/platform_data/gpio-davinci.h>
Kevin Hilmane38d92f2009-04-29 17:44:58 -070019
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070020#include <asm/mach/map.h>
21
Kevin Hilmane38d92f2009-04-29 17:44:58 -070022#include <mach/cputype.h>
Kevin Hilmane38d92f2009-04-29 17:44:58 -070023#include <mach/irqs.h>
Arnd Bergmann3acf7312015-01-30 10:45:33 +010024#include "psc.h"
Kevin Hilmane38d92f2009-04-29 17:44:58 -070025#include <mach/mux.h>
Mark A. Greerf64691b2009-04-15 12:40:11 -070026#include <mach/time.h>
Mark A. Greer65e866a2009-03-18 12:36:08 -050027#include <mach/serial.h>
Mark A. Greer79c3c0b2009-04-15 12:38:58 -070028#include <mach/common.h>
Kevin Hilmane38d92f2009-04-29 17:44:58 -070029
Manjunath Hadli39c6d2d2011-12-21 19:13:35 +053030#include "davinci.h"
Kevin Hilmane38d92f2009-04-29 17:44:58 -070031#include "clock.h"
32#include "mux.h"
Hebbar, Gururaja896f66b2012-08-27 18:56:41 +053033#include "asp.h"
Kevin Hilmane38d92f2009-04-29 17:44:58 -070034
Muralidharan Karicheri85609c12009-09-16 13:15:30 -040035#define DAVINCI_VPIF_BASE (0x01C12000)
Muralidharan Karicheri85609c12009-09-16 13:15:30 -040036
37#define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\
38 BIT_MASK(0))
39#define VSCLKDIS_MASK (BIT_MASK(11) | BIT_MASK(10) | BIT_MASK(9) |\
40 BIT_MASK(8))
41
Kevin Hilmane38d92f2009-04-29 17:44:58 -070042/*
43 * Device specific clocks
44 */
Sekhar Nori56e580d2011-06-14 15:33:20 +000045#define DM646X_REF_FREQ 27000000
Kevin Hilmane38d92f2009-04-29 17:44:58 -070046#define DM646X_AUX_FREQ 24000000
47
Manjunath Hadli3d091402011-12-15 17:41:51 +053048#define DM646X_EMAC_BASE 0x01c80000
49#define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000)
50#define DM646X_EMAC_CNTRL_OFFSET 0x0000
51#define DM646X_EMAC_CNTRL_MOD_OFFSET 0x1000
52#define DM646X_EMAC_CNTRL_RAM_OFFSET 0x2000
53#define DM646X_EMAC_CNTRL_RAM_SIZE 0x2000
54
Kevin Hilmane38d92f2009-04-29 17:44:58 -070055static struct pll_data pll1_data = {
56 .num = 1,
57 .phys_base = DAVINCI_PLL1_BASE,
58};
59
60static struct pll_data pll2_data = {
61 .num = 2,
62 .phys_base = DAVINCI_PLL2_BASE,
63};
64
65static struct clk ref_clk = {
66 .name = "ref_clk",
Sekhar Nori56e580d2011-06-14 15:33:20 +000067 .rate = DM646X_REF_FREQ,
68 .set_rate = davinci_simple_set_rate,
Kevin Hilmane38d92f2009-04-29 17:44:58 -070069};
70
71static struct clk aux_clkin = {
72 .name = "aux_clkin",
73 .rate = DM646X_AUX_FREQ,
74};
75
76static struct clk pll1_clk = {
77 .name = "pll1",
78 .parent = &ref_clk,
79 .pll_data = &pll1_data,
80 .flags = CLK_PLL,
81};
82
83static struct clk pll1_sysclk1 = {
84 .name = "pll1_sysclk1",
85 .parent = &pll1_clk,
86 .flags = CLK_PLL,
87 .div_reg = PLLDIV1,
88};
89
90static struct clk pll1_sysclk2 = {
91 .name = "pll1_sysclk2",
92 .parent = &pll1_clk,
93 .flags = CLK_PLL,
94 .div_reg = PLLDIV2,
95};
96
97static struct clk pll1_sysclk3 = {
98 .name = "pll1_sysclk3",
99 .parent = &pll1_clk,
100 .flags = CLK_PLL,
101 .div_reg = PLLDIV3,
102};
103
104static struct clk pll1_sysclk4 = {
105 .name = "pll1_sysclk4",
106 .parent = &pll1_clk,
107 .flags = CLK_PLL,
108 .div_reg = PLLDIV4,
109};
110
111static struct clk pll1_sysclk5 = {
112 .name = "pll1_sysclk5",
113 .parent = &pll1_clk,
114 .flags = CLK_PLL,
115 .div_reg = PLLDIV5,
116};
117
118static struct clk pll1_sysclk6 = {
119 .name = "pll1_sysclk6",
120 .parent = &pll1_clk,
121 .flags = CLK_PLL,
122 .div_reg = PLLDIV6,
123};
124
125static struct clk pll1_sysclk8 = {
126 .name = "pll1_sysclk8",
127 .parent = &pll1_clk,
128 .flags = CLK_PLL,
129 .div_reg = PLLDIV8,
130};
131
132static struct clk pll1_sysclk9 = {
133 .name = "pll1_sysclk9",
134 .parent = &pll1_clk,
135 .flags = CLK_PLL,
136 .div_reg = PLLDIV9,
137};
138
139static struct clk pll1_sysclkbp = {
140 .name = "pll1_sysclkbp",
141 .parent = &pll1_clk,
142 .flags = CLK_PLL | PRE_PLL,
143 .div_reg = BPDIV,
144};
145
146static struct clk pll1_aux_clk = {
147 .name = "pll1_aux_clk",
148 .parent = &pll1_clk,
149 .flags = CLK_PLL | PRE_PLL,
150};
151
152static struct clk pll2_clk = {
153 .name = "pll2_clk",
154 .parent = &ref_clk,
155 .pll_data = &pll2_data,
156 .flags = CLK_PLL,
157};
158
159static struct clk pll2_sysclk1 = {
160 .name = "pll2_sysclk1",
161 .parent = &pll2_clk,
162 .flags = CLK_PLL,
163 .div_reg = PLLDIV1,
164};
165
166static struct clk dsp_clk = {
167 .name = "dsp",
168 .parent = &pll1_sysclk1,
169 .lpsc = DM646X_LPSC_C64X_CPU,
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700170 .usecount = 1, /* REVISIT how to disable? */
171};
172
173static struct clk arm_clk = {
174 .name = "arm",
175 .parent = &pll1_sysclk2,
176 .lpsc = DM646X_LPSC_ARM,
177 .flags = ALWAYS_ENABLED,
178};
179
Sudhakar Rajashekhara2bcb6132009-06-02 03:38:26 -0400180static struct clk edma_cc_clk = {
181 .name = "edma_cc",
182 .parent = &pll1_sysclk2,
183 .lpsc = DM646X_LPSC_TPCC,
184 .flags = ALWAYS_ENABLED,
185};
186
187static struct clk edma_tc0_clk = {
188 .name = "edma_tc0",
189 .parent = &pll1_sysclk2,
190 .lpsc = DM646X_LPSC_TPTC0,
191 .flags = ALWAYS_ENABLED,
192};
193
194static struct clk edma_tc1_clk = {
195 .name = "edma_tc1",
196 .parent = &pll1_sysclk2,
197 .lpsc = DM646X_LPSC_TPTC1,
198 .flags = ALWAYS_ENABLED,
199};
200
201static struct clk edma_tc2_clk = {
202 .name = "edma_tc2",
203 .parent = &pll1_sysclk2,
204 .lpsc = DM646X_LPSC_TPTC2,
205 .flags = ALWAYS_ENABLED,
206};
207
208static struct clk edma_tc3_clk = {
209 .name = "edma_tc3",
210 .parent = &pll1_sysclk2,
211 .lpsc = DM646X_LPSC_TPTC3,
212 .flags = ALWAYS_ENABLED,
213};
214
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700215static struct clk uart0_clk = {
216 .name = "uart0",
217 .parent = &aux_clkin,
218 .lpsc = DM646X_LPSC_UART0,
219};
220
221static struct clk uart1_clk = {
222 .name = "uart1",
223 .parent = &aux_clkin,
224 .lpsc = DM646X_LPSC_UART1,
225};
226
227static struct clk uart2_clk = {
228 .name = "uart2",
229 .parent = &aux_clkin,
230 .lpsc = DM646X_LPSC_UART2,
231};
232
233static struct clk i2c_clk = {
234 .name = "I2CCLK",
235 .parent = &pll1_sysclk3,
236 .lpsc = DM646X_LPSC_I2C,
237};
238
239static struct clk gpio_clk = {
240 .name = "gpio",
241 .parent = &pll1_sysclk3,
242 .lpsc = DM646X_LPSC_GPIO,
243};
244
Chaithrika U S75d0fa72009-05-28 05:09:21 -0400245static struct clk mcasp0_clk = {
246 .name = "mcasp0",
247 .parent = &pll1_sysclk3,
248 .lpsc = DM646X_LPSC_McASP0,
249};
250
251static struct clk mcasp1_clk = {
252 .name = "mcasp1",
253 .parent = &pll1_sysclk3,
254 .lpsc = DM646X_LPSC_McASP1,
255};
256
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700257static struct clk aemif_clk = {
258 .name = "aemif",
259 .parent = &pll1_sysclk3,
260 .lpsc = DM646X_LPSC_AEMIF,
261 .flags = ALWAYS_ENABLED,
262};
263
264static struct clk emac_clk = {
265 .name = "emac",
266 .parent = &pll1_sysclk3,
267 .lpsc = DM646X_LPSC_EMAC,
268};
269
270static struct clk pwm0_clk = {
271 .name = "pwm0",
272 .parent = &pll1_sysclk3,
273 .lpsc = DM646X_LPSC_PWM0,
274 .usecount = 1, /* REVIST: disabling hangs system */
275};
276
277static struct clk pwm1_clk = {
278 .name = "pwm1",
279 .parent = &pll1_sysclk3,
280 .lpsc = DM646X_LPSC_PWM1,
281 .usecount = 1, /* REVIST: disabling hangs system */
282};
283
284static struct clk timer0_clk = {
285 .name = "timer0",
286 .parent = &pll1_sysclk3,
287 .lpsc = DM646X_LPSC_TIMER0,
288};
289
290static struct clk timer1_clk = {
291 .name = "timer1",
292 .parent = &pll1_sysclk3,
293 .lpsc = DM646X_LPSC_TIMER1,
294};
295
296static struct clk timer2_clk = {
297 .name = "timer2",
298 .parent = &pll1_sysclk3,
299 .flags = ALWAYS_ENABLED, /* no LPSC, always enabled; c.f. spruep9a */
300};
301
Hemant Pedanekar3e25d5f2009-07-07 19:49:41 +0530302
303static struct clk ide_clk = {
304 .name = "ide",
305 .parent = &pll1_sysclk4,
306 .lpsc = DAVINCI_LPSC_ATA,
307};
308
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700309static struct clk vpif0_clk = {
310 .name = "vpif0",
311 .parent = &ref_clk,
312 .lpsc = DM646X_LPSC_VPSSMSTR,
313 .flags = ALWAYS_ENABLED,
314};
315
316static struct clk vpif1_clk = {
317 .name = "vpif1",
318 .parent = &ref_clk,
319 .lpsc = DM646X_LPSC_VPSSSLV,
320 .flags = ALWAYS_ENABLED,
321};
322
Kevin Hilman28552c22010-02-25 15:36:38 -0800323static struct clk_lookup dm646x_clks[] = {
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700324 CLK(NULL, "ref", &ref_clk),
325 CLK(NULL, "aux", &aux_clkin),
326 CLK(NULL, "pll1", &pll1_clk),
327 CLK(NULL, "pll1_sysclk", &pll1_sysclk1),
328 CLK(NULL, "pll1_sysclk", &pll1_sysclk2),
329 CLK(NULL, "pll1_sysclk", &pll1_sysclk3),
330 CLK(NULL, "pll1_sysclk", &pll1_sysclk4),
331 CLK(NULL, "pll1_sysclk", &pll1_sysclk5),
332 CLK(NULL, "pll1_sysclk", &pll1_sysclk6),
333 CLK(NULL, "pll1_sysclk", &pll1_sysclk8),
334 CLK(NULL, "pll1_sysclk", &pll1_sysclk9),
335 CLK(NULL, "pll1_sysclk", &pll1_sysclkbp),
336 CLK(NULL, "pll1_aux", &pll1_aux_clk),
337 CLK(NULL, "pll2", &pll2_clk),
338 CLK(NULL, "pll2_sysclk1", &pll2_sysclk1),
339 CLK(NULL, "dsp", &dsp_clk),
340 CLK(NULL, "arm", &arm_clk),
Sudhakar Rajashekhara2bcb6132009-06-02 03:38:26 -0400341 CLK(NULL, "edma_cc", &edma_cc_clk),
342 CLK(NULL, "edma_tc0", &edma_tc0_clk),
343 CLK(NULL, "edma_tc1", &edma_tc1_clk),
344 CLK(NULL, "edma_tc2", &edma_tc2_clk),
345 CLK(NULL, "edma_tc3", &edma_tc3_clk),
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530346 CLK("serial8250.0", NULL, &uart0_clk),
347 CLK("serial8250.1", NULL, &uart1_clk),
348 CLK("serial8250.2", NULL, &uart2_clk),
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700349 CLK("i2c_davinci.1", NULL, &i2c_clk),
350 CLK(NULL, "gpio", &gpio_clk),
Kevin Hilman61aa0732009-07-15 08:47:48 -0700351 CLK("davinci-mcasp.0", NULL, &mcasp0_clk),
352 CLK("davinci-mcasp.1", NULL, &mcasp1_clk),
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700353 CLK(NULL, "aemif", &aemif_clk),
354 CLK("davinci_emac.1", NULL, &emac_clk),
Lad, Prabhakar46c18332013-08-15 11:31:33 +0530355 CLK("davinci_mdio.0", "fck", &emac_clk),
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700356 CLK(NULL, "pwm0", &pwm0_clk),
357 CLK(NULL, "pwm1", &pwm1_clk),
358 CLK(NULL, "timer0", &timer0_clk),
359 CLK(NULL, "timer1", &timer1_clk),
Ivan Khoronzhuk84374812013-11-27 15:31:53 +0200360 CLK("davinci-wdt", NULL, &timer2_clk),
Hemant Pedanekar3e25d5f2009-07-07 19:49:41 +0530361 CLK("palm_bk3710", NULL, &ide_clk),
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700362 CLK(NULL, "vpif0", &vpif0_clk),
363 CLK(NULL, "vpif1", &vpif1_clk),
364 CLK(NULL, NULL, NULL),
365};
366
Mark A. Greer972412b2009-04-15 12:40:56 -0700367static struct emac_platform_data dm646x_emac_pdata = {
368 .ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET,
369 .ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET,
370 .ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET,
Mark A. Greer972412b2009-04-15 12:40:56 -0700371 .ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE,
372 .version = EMAC_VERSION_2,
373};
374
Kevin Hilmanac7b75b2009-05-07 06:19:40 -0700375static struct resource dm646x_emac_resources[] = {
376 {
377 .start = DM646X_EMAC_BASE,
Cyril Chemparathyd22960c2010-09-15 10:11:22 -0400378 .end = DM646X_EMAC_BASE + SZ_16K - 1,
Kevin Hilmanac7b75b2009-05-07 06:19:40 -0700379 .flags = IORESOURCE_MEM,
380 },
381 {
382 .start = IRQ_DM646X_EMACRXTHINT,
383 .end = IRQ_DM646X_EMACRXTHINT,
384 .flags = IORESOURCE_IRQ,
385 },
386 {
387 .start = IRQ_DM646X_EMACRXINT,
388 .end = IRQ_DM646X_EMACRXINT,
389 .flags = IORESOURCE_IRQ,
390 },
391 {
392 .start = IRQ_DM646X_EMACTXINT,
393 .end = IRQ_DM646X_EMACTXINT,
394 .flags = IORESOURCE_IRQ,
395 },
396 {
397 .start = IRQ_DM646X_EMACMISCINT,
398 .end = IRQ_DM646X_EMACMISCINT,
399 .flags = IORESOURCE_IRQ,
400 },
401};
402
403static struct platform_device dm646x_emac_device = {
404 .name = "davinci_emac",
405 .id = 1,
Mark A. Greer972412b2009-04-15 12:40:56 -0700406 .dev = {
407 .platform_data = &dm646x_emac_pdata,
408 },
Kevin Hilmanac7b75b2009-05-07 06:19:40 -0700409 .num_resources = ARRAY_SIZE(dm646x_emac_resources),
410 .resource = dm646x_emac_resources,
411};
412
Cyril Chemparathyd22960c2010-09-15 10:11:22 -0400413static struct resource dm646x_mdio_resources[] = {
414 {
415 .start = DM646X_EMAC_MDIO_BASE,
416 .end = DM646X_EMAC_MDIO_BASE + SZ_4K - 1,
417 .flags = IORESOURCE_MEM,
418 },
419};
420
421static struct platform_device dm646x_mdio_device = {
422 .name = "davinci_mdio",
423 .id = 0,
424 .num_resources = ARRAY_SIZE(dm646x_mdio_resources),
425 .resource = dm646x_mdio_resources,
426};
427
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700428/*
429 * Device specific mux setup
430 *
431 * soc description mux mode mode mux dbg
432 * reg offset mask mode
433 */
434static const struct mux_config dm646x_pins[] = {
Mark A. Greer0e585952009-04-15 12:39:48 -0700435#ifdef CONFIG_DAVINCI_MUX
Hemant Pedanekar3e25d5f2009-07-07 19:49:41 +0530436MUX_CFG(DM646X, ATAEN, 0, 0, 5, 1, true)
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700437
438MUX_CFG(DM646X, AUDCK1, 0, 29, 1, 0, false)
439
440MUX_CFG(DM646X, AUDCK0, 0, 28, 1, 0, false)
441
442MUX_CFG(DM646X, CRGMUX, 0, 24, 7, 5, true)
443
444MUX_CFG(DM646X, STSOMUX_DISABLE, 0, 22, 3, 0, true)
445
446MUX_CFG(DM646X, STSIMUX_DISABLE, 0, 20, 3, 0, true)
447
448MUX_CFG(DM646X, PTSOMUX_DISABLE, 0, 18, 3, 0, true)
449
450MUX_CFG(DM646X, PTSIMUX_DISABLE, 0, 16, 3, 0, true)
451
452MUX_CFG(DM646X, STSOMUX, 0, 22, 3, 2, true)
453
454MUX_CFG(DM646X, STSIMUX, 0, 20, 3, 2, true)
455
456MUX_CFG(DM646X, PTSOMUX_PARALLEL, 0, 18, 3, 2, true)
457
458MUX_CFG(DM646X, PTSIMUX_PARALLEL, 0, 16, 3, 2, true)
459
460MUX_CFG(DM646X, PTSOMUX_SERIAL, 0, 18, 3, 3, true)
461
462MUX_CFG(DM646X, PTSIMUX_SERIAL, 0, 16, 3, 3, true)
Mark A. Greer0e585952009-04-15 12:39:48 -0700463#endif
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700464};
465
Mark A. Greer673dd362009-04-15 12:40:00 -0700466static u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
467 [IRQ_DM646X_VP_VERTINT0] = 7,
468 [IRQ_DM646X_VP_VERTINT1] = 7,
469 [IRQ_DM646X_VP_VERTINT2] = 7,
470 [IRQ_DM646X_VP_VERTINT3] = 7,
471 [IRQ_DM646X_VP_ERRINT] = 7,
472 [IRQ_DM646X_RESERVED_1] = 7,
473 [IRQ_DM646X_RESERVED_2] = 7,
474 [IRQ_DM646X_WDINT] = 7,
475 [IRQ_DM646X_CRGENINT0] = 7,
476 [IRQ_DM646X_CRGENINT1] = 7,
477 [IRQ_DM646X_TSIFINT0] = 7,
478 [IRQ_DM646X_TSIFINT1] = 7,
479 [IRQ_DM646X_VDCEINT] = 7,
480 [IRQ_DM646X_USBINT] = 7,
481 [IRQ_DM646X_USBDMAINT] = 7,
482 [IRQ_DM646X_PCIINT] = 7,
483 [IRQ_CCINT0] = 7, /* dma */
484 [IRQ_CCERRINT] = 7, /* dma */
485 [IRQ_TCERRINT0] = 7, /* dma */
486 [IRQ_TCERRINT] = 7, /* dma */
487 [IRQ_DM646X_TCERRINT2] = 7,
488 [IRQ_DM646X_TCERRINT3] = 7,
489 [IRQ_DM646X_IDE] = 7,
490 [IRQ_DM646X_HPIINT] = 7,
491 [IRQ_DM646X_EMACRXTHINT] = 7,
492 [IRQ_DM646X_EMACRXINT] = 7,
493 [IRQ_DM646X_EMACTXINT] = 7,
494 [IRQ_DM646X_EMACMISCINT] = 7,
495 [IRQ_DM646X_MCASP0TXINT] = 7,
496 [IRQ_DM646X_MCASP0RXINT] = 7,
Mark A. Greer673dd362009-04-15 12:40:00 -0700497 [IRQ_DM646X_RESERVED_3] = 7,
498 [IRQ_DM646X_MCASP1TXINT] = 7, /* clockevent */
499 [IRQ_TINT0_TINT34] = 7, /* clocksource */
500 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
501 [IRQ_TINT1_TINT34] = 7, /* system tick */
502 [IRQ_PWMINT0] = 7,
503 [IRQ_PWMINT1] = 7,
504 [IRQ_DM646X_VLQINT] = 7,
505 [IRQ_I2C] = 7,
506 [IRQ_UARTINT0] = 7,
507 [IRQ_UARTINT1] = 7,
508 [IRQ_DM646X_UARTINT2] = 7,
509 [IRQ_DM646X_SPINT0] = 7,
510 [IRQ_DM646X_SPINT1] = 7,
511 [IRQ_DM646X_DSP2ARMINT] = 7,
512 [IRQ_DM646X_RESERVED_4] = 7,
513 [IRQ_DM646X_PSCINT] = 7,
514 [IRQ_DM646X_GPIO0] = 7,
515 [IRQ_DM646X_GPIO1] = 7,
516 [IRQ_DM646X_GPIO2] = 7,
517 [IRQ_DM646X_GPIO3] = 7,
518 [IRQ_DM646X_GPIO4] = 7,
519 [IRQ_DM646X_GPIO5] = 7,
520 [IRQ_DM646X_GPIO6] = 7,
521 [IRQ_DM646X_GPIO7] = 7,
522 [IRQ_DM646X_GPIOBNK0] = 7,
523 [IRQ_DM646X_GPIOBNK1] = 7,
524 [IRQ_DM646X_GPIOBNK2] = 7,
525 [IRQ_DM646X_DDRINT] = 7,
526 [IRQ_DM646X_AEMIFINT] = 7,
527 [IRQ_COMMTX] = 7,
528 [IRQ_COMMRX] = 7,
529 [IRQ_EMUINT] = 7,
530};
531
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700532/*----------------------------------------------------------------------*/
533
Sudhakar Rajashekhara60902a22009-05-21 07:41:35 -0400534/* Four Transfer Controllers on DM646x */
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300535static s8 dm646x_queue_priority_mapping[][2] = {
Sudhakar Rajashekhara60902a22009-05-21 07:41:35 -0400536 /* {event queue no, Priority} */
537 {0, 4},
538 {1, 0},
539 {2, 5},
540 {3, 1},
541 {-1, -1},
542};
543
Peter Ujfalusi2137d542016-02-02 14:43:17 +0200544static const struct dma_slave_map dm646x_edma_map[] = {
545 { "davinci-mcasp.0", "tx", EDMA_FILTER_PARAM(0, 6) },
546 { "davinci-mcasp.0", "rx", EDMA_FILTER_PARAM(0, 9) },
547 { "davinci-mcasp.1", "tx", EDMA_FILTER_PARAM(0, 12) },
548 { "spi_davinci", "tx", EDMA_FILTER_PARAM(0, 16) },
549 { "spi_davinci", "rx", EDMA_FILTER_PARAM(0, 17) },
550};
551
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300552static struct edma_soc_info dm646x_edma_pdata = {
Sekhar Noribc3ac9f2010-06-29 11:35:12 +0530553 .queue_priority_mapping = dm646x_queue_priority_mapping,
Ido Yarivf23fe852011-07-10 16:14:35 +0300554 .default_queue = EVENTQ_1,
Peter Ujfalusi2137d542016-02-02 14:43:17 +0200555 .slave_map = dm646x_edma_map,
556 .slavecnt = ARRAY_SIZE(dm646x_edma_map),
Sekhar Noribc3ac9f2010-06-29 11:35:12 +0530557};
558
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700559static struct resource edma_resources[] = {
560 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300561 .name = "edma3_cc",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700562 .start = 0x01c00000,
563 .end = 0x01c00000 + SZ_64K - 1,
564 .flags = IORESOURCE_MEM,
565 },
566 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300567 .name = "edma3_tc0",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700568 .start = 0x01c10000,
569 .end = 0x01c10000 + SZ_1K - 1,
570 .flags = IORESOURCE_MEM,
571 },
572 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300573 .name = "edma3_tc1",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700574 .start = 0x01c10400,
575 .end = 0x01c10400 + SZ_1K - 1,
576 .flags = IORESOURCE_MEM,
577 },
578 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300579 .name = "edma3_tc2",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700580 .start = 0x01c10800,
581 .end = 0x01c10800 + SZ_1K - 1,
582 .flags = IORESOURCE_MEM,
583 },
584 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300585 .name = "edma3_tc3",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700586 .start = 0x01c10c00,
587 .end = 0x01c10c00 + SZ_1K - 1,
588 .flags = IORESOURCE_MEM,
589 },
590 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300591 .name = "edma3_ccint",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700592 .start = IRQ_CCINT0,
593 .flags = IORESOURCE_IRQ,
594 },
595 {
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300596 .name = "edma3_ccerrint",
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700597 .start = IRQ_CCERRINT,
598 .flags = IORESOURCE_IRQ,
599 },
600 /* not using TC*_ERR */
601};
602
Peter Ujfalusi7ab388e2015-10-14 14:42:51 +0300603static const struct platform_device_info dm646x_edma_device __initconst = {
604 .name = "edma",
605 .id = 0,
Peter Ujfalusicef5b0d2015-10-14 14:42:52 +0300606 .dma_mask = DMA_BIT_MASK(32),
Peter Ujfalusi7ab388e2015-10-14 14:42:51 +0300607 .res = edma_resources,
608 .num_res = ARRAY_SIZE(edma_resources),
609 .data = &dm646x_edma_pdata,
610 .size_data = sizeof(dm646x_edma_pdata),
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700611};
612
Chaithrika U S25acf552009-06-05 06:28:08 -0400613static struct resource dm646x_mcasp0_resources[] = {
614 {
Peter Ujfalusiee880db2013-11-13 16:48:17 +0200615 .name = "mpu",
Chaithrika U S25acf552009-06-05 06:28:08 -0400616 .start = DAVINCI_DM646X_MCASP0_REG_BASE,
617 .end = DAVINCI_DM646X_MCASP0_REG_BASE + (SZ_1K << 1) - 1,
618 .flags = IORESOURCE_MEM,
619 },
Chaithrika U S25acf552009-06-05 06:28:08 -0400620 {
Peter Ujfalusi256b20a2015-03-12 10:06:29 +0200621 .name = "tx",
Chaithrika U S25acf552009-06-05 06:28:08 -0400622 .start = DAVINCI_DM646X_DMA_MCASP0_AXEVT0,
623 .end = DAVINCI_DM646X_DMA_MCASP0_AXEVT0,
624 .flags = IORESOURCE_DMA,
625 },
626 {
Peter Ujfalusi256b20a2015-03-12 10:06:29 +0200627 .name = "rx",
Chaithrika U S25acf552009-06-05 06:28:08 -0400628 .start = DAVINCI_DM646X_DMA_MCASP0_AREVT0,
629 .end = DAVINCI_DM646X_DMA_MCASP0_AREVT0,
630 .flags = IORESOURCE_DMA,
631 },
Peter Ujfalusi6cfdf552015-03-12 10:06:31 +0200632 {
633 .name = "tx",
634 .start = IRQ_DM646X_MCASP0TXINT,
635 .flags = IORESOURCE_IRQ,
636 },
637 {
638 .name = "rx",
639 .start = IRQ_DM646X_MCASP0RXINT,
640 .flags = IORESOURCE_IRQ,
641 },
Chaithrika U S25acf552009-06-05 06:28:08 -0400642};
643
Peter Ujfalusi256b20a2015-03-12 10:06:29 +0200644/* DIT mode only, rx is not supported */
Chaithrika U S25acf552009-06-05 06:28:08 -0400645static struct resource dm646x_mcasp1_resources[] = {
646 {
Peter Ujfalusiee880db2013-11-13 16:48:17 +0200647 .name = "mpu",
Chaithrika U S25acf552009-06-05 06:28:08 -0400648 .start = DAVINCI_DM646X_MCASP1_REG_BASE,
649 .end = DAVINCI_DM646X_MCASP1_REG_BASE + (SZ_1K << 1) - 1,
650 .flags = IORESOURCE_MEM,
651 },
Chaithrika U S25acf552009-06-05 06:28:08 -0400652 {
Peter Ujfalusi256b20a2015-03-12 10:06:29 +0200653 .name = "tx",
Chaithrika U S25acf552009-06-05 06:28:08 -0400654 .start = DAVINCI_DM646X_DMA_MCASP1_AXEVT1,
655 .end = DAVINCI_DM646X_DMA_MCASP1_AXEVT1,
656 .flags = IORESOURCE_DMA,
657 },
Peter Ujfalusi6cfdf552015-03-12 10:06:31 +0200658 {
659 .name = "tx",
660 .start = IRQ_DM646X_MCASP1TXINT,
661 .flags = IORESOURCE_IRQ,
662 },
Chaithrika U S25acf552009-06-05 06:28:08 -0400663};
664
665static struct platform_device dm646x_mcasp0_device = {
666 .name = "davinci-mcasp",
667 .id = 0,
668 .num_resources = ARRAY_SIZE(dm646x_mcasp0_resources),
669 .resource = dm646x_mcasp0_resources,
670};
671
672static struct platform_device dm646x_mcasp1_device = {
673 .name = "davinci-mcasp",
674 .id = 1,
675 .num_resources = ARRAY_SIZE(dm646x_mcasp1_resources),
676 .resource = dm646x_mcasp1_resources,
677};
678
679static struct platform_device dm646x_dit_device = {
680 .name = "spdif-dit",
681 .id = -1,
682};
683
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400684static u64 vpif_dma_mask = DMA_BIT_MASK(32);
685
686static struct resource vpif_resource[] = {
687 {
688 .start = DAVINCI_VPIF_BASE,
689 .end = DAVINCI_VPIF_BASE + 0x03ff,
690 .flags = IORESOURCE_MEM,
691 }
692};
693
694static struct platform_device vpif_dev = {
695 .name = "vpif",
696 .id = -1,
697 .dev = {
698 .dma_mask = &vpif_dma_mask,
699 .coherent_dma_mask = DMA_BIT_MASK(32),
700 },
701 .resource = vpif_resource,
702 .num_resources = ARRAY_SIZE(vpif_resource),
703};
704
705static struct resource vpif_display_resource[] = {
706 {
707 .start = IRQ_DM646X_VP_VERTINT2,
708 .end = IRQ_DM646X_VP_VERTINT2,
709 .flags = IORESOURCE_IRQ,
710 },
711 {
712 .start = IRQ_DM646X_VP_VERTINT3,
713 .end = IRQ_DM646X_VP_VERTINT3,
714 .flags = IORESOURCE_IRQ,
715 },
716};
717
718static struct platform_device vpif_display_dev = {
719 .name = "vpif_display",
720 .id = -1,
721 .dev = {
722 .dma_mask = &vpif_dma_mask,
723 .coherent_dma_mask = DMA_BIT_MASK(32),
724 },
725 .resource = vpif_display_resource,
726 .num_resources = ARRAY_SIZE(vpif_display_resource),
727};
728
729static struct resource vpif_capture_resource[] = {
730 {
731 .start = IRQ_DM646X_VP_VERTINT0,
732 .end = IRQ_DM646X_VP_VERTINT0,
733 .flags = IORESOURCE_IRQ,
734 },
735 {
736 .start = IRQ_DM646X_VP_VERTINT1,
737 .end = IRQ_DM646X_VP_VERTINT1,
738 .flags = IORESOURCE_IRQ,
739 },
740};
741
742static struct platform_device vpif_capture_dev = {
743 .name = "vpif_capture",
744 .id = -1,
745 .dev = {
746 .dma_mask = &vpif_dma_mask,
747 .coherent_dma_mask = DMA_BIT_MASK(32),
748 },
749 .resource = vpif_capture_resource,
750 .num_resources = ARRAY_SIZE(vpif_capture_resource),
751};
752
Philip Avinash9cc15152013-08-18 10:49:00 +0530753static struct resource dm646x_gpio_resources[] = {
754 { /* registers */
755 .start = DAVINCI_GPIO_BASE,
756 .end = DAVINCI_GPIO_BASE + SZ_4K - 1,
757 .flags = IORESOURCE_MEM,
758 },
759 { /* interrupt */
760 .start = IRQ_DM646X_GPIOBNK0,
761 .end = IRQ_DM646X_GPIOBNK2,
762 .flags = IORESOURCE_IRQ,
763 },
764};
765
766static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {
767 .ngpio = 43,
Philip Avinash9cc15152013-08-18 10:49:00 +0530768};
769
770int __init dm646x_gpio_register(void)
771{
772 return davinci_gpio_register(dm646x_gpio_resources,
Lad, Prabhakare462f1f2013-11-08 12:15:56 +0530773 ARRAY_SIZE(dm646x_gpio_resources),
Philip Avinash9cc15152013-08-18 10:49:00 +0530774 &dm646x_gpio_platform_data);
775}
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700776/*----------------------------------------------------------------------*/
777
Mark A. Greer79c3c0b2009-04-15 12:38:58 -0700778static struct map_desc dm646x_io_desc[] = {
779 {
780 .virtual = IO_VIRT,
781 .pfn = __phys_to_pfn(IO_PHYS),
782 .length = IO_SIZE,
783 .type = MT_DEVICE
784 },
785};
786
Mark A. Greerb9ab1272009-04-15 12:39:09 -0700787/* Contents of JTAG ID register used to identify exact cpu type */
788static struct davinci_id dm646x_ids[] = {
789 {
790 .variant = 0x0,
791 .part_no = 0xb770,
792 .manufacturer = 0x017,
793 .cpu_id = DAVINCI_CPU_ID_DM6467,
Hemant Pedanekarf63dd122009-09-02 16:49:35 +0530794 .name = "dm6467_rev1.x",
795 },
796 {
797 .variant = 0x1,
798 .part_no = 0xb770,
799 .manufacturer = 0x017,
800 .cpu_id = DAVINCI_CPU_ID_DM6467,
801 .name = "dm6467_rev3.x",
Mark A. Greerb9ab1272009-04-15 12:39:09 -0700802 },
803};
804
Cyril Chemparathye4c822c2010-05-07 17:06:36 -0400805static u32 dm646x_psc_bases[] = { DAVINCI_PWR_SLEEP_CNTRL_BASE };
Mark A. Greerd81d1882009-04-15 12:39:33 -0700806
Mark A. Greerf64691b2009-04-15 12:40:11 -0700807/*
808 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers
809 * T0_TOP: Timer 0, top : clocksource for generic timekeeping
810 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
811 * T1_TOP: Timer 1, top : <unused>
812 */
Kevin Hilman28552c22010-02-25 15:36:38 -0800813static struct davinci_timer_info dm646x_timer_info = {
Mark A. Greerf64691b2009-04-15 12:40:11 -0700814 .timers = davinci_timer_instance,
815 .clockevent_id = T0_BOT,
816 .clocksource_id = T0_TOP,
817};
818
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530819static struct plat_serial8250_port dm646x_serial0_platform_data[] = {
Mark A. Greer65e866a2009-03-18 12:36:08 -0500820 {
821 .mapbase = DAVINCI_UART0_BASE,
822 .irq = IRQ_UARTINT0,
823 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
824 UPF_IOREMAP,
825 .iotype = UPIO_MEM32,
826 .regshift = 2,
827 },
828 {
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530829 .flags = 0,
830 }
831};
832static struct plat_serial8250_port dm646x_serial1_platform_data[] = {
833 {
Mark A. Greer65e866a2009-03-18 12:36:08 -0500834 .mapbase = DAVINCI_UART1_BASE,
835 .irq = IRQ_UARTINT1,
836 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
837 UPF_IOREMAP,
838 .iotype = UPIO_MEM32,
839 .regshift = 2,
840 },
841 {
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530842 .flags = 0,
843 }
844};
845static struct plat_serial8250_port dm646x_serial2_platform_data[] = {
846 {
Mark A. Greer65e866a2009-03-18 12:36:08 -0500847 .mapbase = DAVINCI_UART2_BASE,
848 .irq = IRQ_DM646X_UARTINT2,
849 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
850 UPF_IOREMAP,
851 .iotype = UPIO_MEM32,
852 .regshift = 2,
853 },
854 {
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530855 .flags = 0,
856 }
Mark A. Greer65e866a2009-03-18 12:36:08 -0500857};
858
Manjunathappa, Prakashfcf71572013-06-19 14:45:42 +0530859struct platform_device dm646x_serial_device[] = {
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530860 {
861 .name = "serial8250",
862 .id = PLAT8250_DEV_PLATFORM,
863 .dev = {
864 .platform_data = dm646x_serial0_platform_data,
865 }
Mark A. Greer65e866a2009-03-18 12:36:08 -0500866 },
Manjunathappa, Prakash19955c32013-06-19 14:45:38 +0530867 {
868 .name = "serial8250",
869 .id = PLAT8250_DEV_PLATFORM1,
870 .dev = {
871 .platform_data = dm646x_serial1_platform_data,
872 }
873 },
874 {
875 .name = "serial8250",
876 .id = PLAT8250_DEV_PLATFORM2,
877 .dev = {
878 .platform_data = dm646x_serial2_platform_data,
879 }
880 },
881 {
882 }
Mark A. Greer65e866a2009-03-18 12:36:08 -0500883};
884
Mark A. Greer79c3c0b2009-04-15 12:38:58 -0700885static struct davinci_soc_info davinci_soc_info_dm646x = {
886 .io_desc = dm646x_io_desc,
887 .io_desc_num = ARRAY_SIZE(dm646x_io_desc),
Cyril Chemparathy3347db82010-05-07 17:06:34 -0400888 .jtag_id_reg = 0x01c40028,
Mark A. Greerb9ab1272009-04-15 12:39:09 -0700889 .ids = dm646x_ids,
890 .ids_num = ARRAY_SIZE(dm646x_ids),
Mark A. Greer66e0c392009-04-15 12:39:23 -0700891 .cpu_clks = dm646x_clks,
Mark A. Greerd81d1882009-04-15 12:39:33 -0700892 .psc_bases = dm646x_psc_bases,
893 .psc_bases_num = ARRAY_SIZE(dm646x_psc_bases),
Cyril Chemparathy779b0d52010-05-07 17:06:38 -0400894 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
Mark A. Greer0e585952009-04-15 12:39:48 -0700895 .pinmux_pins = dm646x_pins,
896 .pinmux_pins_num = ARRAY_SIZE(dm646x_pins),
Cyril Chemparathybd808942010-05-07 17:06:37 -0400897 .intc_base = DAVINCI_ARM_INTC_BASE,
Mark A. Greer673dd362009-04-15 12:40:00 -0700898 .intc_type = DAVINCI_INTC_TYPE_AINTC,
899 .intc_irq_prios = dm646x_default_priorities,
900 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
Mark A. Greerf64691b2009-04-15 12:40:11 -0700901 .timer_info = &dm646x_timer_info,
Mark A. Greer972412b2009-04-15 12:40:56 -0700902 .emac_pdata = &dm646x_emac_pdata,
David Brownell0d04eb42009-04-30 17:35:48 -0700903 .sram_dma = 0x10010000,
904 .sram_len = SZ_32K,
Mark A. Greer79c3c0b2009-04-15 12:38:58 -0700905};
906
Chaithrika U S25acf552009-06-05 06:28:08 -0400907void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
908{
909 dm646x_mcasp0_device.dev.platform_data = pdata;
910 platform_device_register(&dm646x_mcasp0_device);
911}
912
913void __init dm646x_init_mcasp1(struct snd_platform_data *pdata)
914{
915 dm646x_mcasp1_device.dev.platform_data = pdata;
916 platform_device_register(&dm646x_mcasp1_device);
917 platform_device_register(&dm646x_dit_device);
918}
919
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400920void dm646x_setup_vpif(struct vpif_display_config *display_config,
921 struct vpif_capture_config *capture_config)
922{
923 unsigned int value;
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400924
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +0530925 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400926 value &= ~VSCLKDIS_MASK;
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +0530927 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400928
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +0530929 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400930 value &= ~VDD3P3V_VID_MASK;
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +0530931 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
Muralidharan Karicheri85609c12009-09-16 13:15:30 -0400932
933 davinci_cfg_reg(DM646X_STSOMUX_DISABLE);
934 davinci_cfg_reg(DM646X_STSIMUX_DISABLE);
935 davinci_cfg_reg(DM646X_PTSOMUX_DISABLE);
936 davinci_cfg_reg(DM646X_PTSIMUX_DISABLE);
937
938 vpif_display_dev.dev.platform_data = display_config;
939 vpif_capture_dev.dev.platform_data = capture_config;
940 platform_device_register(&vpif_dev);
941 platform_device_register(&vpif_display_dev);
942 platform_device_register(&vpif_capture_dev);
943}
944
Rajashekhara, Sudhakarcce3ddd2010-06-29 11:35:15 +0530945int __init dm646x_init_edma(struct edma_rsv_info *rsv)
946{
Peter Ujfalusi7ab388e2015-10-14 14:42:51 +0300947 struct platform_device *edma_pdev;
948
Peter Ujfalusid4cb7f42015-10-14 14:42:46 +0300949 dm646x_edma_pdata.rsv = rsv;
Rajashekhara, Sudhakarcce3ddd2010-06-29 11:35:15 +0530950
Peter Ujfalusi7ab388e2015-10-14 14:42:51 +0300951 edma_pdev = platform_device_register_full(&dm646x_edma_device);
952 return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0;
Rajashekhara, Sudhakarcce3ddd2010-06-29 11:35:15 +0530953}
954
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700955void __init dm646x_init(void)
956{
Mark A. Greer79c3c0b2009-04-15 12:38:58 -0700957 davinci_common_init(&davinci_soc_info_dm646x);
Manjunath Hadli5cfb19a2011-12-21 19:13:36 +0530958 davinci_map_sysmod();
David Lechner6fc9ebb2016-04-14 14:13:35 -0500959 davinci_clk_init(davinci_soc_info_dm646x.cpu_clks);
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700960}
961
962static int __init dm646x_init_devices(void)
963{
Sekhar Nori12330902014-02-26 10:29:43 +0530964 int ret = 0;
965
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700966 if (!cpu_is_davinci_dm646x())
967 return 0;
968
Cyril Chemparathyd22960c2010-09-15 10:11:22 -0400969 platform_device_register(&dm646x_mdio_device);
Mark A. Greer972412b2009-04-15 12:40:56 -0700970 platform_device_register(&dm646x_emac_device);
Cyril Chemparathyd22960c2010-09-15 10:11:22 -0400971
Sekhar Nori12330902014-02-26 10:29:43 +0530972 ret = davinci_init_wdt();
973 if (ret)
974 pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
975
976 return ret;
Kevin Hilmane38d92f2009-04-29 17:44:58 -0700977}
978postcore_initcall(dm646x_init_devices);