19 #include <mach/cputype.h>
21 #include <mach/irqs.h>
24 #include <mach/time.h>
26 #include <mach/common.h>
34 #define DAVINCI_VPIF_BASE (0x01C12000)
36 #define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\
38 #define VSCLKDIS_MASK (BIT_MASK(11) | BIT_MASK(10) | BIT_MASK(9) |\
44 #define DM646X_REF_FREQ 27000000
45 #define DM646X_AUX_FREQ 24000000
47 #define DM646X_EMAC_BASE 0x01c80000
48 #define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000)
49 #define DM646X_EMAC_CNTRL_OFFSET 0x0000
50 #define DM646X_EMAC_CNTRL_MOD_OFFSET 0x1000
51 #define DM646X_EMAC_CNTRL_RAM_OFFSET 0x2000
52 #define DM646X_EMAC_CNTRL_RAM_SIZE 0x2000
64 static struct clk ref_clk = {
70 static struct clk aux_clkin = {
75 static struct clk pll1_clk = {
82 static struct clk pll1_sysclk1 = {
83 .name =
"pll1_sysclk1",
89 static struct clk pll1_sysclk2 = {
90 .name =
"pll1_sysclk2",
96 static struct clk pll1_sysclk3 = {
97 .name =
"pll1_sysclk3",
103 static struct clk pll1_sysclk4 = {
104 .name =
"pll1_sysclk4",
110 static struct clk pll1_sysclk5 = {
111 .name =
"pll1_sysclk5",
117 static struct clk pll1_sysclk6 = {
118 .name =
"pll1_sysclk6",
124 static struct clk pll1_sysclk8 = {
125 .name =
"pll1_sysclk8",
131 static struct clk pll1_sysclk9 = {
132 .name =
"pll1_sysclk9",
138 static struct clk pll1_sysclkbp = {
139 .name =
"pll1_sysclkbp",
145 static struct clk pll1_aux_clk = {
146 .name =
"pll1_aux_clk",
151 static struct clk pll2_clk = {
158 static struct clk pll2_sysclk1 = {
159 .name =
"pll2_sysclk1",
165 static struct clk dsp_clk = {
167 .parent = &pll1_sysclk1,
172 static struct clk arm_clk = {
174 .parent = &pll1_sysclk2,
179 static struct clk edma_cc_clk = {
181 .parent = &pll1_sysclk2,
186 static struct clk edma_tc0_clk = {
188 .parent = &pll1_sysclk2,
193 static struct clk edma_tc1_clk = {
195 .parent = &pll1_sysclk2,
200 static struct clk edma_tc2_clk = {
202 .parent = &pll1_sysclk2,
207 static struct clk edma_tc3_clk = {
209 .parent = &pll1_sysclk2,
214 static struct clk uart0_clk = {
216 .parent = &aux_clkin,
220 static struct clk uart1_clk = {
222 .parent = &aux_clkin,
226 static struct clk uart2_clk = {
228 .parent = &aux_clkin,
234 .parent = &pll1_sysclk3,
238 static struct clk gpio_clk = {
240 .parent = &pll1_sysclk3,
244 static struct clk mcasp0_clk = {
246 .parent = &pll1_sysclk3,
250 static struct clk mcasp1_clk = {
252 .parent = &pll1_sysclk3,
256 static struct clk aemif_clk = {
258 .parent = &pll1_sysclk3,
263 static struct clk emac_clk = {
265 .parent = &pll1_sysclk3,
269 static struct clk pwm0_clk = {
271 .parent = &pll1_sysclk3,
276 static struct clk pwm1_clk = {
278 .parent = &pll1_sysclk3,
283 static struct clk timer0_clk = {
285 .parent = &pll1_sysclk3,
289 static struct clk timer1_clk = {
291 .parent = &pll1_sysclk3,
295 static struct clk timer2_clk = {
297 .parent = &pll1_sysclk3,
302 static struct clk ide_clk = {
304 .parent = &pll1_sysclk4,
308 static struct clk vpif0_clk = {
315 static struct clk vpif1_clk = {
326 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk1),
327 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk2),
328 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk3),
329 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk4),
330 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk5),
331 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk6),
332 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk8),
333 CLK(
NULL,
"pll1_sysclk", &pll1_sysclk9),
334 CLK(
NULL,
"pll1_sysclk", &pll1_sysclkbp),
335 CLK(
NULL,
"pll1_aux", &pll1_aux_clk),
337 CLK(
NULL,
"pll2_sysclk1", &pll2_sysclk1),
340 CLK(
NULL,
"edma_cc", &edma_cc_clk),
341 CLK(
NULL,
"edma_tc0", &edma_tc0_clk),
342 CLK(
NULL,
"edma_tc1", &edma_tc1_clk),
343 CLK(
NULL,
"edma_tc2", &edma_tc2_clk),
344 CLK(
NULL,
"edma_tc3", &edma_tc3_clk),
345 CLK(
NULL,
"uart0", &uart0_clk),
346 CLK(
NULL,
"uart1", &uart1_clk),
347 CLK(
NULL,
"uart2", &uart2_clk),
348 CLK(
"i2c_davinci.1",
NULL, &i2c_clk),
350 CLK(
"davinci-mcasp.0",
NULL, &mcasp0_clk),
351 CLK(
"davinci-mcasp.1",
NULL, &mcasp1_clk),
352 CLK(
NULL,
"aemif", &aemif_clk),
353 CLK(
"davinci_emac.1",
NULL, &emac_clk),
356 CLK(
NULL,
"timer0", &timer0_clk),
357 CLK(
NULL,
"timer1", &timer1_clk),
358 CLK(
"watchdog",
NULL, &timer2_clk),
359 CLK(
"palm_bk3710",
NULL, &ide_clk),
360 CLK(
NULL,
"vpif0", &vpif0_clk),
361 CLK(
NULL,
"vpif1", &vpif1_clk),
373 static struct resource dm646x_emac_resources[] = {
402 .name =
"davinci_emac",
405 .platform_data = &dm646x_emac_pdata,
407 .num_resources =
ARRAY_SIZE(dm646x_emac_resources),
408 .resource = dm646x_emac_resources,
411 static struct resource dm646x_mdio_resources[] = {
420 .name =
"davinci_mdio",
422 .num_resources =
ARRAY_SIZE(dm646x_mdio_resources),
423 .resource = dm646x_mdio_resources,
432 static const struct mux_config dm646x_pins[] = {
433 #ifdef CONFIG_DAVINCI_MUX
434 MUX_CFG(DM646X, ATAEN, 0, 0, 5, 1,
true)
442 MUX_CFG(DM646X, STSOMUX_DISABLE, 0, 22, 3, 0,
true)
444 MUX_CFG(DM646X, STSIMUX_DISABLE, 0, 20, 3, 0,
true)
446 MUX_CFG(DM646X, PTSOMUX_DISABLE, 0, 18, 3, 0,
true)
448 MUX_CFG(DM646X, PTSIMUX_DISABLE, 0, 16, 3, 0,
true)
454 MUX_CFG(DM646X, PTSOMUX_PARALLEL, 0, 18, 3, 2,
true)
456 MUX_CFG(DM646X, PTSIMUX_PARALLEL, 0, 16, 3, 2,
true)
535 dm646x_queue_tc_mapping[][2] = {
545 dm646x_queue_priority_mapping[][2] = {
560 .queue_tc_mapping = dm646x_queue_tc_mapping,
561 .queue_priority_mapping = dm646x_queue_priority_mapping,
569 static struct resource edma_resources[] = {
573 .end = 0x01c00000 +
SZ_64K - 1,
579 .end = 0x01c10000 +
SZ_1K - 1,
585 .end = 0x01c10400 +
SZ_1K - 1,
591 .end = 0x01c10800 +
SZ_1K - 1,
597 .end = 0x01c10c00 +
SZ_1K - 1,
616 .dev.platform_data = dm646x_edma_info,
618 .resource = edma_resources,
621 static struct resource dm646x_mcasp0_resources[] = {
641 static struct resource dm646x_mcasp1_resources[] = {
663 .name =
"davinci-mcasp",
665 .num_resources =
ARRAY_SIZE(dm646x_mcasp0_resources),
666 .resource = dm646x_mcasp0_resources,
670 .name =
"davinci-mcasp",
672 .num_resources =
ARRAY_SIZE(dm646x_mcasp1_resources),
673 .resource = dm646x_mcasp1_resources,
683 static struct resource vpif_resource[] = {
695 .dma_mask = &vpif_dma_mask,
698 .resource = vpif_resource,
702 static struct resource vpif_display_resource[] = {
716 .name =
"vpif_display",
719 .dma_mask = &vpif_dma_mask,
722 .resource = vpif_display_resource,
723 .num_resources =
ARRAY_SIZE(vpif_display_resource),
726 static struct resource vpif_capture_resource[] = {
740 .name =
"vpif_capture",
743 .dma_mask = &vpif_dma_mask,
746 .resource = vpif_capture_resource,
747 .num_resources =
ARRAY_SIZE(vpif_capture_resource),
752 static struct map_desc dm646x_io_desc[] = {
772 .manufacturer = 0x017,
774 .name =
"dm6467_rev1.x",
779 .manufacturer = 0x017,
781 .name =
"dm6467_rev3.x",
830 .name =
"serial8250",
833 .platform_data = dm646x_serial_platform_data,
838 .io_desc = dm646x_io_desc,
840 .jtag_id_reg = 0x01c40028,
843 .cpu_clks = dm646x_clks,
844 .psc_bases = dm646x_psc_bases,
845 .psc_bases_num =
ARRAY_SIZE(dm646x_psc_bases),
847 .pinmux_pins = dm646x_pins,
851 .intc_irq_prios = dm646x_default_priorities,
853 .timer_info = &dm646x_timer_info,
858 .serial_dev = &dm646x_serial_device,
859 .emac_pdata = &dm646x_emac_pdata,
860 .sram_dma = 0x10010000,
866 dm646x_mcasp0_device.
dev.platform_data =
pdata;
872 dm646x_mcasp1_device.
dev.platform_data =
pdata;
895 vpif_display_dev.
dev.platform_data = display_config;
896 vpif_capture_dev.
dev.platform_data = capture_config;
915 static int __init dm646x_init_devices(
void)
923 NULL, &dm646x_emac_device.
dev);