ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / io.c
1 /*
2  * arch/arm/mach-tegra/io.c
3  *
4  * Copyright (C) 2010 Google, Inc.
5  *
6  * Author:
7  *      Colin Cross <ccross@google.com>
8  *      Erik Gilling <konkers@google.com>
9  *
10  * Copyright (C) 2010-2013 NVIDIA Corporation
11  *
12  * This software is licensed under the terms of the GNU General Public
13  * License version 2, as published by the Free Software Foundation, and
14  * may be copied, distributed, and modified under those terms.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  */
22
23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/init.h>
26 #include <linux/mm.h>
27 #include <linux/io.h>
28 #include <linux/tegra-soc.h>
29
30 #include <asm/page.h>
31 #include <asm/mach/map.h>
32
33 #include "board.h"
34 #include "iomap.h"
35
36 static struct map_desc tegra_io_desc[] __initdata = {
37         {
38                 .virtual = (unsigned long)IO_PPSB_VIRT,
39                 .pfn = __phys_to_pfn(IO_PPSB_PHYS),
40                 .length = IO_PPSB_SIZE,
41                 .type = MT_DEVICE,
42         },
43         {
44                 .virtual = (unsigned long)IO_APB_VIRT,
45                 .pfn = __phys_to_pfn(IO_APB_PHYS),
46                 .length = IO_APB_SIZE,
47                 .type = MT_DEVICE,
48         },
49         {
50                 .virtual = (unsigned long)IO_CPU_VIRT,
51                 .pfn = __phys_to_pfn(IO_CPU_PHYS),
52                 .length = IO_CPU_SIZE,
53                 .type = MT_DEVICE,
54         },
55         {
56                 .virtual = (unsigned long)IO_IRAM_VIRT,
57                 .pfn = __phys_to_pfn(IO_IRAM_PHYS),
58                 .length = IO_IRAM_SIZE,
59                 .type = MT_DEVICE,
60         },
61         {
62                 .virtual = (unsigned long)IO_HOST1X_VIRT,
63                 .pfn = __phys_to_pfn(IO_HOST1X_PHYS),
64                 .length = IO_HOST1X_SIZE,
65                 .type = MT_DEVICE,
66         },
67         {
68                 .virtual = (unsigned long)IO_USB_VIRT,
69                 .pfn = __phys_to_pfn(IO_USB_PHYS),
70                 .length = IO_USB_SIZE,
71                 .type = MT_DEVICE,
72         },
73         {
74                 .virtual = (unsigned long)IO_SDMMC_VIRT,
75                 .pfn = __phys_to_pfn(IO_SDMMC_PHYS),
76                 .length = IO_SDMMC_SIZE,
77                 .type = MT_DEVICE,
78         },
79         {
80                 .virtual = (unsigned long)IO_PPCS_VIRT,
81                 .pfn = __phys_to_pfn(IO_PPCS_PHYS),
82                 .length = IO_PPCS_SIZE,
83                 .type = MT_DEVICE,
84         },
85 #if defined(CONFIG_TEGRA_PCI)
86         {
87                 .virtual = (unsigned long)IO_PCIE_VIRT,
88                 .pfn = __phys_to_pfn(IO_PCIE_PHYS),
89                 .length = IO_PCIE_SIZE,
90                 .type = MT_DEVICE,
91         },
92 #endif
93 #if defined(CONFIG_MTD_NOR_TEGRA) || defined(CONFIG_TEGRA_GMI)
94         {
95                 .virtual = (unsigned long)IO_NOR_VIRT,
96                 .pfn = __phys_to_pfn(IO_NOR_PHYS),
97                 .length = IO_NOR_SIZE,
98                 .type = MT_DEVICE,
99         },
100 #endif
101 #ifdef CONFIG_TEGRA_GK20A
102         {
103                 .virtual = (unsigned long)IO_GK20A_B0_VIRT,
104                 .pfn = __phys_to_pfn(IO_GK20A_B0_PHYS),
105                 .length = IO_GK20A_B0_SIZE,
106                 .type = MT_DEVICE,
107         },
108         {
109                 .virtual = (unsigned long)IO_GK20A_B1_VIRT,
110                 .pfn = __phys_to_pfn(IO_GK20A_B1_PHYS),
111                 .length = IO_GK20A_B1_SIZE,
112                 .type = MT_DEVICE,
113         },
114 #endif
115 };
116
117 #ifdef CONFIG_TEGRA_PRE_SILICON_SUPPORT
118 static struct map_desc tegra_io_desc_linsim[] __initdata = {
119         {
120                 .virtual = (unsigned long)IO_SMC_VIRT,
121                 .pfn = __phys_to_pfn(IO_SMC_PHYS),
122                 .length = IO_SMC_SIZE,
123                 .type = MT_DEVICE,
124         },
125         {
126                 .virtual = (unsigned long)IO_SIM_ESCAPE_VIRT,
127                 .pfn = __phys_to_pfn(IO_SIM_ESCAPE_PHYS),
128                 .length = IO_SIM_ESCAPE_SIZE,
129                 .type = MT_DEVICE,
130         },
131 };
132 #endif
133
134 void __init tegra_map_common_io(void)
135 {
136         debug_ll_io_init();
137         iotable_init(tegra_io_desc, ARRAY_SIZE(tegra_io_desc));
138
139 #ifdef CONFIG_TEGRA_PRE_SILICON_SUPPORT
140         if (tegra_platform_is_linsim())
141                 iotable_init(tegra_io_desc_linsim,
142                         ARRAY_SIZE(tegra_io_desc_linsim));
143 #endif
144 }