2 * Copyright (C) 2010,2011 Google, Inc.
5 * Colin Cross <ccross@android.com>
6 * Erik Gilling <ccross@android.com>
8 * Copyright (c) 2010-2015, NVIDIA CORPORATION. All rights reserved.
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
22 #include <linux/resource.h>
23 #include <linux/dma-mapping.h>
24 #include <linux/fsl_devices.h>
25 #include <linux/serial_8250.h>
26 #include <linux/mipi-bif-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>
31 #include <linux/tegra-soc.h>
32 #include <mach/irqs.h>
33 #include <linux/usb/tegra_usb_phy.h>
34 #include <mach/tegra_smmu.h>
35 #include <mach/tegra-swgid.h>
36 #include <linux/dma-contiguous.h>
38 #ifdef CONFIG_TEGRA_WAKEUP_MONITOR
39 #include <mach/tegra_wakeup_monitor.h>
42 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
43 #include <asm/dma-iommu.h>
46 #include "gpio-names.h"
50 #include "tegra_ptm.h"
52 #define TEGRA_DMA_REQ_SEL_I2S_1 2
53 #define TEGRA_DMA_REQ_SEL_SPD_I 3
54 #define TEGRA_DMA_REQ_SEL_I2S2_1 7
55 #define TEGRA_DMA_REQ_SEL_SPI 11
56 #define TEGRA_DMA_REQ_SEL_DTV TEGRA_DMA_REQ_SEL_SPI
58 static struct resource emc_resource[] = {
60 .start = TEGRA_EMC_BASE,
61 .end = TEGRA_EMC_BASE + TEGRA_EMC_SIZE-1,
62 .flags = IORESOURCE_MEM,
66 struct platform_device tegra_emc_device = {
69 .resource = emc_resource,
70 .num_resources = ARRAY_SIZE(emc_resource),
73 static struct resource gpio_resource[] = {
75 .start = TEGRA_GPIO_BASE,
76 .end = TEGRA_GPIO_BASE + TEGRA_GPIO_SIZE-1,
77 .flags = IORESOURCE_MEM,
82 .flags = IORESOURCE_IRQ,
87 .flags = IORESOURCE_IRQ,
92 .flags = IORESOURCE_IRQ,
97 .flags = IORESOURCE_IRQ,
102 .flags = IORESOURCE_IRQ,
107 .flags = IORESOURCE_IRQ,
112 .flags = IORESOURCE_IRQ,
114 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
118 .flags = IORESOURCE_IRQ,
123 struct platform_device tegra_gpio_device = {
124 .name = "tegra-gpio",
126 .resource = gpio_resource,
127 .num_resources = ARRAY_SIZE(gpio_resource),
130 static struct resource tegra124_pinctrl_resource[] = {
132 /* Drive registers */
133 .start = TEGRA_APB_MISC_BASE + 0x868,
134 .end = TEGRA_APB_MISC_BASE + 0x9c8 + 3,
135 .flags = IORESOURCE_MEM,
139 .start = TEGRA_APB_MISC_BASE + 0x3000,
140 .end = TEGRA_APB_MISC_BASE + 0x3430 + 3,
141 .flags = IORESOURCE_MEM,
145 struct platform_device tegra124_pinctrl_device = {
146 .name = "tegra124-pinctrl",
148 .resource = tegra124_pinctrl_resource,
149 .num_resources = ARRAY_SIZE(tegra124_pinctrl_resource),
152 static struct resource tegra114_pinctrl_resource[] = {
154 /* Drive registers */
155 .start = TEGRA_APB_MISC_BASE + 0x868,
156 .end = TEGRA_APB_MISC_BASE + 0x938 + 3,
157 .flags = IORESOURCE_MEM,
161 .start = TEGRA_APB_MISC_BASE + 0x3000,
162 .end = TEGRA_APB_MISC_BASE + 0x3408 + 3,
163 .flags = IORESOURCE_MEM,
167 struct platform_device tegra114_pinctrl_device = {
168 .name = "tegra114-pinctrl",
170 .resource = tegra114_pinctrl_resource,
171 .num_resources = ARRAY_SIZE(tegra114_pinctrl_resource),
174 static struct resource apbdma_resource[] = {
176 .start = TEGRA_APB_DMA_BASE,
177 .end = TEGRA_APB_DMA_BASE + TEGRA_APB_DMA_SIZE-1,
178 .flags = IORESOURCE_MEM,
181 .start = INT_APB_DMA_CH0,
182 .end = INT_APB_DMA_CH0,
183 .flags = IORESOURCE_IRQ,
186 .start = INT_APB_DMA_CH1,
187 .end = INT_APB_DMA_CH1,
188 .flags = IORESOURCE_IRQ,
191 .start = INT_APB_DMA_CH2,
192 .end = INT_APB_DMA_CH2,
193 .flags = IORESOURCE_IRQ,
196 .start = INT_APB_DMA_CH3,
197 .end = INT_APB_DMA_CH3,
198 .flags = IORESOURCE_IRQ,
201 .start = INT_APB_DMA_CH4,
202 .end = INT_APB_DMA_CH4,
203 .flags = IORESOURCE_IRQ,
206 .start = INT_APB_DMA_CH5,
207 .end = INT_APB_DMA_CH5,
208 .flags = IORESOURCE_IRQ,
211 .start = INT_APB_DMA_CH6,
212 .end = INT_APB_DMA_CH6,
213 .flags = IORESOURCE_IRQ,
216 .start = INT_APB_DMA_CH7,
217 .end = INT_APB_DMA_CH7,
218 .flags = IORESOURCE_IRQ,
221 .start = INT_APB_DMA_CH8,
222 .end = INT_APB_DMA_CH8,
223 .flags = IORESOURCE_IRQ,
226 .start = INT_APB_DMA_CH9,
227 .end = INT_APB_DMA_CH9,
228 .flags = IORESOURCE_IRQ,
231 .start = INT_APB_DMA_CH10,
232 .end = INT_APB_DMA_CH10,
233 .flags = IORESOURCE_IRQ,
236 .start = INT_APB_DMA_CH11,
237 .end = INT_APB_DMA_CH11,
238 .flags = IORESOURCE_IRQ,
241 .start = INT_APB_DMA_CH12,
242 .end = INT_APB_DMA_CH12,
243 .flags = IORESOURCE_IRQ,
246 .start = INT_APB_DMA_CH13,
247 .end = INT_APB_DMA_CH13,
248 .flags = IORESOURCE_IRQ,
251 .start = INT_APB_DMA_CH14,
252 .end = INT_APB_DMA_CH14,
253 .flags = IORESOURCE_IRQ,
256 .start = INT_APB_DMA_CH15,
257 .end = INT_APB_DMA_CH15,
258 .flags = IORESOURCE_IRQ,
261 .start = INT_APB_DMA_CH16,
262 .end = INT_APB_DMA_CH16,
263 .flags = IORESOURCE_IRQ,
266 .start = INT_APB_DMA_CH17,
267 .end = INT_APB_DMA_CH17,
268 .flags = IORESOURCE_IRQ,
271 .start = INT_APB_DMA_CH18,
272 .end = INT_APB_DMA_CH18,
273 .flags = IORESOURCE_IRQ,
276 .start = INT_APB_DMA_CH19,
277 .end = INT_APB_DMA_CH19,
278 .flags = IORESOURCE_IRQ,
281 .start = INT_APB_DMA_CH20,
282 .end = INT_APB_DMA_CH20,
283 .flags = IORESOURCE_IRQ,
286 .start = INT_APB_DMA_CH21,
287 .end = INT_APB_DMA_CH21,
288 .flags = IORESOURCE_IRQ,
291 .start = INT_APB_DMA_CH22,
292 .end = INT_APB_DMA_CH22,
293 .flags = IORESOURCE_IRQ,
296 .start = INT_APB_DMA_CH23,
297 .end = INT_APB_DMA_CH23,
298 .flags = IORESOURCE_IRQ,
301 .start = INT_APB_DMA_CH24,
302 .end = INT_APB_DMA_CH24,
303 .flags = IORESOURCE_IRQ,
306 .start = INT_APB_DMA_CH25,
307 .end = INT_APB_DMA_CH25,
308 .flags = IORESOURCE_IRQ,
311 .start = INT_APB_DMA_CH26,
312 .end = INT_APB_DMA_CH26,
313 .flags = IORESOURCE_IRQ,
316 .start = INT_APB_DMA_CH27,
317 .end = INT_APB_DMA_CH27,
318 .flags = IORESOURCE_IRQ,
321 .start = INT_APB_DMA_CH28,
322 .end = INT_APB_DMA_CH28,
323 .flags = IORESOURCE_IRQ,
326 .start = INT_APB_DMA_CH29,
327 .end = INT_APB_DMA_CH29,
328 .flags = IORESOURCE_IRQ,
331 .start = INT_APB_DMA_CH30,
332 .end = INT_APB_DMA_CH30,
333 .flags = IORESOURCE_IRQ,
336 .start = INT_APB_DMA_CH31,
337 .end = INT_APB_DMA_CH31,
338 .flags = IORESOURCE_IRQ,
343 struct platform_device tegra_apbdma = {
344 .name = "tegra124-apbdma",
346 .resource = apbdma_resource,
347 .num_resources = ARRAY_SIZE(apbdma_resource),
350 #if defined(CONFIG_ARCH_TEGRA_14x_SOC)
352 static struct tegra_mipi_bif_platform_data mipi_bif_pdata = {
358 static struct resource mipi_bif_resource[] = {
360 .start = INT_MIPI_BIF,
362 .flags = IORESOURCE_IRQ,
365 .start = TEGRA_MIPI_BIF_BASE,
366 .end = TEGRA_MIPI_BIF_BASE + TEGRA_MIPI_BIF_SIZE - 1,
367 .flags = IORESOURCE_MEM,
371 struct platform_device tegra_mipi_bif_device = {
372 .name = "tegra-mipi-bif",
374 .resource = mipi_bif_resource,
375 .num_resources = ARRAY_SIZE(mipi_bif_resource),
377 .platform_data = &mipi_bif_pdata,
383 static struct resource spi_resource1[] = {
387 .flags = IORESOURCE_IRQ,
390 .start = TEGRA_SPI1_BASE,
391 .end = TEGRA_SPI1_BASE + TEGRA_SPI1_SIZE-1,
392 .flags = IORESOURCE_MEM,
396 static struct resource spi_resource2[] = {
400 .flags = IORESOURCE_IRQ,
403 .start = TEGRA_SPI2_BASE,
404 .end = TEGRA_SPI2_BASE + TEGRA_SPI2_SIZE-1,
405 .flags = IORESOURCE_MEM,
409 static struct resource spi_resource3[] = {
413 .flags = IORESOURCE_IRQ,
416 .start = TEGRA_SPI3_BASE,
417 .end = TEGRA_SPI3_BASE + TEGRA_SPI3_SIZE-1,
418 .flags = IORESOURCE_MEM,
422 static struct resource spi_resource4[] = {
426 .flags = IORESOURCE_IRQ,
429 .start = TEGRA_SPI4_BASE,
430 .end = TEGRA_SPI4_BASE + TEGRA_SPI4_SIZE-1,
431 .flags = IORESOURCE_MEM,
434 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
435 static struct resource spi_resource5[] = {
439 .flags = IORESOURCE_IRQ,
442 .start = TEGRA_SPI5_BASE,
443 .end = TEGRA_SPI5_BASE + TEGRA_SPI5_SIZE-1,
444 .flags = IORESOURCE_MEM,
448 static struct resource spi_resource6[] = {
452 .flags = IORESOURCE_IRQ,
455 .start = TEGRA_SPI6_BASE,
456 .end = TEGRA_SPI6_BASE + TEGRA_SPI6_SIZE-1,
457 .flags = IORESOURCE_MEM,
462 struct platform_device tegra_spi_device1 = {
465 .resource = spi_resource1,
466 .num_resources = ARRAY_SIZE(spi_resource1),
468 .coherent_dma_mask = 0xffffffff,
472 struct platform_device tegra_spi_device2 = {
475 .resource = spi_resource2,
476 .num_resources = ARRAY_SIZE(spi_resource2),
478 .coherent_dma_mask = 0xffffffff,
482 struct platform_device tegra_spi_device3 = {
485 .resource = spi_resource3,
486 .num_resources = ARRAY_SIZE(spi_resource3),
488 .coherent_dma_mask = 0xffffffff,
492 struct platform_device tegra_spi_device4 = {
495 .resource = spi_resource4,
496 .num_resources = ARRAY_SIZE(spi_resource4),
498 .coherent_dma_mask = 0xffffffff,
501 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
502 struct platform_device tegra_spi_device5 = {
505 .resource = spi_resource5,
506 .num_resources = ARRAY_SIZE(spi_resource5),
508 .coherent_dma_mask = 0xffffffff,
512 struct platform_device tegra_spi_device6 = {
515 .resource = spi_resource6,
516 .num_resources = ARRAY_SIZE(spi_resource6),
518 .coherent_dma_mask = 0xffffffff,
523 struct platform_device tegra11_spi_device1 = {
524 .name = "spi-tegra114",
526 .resource = spi_resource1,
527 .num_resources = ARRAY_SIZE(spi_resource1),
529 .coherent_dma_mask = DMA_BIT_MASK(64),
533 struct platform_device tegra11_spi_device2 = {
534 .name = "spi-tegra114",
536 .resource = spi_resource2,
537 .num_resources = ARRAY_SIZE(spi_resource2),
539 .coherent_dma_mask = DMA_BIT_MASK(64),
543 struct platform_device tegra11_spi_device3 = {
544 .name = "spi-tegra114",
546 .resource = spi_resource3,
547 .num_resources = ARRAY_SIZE(spi_resource3),
549 .coherent_dma_mask = DMA_BIT_MASK(64),
553 struct platform_device tegra11_spi_device4 = {
554 .name = "spi-tegra114",
556 .resource = spi_resource4,
557 .num_resources = ARRAY_SIZE(spi_resource4),
559 .coherent_dma_mask = DMA_BIT_MASK(64),
563 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
564 struct platform_device tegra11_spi_device5 = {
565 .name = "spi-tegra114",
567 .resource = spi_resource5,
568 .num_resources = ARRAY_SIZE(spi_resource5),
570 .coherent_dma_mask = DMA_BIT_MASK(64),
574 struct platform_device tegra11_spi_device6 = {
575 .name = "spi-tegra114",
577 .resource = spi_resource6,
578 .num_resources = ARRAY_SIZE(spi_resource6),
580 .coherent_dma_mask = DMA_BIT_MASK(64),
585 struct platform_device tegra_spi_slave_device1 = {
586 .name = "spi_slave_tegra",
588 .resource = spi_resource1,
589 .num_resources = ARRAY_SIZE(spi_resource1),
591 .coherent_dma_mask = 0xffffffff,
595 struct platform_device tegra_spi_slave_device2 = {
596 .name = "spi_slave_tegra",
598 .resource = spi_resource2,
599 .num_resources = ARRAY_SIZE(spi_resource2),
601 .coherent_dma_mask = 0xffffffff,
605 struct platform_device tegra_spi_slave_device3 = {
606 .name = "spi_slave_tegra",
608 .resource = spi_resource3,
609 .num_resources = ARRAY_SIZE(spi_resource3),
611 .coherent_dma_mask = 0xffffffff,
615 struct platform_device tegra_spi_slave_device4 = {
616 .name = "spi_slave_tegra",
618 .resource = spi_resource4,
619 .num_resources = ARRAY_SIZE(spi_resource4),
621 .coherent_dma_mask = 0xffffffff,
624 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
625 struct platform_device tegra_spi_slave_device5 = {
626 .name = "spi_slave_tegra",
628 .resource = spi_resource5,
629 .num_resources = ARRAY_SIZE(spi_resource5),
631 .coherent_dma_mask = 0xffffffff,
635 struct platform_device tegra_spi_slave_device6 = {
636 .name = "spi_slave_tegra",
638 .resource = spi_resource6,
639 .num_resources = ARRAY_SIZE(spi_resource6),
641 .coherent_dma_mask = 0xffffffff,
646 struct platform_device tegra11_spi_slave_device1 = {
647 .name = "tegra11-spi-slave",
649 .resource = spi_resource1,
650 .num_resources = ARRAY_SIZE(spi_resource1),
652 .coherent_dma_mask = 0xffffffff,
656 struct platform_device tegra11_spi_slave_device2 = {
657 .name = "tegra11-spi-slave",
659 .resource = spi_resource2,
660 .num_resources = ARRAY_SIZE(spi_resource2),
662 .coherent_dma_mask = 0xffffffff,
666 struct platform_device tegra11_spi_slave_device3 = {
667 .name = "tegra11-spi-slave",
669 .resource = spi_resource3,
670 .num_resources = ARRAY_SIZE(spi_resource3),
672 .coherent_dma_mask = 0xffffffff,
676 struct platform_device tegra11_spi_slave_device4 = {
677 .name = "tegra11-spi-slave",
679 .resource = spi_resource4,
680 .num_resources = ARRAY_SIZE(spi_resource4),
682 .coherent_dma_mask = 0xffffffff,
685 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
686 struct platform_device tegra11_spi_slave_device5 = {
687 .name = "tegra11-spi-slave",
689 .resource = spi_resource5,
690 .num_resources = ARRAY_SIZE(spi_resource5),
692 .coherent_dma_mask = 0xffffffff,
696 struct platform_device tegra11_spi_slave_device6 = {
697 .name = "tegra11-spi-slave",
699 .resource = spi_resource6,
700 .num_resources = ARRAY_SIZE(spi_resource6),
702 .coherent_dma_mask = 0xffffffff,
707 static struct resource resources_nor[] = {
711 .flags = IORESOURCE_IRQ,
714 /* Map SNOR Controller */
715 .start = TEGRA_SNOR_BASE,
716 .end = TEGRA_SNOR_BASE + TEGRA_SNOR_SIZE - 1,
717 .flags = IORESOURCE_MEM,
720 /* Map the size of flash */
721 .start = TEGRA_NOR_FLASH_BASE,
722 .end = TEGRA_NOR_FLASH_BASE + TEGRA_NOR_FLASH_SIZE - 1,
723 .flags = IORESOURCE_MEM,
727 struct platform_device tegra_nor_device = {
730 .num_resources = ARRAY_SIZE(resources_nor),
731 .resource = resources_nor,
733 .coherent_dma_mask = 0xffffffff,
737 static struct resource dtv_resource[] = {
739 .start = TEGRA_DTV_BASE,
740 .end = TEGRA_DTV_BASE + TEGRA_DTV_SIZE - 1,
741 .flags = IORESOURCE_MEM,
744 .start = TEGRA_DMA_REQ_SEL_DTV,
745 .end = TEGRA_DMA_REQ_SEL_DTV,
746 .flags = IORESOURCE_DMA
750 struct platform_device tegra_dtv_device = {
753 .resource = dtv_resource,
754 .num_resources = ARRAY_SIZE(dtv_resource),
757 .coherent_dma_mask = 0xffffffff,
761 static struct resource sdhci_resource1[] = {
765 .flags = IORESOURCE_IRQ,
768 .start = TEGRA_SDMMC1_BASE,
769 .end = TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1,
770 .flags = IORESOURCE_MEM,
774 static struct resource sdhci_resource2[] = {
778 .flags = IORESOURCE_IRQ,
781 .start = TEGRA_SDMMC2_BASE,
782 .end = TEGRA_SDMMC2_BASE + TEGRA_SDMMC2_SIZE-1,
783 .flags = IORESOURCE_MEM,
787 static struct resource sdhci_resource3[] = {
791 .flags = IORESOURCE_IRQ,
794 .start = TEGRA_SDMMC3_BASE,
795 .end = TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1,
796 .flags = IORESOURCE_MEM,
800 static struct resource sdhci_resource4[] = {
804 .flags = IORESOURCE_IRQ,
807 .start = TEGRA_SDMMC4_BASE,
808 .end = TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1,
809 .flags = IORESOURCE_MEM,
813 struct platform_device tegra_pci_device = {
814 .name = "tegra-pcie",
823 /* board files should fill in platform_data register the devices themselvs.
824 * See board-harmony.c for an example
826 struct platform_device tegra_sdhci_device1 = {
827 .name = "sdhci-tegra",
829 .resource = sdhci_resource1,
830 .num_resources = ARRAY_SIZE(sdhci_resource1),
833 struct platform_device tegra_sdhci_device2 = {
834 .name = "sdhci-tegra",
836 .resource = sdhci_resource2,
837 .num_resources = ARRAY_SIZE(sdhci_resource2),
840 struct platform_device tegra_sdhci_device3 = {
841 .name = "sdhci-tegra",
843 .resource = sdhci_resource3,
844 .num_resources = ARRAY_SIZE(sdhci_resource3),
847 struct platform_device tegra_sdhci_device4 = {
848 .name = "sdhci-tegra",
850 .resource = sdhci_resource4,
851 .num_resources = ARRAY_SIZE(sdhci_resource4),
854 static struct resource tegra_usb1_resources[] = {
856 .start = TEGRA_USB_BASE,
857 .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
858 .flags = IORESOURCE_MEM,
863 .flags = IORESOURCE_IRQ,
867 static struct resource tegra_usb2_resources[] = {
869 .start = TEGRA_USB2_BASE,
870 .end = TEGRA_USB2_BASE + TEGRA_USB2_SIZE - 1,
871 .flags = IORESOURCE_MEM,
876 .flags = IORESOURCE_IRQ,
880 static struct resource tegra_usb3_resources[] = {
882 .start = TEGRA_USB3_BASE,
883 .end = TEGRA_USB3_BASE + TEGRA_USB3_SIZE - 1,
884 .flags = IORESOURCE_MEM,
889 .flags = IORESOURCE_IRQ,
893 #if defined(CONFIG_ARCH_TEGRA_11x_SOC) || defined(CONFIG_ARCH_TEGRA_12x_SOC)
894 static struct resource tegra_xusb_resources[] = {
895 [0] = DEFINE_RES_MEM_NAMED(TEGRA_XUSB_HOST_BASE, TEGRA_XUSB_HOST_SIZE,
897 [1] = DEFINE_RES_MEM_NAMED(TEGRA_XUSB_FPCI_BASE, TEGRA_XUSB_FPCI_SIZE,
899 [2] = DEFINE_RES_MEM_NAMED(TEGRA_XUSB_IPFS_BASE, TEGRA_XUSB_IPFS_SIZE,
901 [3] = DEFINE_RES_MEM_NAMED(TEGRA_XUSB_PADCTL_BASE,
902 TEGRA_XUSB_PADCTL_SIZE, "padctl"),
903 [4] = DEFINE_RES_IRQ_NAMED(INT_XUSB_HOST_INT, "host"),
904 [5] = DEFINE_RES_IRQ_NAMED(INT_XUSB_HOST_SMI, "host-smi"),
905 [6] = DEFINE_RES_IRQ_NAMED(INT_XUSB_PADCTL, "padctl"),
906 [7] = DEFINE_RES_IRQ_NAMED(INT_USB3, "usb3"),
907 [8] = DEFINE_RES_IRQ_NAMED(INT_USB2, "usb2"),
910 static u64 tegra_xusb_dmamask = DMA_BIT_MASK(64);
912 struct platform_device tegra_xhci_device = {
913 .name = "tegra-xhci",
916 .dma_mask = &tegra_xusb_dmamask,
917 .coherent_dma_mask = DMA_BIT_MASK(64),
919 .resource = tegra_xusb_resources,
920 .num_resources = ARRAY_SIZE(tegra_xusb_resources),
924 static u64 tegra_ehci_dmamask = DMA_BIT_MASK(64);
926 struct platform_device tegra_ehci1_device = {
927 .name = "tegra-ehci",
930 .dma_mask = &tegra_ehci_dmamask,
931 .coherent_dma_mask = DMA_BIT_MASK(64),
933 .resource = tegra_usb1_resources,
934 .num_resources = ARRAY_SIZE(tegra_usb1_resources),
937 struct platform_device tegra_ehci2_device = {
938 .name = "tegra-ehci",
941 .dma_mask = &tegra_ehci_dmamask,
942 .coherent_dma_mask = DMA_BIT_MASK(64),
944 .resource = tegra_usb2_resources,
945 .num_resources = ARRAY_SIZE(tegra_usb2_resources),
948 struct platform_device tegra_ehci3_device = {
949 .name = "tegra-ehci",
952 .dma_mask = &tegra_ehci_dmamask,
953 .coherent_dma_mask = DMA_BIT_MASK(64),
955 .resource = tegra_usb3_resources,
956 .num_resources = ARRAY_SIZE(tegra_usb3_resources),
959 static struct resource tegra_pmu_resources[] = {
961 .start = INT_CPU0_PMU_INTR,
962 .end = INT_CPU0_PMU_INTR,
963 .flags = IORESOURCE_IRQ,
966 .start = INT_CPU1_PMU_INTR,
967 .end = INT_CPU1_PMU_INTR,
968 .flags = IORESOURCE_IRQ,
970 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
972 .start = INT_CPU2_PMU_INTR,
973 .end = INT_CPU2_PMU_INTR,
974 .flags = IORESOURCE_IRQ,
977 .start = INT_CPU3_PMU_INTR,
978 .end = INT_CPU3_PMU_INTR,
979 .flags = IORESOURCE_IRQ,
984 struct platform_device tegra_pmu_device = {
987 .num_resources = ARRAY_SIZE(tegra_pmu_resources),
988 .resource = tegra_pmu_resources,
991 static struct resource tegra_uarta_resources[] = {
993 .start = TEGRA_UARTA_BASE,
994 .end = TEGRA_UARTA_BASE + TEGRA_UARTA_SIZE - 1,
995 .flags = IORESOURCE_MEM,
1000 .flags = IORESOURCE_IRQ,
1004 static struct resource tegra_uartb_resources[] = {
1006 .start = TEGRA_UARTB_BASE,
1007 .end = TEGRA_UARTB_BASE + TEGRA_UARTB_SIZE - 1,
1008 .flags = IORESOURCE_MEM,
1013 .flags = IORESOURCE_IRQ,
1017 static struct resource tegra_uartc_resources[] = {
1019 .start = TEGRA_UARTC_BASE,
1020 .end = TEGRA_UARTC_BASE + TEGRA_UARTC_SIZE - 1,
1021 .flags = IORESOURCE_MEM,
1026 .flags = IORESOURCE_IRQ,
1030 static struct resource tegra_uartd_resources[] = {
1032 .start = TEGRA_UARTD_BASE,
1033 .end = TEGRA_UARTD_BASE + TEGRA_UARTD_SIZE - 1,
1034 .flags = IORESOURCE_MEM,
1039 .flags = IORESOURCE_IRQ,
1043 static struct resource tegra_uarte_resources[] = {
1045 .start = TEGRA_UARTE_BASE,
1046 .end = TEGRA_UARTE_BASE + TEGRA_UARTE_SIZE - 1,
1047 .flags = IORESOURCE_MEM,
1052 .flags = IORESOURCE_IRQ,
1056 #if defined(CONFIG_ARCH_TEGRA_12x_SOC)
1057 #define UART_DMA_BIT_MASK DMA_BIT_MASK(64)
1059 #define UART_DMA_BIT_MASK DMA_BIT_MASK(32)
1062 struct platform_device tegra_uarta_device = {
1063 .name = "serial-tegra",
1065 .num_resources = ARRAY_SIZE(tegra_uarta_resources),
1066 .resource = tegra_uarta_resources,
1068 .coherent_dma_mask = UART_DMA_BIT_MASK,
1072 struct platform_device tegra_uartb_device = {
1073 .name = "serial-tegra",
1075 .num_resources = ARRAY_SIZE(tegra_uartb_resources),
1076 .resource = tegra_uartb_resources,
1078 .coherent_dma_mask = UART_DMA_BIT_MASK,
1082 struct platform_device tegra_uartc_device = {
1083 .name = "serial-tegra",
1085 .num_resources = ARRAY_SIZE(tegra_uartc_resources),
1086 .resource = tegra_uartc_resources,
1088 .coherent_dma_mask = UART_DMA_BIT_MASK,
1092 struct platform_device tegra_uartd_device = {
1093 .name = "serial-tegra",
1095 .num_resources = ARRAY_SIZE(tegra_uartd_resources),
1096 .resource = tegra_uartd_resources,
1098 .coherent_dma_mask = UART_DMA_BIT_MASK,
1102 struct platform_device tegra_uarte_device = {
1103 .name = "serial-tegra",
1105 .num_resources = ARRAY_SIZE(tegra_uarte_resources),
1106 .resource = tegra_uarte_resources,
1108 .coherent_dma_mask = DMA_BIT_MASK(32),
1112 static struct plat_serial8250_port debug_uarta_platform_data[] = {
1114 .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
1115 .mapbase = TEGRA_UARTA_BASE,
1117 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
1127 static struct plat_serial8250_port debug_uartb_platform_data[] = {
1129 .membase = IO_ADDRESS(TEGRA_UARTB_BASE),
1130 .mapbase = TEGRA_UARTB_BASE,
1132 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
1142 static struct plat_serial8250_port debug_uartc_platform_data[] = {
1144 .membase = IO_ADDRESS(TEGRA_UARTC_BASE),
1145 .mapbase = TEGRA_UARTC_BASE,
1147 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
1157 static struct plat_serial8250_port debug_uartd_platform_data[] = {
1159 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
1160 .mapbase = TEGRA_UARTD_BASE,
1162 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
1172 #if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
1173 static struct plat_serial8250_port debug_uarte_platform_data[] = {
1175 .membase = IO_ADDRESS(TEGRA_UARTE_BASE),
1176 .mapbase = TEGRA_UARTE_BASE,
1178 .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE,
1189 struct platform_device debug_uarta_device = {
1190 .name = "serial8250",
1191 .id = PLAT8250_DEV_PLATFORM,
1193 .platform_data = debug_uarta_platform_data,
1197 struct platform_device debug_uartb_device = {
1198 .name = "serial8250",
1199 .id = PLAT8250_DEV_PLATFORM,
1201 .platform_data = debug_uartb_platform_data,
1205 struct platform_device debug_uartc_device = {
1206 .name = "serial8250",
1207 .id = PLAT8250_DEV_PLATFORM,
1209 .platform_data = debug_uartc_platform_data,
1213 struct platform_device debug_uartd_device = {
1214 .name = "serial8250",
1215 .id = PLAT8250_DEV_PLATFORM,
1217 .platform_data = debug_uartd_platform_data,
1221 #if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
1222 struct platform_device debug_uarte_device = {
1223 .name = "serial8250",
1224 .id = PLAT8250_DEV_PLATFORM,
1226 .platform_data = debug_uarte_platform_data,
1231 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
1232 static struct resource i2s_resource1[] = {
1236 .flags = IORESOURCE_IRQ
1239 .start = TEGRA_DMA_REQ_SEL_I2S_1,
1240 .end = TEGRA_DMA_REQ_SEL_I2S_1,
1241 .flags = IORESOURCE_DMA
1244 .start = TEGRA_I2S1_BASE,
1245 .end = TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1,
1246 .flags = IORESOURCE_MEM
1250 struct platform_device tegra_i2s_device1 = {
1251 .name = "tegra20-i2s",
1253 .resource = i2s_resource1,
1254 .num_resources = ARRAY_SIZE(i2s_resource1),
1257 static struct resource i2s_resource2[] = {
1261 .flags = IORESOURCE_IRQ
1264 .start = TEGRA_DMA_REQ_SEL_I2S2_1,
1265 .end = TEGRA_DMA_REQ_SEL_I2S2_1,
1266 .flags = IORESOURCE_DMA
1269 .start = TEGRA_I2S2_BASE,
1270 .end = TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1,
1271 .flags = IORESOURCE_MEM
1275 struct platform_device tegra_i2s_device2 = {
1276 .name = "tegra20-i2s",
1278 .resource = i2s_resource2,
1279 .num_resources = ARRAY_SIZE(i2s_resource2),
1282 static struct resource i2s_resource0[] = {
1284 .start = TEGRA_I2S0_BASE,
1285 .end = TEGRA_I2S0_BASE + TEGRA_I2S0_SIZE - 1,
1286 .flags = IORESOURCE_MEM
1290 struct platform_device tegra_i2s_device0 = {
1291 .name = "tegra30-i2s",
1293 .resource = i2s_resource0,
1294 .num_resources = ARRAY_SIZE(i2s_resource0),
1297 static struct resource i2s_resource1[] = {
1299 .start = TEGRA_I2S1_BASE,
1300 .end = TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1,
1301 .flags = IORESOURCE_MEM
1305 struct platform_device tegra_i2s_device1 = {
1306 .name = "tegra30-i2s",
1308 .resource = i2s_resource1,
1309 .num_resources = ARRAY_SIZE(i2s_resource1),
1312 static struct resource i2s_resource2[] = {
1314 .start = TEGRA_I2S2_BASE,
1315 .end = TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1,
1316 .flags = IORESOURCE_MEM
1320 struct platform_device tegra_i2s_device2 = {
1321 .name = "tegra30-i2s",
1323 .resource = i2s_resource2,
1324 .num_resources = ARRAY_SIZE(i2s_resource2),
1327 static struct resource i2s_resource3[] = {
1329 .start = TEGRA_I2S3_BASE,
1330 .end = TEGRA_I2S3_BASE + TEGRA_I2S3_SIZE - 1,
1331 .flags = IORESOURCE_MEM
1335 struct platform_device tegra_i2s_device3 = {
1336 .name = "tegra30-i2s",
1338 .resource = i2s_resource3,
1339 .num_resources = ARRAY_SIZE(i2s_resource3),
1342 static struct resource i2s_resource4[] = {
1344 .start = TEGRA_I2S4_BASE,
1345 .end = TEGRA_I2S4_BASE + TEGRA_I2S4_SIZE - 1,
1346 .flags = IORESOURCE_MEM
1350 struct platform_device tegra_i2s_device4 = {
1351 .name = "tegra30-i2s",
1353 .resource = i2s_resource4,
1354 .num_resources = ARRAY_SIZE(i2s_resource4),
1358 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
1359 static struct resource spdif_resource[] = {
1363 .flags = IORESOURCE_IRQ
1366 .start = TEGRA_DMA_REQ_SEL_SPD_I,
1367 .end = TEGRA_DMA_REQ_SEL_SPD_I,
1368 .flags = IORESOURCE_DMA
1371 .start = TEGRA_SPDIF_BASE,
1372 .end = TEGRA_SPDIF_BASE + TEGRA_SPDIF_SIZE - 1,
1373 .flags = IORESOURCE_MEM
1377 struct platform_device tegra_spdif_device = {
1378 .name = "tegra20-spdif",
1380 .resource = spdif_resource,
1381 .num_resources = ARRAY_SIZE(spdif_resource),
1384 static struct resource spdif_resource[] = {
1386 .start = TEGRA_SPDIF_BASE,
1387 .end = TEGRA_SPDIF_BASE + TEGRA_SPDIF_SIZE - 1,
1388 .flags = IORESOURCE_MEM
1392 struct platform_device tegra_spdif_device = {
1393 .name = "tegra30-spdif",
1395 .resource = spdif_resource,
1396 .num_resources = ARRAY_SIZE(spdif_resource),
1400 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
1401 static struct resource ahub_resource[] = {
1403 .start = TEGRA_APBIF0_BASE,
1404 .end = TEGRA_APBIF3_BASE + TEGRA_APBIF3_SIZE - 1,
1405 .flags = IORESOURCE_MEM
1408 .start = TEGRA_AHUB_BASE,
1409 .end = TEGRA_AHUB_BASE + TEGRA_AHUB_SIZE - 1,
1410 .flags = IORESOURCE_MEM
1414 struct platform_device tegra_ahub_device = {
1415 .name = "tegra30-ahub",
1417 .resource = ahub_resource,
1418 .num_resources = ARRAY_SIZE(ahub_resource),
1421 static struct resource dam_resource0[] = {
1423 .start = TEGRA_DAM0_BASE,
1424 .end = TEGRA_DAM0_BASE + TEGRA_DAM0_SIZE - 1,
1425 .flags = IORESOURCE_MEM
1429 struct platform_device tegra_dam_device0 = {
1430 .name = "tegra30-dam",
1432 .resource = dam_resource0,
1433 .num_resources = ARRAY_SIZE(dam_resource0),
1436 static struct resource dam_resource1[] = {
1438 .start = TEGRA_DAM1_BASE,
1439 .end = TEGRA_DAM1_BASE + TEGRA_DAM1_SIZE - 1,
1440 .flags = IORESOURCE_MEM
1444 struct platform_device tegra_dam_device1 = {
1445 .name = "tegra30-dam",
1447 .resource = dam_resource1,
1448 .num_resources = ARRAY_SIZE(dam_resource1),
1451 static struct resource dam_resource2[] = {
1453 .start = TEGRA_DAM2_BASE,
1454 .end = TEGRA_DAM2_BASE + TEGRA_DAM2_SIZE - 1,
1455 .flags = IORESOURCE_MEM
1459 struct platform_device tegra_dam_device2 = {
1460 .name = "tegra30-dam",
1462 .resource = dam_resource2,
1463 .num_resources = ARRAY_SIZE(dam_resource2),
1466 static u64 tegra_hda_dma_mask = DMA_BIT_MASK(32);
1467 static struct resource hda_platform_resources[] = {
1469 .start = TEGRA_HDA_BASE,
1470 .end = TEGRA_HDA_BASE + TEGRA_HDA_SIZE - 1,
1471 .flags = IORESOURCE_MEM
1476 .flags = IORESOURCE_IRQ
1480 struct platform_device tegra_hda_device = {
1481 .name = "tegra30-hda",
1484 .coherent_dma_mask = DMA_BIT_MASK(32),
1485 .dma_mask = &tegra_hda_dma_mask,
1487 .resource = hda_platform_resources,
1488 .num_resources = ARRAY_SIZE(hda_platform_resources),
1492 #if defined(CONFIG_ARCH_TEGRA_14x_SOC)
1493 static struct resource dmic_resource0[] = {
1495 .start = TEGRA_DMIC0_BASE,
1496 .end = TEGRA_DMIC0_BASE + TEGRA_DMIC0_SIZE - 1,
1497 .flags = IORESOURCE_MEM
1501 struct platform_device tegra_dmic_device0 = {
1502 .name = "tegra-dmic",
1504 .resource = dmic_resource0,
1505 .num_resources = ARRAY_SIZE(dmic_resource0),
1508 static struct resource dmic_resource1[] = {
1510 .start = TEGRA_DMIC1_BASE,
1511 .end = TEGRA_DMIC1_BASE + TEGRA_DMIC1_SIZE - 1,
1512 .flags = IORESOURCE_MEM
1516 struct platform_device tegra_dmic_device1 = {
1517 .name = "tegra-dmic",
1519 .resource = dmic_resource1,
1520 .num_resources = ARRAY_SIZE(dmic_resource1),
1524 struct platform_device spdif_dit_device = {
1525 .name = "spdif-dit",
1529 struct platform_device bluetooth_dit_device = {
1530 .name = "spdif-dit",
1534 struct platform_device baseband_dit_device = {
1535 .name = "spdif-dit",
1539 struct platform_device tegra_pcm_device = {
1540 .name = "tegra-pcm-audio",
1544 struct platform_device tegra_tdm_pcm_device = {
1545 .name = "tegra-tdm-pcm-audio",
1549 struct platform_device tegra_offload_device = {
1550 .name = "tegra-offload",
1554 struct platform_device tegra30_avp_audio_device = {
1555 .name = "tegra30-avp-audio",
1559 static struct resource w1_resources[] = {
1563 .flags = IORESOURCE_IRQ
1566 .start = TEGRA_OWR_BASE,
1567 .end = TEGRA_OWR_BASE + TEGRA_OWR_SIZE - 1,
1568 .flags = IORESOURCE_MEM
1572 struct platform_device tegra_w1_device = {
1575 .resource = w1_resources,
1576 .num_resources = ARRAY_SIZE(w1_resources),
1579 static struct resource tegra_udc_resources[] = {
1581 .start = TEGRA_USB_BASE,
1582 .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
1583 .flags = IORESOURCE_MEM,
1588 .flags = IORESOURCE_IRQ,
1592 static u64 tegra_udc_dmamask = DMA_BIT_MASK(64);
1594 struct platform_device tegra_udc_device = {
1595 .name = "tegra-udc",
1598 .dma_mask = &tegra_udc_dmamask,
1599 .coherent_dma_mask = DMA_BIT_MASK(64),
1601 .resource = tegra_udc_resources,
1602 .num_resources = ARRAY_SIZE(tegra_udc_resources),
1605 static struct resource tegra_otg_resources[] = {
1607 .start = TEGRA_USB_BASE,
1608 .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
1609 .flags = IORESOURCE_MEM,
1614 .flags = IORESOURCE_IRQ,
1618 struct platform_device tegra_otg_device = {
1619 .name = "tegra-otg",
1621 .resource = tegra_otg_resources,
1622 .num_resources = ARRAY_SIZE(tegra_otg_resources),
1625 #ifdef CONFIG_SATA_AHCI_TEGRA
1626 static u64 tegra_sata_dma_mask = DMA_BIT_MASK(64);
1628 static struct resource tegra_sata_resources[] = {
1630 .start = TEGRA_SATA_BAR5_BASE,
1631 .end = TEGRA_SATA_BAR5_BASE + TEGRA_SATA_BAR5_SIZE - 1,
1632 .flags = IORESOURCE_MEM,
1635 .start = TEGRA_SATA_CONFIG_BASE,
1636 .end = TEGRA_SATA_CONFIG_BASE + TEGRA_SATA_CONFIG_SIZE - 1,
1637 .flags = IORESOURCE_MEM,
1640 .start = INT_SATA_CTL,
1641 .end = INT_SATA_CTL,
1642 .flags = IORESOURCE_IRQ,
1646 struct platform_device tegra_sata_device = {
1647 .name = "tegra-sata",
1650 .coherent_dma_mask = DMA_BIT_MASK(64),
1651 .dma_mask = &tegra_sata_dma_mask,
1653 .resource = tegra_sata_resources,
1654 .num_resources = ARRAY_SIZE(tegra_sata_resources),
1658 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
1659 static struct resource das_resource[] = {
1661 .start = TEGRA_APB_MISC_DAS_BASE,
1662 .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1,
1663 .flags = IORESOURCE_MEM
1667 struct platform_device tegra_das_device = {
1668 .name = "tegra20-das",
1670 .resource = das_resource,
1671 .num_resources = ARRAY_SIZE(das_resource),
1675 #if defined(CONFIG_TEGRA_IOVMM_GART) || defined(CONFIG_TEGRA_IOMMU_GART)
1676 static struct resource tegra_gart_resources[] = {
1679 .flags = IORESOURCE_MEM,
1680 .start = TEGRA_MC_BASE,
1681 .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1,
1685 .flags = IORESOURCE_MEM,
1686 .start = TEGRA_GART_BASE,
1687 .end = TEGRA_GART_BASE + TEGRA_GART_SIZE - 1,
1691 struct platform_device tegra_gart_device = {
1692 .name = "tegra_gart",
1694 .num_resources = ARRAY_SIZE(tegra_gart_resources),
1695 .resource = tegra_gart_resources
1699 #if defined(CONFIG_TEGRA_IOMMU_SMMU)
1700 static struct resource tegra_smmu_resources[] = {
1703 .flags = IORESOURCE_MEM,
1704 .start = TEGRA_MC_BASE,
1705 .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1,
1709 .flags = IORESOURCE_MEM,
1710 .start = TEGRA_AHB_ARB_BASE,
1711 .end = TEGRA_AHB_ARB_BASE + TEGRA_AHB_ARB_SIZE - 1,
1715 struct platform_device tegra_smmu_device = {
1716 .name = "tegra_smmu",
1718 .num_resources = ARRAY_SIZE(tegra_smmu_resources),
1719 .resource = tegra_smmu_resources
1722 static struct resource tegra_smmu[] = {
1724 .start = TEGRA_SMMU_BASE,
1725 .end = TEGRA_SMMU_BASE + TEGRA_SMMU_SIZE - 1,
1729 struct resource *tegra_smmu_window(int wnum)
1731 return &tegra_smmu[wnum];
1734 int tegra_smmu_window_count(void)
1736 return ARRAY_SIZE(tegra_smmu);
1739 static struct iommu_linear_map tegra_fb_linear_map[16]; /* Terminated with 0 */
1741 #define LINEAR_MAP_ADD(n) \
1743 if (n##_start && n##_size) { \
1744 map[i].start = n##_start; \
1745 map[i++].size = n##_size; \
1749 void tegra_fb_linear_set(struct iommu_linear_map *map)
1753 map = tegra_fb_linear_map;
1755 LINEAR_MAP_ADD(tegra_fb);
1756 LINEAR_MAP_ADD(tegra_fb2);
1757 LINEAR_MAP_ADD(tegra_bootloader_fb);
1758 LINEAR_MAP_ADD(tegra_bootloader_fb2);
1759 #ifndef CONFIG_NVMAP_USE_CMA_FOR_CARVEOUT
1760 LINEAR_MAP_ADD(tegra_vpr);
1761 LINEAR_MAP_ADD(tegra_carveout);
1766 void carveout_linear_set(struct device *cma_dev)
1768 struct dma_contiguous_stats stats;
1769 struct iommu_linear_map *map = &tegra_fb_linear_map[0];
1771 if (dma_get_contiguous_stats(cma_dev, &stats))
1774 /* get the free slot at end and add carveout entry */
1775 while (map && map->size)
1777 map->start = stats.base;
1778 map->size = stats.size;
1782 struct swgid_fixup {
1783 const char * const name;
1785 struct iommu_linear_map *linear_map;
1788 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
1789 #define DUMMY_DEV_NAME "dummy_dev"
1790 #define DUMMY_DEV_MAX_NAME_SIZE 100
1791 static char dummy_name[DUMMY_DEV_MAX_NAME_SIZE] = DUMMY_DEV_NAME;
1795 * FIXME: They should have a DT entry with swgroup IDs.
1797 struct swgid_fixup tegra_swgid_fixup[] = {
1798 { .name = "540c0000.epp", .swgids = SWGID(EPP), },
1799 { .name = "epp", .swgids = SWGID(EPP), },
1800 { .name = "54200000.dc", .swgids = SWGID(DC),
1801 .linear_map = tegra_fb_linear_map, },
1802 { .name = "54240000.dc", .swgids = SWGID(DCB), },
1803 { .name = "dc", .swgids = SWGID(DC) | SWGID(DCB) },
1804 { .name = "gr2d", .swgids = SWGID(G2), },
1805 { .name = "gr3d", .swgids = SWGID(NV) | SWGID(NV2), },
1806 { .name = "host1x", .swgids = SWGID(HC) | SWGID(VDE) | \
1807 SWGID(EPP) | SWGID(HDA), },
1808 { .name = "isp", .swgids = SWGID(ISP), },
1809 { .name = "max77660", .swgids = SWGID(PPCS), },
1810 { .name = "max8831", .swgids = SWGID(PPCS), },
1811 { .name = "msenc", .swgids = SWGID(MSENC), },
1812 { .name = "mpe", .swgids = SWGID(MPE), },
1813 { .name = "tegra-aes", .swgids = SWGID(VDE), },
1814 { .name = "nvavp", .swgids = SWGID(AVPC), },
1815 { .name = "sdhci-tegra.0", .swgids = SWGID(PPCS1) },
1816 { .name = "sdhci-tegra.1", .swgids = SWGID(PPCS1) },
1817 { .name = "sdhci-tegra.2", .swgids = SWGID(PPCS1) },
1818 { .name = "sdhci-tegra.3", .swgids = SWGID(PPCS1) },
1819 { .name = "serial8250", .swgids = SWGID(PPCS), },
1820 { .name = "serial-tegra", .swgids = SWGID(PPCS), },
1821 { .name = "snd-soc-dummy", .swgids = SWGID(PPCS), },
1822 { .name = "spdif-dit", .swgids = SWGID(PPCS), },
1823 { .name = "tegra11-se", .swgids = SWGID(PPCS), },
1824 { .name = "tegra11-spi", .swgids = SWGID(PPCS), },
1825 { .name = "tegra14-i2c", .swgids = SWGID(PPCS), },
1826 { .name = "tegra30-ahub", .swgids = SWGID(PPCS), },
1827 { .name = "tegra30-dam", .swgids = SWGID(PPCS), },
1828 { .name = "tegra30-hda", .swgids = SWGID(HDA), },
1829 { .name = "tegra30-i2s", .swgids = SWGID(PPCS), },
1830 { .name = "tegra30-spdif", .swgids = SWGID(PPCS), },
1831 { .name = "tegra30-avp-audio", .swgids = SWGID(AVPC), },
1832 { .name = "tegradc.0", .swgids = SWGID(DC),
1833 .linear_map = tegra_fb_linear_map},
1834 { .name = "tegradc.1", .swgids = SWGID(DCB), },
1835 { .name = "tegra_bb", .swgids = SWGID(PPCS), },
1836 { .name = "tegra_dma", .swgids = SWGID(PPCS), },
1837 { .name = "tegra-ehci", .swgids = SWGID(PPCS), },
1838 { .name = "tegra-fuse", .swgids = SWGID(PPCS), },
1839 { .name = "tegra-i2c", .swgids = SWGID(PPCS), },
1840 { .name = "tegra-nvmap", .swgids = SWGID(HC) | SWGID(AVPC), },
1841 { .name = "tegra-otg", .swgids = SWGID(PPCS), },
1842 { .name = "tegra-pcm-audio", .swgids = SWGID(PPCS), },
1843 { .name = "tegra-rtc", .swgids = SWGID(PPCS), },
1844 { .name = "tegra-sata", .swgids = SWGID(SATA), },
1845 { .name = "tegra-se", .swgids = SWGID(PPCS), },
1846 { .name = "tegra-snd", .swgids = SWGID(PPCS), },
1847 { .name = "tegra-tzram", .swgids = SWGID(VDE), },
1848 { .name = "tegra_uart", .swgids = SWGID(PPCS), },
1849 { .name = "tegra-udc", .swgids = SWGID(PPCS), },
1850 { .name = "tegra_usb_modem_power", .swgids = SWGID(PPCS), },
1851 { .name = "tsec", .swgids = SWGID(TSEC), },
1852 { .name = "vi", .swgids = SWGID(VI), },
1853 { .name = "therm_est", .swgids = SWGID(PPCS), },
1854 { .name = "tegra-xhci", .swgids = SWGID(XUSB_HOST), },
1855 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
1856 { .name = dummy_name, .swgids = SWGID(PPCS) },
1861 struct swgid_fixup tegra_swgid_fixup_t124[] = {
1862 { .name = "54200000.dc", .swgids = SWGID(DC), },
1863 { .name = "54240000.dc", .swgids = SWGID(DCB), },
1864 { .name = "dc", .swgids = SWGID(DC) | SWGID(DCB) },
1865 { .name = "host1x", .swgids = SWGID(HC) | SWGID(VDE) |
1866 SWGID(EPP) | SWGID(HDA), },
1867 { .name = "isp", .swgids = SWGID(ISP2) | SWGID(ISP2B), },
1868 { .name = "max77660", .swgids = SWGID(PPCS), },
1869 { .name = "max8831", .swgids = SWGID(PPCS), },
1870 { .name = "msenc", .swgids = SWGID(MSENC), },
1871 { .name = "mpe", .swgids = SWGID(MPE), },
1872 { .name = "tegra-aes", .swgids = SWGID(VDE), },
1873 { .name = "nvavp", .swgids = SWGID(AVPC) | SWGID(A9AVP), },
1874 { .name = "serial8250", .swgids = SWGID(PPCS), },
1875 { .name = "serial-tegra", .swgids = SWGID(PPCS), },
1876 { .name = "dtv", .swgids = SWGID(PPCS), },
1877 { .name = "snd-soc-dummy", .swgids = SWGID(PPCS), },
1878 { .name = "spdif-dit", .swgids = SWGID(PPCS), },
1879 { .name = "tegra12-se", .swgids = SWGID(PPCS), },
1880 { .name = "spi-tegra114", .swgids = SWGID(PPCS), },
1881 { .name = "tegra14-i2c", .swgids = SWGID(PPCS), },
1882 { .name = "tegra30-ahub", .swgids = SWGID(PPCS), },
1883 { .name = "tegra30-dam", .swgids = SWGID(PPCS), },
1884 { .name = "tegra30-hda", .swgids = SWGID(HDA), },
1885 { .name = "tegra30-i2s", .swgids = SWGID(PPCS), },
1886 { .name = "tegra30-spdif", .swgids = SWGID(PPCS), },
1887 { .name = "tegra30-avp-audio", .swgids = SWGID(AVPC) | SWGID(A9AVP), },
1888 { .name = "tegradc.0", .swgids = SWGID(DC) | SWGID(DC12),
1889 .linear_map = tegra_fb_linear_map, },
1890 { .name = "tegradc.1", .swgids = SWGID(DCB),
1891 .linear_map = tegra_fb_linear_map, },
1892 { .name = "tegra_bb", .swgids = SWGID(PPCS), },
1893 { .name = "tegra_dma", .swgids = SWGID(PPCS), },
1894 { .name = "tegra-ehci", .swgids = SWGID(PPCS), },
1895 { .name = "tegra-fuse", .swgids = SWGID(PPCS), },
1896 { .name = "tegra-i2c", .swgids = SWGID(PPCS), },
1897 { .name = "tegra-nvmap", .swgids = SWGID(HC) | SWGID(AVPC), },
1899 * PPCS1 selection for USB2 needs AHB_ARBC register program
1900 * in warm boot and cold boot paths in BL as it needs
1903 { .name = "tegra-otg", .swgids = SWGID(PPCS1), },
1904 { .name = "tegra-pcm-audio", .swgids = SWGID(PPCS), },
1905 { .name = "tegra-rtc", .swgids = SWGID(PPCS), },
1906 { .name = "tegra-sata", .swgids = SWGID(SATA2), },
1907 { .name = "tegra-se", .swgids = SWGID(PPCS), },
1908 { .name = "tegra-snd", .swgids = SWGID(PPCS), },
1909 { .name = "tegra-tzram", .swgids = SWGID(PPCS), },
1910 { .name = "tegra_uart", .swgids = SWGID(PPCS), },
1911 { .name = "tegra-udc", .swgids = SWGID(PPCS), },
1912 { .name = "tegra_usb_modem_power", .swgids = SWGID(PPCS), },
1913 { .name = "tsec", .swgids = SWGID(TSEC), },
1914 /* vic must be before vi to prevent incorrect matching */
1915 { .name = "vic", .swgids = SWGID(VIC), },
1916 { .name = "vi", .swgids = SWGID(VI), },
1917 { .name = "therm_est", .swgids = SWGID(PPCS), },
1918 { .name = "gk20a", .swgids = SWGID(GPU) | SWGID(GPUB), },
1919 { .name = "tegra124-apbdma", .swgids = SWGID(PPCS), },
1920 { .name = "tegra-nor", .swgids = SWGID(PPCS), },
1921 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
1922 { .name = dummy_name, .swgids = SWGID(PPCS) },
1924 { .name = "tegra-xhci", .swgids = SWGID(XUSB_HOST), },
1928 u64 tegra_smmu_fixup_swgids(struct device *dev, struct iommu_linear_map **map)
1931 struct swgid_fixup *table;
1936 switch (tegra_get_chipid()) {
1937 case TEGRA_CHIPID_TEGRA12:
1938 case TEGRA_CHIPID_TEGRA13:
1939 table = tegra_swgid_fixup_t124;
1942 table = tegra_swgid_fixup;
1946 while ((s = table->name) != NULL) {
1947 if (!strncmp(s, dev_name(dev), strlen(s))) {
1949 *map = table->linear_map;
1951 return table->swgids;
1959 #ifdef CONFIG_PLATFORM_ENABLE_IOMMU
1961 struct tegra_iommu_mapping {
1964 struct dma_iommu_mapping *map;
1967 static struct tegra_iommu_mapping smmu_default_map[] = {
1968 [SYSTEM_DEFAULT] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1969 [SYSTEM_PROTECTED] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1970 [PPCS1_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1971 [SYSTEM_DC] = {0x10000, (u32)~0},
1972 [SYSTEM_DCB] = {0x10000, (u32)~0},
1973 /* Non-zero base to account for gk20a driver's assumptions */
1974 [SYSTEM_GK20A] = {0x100000, (u32)~0},
1975 [SDMMC1A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1976 [SDMMC2A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1977 [SDMMC3A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1978 [SDMMC4A_ASID] = {TEGRA_IOMMU_BASE, TEGRA_IOMMU_SIZE},
1981 static void tegra_smmu_map_init(struct platform_device *pdev)
1985 for (i = 0; i < ARRAY_SIZE(smmu_default_map); i++) {
1986 struct tegra_iommu_mapping *m = &smmu_default_map[i];
1987 struct dma_iommu_mapping *map;
1990 if (IS_ENABLED(CONFIG_TEGRA_ERRATA_1053704))
1991 order = get_order(SZ_16K);
1993 map = arm_iommu_create_mapping(&platform_bus_type,
1994 m->base, m->size, 0);
1998 "Failed create IOVA map for ASID[%d]\n", i);
2004 void tegra_smmu_map_misc_device(struct device *dev)
2006 struct dma_iommu_mapping *map = smmu_default_map[SYSTEM_PROTECTED].map;
2007 if (!strncmp(dummy_name, DUMMY_DEV_NAME, strlen(dummy_name))) {
2008 strncpy(dummy_name, dev_name(dev),
2009 DUMMY_DEV_MAX_NAME_SIZE);
2010 arm_iommu_attach_device(dev, map);
2011 dev_info(dev, "Mapped the misc device\n");
2014 dev_err(dev, "Can't Map device\n");
2016 EXPORT_SYMBOL(tegra_smmu_map_misc_device);
2018 void tegra_smmu_unmap_misc_device(struct device *dev)
2020 if (!strncmp(dummy_name, dev_name(dev), strlen(dummy_name))) {
2021 arm_iommu_detach_device(dev);
2022 strncpy(dummy_name, DUMMY_DEV_NAME,
2023 DUMMY_DEV_MAX_NAME_SIZE);
2024 dev_info(dev, "Un-mapped the misc device\n");
2027 dev_err(dev, "Can't Unmap device\n");
2029 EXPORT_SYMBOL(tegra_smmu_unmap_misc_device);
2031 static int _tegra_smmu_get_asid(u64 swgids)
2033 if (swgids & SWGID(PPCS))
2034 return SYSTEM_PROTECTED;
2035 #if defined(CONFIG_ARCH_TEGRA_12x_SOC) || \
2036 defined(CONFIG_ARCH_TEGRA_11x_SOC)
2037 if (swgids & SWGID(PPCS1))
2040 if (swgids & SWGID(PPCS1))
2041 return SYSTEM_PROTECTED;
2044 if (swgids & SWGID(GPUB))
2045 return SYSTEM_GK20A;
2047 #if defined(CONFIG_ARCH_TEGRA_11x_SOC)
2048 if (swgids & SWGID(DC) ||
2049 swgids & SWGID(DCB))
2051 #elif defined(CONFIG_ARCH_TEGRA_12x_SOC)
2052 if (swgids & SWGID(DC) ||
2053 swgids & SWGID(DC12))
2055 if (swgids & SWGID(DCB))
2057 if (swgids & SWGID(SDMMC1A))
2058 return SDMMC1A_ASID;
2059 if (swgids & SWGID(SDMMC2A))
2060 return SDMMC2A_ASID;
2061 if (swgids & SWGID(SDMMC3A))
2062 return SDMMC3A_ASID;
2063 if (swgids & SWGID(SDMMC4A))
2064 return SDMMC4A_ASID;
2067 return SYSTEM_DEFAULT;
2070 int tegra_smmu_get_asid(struct device *dev)
2072 u64 swgids = tegra_smmu_fixup_swgids(dev, NULL);
2073 return _tegra_smmu_get_asid(swgids);
2076 struct dma_iommu_mapping *tegra_smmu_get_map(struct device *dev, u64 swgids)
2079 swgids = tegra_smmu_fixup_swgids(dev, NULL);
2084 return smmu_default_map[_tegra_smmu_get_asid(swgids)].map;
2087 static inline void tegra_smmu_map_init(struct platform_device *pdev)
2092 static int __init tegra_smmu_init(void)
2094 platform_device_register(&tegra_smmu_device);
2095 tegra_smmu_map_init(&tegra_smmu_device);
2098 postcore_initcall(tegra_smmu_init);
2101 #if defined(CONFIG_ARCH_TEGRA_2x_SOC)
2102 #define CLK_RESET_RST_SOURCE 0x0
2103 static struct resource tegra_wdt_resources[] = {
2105 .start = TEGRA_CLK_RESET_BASE + CLK_RESET_RST_SOURCE,
2106 .end = TEGRA_CLK_RESET_BASE + CLK_RESET_RST_SOURCE + 4 - 1,
2107 .flags = IORESOURCE_MEM,
2110 .start = TEGRA_TMR1_BASE,
2111 .end = TEGRA_TMR1_BASE + TEGRA_TMR1_SIZE - 1,
2112 .flags = IORESOURCE_MEM,
2115 .start = TEGRA_PMC_BASE,
2116 .end = TEGRA_PMC_BASE + TEGRA_PMC_SIZE - 1,
2117 .flags = IORESOURCE_MEM,
2122 .flags = IORESOURCE_IRQ,
2126 struct platform_device tegra_wdt_device = {
2127 .name = "tegra_wdt",
2129 .num_resources = ARRAY_SIZE(tegra_wdt_resources),
2130 .resource = tegra_wdt_resources,
2133 static struct resource tegra_wdt0_resources[] = {
2135 .start = TEGRA_WDT0_BASE,
2136 .end = TEGRA_WDT0_BASE + TEGRA_WDT0_SIZE - 1,
2137 .flags = IORESOURCE_MEM,
2140 .start = TEGRA_TMR7_BASE,
2141 .end = TEGRA_TMR7_BASE + TEGRA_TMR7_SIZE - 1,
2142 .flags = IORESOURCE_MEM,
2145 .start = TEGRA_PMC_BASE,
2146 .end = TEGRA_PMC_BASE + TEGRA_PMC_SIZE - 1,
2147 .flags = IORESOURCE_MEM,
2150 .start = INT_WDT_CPU,
2152 .flags = IORESOURCE_IRQ,
2154 #ifdef CONFIG_TEGRA_FIQ_DEBUGGER
2156 .start = TEGRA_QUATERNARY_ICTLR_BASE,
2157 .end = TEGRA_QUATERNARY_ICTLR_BASE + \
2158 TEGRA_QUATERNARY_ICTLR_SIZE -1,
2159 .flags = IORESOURCE_MEM,
2162 #if defined(CONFIG_TRUSTED_LITTLE_KERNEL) && \
2163 defined(CONFIG_ARCH_TEGRA_12x_SOC) && defined(CONFIG_FIQ_DEBUGGER)
2165 .start = TEGRA_WDT4_BASE,
2166 .end = TEGRA_WDT4_BASE + TEGRA_WDT4_SIZE - 1,
2167 .flags = IORESOURCE_MEM,
2170 .start = INT_WDT_AVP,
2172 .flags = IORESOURCE_IRQ,
2175 #if !defined(CONFIG_TRUSTED_FOUNDATIONS) && \
2176 defined(CONFIG_ARCH_TEGRA_12x_SOC) && defined(CONFIG_FIQ_DEBUGGER)
2178 .start = TEGRA_WDT4_BASE,
2179 .end = TEGRA_WDT4_BASE + TEGRA_WDT4_SIZE - 1,
2180 .flags = IORESOURCE_MEM,
2183 .start = INT_WDT_AVP,
2185 .flags = IORESOURCE_IRQ,
2190 struct platform_device tegra_wdt0_device = {
2191 .name = "tegra_wdt",
2193 .num_resources = ARRAY_SIZE(tegra_wdt0_resources),
2194 .resource = tegra_wdt0_resources,
2199 static struct tegra_avp_platform_data tegra_avp_pdata = {
2200 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
2201 .emc_clk_rate = ULONG_MAX,
2203 .emc_clk_rate = 200000000,
2207 struct resource tegra_nvavp_resources[] = {
2209 .start = INT_SHR_SEM_INBOX_IBF,
2210 .end = INT_SHR_SEM_INBOX_IBF,
2211 .flags = IORESOURCE_IRQ,
2212 .name = "mbox_from_nvavp_pending",
2216 struct platform_device nvavp_device = {
2219 .resource = tegra_nvavp_resources,
2220 .num_resources = ARRAY_SIZE(tegra_nvavp_resources),
2222 .coherent_dma_mask = 0xffffffffULL,
2223 .platform_data = &tegra_avp_pdata,
2227 static struct resource tegra_avp_resources[] = {
2229 .start = INT_SHR_SEM_INBOX_IBF,
2230 .end = INT_SHR_SEM_INBOX_IBF,
2231 .flags = IORESOURCE_IRQ,
2232 .name = "mbox_from_avp_pending",
2236 struct platform_device tegra_avp_device = {
2237 .name = "tegra-avp",
2239 .num_resources = ARRAY_SIZE(tegra_avp_resources),
2240 .resource = tegra_avp_resources,
2242 .coherent_dma_mask = 0xffffffffULL,
2243 .platform_data = &tegra_avp_pdata,
2247 static struct resource tegra_aes_resources[] = {
2249 .start = TEGRA_VDE_BASE,
2250 .end = TEGRA_VDE_BASE + TEGRA_VDE_SIZE - 1,
2251 .flags = IORESOURCE_MEM,
2254 .start = TEGRA_BSEA_BASE,
2255 .end = TEGRA_BSEA_BASE + TEGRA_BSEA_SIZE - 1,
2256 .flags = IORESOURCE_MEM,
2259 .start = INT_VDE_BSE_V,
2260 .end = INT_VDE_BSE_V,
2261 .flags = IORESOURCE_IRQ,
2264 .start = INT_VDE_BSE_A,
2265 .end = INT_VDE_BSE_A,
2266 .flags = IORESOURCE_IRQ,
2270 static u64 tegra_aes_dma_mask = DMA_BIT_MASK(32);
2272 struct platform_device tegra_aes_device = {
2273 .name = "tegra-aes",
2275 .resource = tegra_aes_resources,
2276 .num_resources = ARRAY_SIZE(tegra_aes_resources),
2278 .dma_mask = &tegra_aes_dma_mask,
2279 .coherent_dma_mask = DMA_BIT_MASK(32),
2283 static struct resource tegra_kbc_resources[] = {
2285 .start = TEGRA_KBC_BASE,
2286 .end = TEGRA_KBC_BASE + TEGRA_KBC_SIZE - 1,
2287 .flags = IORESOURCE_MEM,
2292 .flags = IORESOURCE_IRQ,
2296 struct platform_device tegra_kbc_device = {
2297 .name = "tegra-kbc",
2299 .resource = tegra_kbc_resources,
2300 .num_resources = ARRAY_SIZE(tegra_kbc_resources),
2306 #if defined(CONFIG_TEGRA_SKIN_THROTTLE)
2307 struct platform_device tegra_skin_therm_est_device = {
2308 .name = "therm_est",
2317 #if defined(CONFIG_ARCH_TEGRA_3x_SOC)
2318 static struct resource tegra_tsensor_resources[]= {
2320 .start = TEGRA_TSENSOR_BASE,
2321 .end = TEGRA_TSENSOR_BASE + TEGRA_TSENSOR_SIZE - 1,
2322 .flags = IORESOURCE_MEM,
2325 .start = INT_TSENSOR,
2327 .flags = IORESOURCE_IRQ,
2330 .start = TEGRA_PMC_BASE + 0x1B0,
2331 /* 2 pmc registers mapped */
2332 .end = TEGRA_PMC_BASE + 0x1B0 + (2 * 4),
2333 .flags = IORESOURCE_MEM,
2337 struct platform_device tegra_tsensor_device = {
2338 .name = "tegra-tsensor",
2340 .num_resources = ARRAY_SIZE(tegra_tsensor_resources),
2341 .resource = tegra_tsensor_resources,
2348 #if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
2349 static u64 tegra_se_dma_mask = DMA_BIT_MASK(32);
2350 static u64 tegra12_se_dma_mask = DMA_BIT_MASK(64);
2352 struct resource tegra_se_resources[] = {
2354 .start = TEGRA_SE_BASE,
2355 .end = TEGRA_SE_BASE + TEGRA_SE_SIZE - 1,
2356 .flags = IORESOURCE_MEM,
2359 .start = TEGRA_PMC_BASE,
2360 .end = TEGRA_PMC_BASE + SZ_256 - 1,
2361 .flags = IORESOURCE_MEM,
2366 .flags = IORESOURCE_IRQ,
2370 struct platform_device tegra_se_device = {
2374 .coherent_dma_mask = DMA_BIT_MASK(32),
2375 .dma_mask = &tegra_se_dma_mask,
2377 .resource = tegra_se_resources,
2378 .num_resources = ARRAY_SIZE(tegra_se_resources),
2381 struct platform_device tegra11_se_device = {
2382 .name = "tegra11-se",
2385 .coherent_dma_mask = DMA_BIT_MASK(32),
2386 .dma_mask = &tegra_se_dma_mask,
2388 .resource = tegra_se_resources,
2389 .num_resources = ARRAY_SIZE(tegra_se_resources),
2392 struct platform_device tegra12_se_device = {
2393 .name = "tegra12-se",
2396 .coherent_dma_mask = DMA_BIT_MASK(64),
2397 .dma_mask = &tegra12_se_dma_mask,
2399 .resource = tegra_se_resources,
2400 .num_resources = ARRAY_SIZE(tegra_se_resources),
2404 static struct resource tegra_disp1_resources[] = {
2407 .start = INT_DISPLAY_GENERAL,
2408 .end = INT_DISPLAY_GENERAL,
2409 .flags = IORESOURCE_IRQ,
2413 .start = TEGRA_DISPLAY_BASE,
2414 .end = TEGRA_DISPLAY_BASE + TEGRA_DISPLAY_SIZE-1,
2415 .flags = IORESOURCE_MEM,
2421 .flags = IORESOURCE_MEM,
2425 .start = TEGRA_DSI_BASE,
2426 .end = TEGRA_DSI_BASE + TEGRA_DSI_SIZE - 1,
2427 .flags = IORESOURCE_MEM,
2431 struct platform_device tegra_disp1_device = {
2434 .resource = tegra_disp1_resources,
2435 .num_resources = ARRAY_SIZE(tegra_disp1_resources),
2438 static struct resource tegra_disp2_resources[] = {
2441 .start = INT_DISPLAY_B_GENERAL,
2442 .end = INT_DISPLAY_B_GENERAL,
2443 .flags = IORESOURCE_IRQ,
2447 .start = TEGRA_DISPLAY2_BASE,
2448 .end = TEGRA_DISPLAY2_BASE + TEGRA_DISPLAY2_SIZE - 1,
2449 .flags = IORESOURCE_MEM,
2453 .flags = IORESOURCE_MEM,
2458 .name = "hdmi_regs",
2459 .start = TEGRA_HDMI_BASE,
2460 .end = TEGRA_HDMI_BASE + TEGRA_HDMI_SIZE - 1,
2461 .flags = IORESOURCE_MEM,
2465 struct platform_device tegra_disp2_device = {
2468 .resource = tegra_disp2_resources,
2469 .num_resources = ARRAY_SIZE(tegra_disp2_resources),
2475 struct platform_device tegra_nvmap_device = {
2476 .name = "tegra-nvmap",
2480 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
2481 static struct resource tegra_cec_resources[] = {
2483 .start = TEGRA_CEC_BASE,
2484 .end = TEGRA_CEC_BASE + TEGRA_CEC_SIZE - 1,
2485 .flags = IORESOURCE_MEM,
2490 .flags = IORESOURCE_IRQ,
2494 struct platform_device tegra_cec_device = {
2495 .name = "tegra_cec",
2497 .resource = tegra_cec_resources,
2498 .num_resources = ARRAY_SIZE(tegra_cec_resources),
2502 #ifdef CONFIG_ARCH_TEGRA_HAS_CL_DVFS
2503 static struct resource cl_dvfs_resource[] = {
2504 #ifndef CONFIG_ARCH_TEGRA_13x_SOC
2506 .start = TEGRA_CL_DVFS_BASE,
2507 .end = TEGRA_CL_DVFS_BASE + TEGRA_CL_DVFS_SIZE-1,
2508 .flags = IORESOURCE_MEM,
2512 .start = TEGRA_CLK13_RESET_BASE + 0x84,
2513 .end = TEGRA_CLK13_RESET_BASE + 0x84 + TEGRA_CL_DVFS_SIZE-1,
2514 .flags = IORESOURCE_MEM,
2517 .start = TEGRA_CL_DVFS_BASE,
2518 .end = TEGRA_CL_DVFS_BASE + TEGRA_CL_DVFS_SIZE-1,
2519 .flags = IORESOURCE_MEM,
2524 struct platform_device tegra_cl_dvfs_device = {
2525 .name = "tegra_cl_dvfs",
2527 .resource = cl_dvfs_resource,
2528 .num_resources = ARRAY_SIZE(cl_dvfs_resource),
2532 struct platform_device tegra_fuse_device = {
2533 .name = "tegra-fuse",
2537 #if defined(CONFIG_TEGRA_WAKEUP_MONITOR)
2538 static struct tegra_wakeup_monitor_platform_data
2539 tegratab_tegra_wakeup_monitor_pdata = {
2540 .wifi_wakeup_source = 6,
2541 .rtc_wakeup_source = 18,
2544 struct platform_device tegratab_tegra_wakeup_monitor_device = {
2545 .name = "tegra_wakeup_monitor",
2548 .platform_data = &tegratab_tegra_wakeup_monitor_pdata,
2553 static struct resource ptm_resources[] = {
2557 .end = PTM0_BASE + SZ_4K - 1,
2558 .flags = IORESOURCE_MEM,
2563 .end = PTM1_BASE + SZ_4K - 1,
2564 .flags = IORESOURCE_MEM,
2569 .end = PTM2_BASE + SZ_4K - 1,
2570 .flags = IORESOURCE_MEM,
2575 .end = PTM3_BASE + SZ_4K - 1,
2576 .flags = IORESOURCE_MEM,
2581 .end = ETB_BASE + SZ_4K - 1,
2582 .flags = IORESOURCE_MEM,
2586 .start = FUNNEL_BASE,
2587 .end = FUNNEL_BASE + SZ_4K - 1,
2588 .flags = IORESOURCE_MEM,
2593 .end = TPIU_BASE + SZ_4K - 1,
2594 .flags = IORESOURCE_MEM,
2598 struct platform_device tegra_ptm_device = {
2601 .num_resources = ARRAY_SIZE(ptm_resources),
2602 .resource = ptm_resources,
2605 void __init tegra_init_debug_uart_rate(void)
2607 unsigned int uartclk;
2608 struct clk *debug_uart_parent = clk_get_sys(NULL, "pll_p");
2610 BUG_ON(IS_ERR(debug_uart_parent));
2611 uartclk = clk_get_rate(debug_uart_parent);
2613 debug_uarta_platform_data[0].uartclk = uartclk;
2614 debug_uartb_platform_data[0].uartclk = uartclk;
2615 debug_uartc_platform_data[0].uartclk = uartclk;
2616 debug_uartd_platform_data[0].uartclk = uartclk;
2617 #if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
2618 debug_uarte_platform_data[0].uartclk = uartclk;
2622 #if !defined(CONFIG_ARCH_TEGRA_2x_SOC) && !defined(CONFIG_ARCH_TEGRA_3x_SOC)
2623 static struct resource tegra_hier_ictlr_resource[] = {
2625 .start = TEGRA_HIER2_ICTLR1_BASE,
2626 .end = TEGRA_HIER2_ICTLR1_BASE + TEGRA_HIER2_ICTLR1_SIZE - 1,
2627 .flags = IORESOURCE_MEM,
2630 .start = TEGRA_MSELECT_BASE,
2631 .end = TEGRA_MSELECT_BASE + TEGRA_MSELECT_SIZE - 1,
2632 .flags = IORESOURCE_MEM,
2635 .start = INT_HIER_GROUP1_CPU,
2636 .end = INT_HIER_GROUP1_CPU,
2637 .flags = IORESOURCE_IRQ,
2641 struct platform_device tegra_hier_ictlr_device = {
2642 .name = "tegra-hier-ictlr",
2644 .resource = tegra_hier_ictlr_resource,
2645 .num_resources = ARRAY_SIZE(tegra_hier_ictlr_resource),