omap5: opp: fix fdif clk name in opp tables
[rpmsg:rpmsg.git] / arch / arm / mach-omap2 / opp5xxx_data.c
1 /*
2  * OMAP4 OPP table definitions.
3  *
4  * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5  *      Nishanth Menon
6  *      Kevin Hilman
7  *      Thara Gopinath
8  * Copyright (C) 2010-2011 Nokia Corporation.
9  *      Eduardo Valentin
10  *      Paul Walmsley
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation.
15  *
16  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
17  * kind, whether express or implied; without even the implied warranty
18  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  */
21 #include <linux/module.h>
22
23 #include <plat/cpu.h>
24
25 #include "control.h"
26 #include "omap_opp_data.h"
27 #include "pm.h"
28 #include "abb.h"
29
30 /*
31  * Structures containing OMAP5430 voltage supported and various
32  * voltage dependent data for each VDD.
33  */
34
35 #define OMAP5_ON_VOLTAGE_UV                             1040000
36 #define OMAP5_ONLP_VOLTAGE_UV                   1040000
37 #define OMAP5_ON_VOLTAGE_MPU_UV                 1220000
38 #define OMAP5_ONLP_VOLTAGE_MPU_UV               1220000
39 #define OMAP5_RET_VOLTAGE_UV                    700000
40 #define OMAP5_OFF_VOLTAGE_UV                    0
41
42 #define OMAP5430_VDD_MPU_OPP_LOW                 950000
43 #define OMAP5430_VDD_MPU_OPP_NOM                1040000
44 #define OMAP5430_VDD_MPU_OPP_HIGH               1220000
45 #define OMAP5430_VDD_MPU_OPP_SB                 1220000
46
47 struct omap_volt_data omap54xx_vdd_mpu_volt_data[] = {
48         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MPU_OPP_LOW, OMAP54XX_CONTROL_FUSE_MPU_OPP50, OMAP54XX_CONTROL_FUSE_MPU_LVT_OPP50, 0xf4, 0x0c, OMAP_ABB_NOMINAL_OPP),
49         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MPU_OPP_NOM, OMAP54XX_CONTROL_FUSE_MPU_OPP100, OMAP54XX_CONTROL_FUSE_MPU_LVT_OPP100, 0xf9, 0x16, OMAP_ABB_NOMINAL_OPP),
50         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MPU_OPP_HIGH, OMAP54XX_CONTROL_FUSE_MPU_OPPTURBO, OMAP54XX_CONTROL_FUSE_MPU_LVT_OPPTURBO, 0xfa, 0x23, OMAP_ABB_NOMINAL_OPP),
51         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MPU_OPP_SB, OMAP54XX_CONTROL_FUSE_MPU_OPPNITRO, OMAP54XX_CONTROL_FUSE_MPU_LVT_OPPNITRO, 0xfa, 0x27, OMAP_ABB_NOMINAL_OPP),
52         OMAP5_VOLT_DATA_DEFINE(0, 0, 0, 0, 0, 0),
53 };
54
55 struct omap_vp_param omap54xx_mpu_vp_data = {
56         .vddmin                 = OMAP5_VP_MPU_VLIMITTO_VDDMIN,
57         .vddmax                 = OMAP5_VP_MPU_VLIMITTO_VDDMAX,
58 };
59
60 struct omap_vc_param omap54xx_mpu_vc_data = {
61         .on                     = OMAP5_ON_VOLTAGE_MPU_UV,
62         .onlp                   = OMAP5_ONLP_VOLTAGE_MPU_UV,
63         .ret                    = OMAP5_RET_VOLTAGE_UV,
64         .off                    = OMAP5_OFF_VOLTAGE_UV,
65 };
66
67 #define OMAP5430_VDD_MM_OPP_LOW                  950000
68 #define OMAP5430_VDD_MM_OPP_NOM                 1040000
69 #define OMAP5430_VDD_MM_OPP_OD                  1200000
70
71 struct omap_volt_data omap54xx_vdd_mm_volt_data[] = {
72         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MM_OPP_LOW, OMAP54XX_CONTROL_FUSE_MM_OPP50, OMAP54XX_CONTROL_FUSE_MM_LVT_OPP50, 0xf4, 0x0c, OMAP_ABB_NOMINAL_OPP),
73         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MM_OPP_NOM, OMAP54XX_CONTROL_FUSE_MM_OPP100, OMAP54XX_CONTROL_FUSE_MM_LVT_OPP100, 0xf9, 0x16, OMAP_ABB_NOMINAL_OPP),
74         OMAP5_VOLT_DATA_DEFINE(OMAP5430_VDD_MM_OPP_OD, OMAP54XX_CONTROL_FUSE_MM_OPPTURBO, OMAP54XX_CONTROL_FUSE_MM_LVT_OPPTURBO, 0xfa, 0x23, OMAP_ABB_NOMINAL_OPP),
75         OMAP5_VOLT_DATA_DEFINE(0, 0, 0, 0, 0, 0),
76 };
77
78 struct omap_vp_param omap54xx_mm_vp_data = {
79         .vddmin                 = OMAP5_VP_MM_VLIMITTO_VDDMIN,
80         .vddmax                 = OMAP5_VP_MM_VLIMITTO_VDDMAX,
81 };
82
83 struct omap_vc_param omap54xx_mm_vc_data = {
84         .on                     = OMAP5_ON_VOLTAGE_UV,
85         .onlp                   = OMAP5_ONLP_VOLTAGE_UV,
86         .ret                    = OMAP5_RET_VOLTAGE_UV,
87         .off                    = OMAP5_OFF_VOLTAGE_UV,
88 };
89
90 #define OMAP5430_VDD_CORE_OPP_LOW                950000
91 #define OMAP5430_VDD_CORE_OPP_NOM               1040000
92
93 struct omap_volt_data omap54xx_vdd_core_volt_data[] = {
94         VOLT_DATA_DEFINE(OMAP5430_VDD_CORE_OPP_LOW, OMAP54XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c, OMAP_ABB_NO_LDO),
95         VOLT_DATA_DEFINE(OMAP5430_VDD_CORE_OPP_NOM, OMAP54XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16, OMAP_ABB_NO_LDO),
96         VOLT_DATA_DEFINE(0, 0, 0, 0, 0),
97 };
98
99 struct omap_vp_param omap54xx_core_vp_data = {
100         .vddmin                 = OMAP5_VP_CORE_VLIMITTO_VDDMIN,
101         .vddmax                 = OMAP5_VP_CORE_VLIMITTO_VDDMAX,
102 };
103
104 struct omap_vc_param omap54xx_core_vc_data = {
105         .on                     = OMAP5_ON_VOLTAGE_UV,
106         .onlp                   = OMAP5_ONLP_VOLTAGE_UV,
107         .ret                    = OMAP5_RET_VOLTAGE_UV,
108         .off                    = OMAP5_OFF_VOLTAGE_UV,
109 };
110
111 /* Dependency of domains are as follows for OMAP5430 (OPP based):
112  *
113  *      MPU     IVA     CORE
114  *      50      50      50+
115  *      50      100+    100
116  *      100+    50      100
117  *      100+    100+    100
118  */
119
120 /* OMAP 5430 MPU Core VDD dependency table */
121 static struct omap_vdd_dep_volt omap54xx_vdd_mpu_core_dep_data[] = {
122         {.main_vdd_volt = OMAP5430_VDD_MPU_OPP_LOW, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_LOW},
123         {.main_vdd_volt = OMAP5430_VDD_MPU_OPP_NOM, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_NOM},
124         {.main_vdd_volt = OMAP5430_VDD_MPU_OPP_HIGH, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_NOM},
125         {.main_vdd_volt = OMAP5430_VDD_MPU_OPP_SB, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_NOM},
126 };
127 struct omap_vdd_dep_info omap54xx_vddmpu_dep_info[] = {
128         {
129                 .name   = "core",
130                 .dep_table = omap54xx_vdd_mpu_core_dep_data,
131                 .nr_dep_entries = ARRAY_SIZE(omap54xx_vdd_mpu_core_dep_data),
132         },
133         {.name = NULL, .dep_table = NULL, .nr_dep_entries = 0},
134 };
135
136 /* OMAP 5430 MPU IVA VDD dependency table */
137 static struct omap_vdd_dep_volt omap54xx_vdd_mm_core_dep_data[] = {
138         {.main_vdd_volt = OMAP5430_VDD_MM_OPP_LOW, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_LOW},
139         {.main_vdd_volt = OMAP5430_VDD_MM_OPP_NOM, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_NOM},
140         {.main_vdd_volt = OMAP5430_VDD_MM_OPP_OD, .dep_vdd_volt = OMAP5430_VDD_CORE_OPP_NOM},
141 };
142
143 struct omap_vdd_dep_info omap54xx_vddmm_dep_info[] = {
144         {
145                 .name   = "core",
146                 .dep_table = omap54xx_vdd_mm_core_dep_data,
147                 .nr_dep_entries = ARRAY_SIZE(omap54xx_vdd_mm_core_dep_data),
148         },
149         {.name = NULL, .dep_table = NULL, .nr_dep_entries = 0},
150 };
151
152
153 static struct omap_opp_def __initdata omap54xx_opp_def_list[] = {
154 #ifdef CONFIG_MACH_OMAP_5430ZEBU
155         /* MPU OPP1 - OPPLOW */
156         OPP_INITIALIZER("mpu", "virt_dpll_mpu_ck", "mpu", true, 550000000, OMAP5430_VDD_MPU_OPP_LOW),
157         /* MPU OPP2 - OPPNOM */
158         OPP_INITIALIZER("mpu", "virt_dpll_mpu_ck", "mpu", true, 1100000000, OMAP5430_VDD_MPU_OPP_NOM),
159         /* MPU OPP3 - OPP-HIGH */
160         OPP_INITIALIZER("mpu", "virt_dpll_mpu_ck", "mpu", false, 1500000000, OMAP5430_VDD_MPU_OPP_HIGH),
161 #else
162         /* MPU OPP1 - OPPLOW */
163         OPP_INITIALIZER("mpu", "virt_dpll_mpu_ck", "mpu", true, 400000000, OMAP5430_VDD_MPU_OPP_LOW),
164         /* MPU OPP2 - OPPNOM */
165         OPP_INITIALIZER("mpu", "virt_dpll_mpu_ck", "mpu", true, 800000000, OMAP5430_VDD_MPU_OPP_NOM),
166         /* MPU OPP3 - OPP-HIGH */
167         OPP_INITIALIZER("mpu", "virt_dpll_mpu_ck", "mpu", false, 1100000000, OMAP5430_VDD_MPU_OPP_HIGH),
168 #endif
169         /* L3 OPP1 - OPPLOW */
170         OPP_INITIALIZER("l3_main_1", "virt_l3_ck", "core", true, 133000000, OMAP5430_VDD_CORE_OPP_LOW),
171         /* L3 OPP2 - OPPNOM */
172         OPP_INITIALIZER("l3_main_1", "virt_l3_ck", "core", true, 266000000, OMAP5430_VDD_CORE_OPP_NOM),
173         /* TODO: Uncomment the following once we have drivers for them */
174 #if 0
175         /* MMC1 OPP1 - OPPLOW */
176         OPP_INITIALIZER("mmc1", "mmc1_fclk", "core", true, 96000000, OMAP5430_VDD_CORE_OPP_LOW),
177         /* MMC1 OPP2 - OPPNOM */
178         OPP_INITIALIZER("mmc1", "mmc1_fclk", "core", true, 192000000, OMAP5430_VDD_CORE_OPP_NOM),
179
180         /* MMC2 OPP1 - OPPLOW */
181         OPP_INITIALIZER("mmc2", "mmc2_fclk", "core", true, 96000000, OMAP5430_VDD_CORE_OPP_LOW),
182         /* MMC2 OPP2 - OPPNOM */
183         OPP_INITIALIZER("mmc2", "mmc2_fclk", "core", true, 192000000, OMAP5430_VDD_CORE_OPP_NOM),
184 #endif
185
186         /* FDIF OPP1 - OPPLOW */
187         OPP_INITIALIZER("fdif", "fdif_fclk", "core", true, 64000000, OMAP5430_VDD_CORE_OPP_LOW),
188         /* FDIF OPP2 - OPPNOM */
189         OPP_INITIALIZER("fdif", "fdif_fclk", "core", true, 128000000, OMAP5430_VDD_CORE_OPP_NOM),
190
191 #if 0
192         /* HSI OPP1 - OPPLOW */
193         OPP_INITIALIZER("hsi", "hsi_fck", "core", true, 96000000, OMAP5430_VDD_CORE_OPP_LOW),
194         /* FDIF OPP3 - OPPNOM */
195         OPP_INITIALIZER("fdif", "hsi_fck", "core", true, 192000000, OMAP5430_VDD_CORE_OPP_NOM),
196
197         /* ABE OPP1 - OPPLOW */
198         OPP_INITIALIZER("aess", "abe_clk", "core", true, 98304000, OMAP5430_VDD_CORE_OPP_LOW),
199         /* ABE OPP2 - OPPNOM */
200         OPP_INITIALIZER("aess", "abe_clk", "core", true, 196608000, OMAP5430_VDD_CORE_OPP_NOM),
201 #endif
202
203 #ifndef CONFIG_OMAP_PM_STANDALONE
204         /* IVA OPP1 - OPPLOW */
205         OPP_INITIALIZER("iva", "dpll_iva_h12x2_ck", "mm", true, 194200000, OMAP5430_VDD_MM_OPP_LOW),
206         /* IVA OPP2 - OPPNOM */
207         OPP_INITIALIZER("iva", "dpll_iva_h12x2_ck", "mm", true, 388300000, OMAP5430_VDD_MM_OPP_NOM),
208         /* IVA OPP3 - OPP-OD */
209         OPP_INITIALIZER("iva", "dpll_iva_h12x2_ck", "mm", false, 532000000, OMAP5430_VDD_MM_OPP_OD),
210
211         /* DSP OPP1 - OPP50 */
212         OPP_INITIALIZER("dsp", "dpll_iva_h11x2_ck", "mm", true, 233000000, OMAP5430_VDD_MM_OPP_LOW),
213         /* DSP OPP2 - OPP100 */
214         OPP_INITIALIZER("dsp", "dpll_iva_h11x2_ck", "mm", true, 466000000, OMAP5430_VDD_MM_OPP_NOM),
215         /* DSP OPP3 - OPPTB */
216         OPP_INITIALIZER("dsp", "dpll_iva_h11x2_ck", "mm", false, 532000000, OMAP5430_VDD_MM_OPP_OD),
217 #endif
218 #if 0
219         /* SGX OPP1 - OPPLOW */
220         OPP_INITIALIZER("gpu", "dpll_per_h14x2_ck", "mm", true, 192000000, OMAP5430_VDD_MM_OPP_LOW),
221         /* SGX OPP2 - OPPNOM */
222         OPP_INITIALIZER("gpu", "dpll_per_h14x2_ck", "mm", true, 384000000, OMAP5430_VDD_MM_OPP_NOM),
223         /* SGX OPP3 - OPPOV */
224         OPP_INITIALIZER("gpu", "dpll_per_h14x2_ck", "mm", false, 532000000, OMAP5430_VDD_MM_OPP_OD),
225 #endif
226 };
227
228 /**
229  * omap4_opp_init() - initialize omap4 opp table
230  */
231 static int __init omap5_opp_init(void)
232 {
233         int r = -ENODEV;
234
235         if (!cpu_is_omap54xx())
236                 return r;
237
238         r = omap_init_opp_table(omap54xx_opp_def_list,
239                         ARRAY_SIZE(omap54xx_opp_def_list));
240
241         return r;
242 }
243 device_initcall(omap5_opp_init);