diff options
Diffstat (limited to 'arch/arm/mach-tegra/devices.c')
-rw-r--r-- | arch/arm/mach-tegra/devices.c | 1153 |
1 files changed, 1135 insertions, 18 deletions
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c index 1528f9daef1..202c767550e 100644 --- a/arch/arm/mach-tegra/devices.c +++ b/arch/arm/mach-tegra/devices.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * Colin Cross <ccross@android.com> | 5 | * Colin Cross <ccross@android.com> |
6 | * Erik Gilling <ccross@android.com> | 6 | * Erik Gilling <ccross@android.com> |
7 | * | 7 | * |
8 | * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved. | ||
9 | * | ||
8 | * This software is licensed under the terms of the GNU General Public | 10 | * This software is licensed under the terms of the GNU General Public |
9 | * License version 2, as published by the Free Software Foundation, and | 11 | * License version 2, as published by the Free Software Foundation, and |
10 | * may be copied, distributed, and modified under those terms. | 12 | * may be copied, distributed, and modified under those terms. |
@@ -18,14 +20,23 @@ | |||
18 | 20 | ||
19 | 21 | ||
20 | #include <linux/resource.h> | 22 | #include <linux/resource.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
23 | #include <linux/fsl_devices.h> | 24 | #include <linux/fsl_devices.h> |
24 | #include <linux/serial_8250.h> | 25 | #include <linux/serial_8250.h> |
26 | #include <linux/i2c-tegra.h> | ||
27 | #include <linux/platform_data/tegra_usb.h> | ||
28 | #include <linux/tegra_avp.h> | ||
29 | #include <linux/nvhost.h> | ||
30 | #include <linux/clk.h> | ||
25 | #include <asm/pmu.h> | 31 | #include <asm/pmu.h> |
26 | #include <mach/irqs.h> | 32 | #include <mach/irqs.h> |
27 | #include <mach/iomap.h> | 33 | #include <mach/iomap.h> |
28 | #include <mach/dma.h> | 34 | #include <mach/dma.h> |
35 | #include <mach/usb_phy.h> | ||
36 | #include <mach/tegra_smmu.h> | ||
37 | |||
38 | #include "gpio-names.h" | ||
39 | #include "devices.h" | ||
29 | 40 | ||
30 | static struct resource i2c_resource1[] = { | 41 | static struct resource i2c_resource1[] = { |
31 | [0] = { | 42 | [0] = { |
@@ -66,6 +77,7 @@ static struct resource i2c_resource3[] = { | |||
66 | }, | 77 | }, |
67 | }; | 78 | }; |
68 | 79 | ||
80 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
69 | static struct resource i2c_resource4[] = { | 81 | static struct resource i2c_resource4[] = { |
70 | [0] = { | 82 | [0] = { |
71 | .start = INT_DVC, | 83 | .start = INT_DVC, |
@@ -79,13 +91,57 @@ static struct resource i2c_resource4[] = { | |||
79 | }, | 91 | }, |
80 | }; | 92 | }; |
81 | 93 | ||
94 | #else | ||
95 | static struct resource i2c_resource4[] = { | ||
96 | [0] = { | ||
97 | .start = INT_I2C4, | ||
98 | .end = INT_I2C4, | ||
99 | .flags = IORESOURCE_IRQ, | ||
100 | }, | ||
101 | [1] = { | ||
102 | .start = TEGRA_I2C4_BASE, | ||
103 | .end = TEGRA_I2C4_BASE + TEGRA_I2C4_SIZE-1, | ||
104 | .flags = IORESOURCE_MEM, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | static struct resource i2c_resource5[] = { | ||
109 | [0] = { | ||
110 | .start = INT_I2C5, | ||
111 | .end = INT_I2C5, | ||
112 | .flags = IORESOURCE_IRQ, | ||
113 | }, | ||
114 | [1] = { | ||
115 | .start = TEGRA_I2C5_BASE, | ||
116 | .end = TEGRA_I2C5_BASE + TEGRA_I2C5_SIZE-1, | ||
117 | .flags = IORESOURCE_MEM, | ||
118 | }, | ||
119 | }; | ||
120 | #endif | ||
121 | |||
122 | static struct tegra_i2c_platform_data tegra_i2c1_platform_data = { | ||
123 | .bus_clk_rate = { 400000 }, | ||
124 | }; | ||
125 | |||
126 | static struct tegra_i2c_platform_data tegra_i2c2_platform_data = { | ||
127 | .bus_clk_rate = { 400000 }, | ||
128 | }; | ||
129 | |||
130 | static struct tegra_i2c_platform_data tegra_i2c3_platform_data = { | ||
131 | .bus_clk_rate = { 400000 }, | ||
132 | }; | ||
133 | |||
134 | static struct tegra_i2c_platform_data tegra_dvc_platform_data = { | ||
135 | .bus_clk_rate = { 400000 }, | ||
136 | }; | ||
137 | |||
82 | struct platform_device tegra_i2c_device1 = { | 138 | struct platform_device tegra_i2c_device1 = { |
83 | .name = "tegra-i2c", | 139 | .name = "tegra-i2c", |
84 | .id = 0, | 140 | .id = 0, |
85 | .resource = i2c_resource1, | 141 | .resource = i2c_resource1, |
86 | .num_resources = ARRAY_SIZE(i2c_resource1), | 142 | .num_resources = ARRAY_SIZE(i2c_resource1), |
87 | .dev = { | 143 | .dev = { |
88 | .platform_data = 0, | 144 | .platform_data = &tegra_i2c1_platform_data, |
89 | }, | 145 | }, |
90 | }; | 146 | }; |
91 | 147 | ||
@@ -95,7 +151,7 @@ struct platform_device tegra_i2c_device2 = { | |||
95 | .resource = i2c_resource2, | 151 | .resource = i2c_resource2, |
96 | .num_resources = ARRAY_SIZE(i2c_resource2), | 152 | .num_resources = ARRAY_SIZE(i2c_resource2), |
97 | .dev = { | 153 | .dev = { |
98 | .platform_data = 0, | 154 | .platform_data = &tegra_i2c2_platform_data, |
99 | }, | 155 | }, |
100 | }; | 156 | }; |
101 | 157 | ||
@@ -105,7 +161,7 @@ struct platform_device tegra_i2c_device3 = { | |||
105 | .resource = i2c_resource3, | 161 | .resource = i2c_resource3, |
106 | .num_resources = ARRAY_SIZE(i2c_resource3), | 162 | .num_resources = ARRAY_SIZE(i2c_resource3), |
107 | .dev = { | 163 | .dev = { |
108 | .platform_data = 0, | 164 | .platform_data = &tegra_i2c3_platform_data, |
109 | }, | 165 | }, |
110 | }; | 166 | }; |
111 | 167 | ||
@@ -115,14 +171,26 @@ struct platform_device tegra_i2c_device4 = { | |||
115 | .resource = i2c_resource4, | 171 | .resource = i2c_resource4, |
116 | .num_resources = ARRAY_SIZE(i2c_resource4), | 172 | .num_resources = ARRAY_SIZE(i2c_resource4), |
117 | .dev = { | 173 | .dev = { |
174 | .platform_data = &tegra_dvc_platform_data, | ||
175 | }, | ||
176 | }; | ||
177 | |||
178 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
179 | struct platform_device tegra_i2c_device5 = { | ||
180 | .name = "tegra-i2c", | ||
181 | .id = 4, | ||
182 | .resource = i2c_resource5, | ||
183 | .num_resources = ARRAY_SIZE(i2c_resource5), | ||
184 | .dev = { | ||
118 | .platform_data = 0, | 185 | .platform_data = 0, |
119 | }, | 186 | }, |
120 | }; | 187 | }; |
188 | #endif | ||
121 | 189 | ||
122 | static struct resource spi_resource1[] = { | 190 | static struct resource spi_resource1[] = { |
123 | [0] = { | 191 | [0] = { |
124 | .start = INT_S_LINK1, | 192 | .start = INT_SPI_1, |
125 | .end = INT_S_LINK1, | 193 | .end = INT_SPI_1, |
126 | .flags = IORESOURCE_IRQ, | 194 | .flags = IORESOURCE_IRQ, |
127 | }, | 195 | }, |
128 | [1] = { | 196 | [1] = { |
@@ -170,6 +238,54 @@ static struct resource spi_resource4[] = { | |||
170 | .flags = IORESOURCE_MEM, | 238 | .flags = IORESOURCE_MEM, |
171 | }, | 239 | }, |
172 | }; | 240 | }; |
241 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
242 | static struct resource spi_resource5[] = { | ||
243 | [0] = { | ||
244 | .start = INT_SPI_5, | ||
245 | .end = INT_SPI_5, | ||
246 | .flags = IORESOURCE_IRQ, | ||
247 | }, | ||
248 | [1] = { | ||
249 | .start = TEGRA_SPI5_BASE, | ||
250 | .end = TEGRA_SPI5_BASE + TEGRA_SPI5_SIZE-1, | ||
251 | .flags = IORESOURCE_MEM, | ||
252 | }, | ||
253 | }; | ||
254 | |||
255 | static struct resource spi_resource6[] = { | ||
256 | [0] = { | ||
257 | .start = INT_SPI_6, | ||
258 | .end = INT_SPI_6, | ||
259 | .flags = IORESOURCE_IRQ, | ||
260 | }, | ||
261 | [1] = { | ||
262 | .start = TEGRA_SPI6_BASE, | ||
263 | .end = TEGRA_SPI6_BASE + TEGRA_SPI6_SIZE-1, | ||
264 | .flags = IORESOURCE_MEM, | ||
265 | }, | ||
266 | }; | ||
267 | #endif | ||
268 | |||
269 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
270 | static struct resource dtv_resource[] = { | ||
271 | [0] = { | ||
272 | .start = INT_DTV, | ||
273 | .end = INT_DTV, | ||
274 | .flags = IORESOURCE_IRQ, | ||
275 | }, | ||
276 | [1] = { | ||
277 | .start = TEGRA_DTV_BASE, | ||
278 | .end = TEGRA_DTV_BASE + TEGRA_DTV_SIZE - 1, | ||
279 | .flags = IORESOURCE_MEM, | ||
280 | }, | ||
281 | [2] = { | ||
282 | .start = TEGRA_DMA_REQ_SEL_DTV, | ||
283 | .end = TEGRA_DMA_REQ_SEL_DTV, | ||
284 | .flags = IORESOURCE_DMA | ||
285 | }, | ||
286 | }; | ||
287 | #endif | ||
288 | |||
173 | 289 | ||
174 | struct platform_device tegra_spi_device1 = { | 290 | struct platform_device tegra_spi_device1 = { |
175 | .name = "spi_tegra", | 291 | .name = "spi_tegra", |
@@ -210,7 +326,131 @@ struct platform_device tegra_spi_device4 = { | |||
210 | .coherent_dma_mask = 0xffffffff, | 326 | .coherent_dma_mask = 0xffffffff, |
211 | }, | 327 | }, |
212 | }; | 328 | }; |
329 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
330 | struct platform_device tegra_spi_device5 = { | ||
331 | .name = "spi_tegra", | ||
332 | .id = 4, | ||
333 | .resource = spi_resource5, | ||
334 | .num_resources = ARRAY_SIZE(spi_resource5), | ||
335 | .dev = { | ||
336 | .coherent_dma_mask = 0xffffffff, | ||
337 | }, | ||
338 | }; | ||
339 | |||
340 | struct platform_device tegra_spi_device6 = { | ||
341 | .name = "spi_tegra", | ||
342 | .id = 5, | ||
343 | .resource = spi_resource6, | ||
344 | .num_resources = ARRAY_SIZE(spi_resource6), | ||
345 | .dev = { | ||
346 | .coherent_dma_mask = 0xffffffff, | ||
347 | }, | ||
348 | }; | ||
349 | #endif | ||
350 | |||
351 | struct platform_device tegra_spi_slave_device1 = { | ||
352 | .name = "spi_slave_tegra", | ||
353 | .id = 0, | ||
354 | .resource = spi_resource1, | ||
355 | .num_resources = ARRAY_SIZE(spi_resource1), | ||
356 | .dev = { | ||
357 | .coherent_dma_mask = 0xffffffff, | ||
358 | }, | ||
359 | }; | ||
360 | |||
361 | struct platform_device tegra_spi_slave_device2 = { | ||
362 | .name = "spi_slave_tegra", | ||
363 | .id = 1, | ||
364 | .resource = spi_resource2, | ||
365 | .num_resources = ARRAY_SIZE(spi_resource2), | ||
366 | .dev = { | ||
367 | .coherent_dma_mask = 0xffffffff, | ||
368 | }, | ||
369 | }; | ||
370 | |||
371 | struct platform_device tegra_spi_slave_device3 = { | ||
372 | .name = "spi_slave_tegra", | ||
373 | .id = 2, | ||
374 | .resource = spi_resource3, | ||
375 | .num_resources = ARRAY_SIZE(spi_resource3), | ||
376 | .dev = { | ||
377 | .coherent_dma_mask = 0xffffffff, | ||
378 | }, | ||
379 | }; | ||
380 | |||
381 | struct platform_device tegra_spi_slave_device4 = { | ||
382 | .name = "spi_slave_tegra", | ||
383 | .id = 3, | ||
384 | .resource = spi_resource4, | ||
385 | .num_resources = ARRAY_SIZE(spi_resource4), | ||
386 | .dev = { | ||
387 | .coherent_dma_mask = 0xffffffff, | ||
388 | }, | ||
389 | }; | ||
390 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
391 | struct platform_device tegra_spi_slave_device5 = { | ||
392 | .name = "spi_slave_tegra", | ||
393 | .id = 4, | ||
394 | .resource = spi_resource5, | ||
395 | .num_resources = ARRAY_SIZE(spi_resource5), | ||
396 | .dev = { | ||
397 | .coherent_dma_mask = 0xffffffff, | ||
398 | }, | ||
399 | }; | ||
400 | |||
401 | struct platform_device tegra_spi_slave_device6 = { | ||
402 | .name = "spi_slave_tegra", | ||
403 | .id = 5, | ||
404 | .resource = spi_resource6, | ||
405 | .num_resources = ARRAY_SIZE(spi_resource6), | ||
406 | .dev = { | ||
407 | .coherent_dma_mask = 0xffffffff, | ||
408 | }, | ||
409 | }; | ||
410 | #endif | ||
411 | |||
412 | static struct resource resources_nor[] = { | ||
413 | [0] = { | ||
414 | .start = INT_SNOR, | ||
415 | .end = INT_SNOR, | ||
416 | .flags = IORESOURCE_IRQ, | ||
417 | }, | ||
418 | [1] = { | ||
419 | /* Map SNOR Controller */ | ||
420 | .start = TEGRA_SNOR_BASE, | ||
421 | .end = TEGRA_SNOR_BASE + TEGRA_SNOR_SIZE - 1, | ||
422 | .flags = IORESOURCE_MEM, | ||
423 | }, | ||
424 | [2] = { | ||
425 | /* Map the size of flash */ | ||
426 | .start = TEGRA_NOR_FLASH_BASE, | ||
427 | .end = TEGRA_NOR_FLASH_BASE + TEGRA_NOR_FLASH_SIZE - 1, | ||
428 | .flags = IORESOURCE_MEM, | ||
429 | } | ||
430 | }; | ||
213 | 431 | ||
432 | struct platform_device tegra_nor_device = { | ||
433 | .name = "tegra-nor", | ||
434 | .id = -1, | ||
435 | .num_resources = ARRAY_SIZE(resources_nor), | ||
436 | .resource = resources_nor, | ||
437 | .dev = { | ||
438 | .coherent_dma_mask = 0xffffffff, | ||
439 | }, | ||
440 | }; | ||
441 | |||
442 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
443 | struct platform_device tegra_dtv_device = { | ||
444 | .name = "tegra_dtv", | ||
445 | .id = -1, | ||
446 | .resource = dtv_resource, | ||
447 | .num_resources = ARRAY_SIZE(dtv_resource), | ||
448 | .dev = { | ||
449 | .init_name = "dtv", | ||
450 | .coherent_dma_mask = 0xffffffff, | ||
451 | }, | ||
452 | }; | ||
453 | #endif | ||
214 | 454 | ||
215 | static struct resource sdhci_resource1[] = { | 455 | static struct resource sdhci_resource1[] = { |
216 | [0] = { | 456 | [0] = { |
@@ -264,6 +504,16 @@ static struct resource sdhci_resource4[] = { | |||
264 | }, | 504 | }, |
265 | }; | 505 | }; |
266 | 506 | ||
507 | struct platform_device tegra_pci_device = { | ||
508 | .name = "tegra-pcie", | ||
509 | .id = 0, | ||
510 | .resource = 0, | ||
511 | .num_resources = 0, | ||
512 | .dev = { | ||
513 | .platform_data = 0, | ||
514 | }, | ||
515 | }; | ||
516 | |||
267 | /* board files should fill in platform_data register the devices themselvs. | 517 | /* board files should fill in platform_data register the devices themselvs. |
268 | * See board-harmony.c for an example | 518 | * See board-harmony.c for an example |
269 | */ | 519 | */ |
@@ -334,6 +584,28 @@ static struct resource tegra_usb3_resources[] = { | |||
334 | }, | 584 | }, |
335 | }; | 585 | }; |
336 | 586 | ||
587 | static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = { | ||
588 | /* All existing boards use GPIO PV0 for phy reset */ | ||
589 | .reset_gpio = TEGRA_GPIO_PV0, | ||
590 | .clk = "cdev2", | ||
591 | }; | ||
592 | |||
593 | static struct tegra_ehci_platform_data tegra_ehci1_pdata = { | ||
594 | .operating_mode = TEGRA_USB_OTG, | ||
595 | .power_down_on_bus_suspend = 1, | ||
596 | }; | ||
597 | |||
598 | static struct tegra_ehci_platform_data tegra_ehci2_pdata = { | ||
599 | .phy_config = &tegra_ehci2_ulpi_phy_config, | ||
600 | .operating_mode = TEGRA_USB_HOST, | ||
601 | .power_down_on_bus_suspend = 1, | ||
602 | }; | ||
603 | |||
604 | static struct tegra_ehci_platform_data tegra_ehci3_pdata = { | ||
605 | .operating_mode = TEGRA_USB_HOST, | ||
606 | .power_down_on_bus_suspend = 1, | ||
607 | }; | ||
608 | |||
337 | static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); | 609 | static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32); |
338 | 610 | ||
339 | struct platform_device tegra_ehci1_device = { | 611 | struct platform_device tegra_ehci1_device = { |
@@ -342,6 +614,7 @@ struct platform_device tegra_ehci1_device = { | |||
342 | .dev = { | 614 | .dev = { |
343 | .dma_mask = &tegra_ehci_dmamask, | 615 | .dma_mask = &tegra_ehci_dmamask, |
344 | .coherent_dma_mask = DMA_BIT_MASK(32), | 616 | .coherent_dma_mask = DMA_BIT_MASK(32), |
617 | .platform_data = &tegra_ehci1_pdata, | ||
345 | }, | 618 | }, |
346 | .resource = tegra_usb1_resources, | 619 | .resource = tegra_usb1_resources, |
347 | .num_resources = ARRAY_SIZE(tegra_usb1_resources), | 620 | .num_resources = ARRAY_SIZE(tegra_usb1_resources), |
@@ -353,6 +626,7 @@ struct platform_device tegra_ehci2_device = { | |||
353 | .dev = { | 626 | .dev = { |
354 | .dma_mask = &tegra_ehci_dmamask, | 627 | .dma_mask = &tegra_ehci_dmamask, |
355 | .coherent_dma_mask = DMA_BIT_MASK(32), | 628 | .coherent_dma_mask = DMA_BIT_MASK(32), |
629 | .platform_data = &tegra_ehci2_pdata, | ||
356 | }, | 630 | }, |
357 | .resource = tegra_usb2_resources, | 631 | .resource = tegra_usb2_resources, |
358 | .num_resources = ARRAY_SIZE(tegra_usb2_resources), | 632 | .num_resources = ARRAY_SIZE(tegra_usb2_resources), |
@@ -364,6 +638,7 @@ struct platform_device tegra_ehci3_device = { | |||
364 | .dev = { | 638 | .dev = { |
365 | .dma_mask = &tegra_ehci_dmamask, | 639 | .dma_mask = &tegra_ehci_dmamask, |
366 | .coherent_dma_mask = DMA_BIT_MASK(32), | 640 | .coherent_dma_mask = DMA_BIT_MASK(32), |
641 | .platform_data = &tegra_ehci3_pdata, | ||
367 | }, | 642 | }, |
368 | .resource = tegra_usb3_resources, | 643 | .resource = tegra_usb3_resources, |
369 | .num_resources = ARRAY_SIZE(tegra_usb3_resources), | 644 | .num_resources = ARRAY_SIZE(tegra_usb3_resources), |
@@ -380,6 +655,18 @@ static struct resource tegra_pmu_resources[] = { | |||
380 | .end = INT_CPU1_PMU_INTR, | 655 | .end = INT_CPU1_PMU_INTR, |
381 | .flags = IORESOURCE_IRQ, | 656 | .flags = IORESOURCE_IRQ, |
382 | }, | 657 | }, |
658 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
659 | [2] = { | ||
660 | .start = INT_CPU2_PMU_INTR, | ||
661 | .end = INT_CPU2_PMU_INTR, | ||
662 | .flags = IORESOURCE_IRQ, | ||
663 | }, | ||
664 | [3] = { | ||
665 | .start = INT_CPU3_PMU_INTR, | ||
666 | .end = INT_CPU3_PMU_INTR, | ||
667 | .flags = IORESOURCE_IRQ, | ||
668 | }, | ||
669 | #endif | ||
383 | }; | 670 | }; |
384 | 671 | ||
385 | struct platform_device tegra_pmu_device = { | 672 | struct platform_device tegra_pmu_device = { |
@@ -504,6 +791,126 @@ struct platform_device tegra_uarte_device = { | |||
504 | }, | 791 | }, |
505 | }; | 792 | }; |
506 | 793 | ||
794 | static struct plat_serial8250_port debug_uarta_platform_data[] = { | ||
795 | { | ||
796 | .membase = IO_ADDRESS(TEGRA_UARTA_BASE), | ||
797 | .mapbase = TEGRA_UARTA_BASE, | ||
798 | .irq = INT_UARTA, | ||
799 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
800 | .type = PORT_TEGRA, | ||
801 | .iotype = UPIO_MEM, | ||
802 | .regshift = 2, | ||
803 | }, | ||
804 | { | ||
805 | .flags = 0, | ||
806 | }, | ||
807 | }; | ||
808 | |||
809 | static struct plat_serial8250_port debug_uartb_platform_data[] = { | ||
810 | { | ||
811 | .membase = IO_ADDRESS(TEGRA_UARTB_BASE), | ||
812 | .mapbase = TEGRA_UARTB_BASE, | ||
813 | .irq = INT_UARTB, | ||
814 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
815 | .type = PORT_TEGRA, | ||
816 | .iotype = UPIO_MEM, | ||
817 | .regshift = 2, | ||
818 | }, | ||
819 | { | ||
820 | .flags = 0, | ||
821 | }, | ||
822 | }; | ||
823 | |||
824 | static struct plat_serial8250_port debug_uartc_platform_data[] = { | ||
825 | { | ||
826 | .membase = IO_ADDRESS(TEGRA_UARTC_BASE), | ||
827 | .mapbase = TEGRA_UARTC_BASE, | ||
828 | .irq = INT_UARTC, | ||
829 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
830 | .type = PORT_TEGRA, | ||
831 | .iotype = UPIO_MEM, | ||
832 | .regshift = 2, | ||
833 | }, | ||
834 | { | ||
835 | .flags = 0, | ||
836 | }, | ||
837 | }; | ||
838 | |||
839 | static struct plat_serial8250_port debug_uartd_platform_data[] = { | ||
840 | { | ||
841 | .membase = IO_ADDRESS(TEGRA_UARTD_BASE), | ||
842 | .mapbase = TEGRA_UARTD_BASE, | ||
843 | .irq = INT_UARTD, | ||
844 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
845 | .type = PORT_TEGRA, | ||
846 | .iotype = UPIO_MEM, | ||
847 | .regshift = 2, | ||
848 | }, | ||
849 | { | ||
850 | .flags = 0, | ||
851 | }, | ||
852 | }; | ||
853 | |||
854 | #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) | ||
855 | static struct plat_serial8250_port debug_uarte_platform_data[] = { | ||
856 | { | ||
857 | .membase = IO_ADDRESS(TEGRA_UARTE_BASE), | ||
858 | .mapbase = TEGRA_UARTE_BASE, | ||
859 | .irq = INT_UARTE, | ||
860 | .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, | ||
861 | .type = PORT_TEGRA, | ||
862 | .iotype = UPIO_MEM, | ||
863 | .regshift = 2, | ||
864 | }, | ||
865 | { | ||
866 | .flags = 0, | ||
867 | }, | ||
868 | }; | ||
869 | #endif | ||
870 | |||
871 | struct platform_device debug_uarta_device = { | ||
872 | .name = "serial8250", | ||
873 | .id = PLAT8250_DEV_PLATFORM, | ||
874 | .dev = { | ||
875 | .platform_data = debug_uarta_platform_data, | ||
876 | }, | ||
877 | }; | ||
878 | |||
879 | struct platform_device debug_uartb_device = { | ||
880 | .name = "serial8250", | ||
881 | .id = PLAT8250_DEV_PLATFORM, | ||
882 | .dev = { | ||
883 | .platform_data = debug_uartb_platform_data, | ||
884 | }, | ||
885 | }; | ||
886 | |||
887 | struct platform_device debug_uartc_device = { | ||
888 | .name = "serial8250", | ||
889 | .id = PLAT8250_DEV_PLATFORM, | ||
890 | .dev = { | ||
891 | .platform_data = debug_uartc_platform_data, | ||
892 | }, | ||
893 | }; | ||
894 | |||
895 | struct platform_device debug_uartd_device = { | ||
896 | .name = "serial8250", | ||
897 | .id = PLAT8250_DEV_PLATFORM, | ||
898 | .dev = { | ||
899 | .platform_data = debug_uartd_platform_data, | ||
900 | }, | ||
901 | }; | ||
902 | |||
903 | #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) | ||
904 | struct platform_device debug_uarte_device = { | ||
905 | .name = "serial8250", | ||
906 | .id = PLAT8250_DEV_PLATFORM, | ||
907 | .dev = { | ||
908 | .platform_data = debug_uarte_platform_data, | ||
909 | }, | ||
910 | }; | ||
911 | #endif | ||
912 | |||
913 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
507 | static struct resource i2s_resource1[] = { | 914 | static struct resource i2s_resource1[] = { |
508 | [0] = { | 915 | [0] = { |
509 | .start = INT_I2S1, | 916 | .start = INT_I2S1, |
@@ -522,6 +929,13 @@ static struct resource i2s_resource1[] = { | |||
522 | } | 929 | } |
523 | }; | 930 | }; |
524 | 931 | ||
932 | struct platform_device tegra_i2s_device1 = { | ||
933 | .name = "tegra20-i2s", | ||
934 | .id = 0, | ||
935 | .resource = i2s_resource1, | ||
936 | .num_resources = ARRAY_SIZE(i2s_resource1), | ||
937 | }; | ||
938 | |||
525 | static struct resource i2s_resource2[] = { | 939 | static struct resource i2s_resource2[] = { |
526 | [0] = { | 940 | [0] = { |
527 | .start = INT_I2S2, | 941 | .start = INT_I2S2, |
@@ -540,36 +954,739 @@ static struct resource i2s_resource2[] = { | |||
540 | } | 954 | } |
541 | }; | 955 | }; |
542 | 956 | ||
543 | struct platform_device tegra_i2s_device1 = { | 957 | struct platform_device tegra_i2s_device2 = { |
544 | .name = "tegra-i2s", | 958 | .name = "tegra20-i2s", |
959 | .id = 1, | ||
960 | .resource = i2s_resource2, | ||
961 | .num_resources = ARRAY_SIZE(i2s_resource2), | ||
962 | }; | ||
963 | #else | ||
964 | static struct resource i2s_resource0[] = { | ||
965 | [0] = { | ||
966 | .start = TEGRA_I2S0_BASE, | ||
967 | .end = TEGRA_I2S0_BASE + TEGRA_I2S0_SIZE - 1, | ||
968 | .flags = IORESOURCE_MEM | ||
969 | } | ||
970 | }; | ||
971 | |||
972 | struct platform_device tegra_i2s_device0 = { | ||
973 | .name = "tegra30-i2s", | ||
545 | .id = 0, | 974 | .id = 0, |
975 | .resource = i2s_resource0, | ||
976 | .num_resources = ARRAY_SIZE(i2s_resource0), | ||
977 | }; | ||
978 | |||
979 | static struct resource i2s_resource1[] = { | ||
980 | [0] = { | ||
981 | .start = TEGRA_I2S1_BASE, | ||
982 | .end = TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1, | ||
983 | .flags = IORESOURCE_MEM | ||
984 | } | ||
985 | }; | ||
986 | |||
987 | struct platform_device tegra_i2s_device1 = { | ||
988 | .name = "tegra30-i2s", | ||
989 | .id = 1, | ||
546 | .resource = i2s_resource1, | 990 | .resource = i2s_resource1, |
547 | .num_resources = ARRAY_SIZE(i2s_resource1), | 991 | .num_resources = ARRAY_SIZE(i2s_resource1), |
548 | }; | 992 | }; |
549 | 993 | ||
994 | static struct resource i2s_resource2[] = { | ||
995 | [0] = { | ||
996 | .start = TEGRA_I2S2_BASE, | ||
997 | .end = TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1, | ||
998 | .flags = IORESOURCE_MEM | ||
999 | } | ||
1000 | }; | ||
1001 | |||
550 | struct platform_device tegra_i2s_device2 = { | 1002 | struct platform_device tegra_i2s_device2 = { |
551 | .name = "tegra-i2s", | 1003 | .name = "tegra30-i2s", |
552 | .id = 1, | 1004 | .id = 2, |
553 | .resource = i2s_resource2, | 1005 | .resource = i2s_resource2, |
554 | .num_resources = ARRAY_SIZE(i2s_resource2), | 1006 | .num_resources = ARRAY_SIZE(i2s_resource2), |
555 | }; | 1007 | }; |
556 | 1008 | ||
557 | static struct resource tegra_das_resources[] = { | 1009 | static struct resource i2s_resource3[] = { |
558 | [0] = { | 1010 | [0] = { |
559 | .start = TEGRA_APB_MISC_DAS_BASE, | 1011 | .start = TEGRA_I2S3_BASE, |
560 | .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1, | 1012 | .end = TEGRA_I2S3_BASE + TEGRA_I2S3_SIZE - 1, |
561 | .flags = IORESOURCE_MEM, | 1013 | .flags = IORESOURCE_MEM |
1014 | } | ||
1015 | }; | ||
1016 | |||
1017 | struct platform_device tegra_i2s_device3 = { | ||
1018 | .name = "tegra30-i2s", | ||
1019 | .id = 3, | ||
1020 | .resource = i2s_resource3, | ||
1021 | .num_resources = ARRAY_SIZE(i2s_resource3), | ||
1022 | }; | ||
1023 | |||
1024 | static struct resource i2s_resource4[] = { | ||
1025 | [0] = { | ||
1026 | .start = TEGRA_I2S4_BASE, | ||
1027 | .end = TEGRA_I2S4_BASE + TEGRA_I2S4_SIZE - 1, | ||
1028 | .flags = IORESOURCE_MEM | ||
1029 | } | ||
1030 | }; | ||
1031 | |||
1032 | struct platform_device tegra_i2s_device4 = { | ||
1033 | .name = "tegra30-i2s", | ||
1034 | .id = 4, | ||
1035 | .resource = i2s_resource4, | ||
1036 | .num_resources = ARRAY_SIZE(i2s_resource4), | ||
1037 | }; | ||
1038 | #endif | ||
1039 | |||
1040 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
1041 | static struct resource spdif_resource[] = { | ||
1042 | [0] = { | ||
1043 | .start = INT_SPDIF, | ||
1044 | .end = INT_SPDIF, | ||
1045 | .flags = IORESOURCE_IRQ | ||
1046 | }, | ||
1047 | [1] = { | ||
1048 | .start = TEGRA_DMA_REQ_SEL_SPD_I, | ||
1049 | .end = TEGRA_DMA_REQ_SEL_SPD_I, | ||
1050 | .flags = IORESOURCE_DMA | ||
562 | }, | 1051 | }, |
1052 | [2] = { | ||
1053 | .start = TEGRA_SPDIF_BASE, | ||
1054 | .end = TEGRA_SPDIF_BASE + TEGRA_SPDIF_SIZE - 1, | ||
1055 | .flags = IORESOURCE_MEM | ||
1056 | } | ||
563 | }; | 1057 | }; |
564 | 1058 | ||
565 | struct platform_device tegra_das_device = { | 1059 | struct platform_device tegra_spdif_device = { |
566 | .name = "tegra-das", | 1060 | .name = "tegra20-spdif", |
567 | .id = -1, | 1061 | .id = -1, |
568 | .num_resources = ARRAY_SIZE(tegra_das_resources), | 1062 | .resource = spdif_resource, |
569 | .resource = tegra_das_resources, | 1063 | .num_resources = ARRAY_SIZE(spdif_resource), |
1064 | }; | ||
1065 | #else | ||
1066 | static struct resource spdif_resource[] = { | ||
1067 | [0] = { | ||
1068 | .start = TEGRA_SPDIF_BASE, | ||
1069 | .end = TEGRA_SPDIF_BASE + TEGRA_SPDIF_SIZE - 1, | ||
1070 | .flags = IORESOURCE_MEM | ||
1071 | } | ||
1072 | }; | ||
1073 | |||
1074 | struct platform_device tegra_spdif_device = { | ||
1075 | .name = "tegra30-spdif", | ||
1076 | .id = -1, | ||
1077 | .resource = spdif_resource, | ||
1078 | .num_resources = ARRAY_SIZE(spdif_resource), | ||
1079 | }; | ||
1080 | #endif | ||
1081 | |||
1082 | #ifndef CONFIG_ARCH_TEGRA_2x_SOC | ||
1083 | static struct resource ahub_resource[] = { | ||
1084 | [0] = { | ||
1085 | .start = TEGRA_APBIF0_BASE, | ||
1086 | .end = TEGRA_APBIF3_BASE + TEGRA_APBIF3_SIZE - 1, | ||
1087 | .flags = IORESOURCE_MEM | ||
1088 | }, | ||
1089 | [1] = { | ||
1090 | .start = TEGRA_AHUB_BASE, | ||
1091 | .end = TEGRA_AHUB_BASE + TEGRA_AHUB_SIZE - 1, | ||
1092 | .flags = IORESOURCE_MEM | ||
1093 | } | ||
1094 | }; | ||
1095 | |||
1096 | struct platform_device tegra_ahub_device = { | ||
1097 | .name = "tegra30-ahub", | ||
1098 | .id = -1, | ||
1099 | .resource = ahub_resource, | ||
1100 | .num_resources = ARRAY_SIZE(ahub_resource), | ||
1101 | }; | ||
1102 | |||
1103 | static struct resource dam_resource0[] = { | ||
1104 | [0] = { | ||
1105 | .start = TEGRA_DAM0_BASE, | ||
1106 | .end = TEGRA_DAM0_BASE + TEGRA_DAM0_SIZE - 1, | ||
1107 | .flags = IORESOURCE_MEM | ||
1108 | } | ||
1109 | }; | ||
1110 | |||
1111 | struct platform_device tegra_dam_device0 = { | ||
1112 | .name = "tegra30-dam", | ||
1113 | .id = 0, | ||
1114 | .resource = dam_resource0, | ||
1115 | .num_resources = ARRAY_SIZE(dam_resource0), | ||
1116 | }; | ||
1117 | |||
1118 | static struct resource dam_resource1[] = { | ||
1119 | [0] = { | ||
1120 | .start = TEGRA_DAM1_BASE, | ||
1121 | .end = TEGRA_DAM1_BASE + TEGRA_DAM1_SIZE - 1, | ||
1122 | .flags = IORESOURCE_MEM | ||
1123 | } | ||
1124 | }; | ||
1125 | |||
1126 | struct platform_device tegra_dam_device1 = { | ||
1127 | .name = "tegra30-dam", | ||
1128 | .id = 1, | ||
1129 | .resource = dam_resource1, | ||
1130 | .num_resources = ARRAY_SIZE(dam_resource1), | ||
1131 | }; | ||
1132 | |||
1133 | static struct resource dam_resource2[] = { | ||
1134 | [0] = { | ||
1135 | .start = TEGRA_DAM2_BASE, | ||
1136 | .end = TEGRA_DAM2_BASE + TEGRA_DAM2_SIZE - 1, | ||
1137 | .flags = IORESOURCE_MEM | ||
1138 | } | ||
1139 | }; | ||
1140 | |||
1141 | struct platform_device tegra_dam_device2 = { | ||
1142 | .name = "tegra30-dam", | ||
1143 | .id = 2, | ||
1144 | .resource = dam_resource2, | ||
1145 | .num_resources = ARRAY_SIZE(dam_resource2), | ||
1146 | }; | ||
1147 | |||
1148 | static u64 tegra_hda_dma_mask = DMA_BIT_MASK(32); | ||
1149 | static struct resource hda_platform_resources[] = { | ||
1150 | [0] = { | ||
1151 | .start = TEGRA_HDA_BASE, | ||
1152 | .end = TEGRA_HDA_BASE + TEGRA_HDA_SIZE - 1, | ||
1153 | .flags = IORESOURCE_MEM | ||
1154 | }, | ||
1155 | [1] = { | ||
1156 | .start = INT_HDA, | ||
1157 | .end = INT_HDA, | ||
1158 | .flags = IORESOURCE_IRQ | ||
1159 | }, | ||
1160 | }; | ||
1161 | |||
1162 | struct platform_device tegra_hda_device = { | ||
1163 | .name = "tegra30-hda", | ||
1164 | .id = -1, | ||
1165 | .dev = { | ||
1166 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1167 | .dma_mask = &tegra_hda_dma_mask, | ||
1168 | }, | ||
1169 | .resource = hda_platform_resources, | ||
1170 | .num_resources = ARRAY_SIZE(hda_platform_resources), | ||
1171 | }; | ||
1172 | #endif | ||
1173 | |||
1174 | struct platform_device spdif_dit_device = { | ||
1175 | .name = "spdif-dit", | ||
1176 | .id = 0, | ||
1177 | }; | ||
1178 | |||
1179 | struct platform_device bluetooth_dit_device = { | ||
1180 | .name = "spdif-dit", | ||
1181 | .id = 1, | ||
1182 | }; | ||
1183 | |||
1184 | struct platform_device baseband_dit_device = { | ||
1185 | .name = "spdif-dit", | ||
1186 | .id = 2, | ||
570 | }; | 1187 | }; |
571 | 1188 | ||
572 | struct platform_device tegra_pcm_device = { | 1189 | struct platform_device tegra_pcm_device = { |
573 | .name = "tegra-pcm-audio", | 1190 | .name = "tegra-pcm-audio", |
574 | .id = -1, | 1191 | .id = -1, |
575 | }; | 1192 | }; |
1193 | |||
1194 | static struct resource w1_resources[] = { | ||
1195 | [0] = { | ||
1196 | .start = INT_OWR, | ||
1197 | .end = INT_OWR, | ||
1198 | .flags = IORESOURCE_IRQ | ||
1199 | }, | ||
1200 | [1] = { | ||
1201 | .start = TEGRA_OWR_BASE, | ||
1202 | .end = TEGRA_OWR_BASE + TEGRA_OWR_SIZE - 1, | ||
1203 | .flags = IORESOURCE_MEM | ||
1204 | } | ||
1205 | }; | ||
1206 | |||
1207 | struct platform_device tegra_w1_device = { | ||
1208 | .name = "tegra_w1", | ||
1209 | .id = -1, | ||
1210 | .resource = w1_resources, | ||
1211 | .num_resources = ARRAY_SIZE(w1_resources), | ||
1212 | }; | ||
1213 | |||
1214 | static struct resource tegra_udc_resources[] = { | ||
1215 | [0] = { | ||
1216 | .start = TEGRA_USB_BASE, | ||
1217 | .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1, | ||
1218 | .flags = IORESOURCE_MEM, | ||
1219 | }, | ||
1220 | [1] = { | ||
1221 | .start = INT_USB, | ||
1222 | .end = INT_USB, | ||
1223 | .flags = IORESOURCE_IRQ, | ||
1224 | }, | ||
1225 | }; | ||
1226 | |||
1227 | static u64 tegra_udc_dmamask = DMA_BIT_MASK(32); | ||
1228 | |||
1229 | static struct fsl_usb2_platform_data tegra_udc_pdata = { | ||
1230 | .operating_mode = FSL_USB2_DR_DEVICE, | ||
1231 | .phy_mode = FSL_USB2_PHY_UTMI, | ||
1232 | }; | ||
1233 | |||
1234 | struct platform_device tegra_udc_device = { | ||
1235 | .name = "fsl-tegra-udc", | ||
1236 | .id = -1, | ||
1237 | .dev = { | ||
1238 | .dma_mask = &tegra_udc_dmamask, | ||
1239 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1240 | .platform_data = &tegra_udc_pdata, | ||
1241 | }, | ||
1242 | .resource = tegra_udc_resources, | ||
1243 | .num_resources = ARRAY_SIZE(tegra_udc_resources), | ||
1244 | }; | ||
1245 | |||
1246 | static struct resource tegra_otg_resources[] = { | ||
1247 | [0] = { | ||
1248 | .start = TEGRA_USB_BASE, | ||
1249 | .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1, | ||
1250 | .flags = IORESOURCE_MEM, | ||
1251 | }, | ||
1252 | [1] = { | ||
1253 | .start = INT_USB, | ||
1254 | .end = INT_USB, | ||
1255 | .flags = IORESOURCE_IRQ, | ||
1256 | }, | ||
1257 | }; | ||
1258 | |||
1259 | struct platform_device tegra_otg_device = { | ||
1260 | .name = "tegra-otg", | ||
1261 | .id = -1, | ||
1262 | .resource = tegra_otg_resources, | ||
1263 | .num_resources = ARRAY_SIZE(tegra_otg_resources), | ||
1264 | }; | ||
1265 | |||
1266 | #ifdef CONFIG_SATA_AHCI_TEGRA | ||
1267 | static u64 tegra_sata_dma_mask = DMA_BIT_MASK(32); | ||
1268 | |||
1269 | static struct resource tegra_sata_resources[] = { | ||
1270 | [0] = { | ||
1271 | .start = TEGRA_SATA_BAR5_BASE, | ||
1272 | .end = TEGRA_SATA_BAR5_BASE + TEGRA_SATA_BAR5_SIZE - 1, | ||
1273 | .flags = IORESOURCE_MEM, | ||
1274 | }, | ||
1275 | [1] = { | ||
1276 | .start = TEGRA_SATA_CONFIG_BASE, | ||
1277 | .end = TEGRA_SATA_CONFIG_BASE + TEGRA_SATA_CONFIG_SIZE - 1, | ||
1278 | .flags = IORESOURCE_MEM, | ||
1279 | }, | ||
1280 | [2] = { | ||
1281 | .start = INT_SATA_CTL, | ||
1282 | .end = INT_SATA_CTL, | ||
1283 | .flags = IORESOURCE_IRQ, | ||
1284 | }, | ||
1285 | }; | ||
1286 | |||
1287 | struct platform_device tegra_sata_device = { | ||
1288 | .name = "tegra-sata", | ||
1289 | .id = 0, | ||
1290 | .dev = { | ||
1291 | .platform_data = 0, | ||
1292 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1293 | .dma_mask = &tegra_sata_dma_mask, | ||
1294 | }, | ||
1295 | .resource = tegra_sata_resources, | ||
1296 | .num_resources = ARRAY_SIZE(tegra_sata_resources), | ||
1297 | }; | ||
1298 | #endif | ||
1299 | |||
1300 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
1301 | static struct resource das_resource[] = { | ||
1302 | [0] = { | ||
1303 | .start = TEGRA_APB_MISC_DAS_BASE, | ||
1304 | .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1, | ||
1305 | .flags = IORESOURCE_MEM | ||
1306 | } | ||
1307 | }; | ||
1308 | |||
1309 | struct platform_device tegra_das_device = { | ||
1310 | .name = "tegra20-das", | ||
1311 | .id = -1, | ||
1312 | .resource = das_resource, | ||
1313 | .num_resources = ARRAY_SIZE(das_resource), | ||
1314 | }; | ||
1315 | #endif | ||
1316 | |||
1317 | #if defined(CONFIG_TEGRA_IOVMM_GART) || defined(CONFIG_TEGRA_IOMMU_GART) | ||
1318 | static struct resource tegra_gart_resources[] = { | ||
1319 | [0] = { | ||
1320 | .name = "mc", | ||
1321 | .flags = IORESOURCE_MEM, | ||
1322 | .start = TEGRA_MC_BASE, | ||
1323 | .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1, | ||
1324 | }, | ||
1325 | [1] = { | ||
1326 | .name = "gart", | ||
1327 | .flags = IORESOURCE_MEM, | ||
1328 | .start = TEGRA_GART_BASE, | ||
1329 | .end = TEGRA_GART_BASE + TEGRA_GART_SIZE - 1, | ||
1330 | } | ||
1331 | }; | ||
1332 | |||
1333 | struct platform_device tegra_gart_device = { | ||
1334 | .name = "tegra_gart", | ||
1335 | .id = -1, | ||
1336 | .num_resources = ARRAY_SIZE(tegra_gart_resources), | ||
1337 | .resource = tegra_gart_resources | ||
1338 | }; | ||
1339 | #endif | ||
1340 | |||
1341 | #if defined(CONFIG_TEGRA_IOVMM_SMMU) || defined(CONFIG_TEGRA_IOMMU_SMMU) | ||
1342 | static struct resource tegra_smmu_resources[] = { | ||
1343 | [0] = { | ||
1344 | .name = "mc", | ||
1345 | .flags = IORESOURCE_MEM, | ||
1346 | .start = TEGRA_MC_BASE, | ||
1347 | .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1, | ||
1348 | }, | ||
1349 | [1] = { | ||
1350 | .name = "ahbarb", | ||
1351 | .flags = IORESOURCE_MEM, | ||
1352 | .start = TEGRA_AHB_ARB_BASE, | ||
1353 | .end = TEGRA_AHB_ARB_BASE + TEGRA_AHB_ARB_SIZE - 1, | ||
1354 | } | ||
1355 | }; | ||
1356 | |||
1357 | struct platform_device tegra_smmu_device = { | ||
1358 | .name = "tegra_smmu", | ||
1359 | .id = -1, | ||
1360 | .num_resources = ARRAY_SIZE(tegra_smmu_resources), | ||
1361 | .resource = tegra_smmu_resources | ||
1362 | }; | ||
1363 | |||
1364 | |||
1365 | static struct tegra_smmu_window tegra_smmu[] = { | ||
1366 | [0] = { | ||
1367 | .start = TEGRA_SMMU_BASE, | ||
1368 | .end = TEGRA_SMMU_BASE + TEGRA_SMMU_SIZE - 1, | ||
1369 | }, | ||
1370 | }; | ||
1371 | |||
1372 | struct tegra_smmu_window *tegra_smmu_window(int wnum) | ||
1373 | { | ||
1374 | return &tegra_smmu[wnum]; | ||
1375 | } | ||
1376 | |||
1377 | int tegra_smmu_window_count(void) | ||
1378 | { | ||
1379 | return ARRAY_SIZE(tegra_smmu); | ||
1380 | } | ||
1381 | #endif | ||
1382 | |||
1383 | #if defined(CONFIG_ARCH_TEGRA_2x_SOC) | ||
1384 | #define CLK_RESET_RST_SOURCE 0x0 | ||
1385 | static struct resource tegra_wdt_resources[] = { | ||
1386 | [0] = { | ||
1387 | .start = TEGRA_CLK_RESET_BASE + CLK_RESET_RST_SOURCE, | ||
1388 | .end = TEGRA_CLK_RESET_BASE + CLK_RESET_RST_SOURCE + 4 - 1, | ||
1389 | .flags = IORESOURCE_MEM, | ||
1390 | }, | ||
1391 | [1] = { | ||
1392 | .start = TEGRA_TMR1_BASE, | ||
1393 | .end = TEGRA_TMR1_BASE + TEGRA_TMR1_SIZE - 1, | ||
1394 | .flags = IORESOURCE_MEM, | ||
1395 | }, | ||
1396 | [2] = { | ||
1397 | .start = INT_TMR1, | ||
1398 | .end = INT_TMR1, | ||
1399 | .flags = IORESOURCE_IRQ, | ||
1400 | }, | ||
1401 | }; | ||
1402 | #else | ||
1403 | static struct resource tegra_wdt_resources[] = { | ||
1404 | [0] = { | ||
1405 | .start = TEGRA_WDT0_BASE, | ||
1406 | .end = TEGRA_WDT0_BASE + TEGRA_WDT0_SIZE - 1, | ||
1407 | .flags = IORESOURCE_MEM, | ||
1408 | }, | ||
1409 | [1] = { | ||
1410 | .start = TEGRA_TMR10_BASE, | ||
1411 | .end = TEGRA_TMR10_BASE + TEGRA_TMR10_SIZE - 1, | ||
1412 | .flags = IORESOURCE_MEM, | ||
1413 | }, | ||
1414 | [2] = { | ||
1415 | .start = INT_WDT_CPU, | ||
1416 | .end = INT_WDT_CPU, | ||
1417 | .flags = IORESOURCE_IRQ, | ||
1418 | }, | ||
1419 | }; | ||
1420 | #endif | ||
1421 | |||
1422 | struct platform_device tegra_wdt_device = { | ||
1423 | .name = "tegra_wdt", | ||
1424 | .id = -1, | ||
1425 | .num_resources = ARRAY_SIZE(tegra_wdt_resources), | ||
1426 | .resource = tegra_wdt_resources, | ||
1427 | }; | ||
1428 | |||
1429 | static struct resource tegra_pwfm0_resource = { | ||
1430 | .start = TEGRA_PWFM0_BASE, | ||
1431 | .end = TEGRA_PWFM0_BASE + TEGRA_PWFM0_SIZE - 1, | ||
1432 | .flags = IORESOURCE_MEM, | ||
1433 | }; | ||
1434 | |||
1435 | static struct resource tegra_pwfm1_resource = { | ||
1436 | .start = TEGRA_PWFM1_BASE, | ||
1437 | .end = TEGRA_PWFM1_BASE + TEGRA_PWFM1_SIZE - 1, | ||
1438 | .flags = IORESOURCE_MEM, | ||
1439 | }; | ||
1440 | |||
1441 | static struct resource tegra_pwfm2_resource = { | ||
1442 | .start = TEGRA_PWFM2_BASE, | ||
1443 | .end = TEGRA_PWFM2_BASE + TEGRA_PWFM2_SIZE - 1, | ||
1444 | .flags = IORESOURCE_MEM, | ||
1445 | }; | ||
1446 | |||
1447 | static struct resource tegra_pwfm3_resource = { | ||
1448 | .start = TEGRA_PWFM3_BASE, | ||
1449 | .end = TEGRA_PWFM3_BASE + TEGRA_PWFM3_SIZE - 1, | ||
1450 | .flags = IORESOURCE_MEM, | ||
1451 | }; | ||
1452 | |||
1453 | struct platform_device tegra_pwfm0_device = { | ||
1454 | .name = "tegra_pwm", | ||
1455 | .id = 0, | ||
1456 | .num_resources = 1, | ||
1457 | .resource = &tegra_pwfm0_resource, | ||
1458 | }; | ||
1459 | |||
1460 | struct platform_device tegra_pwfm1_device = { | ||
1461 | .name = "tegra_pwm", | ||
1462 | .id = 1, | ||
1463 | .num_resources = 1, | ||
1464 | .resource = &tegra_pwfm1_resource, | ||
1465 | }; | ||
1466 | |||
1467 | struct platform_device tegra_pwfm2_device = { | ||
1468 | .name = "tegra_pwm", | ||
1469 | .id = 2, | ||
1470 | .num_resources = 1, | ||
1471 | .resource = &tegra_pwfm2_resource, | ||
1472 | }; | ||
1473 | |||
1474 | struct platform_device tegra_pwfm3_device = { | ||
1475 | .name = "tegra_pwm", | ||
1476 | .id = 3, | ||
1477 | .num_resources = 1, | ||
1478 | .resource = &tegra_pwfm3_resource, | ||
1479 | }; | ||
1480 | |||
1481 | static struct tegra_avp_platform_data tegra_avp_pdata = { | ||
1482 | #ifdef CONFIG_ARCH_TEGRA_2x_SOC | ||
1483 | .emc_clk_rate = ULONG_MAX, | ||
1484 | #else | ||
1485 | .emc_clk_rate = 200000000, | ||
1486 | #endif | ||
1487 | }; | ||
1488 | |||
1489 | struct resource tegra_nvavp_resources[] = { | ||
1490 | [0] = { | ||
1491 | .start = INT_SHR_SEM_INBOX_IBF, | ||
1492 | .end = INT_SHR_SEM_INBOX_IBF, | ||
1493 | .flags = IORESOURCE_IRQ, | ||
1494 | .name = "mbox_from_nvavp_pending", | ||
1495 | }, | ||
1496 | }; | ||
1497 | |||
1498 | struct nvhost_device nvavp_device = { | ||
1499 | .name = "nvavp", | ||
1500 | .id = -1, | ||
1501 | .resource = tegra_nvavp_resources, | ||
1502 | .num_resources = ARRAY_SIZE(tegra_nvavp_resources), | ||
1503 | }; | ||
1504 | |||
1505 | static struct resource tegra_avp_resources[] = { | ||
1506 | [0] = { | ||
1507 | .start = INT_SHR_SEM_INBOX_IBF, | ||
1508 | .end = INT_SHR_SEM_INBOX_IBF, | ||
1509 | .flags = IORESOURCE_IRQ, | ||
1510 | .name = "mbox_from_avp_pending", | ||
1511 | }, | ||
1512 | }; | ||
1513 | |||
1514 | struct platform_device tegra_avp_device = { | ||
1515 | .name = "tegra-avp", | ||
1516 | .id = -1, | ||
1517 | .num_resources = ARRAY_SIZE(tegra_avp_resources), | ||
1518 | .resource = tegra_avp_resources, | ||
1519 | .dev = { | ||
1520 | .coherent_dma_mask = 0xffffffffULL, | ||
1521 | .platform_data = &tegra_avp_pdata, | ||
1522 | }, | ||
1523 | }; | ||
1524 | |||
1525 | static struct resource tegra_aes_resources[] = { | ||
1526 | { | ||
1527 | .start = TEGRA_VDE_BASE, | ||
1528 | .end = TEGRA_VDE_BASE + TEGRA_VDE_SIZE - 1, | ||
1529 | .flags = IORESOURCE_MEM, | ||
1530 | }, | ||
1531 | { | ||
1532 | .start = TEGRA_BSEA_BASE, | ||
1533 | .end = TEGRA_BSEA_BASE + TEGRA_BSEA_SIZE - 1, | ||
1534 | .flags = IORESOURCE_MEM, | ||
1535 | }, | ||
1536 | }; | ||
1537 | |||
1538 | static u64 tegra_aes_dma_mask = DMA_BIT_MASK(32); | ||
1539 | |||
1540 | struct platform_device tegra_aes_device = { | ||
1541 | .name = "tegra-aes", | ||
1542 | .id = -1, | ||
1543 | .resource = tegra_aes_resources, | ||
1544 | .num_resources = ARRAY_SIZE(tegra_aes_resources), | ||
1545 | .dev = { | ||
1546 | .dma_mask = &tegra_aes_dma_mask, | ||
1547 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1548 | }, | ||
1549 | }; | ||
1550 | |||
1551 | static struct resource tegra_kbc_resources[] = { | ||
1552 | [0] = { | ||
1553 | .start = TEGRA_KBC_BASE, | ||
1554 | .end = TEGRA_KBC_BASE + TEGRA_KBC_SIZE - 1, | ||
1555 | .flags = IORESOURCE_MEM, | ||
1556 | }, | ||
1557 | [1] = { | ||
1558 | .start = INT_KBC, | ||
1559 | .end = INT_KBC, | ||
1560 | .flags = IORESOURCE_IRQ, | ||
1561 | }, | ||
1562 | }; | ||
1563 | |||
1564 | struct platform_device tegra_kbc_device = { | ||
1565 | .name = "tegra-kbc", | ||
1566 | .id = -1, | ||
1567 | .resource = tegra_kbc_resources, | ||
1568 | .num_resources = ARRAY_SIZE(tegra_kbc_resources), | ||
1569 | .dev = { | ||
1570 | .platform_data = 0, | ||
1571 | }, | ||
1572 | }; | ||
1573 | |||
1574 | #if defined(CONFIG_ARCH_TEGRA_3x_SOC) | ||
1575 | static struct resource tegra_tsensor_resources[]= { | ||
1576 | { | ||
1577 | .start = TEGRA_TSENSOR_BASE, | ||
1578 | .end = TEGRA_TSENSOR_BASE + TEGRA_TSENSOR_SIZE - 1, | ||
1579 | .flags = IORESOURCE_MEM, | ||
1580 | }, | ||
1581 | { | ||
1582 | .start = INT_TSENSOR, | ||
1583 | .end = INT_TSENSOR, | ||
1584 | .flags = IORESOURCE_IRQ, | ||
1585 | }, | ||
1586 | { | ||
1587 | .start = TEGRA_PMC_BASE + 0x1B0, | ||
1588 | /* 2 pmc registers mapped */ | ||
1589 | .end = TEGRA_PMC_BASE + 0x1B0 + (2 * 4), | ||
1590 | .flags = IORESOURCE_MEM, | ||
1591 | }, | ||
1592 | }; | ||
1593 | |||
1594 | struct platform_device tegra_tsensor_device = { | ||
1595 | .name = "tegra-tsensor", | ||
1596 | .id = -1, | ||
1597 | .num_resources = ARRAY_SIZE(tegra_tsensor_resources), | ||
1598 | .resource = tegra_tsensor_resources, | ||
1599 | .dev = { | ||
1600 | .platform_data = 0, | ||
1601 | }, | ||
1602 | }; | ||
1603 | #endif | ||
1604 | |||
1605 | #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) | ||
1606 | static u64 tegra_se_dma_mask = DMA_BIT_MASK(32); | ||
1607 | |||
1608 | struct resource tegra_se_resources[] = { | ||
1609 | [0] = { | ||
1610 | .start = TEGRA_SE_BASE, | ||
1611 | .end = TEGRA_SE_BASE + TEGRA_SE_SIZE - 1, | ||
1612 | .flags = IORESOURCE_MEM, | ||
1613 | }, | ||
1614 | [1] = { | ||
1615 | .start = TEGRA_PMC_BASE, | ||
1616 | .end = TEGRA_PMC_BASE + SZ_256 - 1, | ||
1617 | .flags = IORESOURCE_MEM, | ||
1618 | }, | ||
1619 | [2] = { | ||
1620 | .start = INT_SE, | ||
1621 | .end = INT_SE, | ||
1622 | .flags = IORESOURCE_IRQ, | ||
1623 | }, | ||
1624 | }; | ||
1625 | |||
1626 | struct platform_device tegra_se_device = { | ||
1627 | .name = "tegra-se", | ||
1628 | .id = -1, | ||
1629 | .dev = { | ||
1630 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
1631 | .dma_mask = &tegra_se_dma_mask, | ||
1632 | }, | ||
1633 | .resource = tegra_se_resources, | ||
1634 | .num_resources = ARRAY_SIZE(tegra_se_resources), | ||
1635 | }; | ||
1636 | #endif | ||
1637 | |||
1638 | static struct resource tegra_disp1_resources[] = { | ||
1639 | { | ||
1640 | .name = "irq", | ||
1641 | .start = INT_DISPLAY_GENERAL, | ||
1642 | .end = INT_DISPLAY_GENERAL, | ||
1643 | .flags = IORESOURCE_IRQ, | ||
1644 | }, | ||
1645 | { | ||
1646 | .name = "regs", | ||
1647 | .start = TEGRA_DISPLAY_BASE, | ||
1648 | .end = TEGRA_DISPLAY_BASE + TEGRA_DISPLAY_SIZE-1, | ||
1649 | .flags = IORESOURCE_MEM, | ||
1650 | }, | ||
1651 | { | ||
1652 | .name = "fbmem", | ||
1653 | .start = 0, | ||
1654 | .end = 0, | ||
1655 | .flags = IORESOURCE_MEM, | ||
1656 | }, | ||
1657 | { | ||
1658 | .name = "dsi_regs", | ||
1659 | .start = TEGRA_DSI_BASE, | ||
1660 | .end = TEGRA_DSI_BASE + TEGRA_DSI_SIZE - 1, | ||
1661 | .flags = IORESOURCE_MEM, | ||
1662 | }, | ||
1663 | }; | ||
1664 | |||
1665 | struct nvhost_device tegra_disp1_device = { | ||
1666 | .name = "tegradc", | ||
1667 | .id = 0, | ||
1668 | .resource = tegra_disp1_resources, | ||
1669 | .num_resources = ARRAY_SIZE(tegra_disp1_resources), | ||
1670 | }; | ||
1671 | |||
1672 | struct platform_device tegra_nvmap_device = { | ||
1673 | .name = "tegra-nvmap", | ||
1674 | .id = -1, | ||
1675 | }; | ||
1676 | |||
1677 | void __init tegra_init_debug_uart_rate(void) | ||
1678 | { | ||
1679 | unsigned int uartclk; | ||
1680 | struct clk *debug_uart_parent = clk_get_sys(NULL, "pll_p"); | ||
1681 | |||
1682 | BUG_ON(IS_ERR(debug_uart_parent)); | ||
1683 | uartclk = clk_get_rate(debug_uart_parent); | ||
1684 | |||
1685 | debug_uarta_platform_data[0].uartclk = uartclk; | ||
1686 | debug_uartb_platform_data[0].uartclk = uartclk; | ||
1687 | debug_uartc_platform_data[0].uartclk = uartclk; | ||
1688 | debug_uartd_platform_data[0].uartclk = uartclk; | ||
1689 | #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) | ||
1690 | debug_uarte_platform_data[0].uartclk = uartclk; | ||
1691 | #endif | ||
1692 | } | ||