24 #include <mach/cputype.h>
28 #include <mach/irqs.h>
29 #include <mach/time.h>
31 #include <mach/common.h>
41 #define DM365_REF_FREQ 24000000
44 #define DM365_KEYSCAN_BASE 0x01c69400
46 #define DM365_RTC_BASE 0x01c69000
48 #define DAVINCI_DM365_VC_BASE 0x01d0c000
49 #define DAVINCI_DMA_VC_TX 2
50 #define DAVINCI_DMA_VC_RX 3
52 #define DM365_EMAC_BASE 0x01d07000
53 #define DM365_EMAC_MDIO_BASE (DM365_EMAC_BASE + 0x4000)
54 #define DM365_EMAC_CNTRL_OFFSET 0x0000
55 #define DM365_EMAC_CNTRL_MOD_OFFSET 0x3000
56 #define DM365_EMAC_CNTRL_RAM_OFFSET 0x1000
57 #define DM365_EMAC_CNTRL_RAM_SIZE 0x2000
71 static struct clk ref_clk = {
76 static struct clk pll1_clk = {
80 .pll_data = &pll1_data,
83 static struct clk pll1_aux_clk = {
84 .name =
"pll1_aux_clk",
89 static struct clk pll1_sysclkbp = {
90 .name =
"pll1_sysclkbp",
96 static struct clk clkout0_clk = {
102 static struct clk pll1_sysclk1 = {
103 .name =
"pll1_sysclk1",
109 static struct clk pll1_sysclk2 = {
110 .name =
"pll1_sysclk2",
116 static struct clk pll1_sysclk3 = {
117 .name =
"pll1_sysclk3",
123 static struct clk pll1_sysclk4 = {
124 .name =
"pll1_sysclk4",
130 static struct clk pll1_sysclk5 = {
131 .name =
"pll1_sysclk5",
137 static struct clk pll1_sysclk6 = {
138 .name =
"pll1_sysclk6",
144 static struct clk pll1_sysclk7 = {
145 .name =
"pll1_sysclk7",
151 static struct clk pll1_sysclk8 = {
152 .name =
"pll1_sysclk8",
158 static struct clk pll1_sysclk9 = {
159 .name =
"pll1_sysclk9",
165 static struct clk pll2_clk = {
169 .pll_data = &pll2_data,
172 static struct clk pll2_aux_clk = {
173 .name =
"pll2_aux_clk",
178 static struct clk clkout1_clk = {
184 static struct clk pll2_sysclk1 = {
185 .name =
"pll2_sysclk1",
191 static struct clk pll2_sysclk2 = {
192 .name =
"pll2_sysclk2",
198 static struct clk pll2_sysclk3 = {
199 .name =
"pll2_sysclk3",
205 static struct clk pll2_sysclk4 = {
206 .name =
"pll2_sysclk4",
212 static struct clk pll2_sysclk5 = {
213 .name =
"pll2_sysclk5",
219 static struct clk pll2_sysclk6 = {
220 .name =
"pll2_sysclk6",
226 static struct clk pll2_sysclk7 = {
227 .name =
"pll2_sysclk7",
233 static struct clk pll2_sysclk8 = {
234 .name =
"pll2_sysclk8",
240 static struct clk pll2_sysclk9 = {
241 .name =
"pll2_sysclk9",
247 static struct clk vpss_dac_clk = {
249 .parent = &pll1_sysclk3,
253 static struct clk vpss_master_clk = {
254 .name =
"vpss_master",
255 .parent = &pll1_sysclk5,
260 static struct clk arm_clk = {
262 .parent = &pll2_sysclk2,
267 static struct clk uart0_clk = {
269 .parent = &pll1_aux_clk,
273 static struct clk uart1_clk = {
275 .parent = &pll1_sysclk4,
281 .parent = &pll1_aux_clk,
285 static struct clk mmcsd0_clk = {
287 .parent = &pll1_sysclk8,
291 static struct clk mmcsd1_clk = {
293 .parent = &pll1_sysclk4,
297 static struct clk spi0_clk = {
299 .parent = &pll1_sysclk4,
303 static struct clk spi1_clk = {
305 .parent = &pll1_sysclk4,
309 static struct clk spi2_clk = {
311 .parent = &pll1_sysclk4,
315 static struct clk spi3_clk = {
317 .parent = &pll1_sysclk4,
321 static struct clk spi4_clk = {
323 .parent = &pll1_aux_clk,
327 static struct clk gpio_clk = {
329 .parent = &pll1_sysclk4,
333 static struct clk aemif_clk = {
335 .parent = &pll1_sysclk4,
339 static struct clk pwm0_clk = {
341 .parent = &pll1_aux_clk,
345 static struct clk pwm1_clk = {
347 .parent = &pll1_aux_clk,
351 static struct clk pwm2_clk = {
353 .parent = &pll1_aux_clk,
357 static struct clk pwm3_clk = {
363 static struct clk timer0_clk = {
365 .parent = &pll1_aux_clk,
369 static struct clk timer1_clk = {
371 .parent = &pll1_aux_clk,
375 static struct clk timer2_clk = {
377 .parent = &pll1_aux_clk,
382 static struct clk timer3_clk = {
384 .parent = &pll1_aux_clk,
388 static struct clk usb_clk = {
390 .parent = &pll1_aux_clk,
394 static struct clk emac_clk = {
396 .parent = &pll1_sysclk4,
400 static struct clk voicecodec_clk = {
401 .name =
"voice_codec",
402 .parent = &pll2_sysclk4,
406 static struct clk asp0_clk = {
408 .parent = &pll1_sysclk4,
412 static struct clk rto_clk = {
414 .parent = &pll1_sysclk4,
418 static struct clk mjcp_clk = {
420 .parent = &pll1_sysclk3,
427 CLK(
NULL,
"pll1_aux", &pll1_aux_clk),
428 CLK(
NULL,
"pll1_sysclkbp", &pll1_sysclkbp),
429 CLK(
NULL,
"clkout0", &clkout0_clk),
430 CLK(
NULL,
"pll1_sysclk1", &pll1_sysclk1),
431 CLK(
NULL,
"pll1_sysclk2", &pll1_sysclk2),
432 CLK(
NULL,
"pll1_sysclk3", &pll1_sysclk3),
433 CLK(
NULL,
"pll1_sysclk4", &pll1_sysclk4),
434 CLK(
NULL,
"pll1_sysclk5", &pll1_sysclk5),
435 CLK(
NULL,
"pll1_sysclk6", &pll1_sysclk6),
436 CLK(
NULL,
"pll1_sysclk7", &pll1_sysclk7),
437 CLK(
NULL,
"pll1_sysclk8", &pll1_sysclk8),
438 CLK(
NULL,
"pll1_sysclk9", &pll1_sysclk9),
440 CLK(
NULL,
"pll2_aux", &pll2_aux_clk),
441 CLK(
NULL,
"clkout1", &clkout1_clk),
442 CLK(
NULL,
"pll2_sysclk1", &pll2_sysclk1),
443 CLK(
NULL,
"pll2_sysclk2", &pll2_sysclk2),
444 CLK(
NULL,
"pll2_sysclk3", &pll2_sysclk3),
445 CLK(
NULL,
"pll2_sysclk4", &pll2_sysclk4),
446 CLK(
NULL,
"pll2_sysclk5", &pll2_sysclk5),
447 CLK(
NULL,
"pll2_sysclk6", &pll2_sysclk6),
448 CLK(
NULL,
"pll2_sysclk7", &pll2_sysclk7),
449 CLK(
NULL,
"pll2_sysclk8", &pll2_sysclk8),
450 CLK(
NULL,
"pll2_sysclk9", &pll2_sysclk9),
451 CLK(
NULL,
"vpss_dac", &vpss_dac_clk),
452 CLK(
NULL,
"vpss_master", &vpss_master_clk),
454 CLK(
NULL,
"uart0", &uart0_clk),
455 CLK(
NULL,
"uart1", &uart1_clk),
456 CLK(
"i2c_davinci.1",
NULL, &i2c_clk),
457 CLK(
"davinci_mmc.0",
NULL, &mmcsd0_clk),
458 CLK(
"davinci_mmc.1",
NULL, &mmcsd1_clk),
459 CLK(
"spi_davinci.0",
NULL, &spi0_clk),
460 CLK(
"spi_davinci.1",
NULL, &spi1_clk),
461 CLK(
"spi_davinci.2",
NULL, &spi2_clk),
462 CLK(
"spi_davinci.3",
NULL, &spi3_clk),
463 CLK(
"spi_davinci.4",
NULL, &spi4_clk),
465 CLK(
NULL,
"aemif", &aemif_clk),
470 CLK(
NULL,
"timer0", &timer0_clk),
471 CLK(
NULL,
"timer1", &timer1_clk),
472 CLK(
"watchdog",
NULL, &timer2_clk),
473 CLK(
NULL,
"timer3", &timer3_clk),
475 CLK(
"davinci_emac.1",
NULL, &emac_clk),
476 CLK(
"davinci_voicecodec",
NULL, &voicecodec_clk),
477 CLK(
"davinci-mcbsp",
NULL, &asp0_clk),
489 static const struct mux_config dm365_pins[] = {
490 #ifdef CONFIG_DAVINCI_MUX
646 static struct resource dm365_spi0_resources[] = {
667 .name =
"spi_davinci",
670 .dma_mask = &dm365_spi0_dma_mask,
672 .platform_data = &dm365_spi0_pdata,
674 .num_resources =
ARRAY_SIZE(dm365_spi0_resources),
675 .resource = dm365_spi0_resources,
686 if (chipselect_mask &
BIT(0))
688 if (chipselect_mask &
BIT(1))
704 static struct resource dm365_emac_resources[] = {
733 .name =
"davinci_emac",
736 .platform_data = &dm365_emac_pdata,
738 .num_resources =
ARRAY_SIZE(dm365_emac_resources),
739 .resource = dm365_emac_resources,
742 static struct resource dm365_mdio_resources[] = {
751 .name =
"davinci_mdio",
753 .num_resources =
ARRAY_SIZE(dm365_mdio_resources),
754 .resource = dm365_mdio_resources,
826 dm365_queue_tc_mapping[][2] = {
836 dm365_queue_priority_mapping[][2] = {
851 .queue_tc_mapping = dm365_queue_tc_mapping,
852 .queue_priority_mapping = dm365_queue_priority_mapping,
860 static struct resource edma_resources[] = {
864 .end = 0x01c00000 +
SZ_64K - 1,
870 .end = 0x01c10000 +
SZ_1K - 1,
876 .end = 0x01c10400 +
SZ_1K - 1,
882 .end = 0x01c10800 +
SZ_1K - 1,
888 .end = 0x01c10c00 +
SZ_1K - 1,
907 .dev.platform_data = dm365_edma_info,
909 .resource = edma_resources,
912 static struct resource dm365_asp_resources[] = {
931 .name =
"davinci-mcbsp",
933 .num_resources =
ARRAY_SIZE(dm365_asp_resources),
934 .resource = dm365_asp_resources,
937 static struct resource dm365_vc_resources[] = {
956 .name =
"davinci_voicecodec",
958 .num_resources =
ARRAY_SIZE(dm365_vc_resources),
959 .resource = dm365_vc_resources,
962 static struct resource dm365_rtc_resources[] = {
975 .name =
"rtc_davinci",
977 .num_resources =
ARRAY_SIZE(dm365_rtc_resources),
978 .resource = dm365_rtc_resources,
981 static struct map_desc dm365_io_desc[] = {
996 static struct resource dm365_ks_resources[] = {
1012 .name =
"davinci_keyscan",
1014 .num_resources =
ARRAY_SIZE(dm365_ks_resources),
1015 .resource = dm365_ks_resources,
1023 .manufacturer = 0x017,
1025 .name =
"dm365_rev1.1",
1030 .manufacturer = 0x017,
1032 .name =
"dm365_rev1.2",
1041 .clocksource_id =
T0_TOP,
1044 #define DM365_UART1_BASE (IO_PHYS + 0x106000)
1069 .name =
"serial8250",
1072 .platform_data = dm365_serial_platform_data,
1077 .io_desc = dm365_io_desc,
1079 .jtag_id_reg = 0x01c40028,
1082 .cpu_clks = dm365_clks,
1083 .psc_bases = dm365_psc_bases,
1084 .psc_bases_num =
ARRAY_SIZE(dm365_psc_bases),
1086 .pinmux_pins = dm365_pins,
1090 .intc_irq_prios = dm365_default_priorities,
1092 .timer_info = &dm365_timer_info,
1098 .serial_dev = &dm365_serial_device,
1099 .emac_pdata = &dm365_emac_pdata,
1100 .sram_dma = 0x00010000,
1114 dm365_asp_device.
dev.platform_data =
pdata;
1122 dm365_vc_device.
dev.platform_data =
pdata;
1128 dm365_ks_device.
dev.platform_data =
pdata;
1144 static struct resource dm365_vpss_resources[] = {
1148 .start = 0x01c70000,
1149 .end = 0x01c70000 + 0xff,
1155 .start = 0x01c70200,
1156 .end = 0x01c70200 + 0xff,
1164 .dev.platform_data =
"dm365_vpss",
1165 .num_resources =
ARRAY_SIZE(dm365_vpss_resources),
1166 .resource = dm365_vpss_resources,
1169 static struct resource vpfe_resources[] = {
1187 .resource = vpfe_resources,
1189 .dma_mask = &vpfe_capture_dma_mask,
1194 static void dm365_isif_setup_pinmux(
void)
1203 static struct resource isif_resource[] = {
1206 .start = 0x01c71000,
1207 .end = 0x01c71000 + 0x1ff,
1213 .end = 0x1C7C000 + 0x2ff,
1219 .end = 0x1C7C400 + 0x2ff,
1227 .resource = isif_resource,
1229 .dma_mask = &vpfe_capture_dma_mask,
1231 .platform_data = dm365_isif_setup_pinmux,
1235 static int __init dm365_init_devices(
void)
1246 NULL, &dm365_emac_device.
dev);
1259 vpfe_capture_dev.
dev.platform_data =
cfg;