18 #include <mach/cputype.h>
20 #include <mach/irqs.h>
23 #include <mach/time.h>
25 #include <mach/common.h>
36 #define DM644X_REF_FREQ 27000000
38 #define DM644X_EMAC_BASE 0x01c80000
39 #define DM644X_EMAC_MDIO_BASE (DM644X_EMAC_BASE + 0x4000)
40 #define DM644X_EMAC_CNTRL_OFFSET 0x0000
41 #define DM644X_EMAC_CNTRL_MOD_OFFSET 0x1000
42 #define DM644X_EMAC_CNTRL_RAM_OFFSET 0x2000
43 #define DM644X_EMAC_CNTRL_RAM_SIZE 0x2000
55 static struct clk ref_clk = {
60 static struct clk pll1_clk = {
67 static struct clk pll1_sysclk1 = {
68 .name =
"pll1_sysclk1",
74 static struct clk pll1_sysclk2 = {
75 .name =
"pll1_sysclk2",
81 static struct clk pll1_sysclk3 = {
82 .name =
"pll1_sysclk3",
88 static struct clk pll1_sysclk5 = {
89 .name =
"pll1_sysclk5",
95 static struct clk pll1_aux_clk = {
96 .name =
"pll1_aux_clk",
101 static struct clk pll1_sysclkbp = {
102 .name =
"pll1_sysclkbp",
108 static struct clk pll2_clk = {
115 static struct clk pll2_sysclk1 = {
116 .name =
"pll2_sysclk1",
122 static struct clk pll2_sysclk2 = {
123 .name =
"pll2_sysclk2",
129 static struct clk pll2_sysclkbp = {
130 .name =
"pll2_sysclkbp",
136 static struct clk dsp_clk = {
138 .parent = &pll1_sysclk1,
144 static struct clk arm_clk = {
146 .parent = &pll1_sysclk2,
151 static struct clk vicp_clk = {
153 .parent = &pll1_sysclk2,
159 static struct clk vpss_master_clk = {
160 .name =
"vpss_master",
161 .parent = &pll1_sysclk3,
166 static struct clk vpss_slave_clk = {
167 .name =
"vpss_slave",
168 .parent = &pll1_sysclk3,
172 static struct clk uart0_clk = {
174 .parent = &pll1_aux_clk,
178 static struct clk uart1_clk = {
180 .parent = &pll1_aux_clk,
184 static struct clk uart2_clk = {
186 .parent = &pll1_aux_clk,
190 static struct clk emac_clk = {
192 .parent = &pll1_sysclk5,
198 .parent = &pll1_aux_clk,
202 static struct clk ide_clk = {
204 .parent = &pll1_sysclk5,
208 static struct clk asp_clk = {
210 .parent = &pll1_sysclk5,
214 static struct clk mmcsd_clk = {
216 .parent = &pll1_sysclk5,
220 static struct clk spi_clk = {
222 .parent = &pll1_sysclk5,
226 static struct clk gpio_clk = {
228 .parent = &pll1_sysclk5,
232 static struct clk usb_clk = {
234 .parent = &pll1_sysclk5,
238 static struct clk vlynq_clk = {
240 .parent = &pll1_sysclk5,
244 static struct clk aemif_clk = {
246 .parent = &pll1_sysclk5,
250 static struct clk pwm0_clk = {
252 .parent = &pll1_aux_clk,
256 static struct clk pwm1_clk = {
258 .parent = &pll1_aux_clk,
262 static struct clk pwm2_clk = {
264 .parent = &pll1_aux_clk,
268 static struct clk timer0_clk = {
270 .parent = &pll1_aux_clk,
274 static struct clk timer1_clk = {
276 .parent = &pll1_aux_clk,
280 static struct clk timer2_clk = {
282 .parent = &pll1_aux_clk,
290 CLK(
NULL,
"pll1_sysclk1", &pll1_sysclk1),
291 CLK(
NULL,
"pll1_sysclk2", &pll1_sysclk2),
292 CLK(
NULL,
"pll1_sysclk3", &pll1_sysclk3),
293 CLK(
NULL,
"pll1_sysclk5", &pll1_sysclk5),
294 CLK(
NULL,
"pll1_aux", &pll1_aux_clk),
295 CLK(
NULL,
"pll1_sysclkbp", &pll1_sysclkbp),
297 CLK(
NULL,
"pll2_sysclk1", &pll2_sysclk1),
298 CLK(
NULL,
"pll2_sysclk2", &pll2_sysclk2),
299 CLK(
NULL,
"pll2_sysclkbp", &pll2_sysclkbp),
303 CLK(
NULL,
"vpss_master", &vpss_master_clk),
304 CLK(
NULL,
"vpss_slave", &vpss_slave_clk),
306 CLK(
NULL,
"uart0", &uart0_clk),
307 CLK(
NULL,
"uart1", &uart1_clk),
308 CLK(
NULL,
"uart2", &uart2_clk),
309 CLK(
"davinci_emac.1",
NULL, &emac_clk),
310 CLK(
"i2c_davinci.1",
NULL, &i2c_clk),
311 CLK(
"palm_bk3710",
NULL, &ide_clk),
312 CLK(
"davinci-mcbsp",
NULL, &asp_clk),
313 CLK(
"davinci_mmc.0",
NULL, &mmcsd_clk),
317 CLK(
NULL,
"vlynq", &vlynq_clk),
318 CLK(
NULL,
"aemif", &aemif_clk),
322 CLK(
NULL,
"timer0", &timer0_clk),
323 CLK(
NULL,
"timer1", &timer1_clk),
324 CLK(
"watchdog",
NULL, &timer2_clk),
336 static struct resource dm644x_emac_resources[] = {
350 .name =
"davinci_emac",
353 .platform_data = &dm644x_emac_pdata,
355 .num_resources =
ARRAY_SIZE(dm644x_emac_resources),
356 .resource = dm644x_emac_resources,
359 static struct resource dm644x_mdio_resources[] = {
368 .name =
"davinci_mdio",
370 .num_resources =
ARRAY_SIZE(dm644x_mdio_resources),
371 .resource = dm644x_mdio_resources,
380 static const struct mux_config dm644x_pins[] = {
381 #ifdef CONFIG_DAVINCI_MUX
501 queue_tc_mapping[][2] = {
509 queue_priority_mapping[][2] = {
531 static struct resource edma_resources[] = {
535 .end = 0x01c00000 +
SZ_64K - 1,
541 .end = 0x01c10000 +
SZ_1K - 1,
547 .end = 0x01c10400 +
SZ_1K - 1,
566 .dev.platform_data = dm644x_edma_info,
568 .resource = edma_resources,
572 static struct resource dm644x_asp_resources[] = {
591 .name =
"davinci-mcbsp",
593 .num_resources =
ARRAY_SIZE(dm644x_asp_resources),
594 .resource = dm644x_asp_resources,
597 #define DM644X_VPSS_BASE 0x01c73400
599 static struct resource dm644x_vpss_resources[] = {
612 .dev.platform_data =
"dm644x_vpss",
613 .num_resources =
ARRAY_SIZE(dm644x_vpss_resources),
614 .resource = dm644x_vpss_resources,
617 static struct resource dm644x_vpfe_resources[] = {
631 static struct resource dm644x_ccdc_resource[] = {
635 .end = 0x01c70400 + 0xff,
641 .name =
"dm644x_ccdc",
643 .num_resources =
ARRAY_SIZE(dm644x_ccdc_resource),
644 .resource = dm644x_ccdc_resource,
646 .dma_mask = &dm644x_video_dma_mask,
654 .num_resources =
ARRAY_SIZE(dm644x_vpfe_resources),
655 .resource = dm644x_vpfe_resources,
657 .dma_mask = &dm644x_video_dma_mask,
662 #define DM644X_OSD_BASE 0x01c72600
664 static struct resource dm644x_osd_resources[] = {
679 .num_resources =
ARRAY_SIZE(dm644x_osd_resources),
680 .resource = dm644x_osd_resources,
682 .dma_mask = &dm644x_video_dma_mask,
684 .platform_data = &dm644x_osd_data,
688 #define DM644X_VENC_BASE 0x01c72400
690 static struct resource dm644x_venc_resources[] = {
698 #define DM644X_VPSS_MUXSEL_PLL2_MODE BIT(0)
699 #define DM644X_VPSS_MUXSEL_VPBECLK_MODE BIT(1)
700 #define DM644X_VPSS_VENCLKEN BIT(3)
701 #define DM644X_VPSS_DACCLKEN BIT(4)
715 if (pclock <= 27000000) {
734 static struct resource dm644x_v4l2_disp_resources[] = {
745 .num_resources =
ARRAY_SIZE(dm644x_v4l2_disp_resources),
746 .resource = dm644x_v4l2_disp_resources,
748 .dma_mask = &dm644x_video_dma_mask,
755 .setup_clock = dm644x_venc_setup_clock,
761 .num_resources =
ARRAY_SIZE(dm644x_venc_resources),
762 .resource = dm644x_venc_resources,
764 .dma_mask = &dm644x_video_dma_mask,
766 .platform_data = &dm644x_venc_pdata,
771 .name =
"vpbe_controller",
774 .dma_mask = &dm644x_video_dma_mask,
781 static struct map_desc dm644x_io_desc[] = {
801 .manufacturer = 0x017,
808 .manufacturer = 0x017,
859 .name =
"serial8250",
862 .platform_data = dm644x_serial_platform_data,
867 .io_desc = dm644x_io_desc,
869 .jtag_id_reg = 0x01c40028,
872 .cpu_clks = dm644x_clks,
873 .psc_bases = dm644x_psc_bases,
874 .psc_bases_num =
ARRAY_SIZE(dm644x_psc_bases),
876 .pinmux_pins = dm644x_pins,
880 .intc_irq_prios = dm644x_default_priorities,
882 .timer_info = &dm644x_timer_info,
887 .serial_dev = &dm644x_serial_device,
888 .emac_pdata = &dm644x_emac_pdata,
889 .sram_dma = 0x00008000,
896 dm644x_asp_device.
dev.platform_data =
pdata;
909 if (vpfe_cfg || vpbe_cfg)
913 dm644x_vpfe_dev.
dev.platform_data = vpfe_cfg;
918 "vpss_master",
NULL);
924 dm644x_vpbe_dev.
dev.platform_data = vpbe_cfg;
934 static int __init dm644x_init_devices(
void)
944 NULL, &dm644x_emac_device.
dev);