2 * TI DaVinci DM355 chip specific setup
4 * Author: Kevin Hilman, Deep Root Systems, LLC
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
12 #include <linux/clk-provider.h>
13 #include <linux/clk/davinci.h>
14 #include <linux/clkdev.h>
15 #include <linux/dma-mapping.h>
16 #include <linux/dmaengine.h>
17 #include <linux/init.h>
18 #include <linux/platform_data/edma.h>
19 #include <linux/platform_data/gpio-davinci.h>
20 #include <linux/platform_data/spi-davinci.h>
21 #include <linux/platform_device.h>
22 #include <linux/serial_8250.h>
23 #include <linux/spi/spi.h>
25 #include <asm/mach/map.h>
27 #include <mach/common.h>
28 #include <mach/cputype.h>
29 #include <mach/irqs.h>
31 #include <mach/serial.h>
32 #include <mach/time.h>
38 #define DM355_UART2_BASE (IO_PHYS + 0x206000)
39 #define DM355_OSD_BASE (IO_PHYS + 0x70200)
40 #define DM355_VENC_BASE (IO_PHYS + 0x70400)
43 * Device specific clocks
45 #define DM355_REF_FREQ 24000000 /* 24 or 36 MHz */
47 static u64 dm355_spi0_dma_mask = DMA_BIT_MASK(32);
49 static struct resource dm355_spi0_resources[] = {
53 .flags = IORESOURCE_MEM,
56 .start = IRQ_DM355_SPINT0_0,
57 .flags = IORESOURCE_IRQ,
61 static struct davinci_spi_platform_data dm355_spi0_pdata = {
62 .version = SPI_VERSION_1,
65 .dma_event_q = EVENTQ_1,
68 static struct platform_device dm355_spi0_device = {
69 .name = "spi_davinci",
72 .dma_mask = &dm355_spi0_dma_mask,
73 .coherent_dma_mask = DMA_BIT_MASK(32),
74 .platform_data = &dm355_spi0_pdata,
76 .num_resources = ARRAY_SIZE(dm355_spi0_resources),
77 .resource = dm355_spi0_resources,
80 void __init dm355_init_spi0(unsigned chipselect_mask,
81 const struct spi_board_info *info, unsigned len)
83 /* for now, assume we need MISO */
84 davinci_cfg_reg(DM355_SPI0_SDI);
86 /* not all slaves will be wired up */
87 if (chipselect_mask & BIT(0))
88 davinci_cfg_reg(DM355_SPI0_SDENA0);
89 if (chipselect_mask & BIT(1))
90 davinci_cfg_reg(DM355_SPI0_SDENA1);
92 spi_register_board_info(info, len);
94 platform_device_register(&dm355_spi0_device);
97 /*----------------------------------------------------------------------*/
103 * Device specific mux setup
105 * soc description mux mode mode mux dbg
106 * reg offset mask mode
108 static const struct mux_config dm355_pins[] = {
109 #ifdef CONFIG_DAVINCI_MUX
110 MUX_CFG(DM355, MMCSD0, 4, 2, 1, 0, false)
112 MUX_CFG(DM355, SD1_CLK, 3, 6, 1, 1, false)
113 MUX_CFG(DM355, SD1_CMD, 3, 7, 1, 1, false)
114 MUX_CFG(DM355, SD1_DATA3, 3, 8, 3, 1, false)
115 MUX_CFG(DM355, SD1_DATA2, 3, 10, 3, 1, false)
116 MUX_CFG(DM355, SD1_DATA1, 3, 12, 3, 1, false)
117 MUX_CFG(DM355, SD1_DATA0, 3, 14, 3, 1, false)
119 MUX_CFG(DM355, I2C_SDA, 3, 19, 1, 1, false)
120 MUX_CFG(DM355, I2C_SCL, 3, 20, 1, 1, false)
122 MUX_CFG(DM355, MCBSP0_BDX, 3, 0, 1, 1, false)
123 MUX_CFG(DM355, MCBSP0_X, 3, 1, 1, 1, false)
124 MUX_CFG(DM355, MCBSP0_BFSX, 3, 2, 1, 1, false)
125 MUX_CFG(DM355, MCBSP0_BDR, 3, 3, 1, 1, false)
126 MUX_CFG(DM355, MCBSP0_R, 3, 4, 1, 1, false)
127 MUX_CFG(DM355, MCBSP0_BFSR, 3, 5, 1, 1, false)
129 MUX_CFG(DM355, SPI0_SDI, 4, 1, 1, 0, false)
130 MUX_CFG(DM355, SPI0_SDENA0, 4, 0, 1, 0, false)
131 MUX_CFG(DM355, SPI0_SDENA1, 3, 28, 1, 1, false)
133 INT_CFG(DM355, INT_EDMA_CC, 2, 1, 1, false)
134 INT_CFG(DM355, INT_EDMA_TC0_ERR, 3, 1, 1, false)
135 INT_CFG(DM355, INT_EDMA_TC1_ERR, 4, 1, 1, false)
137 EVT_CFG(DM355, EVT8_ASP1_TX, 0, 1, 0, false)
138 EVT_CFG(DM355, EVT9_ASP1_RX, 1, 1, 0, false)
139 EVT_CFG(DM355, EVT26_MMC0_RX, 2, 1, 0, false)
141 MUX_CFG(DM355, VOUT_FIELD, 1, 18, 3, 1, false)
142 MUX_CFG(DM355, VOUT_FIELD_G70, 1, 18, 3, 0, false)
143 MUX_CFG(DM355, VOUT_HVSYNC, 1, 16, 1, 0, false)
144 MUX_CFG(DM355, VOUT_COUTL_EN, 1, 0, 0xff, 0x55, false)
145 MUX_CFG(DM355, VOUT_COUTH_EN, 1, 8, 0xff, 0x55, false)
147 MUX_CFG(DM355, VIN_PCLK, 0, 14, 1, 1, false)
148 MUX_CFG(DM355, VIN_CAM_WEN, 0, 13, 1, 1, false)
149 MUX_CFG(DM355, VIN_CAM_VD, 0, 12, 1, 1, false)
150 MUX_CFG(DM355, VIN_CAM_HD, 0, 11, 1, 1, false)
151 MUX_CFG(DM355, VIN_YIN_EN, 0, 10, 1, 1, false)
152 MUX_CFG(DM355, VIN_CINL_EN, 0, 0, 0xff, 0x55, false)
153 MUX_CFG(DM355, VIN_CINH_EN, 0, 8, 3, 3, false)
157 static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
158 [IRQ_DM355_CCDC_VDINT0] = 2,
159 [IRQ_DM355_CCDC_VDINT1] = 6,
160 [IRQ_DM355_CCDC_VDINT2] = 6,
161 [IRQ_DM355_IPIPE_HST] = 6,
162 [IRQ_DM355_H3AINT] = 6,
163 [IRQ_DM355_IPIPE_SDR] = 6,
164 [IRQ_DM355_IPIPEIFINT] = 6,
165 [IRQ_DM355_OSDINT] = 7,
166 [IRQ_DM355_VENCINT] = 6,
170 [IRQ_DM355_RTOINT] = 4,
171 [IRQ_DM355_UARTINT2] = 7,
172 [IRQ_DM355_TINT6] = 7,
173 [IRQ_CCINT0] = 5, /* dma */
174 [IRQ_CCERRINT] = 5, /* dma */
175 [IRQ_TCERRINT0] = 5, /* dma */
176 [IRQ_TCERRINT] = 5, /* dma */
177 [IRQ_DM355_SPINT2_1] = 7,
178 [IRQ_DM355_TINT7] = 4,
179 [IRQ_DM355_SDIOINT0] = 7,
183 [IRQ_DM355_MMCINT1] = 7,
184 [IRQ_DM355_PWMINT3] = 7,
187 [IRQ_DM355_SDIOINT1] = 4,
188 [IRQ_TINT0_TINT12] = 2, /* clockevent */
189 [IRQ_TINT0_TINT34] = 2, /* clocksource */
190 [IRQ_TINT1_TINT12] = 7, /* DSP timer */
191 [IRQ_TINT1_TINT34] = 7, /* system tick */
198 [IRQ_DM355_SPINT0_0] = 3,
199 [IRQ_DM355_SPINT0_1] = 3,
200 [IRQ_DM355_GPIO0] = 3,
201 [IRQ_DM355_GPIO1] = 7,
202 [IRQ_DM355_GPIO2] = 4,
203 [IRQ_DM355_GPIO3] = 4,
204 [IRQ_DM355_GPIO4] = 7,
205 [IRQ_DM355_GPIO5] = 7,
206 [IRQ_DM355_GPIO6] = 7,
207 [IRQ_DM355_GPIO7] = 7,
208 [IRQ_DM355_GPIO8] = 7,
209 [IRQ_DM355_GPIO9] = 7,
210 [IRQ_DM355_GPIOBNK0] = 7,
211 [IRQ_DM355_GPIOBNK1] = 7,
212 [IRQ_DM355_GPIOBNK2] = 7,
213 [IRQ_DM355_GPIOBNK3] = 7,
214 [IRQ_DM355_GPIOBNK4] = 7,
215 [IRQ_DM355_GPIOBNK5] = 7,
216 [IRQ_DM355_GPIOBNK6] = 7,
222 /*----------------------------------------------------------------------*/
224 static s8 queue_priority_mapping[][2] = {
225 /* {event queue no, Priority} */
231 static const struct dma_slave_map dm355_edma_map[] = {
232 { "davinci-mcbsp.0", "tx", EDMA_FILTER_PARAM(0, 2) },
233 { "davinci-mcbsp.0", "rx", EDMA_FILTER_PARAM(0, 3) },
234 { "davinci-mcbsp.1", "tx", EDMA_FILTER_PARAM(0, 8) },
235 { "davinci-mcbsp.1", "rx", EDMA_FILTER_PARAM(0, 9) },
236 { "spi_davinci.2", "tx", EDMA_FILTER_PARAM(0, 10) },
237 { "spi_davinci.2", "rx", EDMA_FILTER_PARAM(0, 11) },
238 { "spi_davinci.1", "tx", EDMA_FILTER_PARAM(0, 14) },
239 { "spi_davinci.1", "rx", EDMA_FILTER_PARAM(0, 15) },
240 { "spi_davinci.0", "tx", EDMA_FILTER_PARAM(0, 16) },
241 { "spi_davinci.0", "rx", EDMA_FILTER_PARAM(0, 17) },
242 { "dm6441-mmc.0", "rx", EDMA_FILTER_PARAM(0, 26) },
243 { "dm6441-mmc.0", "tx", EDMA_FILTER_PARAM(0, 27) },
244 { "dm6441-mmc.1", "rx", EDMA_FILTER_PARAM(0, 30) },
245 { "dm6441-mmc.1", "tx", EDMA_FILTER_PARAM(0, 31) },
248 static struct edma_soc_info dm355_edma_pdata = {
249 .queue_priority_mapping = queue_priority_mapping,
250 .default_queue = EVENTQ_1,
251 .slave_map = dm355_edma_map,
252 .slavecnt = ARRAY_SIZE(dm355_edma_map),
255 static struct resource edma_resources[] = {
259 .end = 0x01c00000 + SZ_64K - 1,
260 .flags = IORESOURCE_MEM,
265 .end = 0x01c10000 + SZ_1K - 1,
266 .flags = IORESOURCE_MEM,
271 .end = 0x01c10400 + SZ_1K - 1,
272 .flags = IORESOURCE_MEM,
275 .name = "edma3_ccint",
277 .flags = IORESOURCE_IRQ,
280 .name = "edma3_ccerrint",
281 .start = IRQ_CCERRINT,
282 .flags = IORESOURCE_IRQ,
284 /* not using (or muxing) TC*_ERR */
287 static const struct platform_device_info dm355_edma_device __initconst = {
290 .dma_mask = DMA_BIT_MASK(32),
291 .res = edma_resources,
292 .num_res = ARRAY_SIZE(edma_resources),
293 .data = &dm355_edma_pdata,
294 .size_data = sizeof(dm355_edma_pdata),
297 static struct resource dm355_asp1_resources[] = {
300 .start = DAVINCI_ASP1_BASE,
301 .end = DAVINCI_ASP1_BASE + SZ_8K - 1,
302 .flags = IORESOURCE_MEM,
305 .start = DAVINCI_DMA_ASP1_TX,
306 .end = DAVINCI_DMA_ASP1_TX,
307 .flags = IORESOURCE_DMA,
310 .start = DAVINCI_DMA_ASP1_RX,
311 .end = DAVINCI_DMA_ASP1_RX,
312 .flags = IORESOURCE_DMA,
316 static struct platform_device dm355_asp1_device = {
317 .name = "davinci-mcbsp",
319 .num_resources = ARRAY_SIZE(dm355_asp1_resources),
320 .resource = dm355_asp1_resources,
323 static void dm355_ccdc_setup_pinmux(void)
325 davinci_cfg_reg(DM355_VIN_PCLK);
326 davinci_cfg_reg(DM355_VIN_CAM_WEN);
327 davinci_cfg_reg(DM355_VIN_CAM_VD);
328 davinci_cfg_reg(DM355_VIN_CAM_HD);
329 davinci_cfg_reg(DM355_VIN_YIN_EN);
330 davinci_cfg_reg(DM355_VIN_CINL_EN);
331 davinci_cfg_reg(DM355_VIN_CINH_EN);
334 static struct resource dm355_vpss_resources[] = {
336 /* VPSS BL Base address */
339 .end = 0x01c70800 + 0xff,
340 .flags = IORESOURCE_MEM,
343 /* VPSS CLK Base address */
346 .end = 0x01c70000 + 0xf,
347 .flags = IORESOURCE_MEM,
351 static struct platform_device dm355_vpss_device = {
354 .dev.platform_data = "dm355_vpss",
355 .num_resources = ARRAY_SIZE(dm355_vpss_resources),
356 .resource = dm355_vpss_resources,
359 static struct resource vpfe_resources[] = {
363 .flags = IORESOURCE_IRQ,
368 .flags = IORESOURCE_IRQ,
372 static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
373 static struct resource dm355_ccdc_resource[] = {
374 /* CCDC Base address */
376 .flags = IORESOURCE_MEM,
378 .end = 0x01c70600 + 0x1ff,
381 static struct platform_device dm355_ccdc_dev = {
382 .name = "dm355_ccdc",
384 .num_resources = ARRAY_SIZE(dm355_ccdc_resource),
385 .resource = dm355_ccdc_resource,
387 .dma_mask = &vpfe_capture_dma_mask,
388 .coherent_dma_mask = DMA_BIT_MASK(32),
389 .platform_data = dm355_ccdc_setup_pinmux,
393 static struct platform_device vpfe_capture_dev = {
394 .name = CAPTURE_DRV_NAME,
396 .num_resources = ARRAY_SIZE(vpfe_resources),
397 .resource = vpfe_resources,
399 .dma_mask = &vpfe_capture_dma_mask,
400 .coherent_dma_mask = DMA_BIT_MASK(32),
404 static struct resource dm355_osd_resources[] = {
406 .start = DM355_OSD_BASE,
407 .end = DM355_OSD_BASE + 0x17f,
408 .flags = IORESOURCE_MEM,
412 static struct platform_device dm355_osd_dev = {
413 .name = DM355_VPBE_OSD_SUBDEV_NAME,
415 .num_resources = ARRAY_SIZE(dm355_osd_resources),
416 .resource = dm355_osd_resources,
418 .dma_mask = &vpfe_capture_dma_mask,
419 .coherent_dma_mask = DMA_BIT_MASK(32),
423 static struct resource dm355_venc_resources[] = {
425 .start = IRQ_VENCINT,
427 .flags = IORESOURCE_IRQ,
429 /* venc registers io space */
431 .start = DM355_VENC_BASE,
432 .end = DM355_VENC_BASE + 0x17f,
433 .flags = IORESOURCE_MEM,
435 /* VDAC config register io space */
437 .start = DAVINCI_SYSTEM_MODULE_BASE + SYSMOD_VDAC_CONFIG,
438 .end = DAVINCI_SYSTEM_MODULE_BASE + SYSMOD_VDAC_CONFIG + 3,
439 .flags = IORESOURCE_MEM,
443 static struct resource dm355_v4l2_disp_resources[] = {
445 .start = IRQ_VENCINT,
447 .flags = IORESOURCE_IRQ,
449 /* venc registers io space */
451 .start = DM355_VENC_BASE,
452 .end = DM355_VENC_BASE + 0x17f,
453 .flags = IORESOURCE_MEM,
457 static int dm355_vpbe_setup_pinmux(u32 if_type, int field)
460 case MEDIA_BUS_FMT_SGRBG8_1X8:
461 davinci_cfg_reg(DM355_VOUT_FIELD_G70);
463 case MEDIA_BUS_FMT_YUYV10_1X20:
465 davinci_cfg_reg(DM355_VOUT_FIELD);
467 davinci_cfg_reg(DM355_VOUT_FIELD_G70);
473 davinci_cfg_reg(DM355_VOUT_COUTL_EN);
474 davinci_cfg_reg(DM355_VOUT_COUTH_EN);
479 static int dm355_venc_setup_clock(enum vpbe_enc_timings_type type,
482 void __iomem *vpss_clk_ctrl_reg;
484 vpss_clk_ctrl_reg = DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL);
488 writel(VPSS_DACCLKEN_ENABLE | VPSS_VENCCLKEN_ENABLE,
491 case VPBE_ENC_DV_TIMINGS:
492 if (pclock > 27000000)
494 * For HD, use external clock source since we cannot
495 * support HD mode with internal clocks.
497 writel(VPSS_MUXSEL_EXTCLK_ENABLE, vpss_clk_ctrl_reg);
506 static struct platform_device dm355_vpbe_display = {
509 .num_resources = ARRAY_SIZE(dm355_v4l2_disp_resources),
510 .resource = dm355_v4l2_disp_resources,
512 .dma_mask = &vpfe_capture_dma_mask,
513 .coherent_dma_mask = DMA_BIT_MASK(32),
517 static struct venc_platform_data dm355_venc_pdata = {
518 .setup_pinmux = dm355_vpbe_setup_pinmux,
519 .setup_clock = dm355_venc_setup_clock,
522 static struct platform_device dm355_venc_dev = {
523 .name = DM355_VPBE_VENC_SUBDEV_NAME,
525 .num_resources = ARRAY_SIZE(dm355_venc_resources),
526 .resource = dm355_venc_resources,
528 .dma_mask = &vpfe_capture_dma_mask,
529 .coherent_dma_mask = DMA_BIT_MASK(32),
530 .platform_data = (void *)&dm355_venc_pdata,
534 static struct platform_device dm355_vpbe_dev = {
535 .name = "vpbe_controller",
538 .dma_mask = &vpfe_capture_dma_mask,
539 .coherent_dma_mask = DMA_BIT_MASK(32),
543 static struct resource dm355_gpio_resources[] = {
545 .start = DAVINCI_GPIO_BASE,
546 .end = DAVINCI_GPIO_BASE + SZ_4K - 1,
547 .flags = IORESOURCE_MEM,
550 .start = IRQ_DM355_GPIOBNK0,
551 .end = IRQ_DM355_GPIOBNK0,
552 .flags = IORESOURCE_IRQ,
555 .start = IRQ_DM355_GPIOBNK1,
556 .end = IRQ_DM355_GPIOBNK1,
557 .flags = IORESOURCE_IRQ,
560 .start = IRQ_DM355_GPIOBNK2,
561 .end = IRQ_DM355_GPIOBNK2,
562 .flags = IORESOURCE_IRQ,
565 .start = IRQ_DM355_GPIOBNK3,
566 .end = IRQ_DM355_GPIOBNK3,
567 .flags = IORESOURCE_IRQ,
570 .start = IRQ_DM355_GPIOBNK4,
571 .end = IRQ_DM355_GPIOBNK4,
572 .flags = IORESOURCE_IRQ,
575 .start = IRQ_DM355_GPIOBNK5,
576 .end = IRQ_DM355_GPIOBNK5,
577 .flags = IORESOURCE_IRQ,
580 .start = IRQ_DM355_GPIOBNK6,
581 .end = IRQ_DM355_GPIOBNK6,
582 .flags = IORESOURCE_IRQ,
586 static struct davinci_gpio_platform_data dm355_gpio_platform_data = {
590 int __init dm355_gpio_register(void)
592 return davinci_gpio_register(dm355_gpio_resources,
593 ARRAY_SIZE(dm355_gpio_resources),
594 &dm355_gpio_platform_data);
596 /*----------------------------------------------------------------------*/
598 static struct map_desc dm355_io_desc[] = {
601 .pfn = __phys_to_pfn(IO_PHYS),
607 /* Contents of JTAG ID register used to identify exact cpu type */
608 static struct davinci_id dm355_ids[] = {
612 .manufacturer = 0x00f,
613 .cpu_id = DAVINCI_CPU_ID_DM355,
619 * T0_BOT: Timer 0, bottom: clockevent source for hrtimers
620 * T0_TOP: Timer 0, top : clocksource for generic timekeeping
621 * T1_BOT: Timer 1, bottom: (used by DSP in TI DSPLink code)
622 * T1_TOP: Timer 1, top : <unused>
624 static struct davinci_timer_info dm355_timer_info = {
625 .timers = davinci_timer_instance,
626 .clockevent_id = T0_BOT,
627 .clocksource_id = T0_TOP,
630 static struct plat_serial8250_port dm355_serial0_platform_data[] = {
632 .mapbase = DAVINCI_UART0_BASE,
634 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
643 static struct plat_serial8250_port dm355_serial1_platform_data[] = {
645 .mapbase = DAVINCI_UART1_BASE,
647 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
656 static struct plat_serial8250_port dm355_serial2_platform_data[] = {
658 .mapbase = DM355_UART2_BASE,
659 .irq = IRQ_DM355_UARTINT2,
660 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
670 struct platform_device dm355_serial_device[] = {
672 .name = "serial8250",
673 .id = PLAT8250_DEV_PLATFORM,
675 .platform_data = dm355_serial0_platform_data,
679 .name = "serial8250",
680 .id = PLAT8250_DEV_PLATFORM1,
682 .platform_data = dm355_serial1_platform_data,
686 .name = "serial8250",
687 .id = PLAT8250_DEV_PLATFORM2,
689 .platform_data = dm355_serial2_platform_data,
696 static const struct davinci_soc_info davinci_soc_info_dm355 = {
697 .io_desc = dm355_io_desc,
698 .io_desc_num = ARRAY_SIZE(dm355_io_desc),
699 .jtag_id_reg = 0x01c40028,
701 .ids_num = ARRAY_SIZE(dm355_ids),
702 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE,
703 .pinmux_pins = dm355_pins,
704 .pinmux_pins_num = ARRAY_SIZE(dm355_pins),
705 .intc_base = DAVINCI_ARM_INTC_BASE,
706 .intc_type = DAVINCI_INTC_TYPE_AINTC,
707 .intc_irq_prios = dm355_default_priorities,
708 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
709 .timer_info = &dm355_timer_info,
710 .sram_dma = 0x00010000,
714 void __init dm355_init_asp1(u32 evt_enable)
716 /* we don't use ASP1 IRQs, or we'd need to mux them ... */
717 if (evt_enable & ASP1_TX_EVT_EN)
718 davinci_cfg_reg(DM355_EVT8_ASP1_TX);
720 if (evt_enable & ASP1_RX_EVT_EN)
721 davinci_cfg_reg(DM355_EVT9_ASP1_RX);
723 platform_device_register(&dm355_asp1_device);
726 void __init dm355_init(void)
728 davinci_common_init(&davinci_soc_info_dm355);
729 davinci_map_sysmod();
732 void __init dm355_init_time(void)
734 void __iomem *pll1, *psc;
737 clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM355_REF_FREQ);
739 pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_1K);
740 dm355_pll1_init(NULL, pll1, NULL);
742 psc = ioremap(DAVINCI_PWR_SLEEP_CNTRL_BASE, SZ_4K);
743 dm355_psc_init(NULL, psc);
745 clk = clk_get(NULL, "timer0");
747 davinci_timer_init(clk);
750 static struct resource dm355_pll2_resources[] = {
752 .start = DAVINCI_PLL2_BASE,
753 .end = DAVINCI_PLL2_BASE + SZ_1K - 1,
754 .flags = IORESOURCE_MEM,
758 static struct platform_device dm355_pll2_device = {
759 .name = "dm355-pll2",
761 .resource = dm355_pll2_resources,
762 .num_resources = ARRAY_SIZE(dm355_pll2_resources),
765 void __init dm355_register_clocks(void)
767 /* PLL1 and PSC are registered in dm355_init_time() */
768 platform_device_register(&dm355_pll2_device);
771 int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
772 struct vpbe_config *vpbe_cfg)
774 if (vpfe_cfg || vpbe_cfg)
775 platform_device_register(&dm355_vpss_device);
778 vpfe_capture_dev.dev.platform_data = vpfe_cfg;
779 platform_device_register(&dm355_ccdc_dev);
780 platform_device_register(&vpfe_capture_dev);
784 dm355_vpbe_dev.dev.platform_data = vpbe_cfg;
785 platform_device_register(&dm355_osd_dev);
786 platform_device_register(&dm355_venc_dev);
787 platform_device_register(&dm355_vpbe_dev);
788 platform_device_register(&dm355_vpbe_display);
794 static int __init dm355_init_devices(void)
796 struct platform_device *edma_pdev;
799 if (!cpu_is_davinci_dm355())
802 davinci_cfg_reg(DM355_INT_EDMA_CC);
803 edma_pdev = platform_device_register_full(&dm355_edma_device);
804 if (IS_ERR(edma_pdev)) {
805 pr_warn("%s: Failed to register eDMA\n", __func__);
806 return PTR_ERR(edma_pdev);
809 ret = davinci_init_wdt();
811 pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
815 postcore_initcall(dm355_init_devices);