blob: 8d6b59eeb04406bc3bf23c4714d41bde89585dce [file] [log] [blame]
Sricharan508a58f2011-11-15 09:49:55 -05001/*
2 *
3 * Functions for omap5 based boards.
4 *
5 * (C) Copyright 2011
6 * Texas Instruments, <www.ti.com>
7 *
8 * Author :
9 * Aneesh V <aneesh@ti.com>
10 * Steve Sakoman <steve@sakoman.com>
11 * Sricharan <r.sricharan@ti.com>
12 *
Wolfgang Denk1a459662013-07-08 09:37:19 +020013 * SPDX-License-Identifier: GPL-2.0+
Sricharan508a58f2011-11-15 09:49:55 -050014 */
15#include <common.h>
16#include <asm/armv7.h>
17#include <asm/arch/cpu.h>
18#include <asm/arch/sys_proto.h>
Lokesh Vutlaaf1d0022013-05-30 02:54:32 +000019#include <asm/arch/clock.h>
Alexey Brodkin1ace4022014-02-26 17:47:58 +040020#include <linux/sizes.h>
Sricharan508a58f2011-11-15 09:49:55 -050021#include <asm/utils.h>
22#include <asm/arch/gpio.h>
Lokesh Vutla784ab7c2012-05-22 00:03:25 +000023#include <asm/emif.h>
SRICHARAN Rf92f2272013-04-24 00:41:22 +000024#include <asm/omap_common.h>
Sricharan508a58f2011-11-15 09:49:55 -050025
26DECLARE_GLOBAL_DATA_PTR;
27
SRICHARAN Rf92f2272013-04-24 00:41:22 +000028u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV;
Sricharan508a58f2011-11-15 09:49:55 -050029
Axel Lin87bd05d2013-06-21 18:54:25 +080030static struct gpio_bank gpio_bank_54xx[8] = {
Sricharan508a58f2011-11-15 09:49:55 -050031 { (void *)OMAP54XX_GPIO1_BASE, METHOD_GPIO_24XX },
32 { (void *)OMAP54XX_GPIO2_BASE, METHOD_GPIO_24XX },
33 { (void *)OMAP54XX_GPIO3_BASE, METHOD_GPIO_24XX },
34 { (void *)OMAP54XX_GPIO4_BASE, METHOD_GPIO_24XX },
35 { (void *)OMAP54XX_GPIO5_BASE, METHOD_GPIO_24XX },
36 { (void *)OMAP54XX_GPIO6_BASE, METHOD_GPIO_24XX },
Axel Lin87bd05d2013-06-21 18:54:25 +080037 { (void *)OMAP54XX_GPIO7_BASE, METHOD_GPIO_24XX },
38 { (void *)OMAP54XX_GPIO8_BASE, METHOD_GPIO_24XX },
Sricharan508a58f2011-11-15 09:49:55 -050039};
40
41const struct gpio_bank *const omap_gpio_bank = gpio_bank_54xx;
42
43#ifdef CONFIG_SPL_BUILD
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000044/* LPDDR2 specific IO settings */
45static void io_settings_lpddr2(void)
46{
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000047 const struct ctrl_ioregs *ioregs;
48
49 get_ioregs(&ioregs);
50 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_0);
51 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_1);
52 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_0);
53 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_1);
54 writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_0);
55 writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_1);
56 writel(ioregs->ctrl_ddrio_0, (*ctrl)->control_ddrio_0);
57 writel(ioregs->ctrl_ddrio_1, (*ctrl)->control_ddrio_1);
58 writel(ioregs->ctrl_ddrio_2, (*ctrl)->control_ddrio_2);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000059}
60
61/* DDR3 specific IO settings */
62static void io_settings_ddr3(void)
63{
64 u32 io_settings = 0;
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000065 const struct ctrl_ioregs *ioregs;
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000066
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000067 get_ioregs(&ioregs);
68 writel(ioregs->ctrl_ddr3ch, (*ctrl)->control_ddr3ch1_0);
69 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_0);
70 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch1_1);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000071
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000072 writel(ioregs->ctrl_ddr3ch, (*ctrl)->control_ddr3ch2_0);
73 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_0);
74 writel(ioregs->ctrl_ddrch, (*ctrl)->control_ddrch2_1);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000075
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000076 writel(ioregs->ctrl_ddrio_0, (*ctrl)->control_ddrio_0);
77 writel(ioregs->ctrl_ddrio_1, (*ctrl)->control_ddrio_1);
78 writel(ioregs->ctrl_ddrio_2, (*ctrl)->control_ddrio_2);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000079
80 /* omap5432 does not use lpddr2 */
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000081 writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_0);
82 writel(ioregs->ctrl_lpddr2ch, (*ctrl)->control_lpddr2ch1_1);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000083
Lokesh Vutlaef1697e2013-02-04 04:22:05 +000084 writel(ioregs->ctrl_emif_sdram_config_ext,
85 (*ctrl)->control_emif1_sdram_config_ext);
86 writel(ioregs->ctrl_emif_sdram_config_ext,
87 (*ctrl)->control_emif2_sdram_config_ext);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000088
Sricharan R92b04822013-05-30 03:19:39 +000089 if (is_omap54xx()) {
90 /* Disable DLL select */
91 io_settings = (readl((*ctrl)->control_port_emif1_sdram_config)
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000092 & 0xFFEFFFFF);
Sricharan R92b04822013-05-30 03:19:39 +000093 writel(io_settings,
94 (*ctrl)->control_port_emif1_sdram_config);
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000095
Sricharan R92b04822013-05-30 03:19:39 +000096 io_settings = (readl((*ctrl)->control_port_emif2_sdram_config)
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +000097 & 0xFFEFFFFF);
Sricharan R92b04822013-05-30 03:19:39 +000098 writel(io_settings,
99 (*ctrl)->control_port_emif2_sdram_config);
100 } else {
101 writel(ioregs->ctrl_ddr_ctrl_ext_0,
102 (*ctrl)->control_ddr_control_ext_0);
103 }
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +0000104}
105
Sricharan508a58f2011-11-15 09:49:55 -0500106/*
107 * Some tuning of IOs for optimal power and performance
108 */
109void do_io_settings(void)
110{
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000111 u32 io_settings = 0, mask = 0;
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000112
113 /* Impedance settings EMMC, C2C 1,2, hsi2 */
114 mask = (ds_mask << 2) | (ds_mask << 8) |
115 (ds_mask << 16) | (ds_mask << 18);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000116 io_settings = readl((*ctrl)->control_smart1io_padconf_0) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000117 (~mask);
118 io_settings |= (ds_60_ohm << 8) | (ds_45_ohm << 16) |
119 (ds_45_ohm << 18) | (ds_60_ohm << 2);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000120 writel(io_settings, (*ctrl)->control_smart1io_padconf_0);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000121
122 /* Impedance settings Mcspi2 */
123 mask = (ds_mask << 30);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000124 io_settings = readl((*ctrl)->control_smart1io_padconf_1) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000125 (~mask);
126 io_settings |= (ds_60_ohm << 30);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000127 writel(io_settings, (*ctrl)->control_smart1io_padconf_1);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000128
129 /* Impedance settings C2C 3,4 */
130 mask = (ds_mask << 14) | (ds_mask << 16);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000131 io_settings = readl((*ctrl)->control_smart1io_padconf_2) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000132 (~mask);
133 io_settings |= (ds_45_ohm << 14) | (ds_45_ohm << 16);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000134 writel(io_settings, (*ctrl)->control_smart1io_padconf_2);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000135
136 /* Slew rate settings EMMC, C2C 1,2 */
137 mask = (sc_mask << 8) | (sc_mask << 16) | (sc_mask << 18);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000138 io_settings = readl((*ctrl)->control_smart2io_padconf_0) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000139 (~mask);
140 io_settings |= (sc_fast << 8) | (sc_na << 16) | (sc_na << 18);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000141 writel(io_settings, (*ctrl)->control_smart2io_padconf_0);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000142
143 /* Slew rate settings hsi2, Mcspi2 */
144 mask = (sc_mask << 24) | (sc_mask << 28);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000145 io_settings = readl((*ctrl)->control_smart2io_padconf_1) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000146 (~mask);
147 io_settings |= (sc_fast << 28) | (sc_fast << 24);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000148 writel(io_settings, (*ctrl)->control_smart2io_padconf_1);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000149
150 /* Slew rate settings C2C 3,4 */
151 mask = (sc_mask << 16) | (sc_mask << 18);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000152 io_settings = readl((*ctrl)->control_smart2io_padconf_2) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000153 (~mask);
154 io_settings |= (sc_na << 16) | (sc_na << 18);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000155 writel(io_settings, (*ctrl)->control_smart2io_padconf_2);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000156
157 /* impedance and slew rate settings for usb */
158 mask = (usb_i_mask << 29) | (usb_i_mask << 26) | (usb_i_mask << 23) |
159 (usb_i_mask << 20) | (usb_i_mask << 17) | (usb_i_mask << 14);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000160 io_settings = readl((*ctrl)->control_smart3io_padconf_1) &
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000161 (~mask);
162 io_settings |= (ds_60_ohm << 29) | (ds_60_ohm << 26) |
163 (ds_60_ohm << 23) | (sc_fast << 20) |
164 (sc_fast << 17) | (sc_fast << 14);
Lokesh Vutlac43c8332013-02-04 04:22:04 +0000165 writel(io_settings, (*ctrl)->control_smart3io_padconf_1);
SRICHARAN R6ad8d672012-03-12 02:25:36 +0000166
Lokesh Vutla9ca8bfe2013-02-04 04:21:59 +0000167 if (emif_sdram_type() == EMIF_SDRAM_TYPE_LPDDR2)
Lokesh Vutlaeb4e18e2012-05-22 00:03:23 +0000168 io_settings_lpddr2();
169 else
170 io_settings_ddr3();
Sricharan508a58f2011-11-15 09:49:55 -0500171}
Lokesh Vutlad4d986e2013-02-12 01:33:45 +0000172
173static const struct srcomp_params srcomp_parameters[NUM_SYS_CLKS] = {
174 {0x45, 0x1}, /* 12 MHz */
175 {-1, -1}, /* 13 MHz */
176 {0x63, 0x2}, /* 16.8 MHz */
177 {0x57, 0x2}, /* 19.2 MHz */
178 {0x20, 0x1}, /* 26 MHz */
179 {-1, -1}, /* 27 MHz */
180 {0x41, 0x3} /* 38.4 MHz */
181};
182
183void srcomp_enable(void)
184{
185 u32 srcomp_value, mul_factor, div_factor, clk_val, i;
186 u32 sysclk_ind = get_sys_clk_index();
187 u32 omap_rev = omap_revision();
188
Lokesh Vutlae9d6cd02013-05-30 03:19:32 +0000189 if (!is_omap54xx())
190 return;
191
Lokesh Vutlad4d986e2013-02-12 01:33:45 +0000192 mul_factor = srcomp_parameters[sysclk_ind].multiply_factor;
193 div_factor = srcomp_parameters[sysclk_ind].divide_factor;
194
195 for (i = 0; i < 4; i++) {
196 srcomp_value = readl((*ctrl)->control_srcomp_north_side + i*4);
197 srcomp_value &=
198 ~(MULTIPLY_FACTOR_XS_MASK | DIVIDE_FACTOR_XS_MASK);
199 srcomp_value |= (mul_factor << MULTIPLY_FACTOR_XS_SHIFT) |
200 (div_factor << DIVIDE_FACTOR_XS_SHIFT);
201 writel(srcomp_value, (*ctrl)->control_srcomp_north_side + i*4);
202 }
203
204 if ((omap_rev == OMAP5430_ES1_0) || (omap_rev == OMAP5432_ES1_0)) {
205 clk_val = readl((*prcm)->cm_coreaon_io_srcomp_clkctrl);
206 clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK;
207 writel(clk_val, (*prcm)->cm_coreaon_io_srcomp_clkctrl);
208
209 for (i = 0; i < 4; i++) {
210 srcomp_value =
211 readl((*ctrl)->control_srcomp_north_side + i*4);
212 srcomp_value &= ~PWRDWN_XS_MASK;
213 writel(srcomp_value,
214 (*ctrl)->control_srcomp_north_side + i*4);
215
216 while (((readl((*ctrl)->control_srcomp_north_side + i*4)
217 & SRCODE_READ_XS_MASK) >>
218 SRCODE_READ_XS_SHIFT) == 0)
219 ;
220
221 srcomp_value =
222 readl((*ctrl)->control_srcomp_north_side + i*4);
223 srcomp_value &= ~OVERRIDE_XS_MASK;
224 writel(srcomp_value,
225 (*ctrl)->control_srcomp_north_side + i*4);
226 }
227 } else {
228 srcomp_value = readl((*ctrl)->control_srcomp_east_side_wkup);
229 srcomp_value &= ~(MULTIPLY_FACTOR_XS_MASK |
230 DIVIDE_FACTOR_XS_MASK);
231 srcomp_value |= (mul_factor << MULTIPLY_FACTOR_XS_SHIFT) |
232 (div_factor << DIVIDE_FACTOR_XS_SHIFT);
233 writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
234
235 for (i = 0; i < 4; i++) {
236 srcomp_value =
237 readl((*ctrl)->control_srcomp_north_side + i*4);
238 srcomp_value |= SRCODE_OVERRIDE_SEL_XS_MASK;
239 writel(srcomp_value,
240 (*ctrl)->control_srcomp_north_side + i*4);
241
242 srcomp_value =
243 readl((*ctrl)->control_srcomp_north_side + i*4);
244 srcomp_value &= ~OVERRIDE_XS_MASK;
245 writel(srcomp_value,
246 (*ctrl)->control_srcomp_north_side + i*4);
247 }
248
249 srcomp_value =
250 readl((*ctrl)->control_srcomp_east_side_wkup);
251 srcomp_value |= SRCODE_OVERRIDE_SEL_XS_MASK;
252 writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
253
254 srcomp_value =
255 readl((*ctrl)->control_srcomp_east_side_wkup);
256 srcomp_value &= ~OVERRIDE_XS_MASK;
257 writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
258
259 clk_val = readl((*prcm)->cm_coreaon_io_srcomp_clkctrl);
260 clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK;
261 writel(clk_val, (*prcm)->cm_coreaon_io_srcomp_clkctrl);
262
263 clk_val = readl((*prcm)->cm_wkupaon_io_srcomp_clkctrl);
264 clk_val |= OPTFCLKEN_SRCOMP_FCLK_MASK;
265 writel(clk_val, (*prcm)->cm_wkupaon_io_srcomp_clkctrl);
266
267 for (i = 0; i < 4; i++) {
268 while (((readl((*ctrl)->control_srcomp_north_side + i*4)
269 & SRCODE_READ_XS_MASK) >>
270 SRCODE_READ_XS_SHIFT) == 0)
271 ;
272
273 srcomp_value =
274 readl((*ctrl)->control_srcomp_north_side + i*4);
275 srcomp_value &= ~SRCODE_OVERRIDE_SEL_XS_MASK;
276 writel(srcomp_value,
277 (*ctrl)->control_srcomp_north_side + i*4);
278 }
279
280 while (((readl((*ctrl)->control_srcomp_east_side_wkup) &
281 SRCODE_READ_XS_MASK) >> SRCODE_READ_XS_SHIFT) == 0)
282 ;
283
284 srcomp_value =
285 readl((*ctrl)->control_srcomp_east_side_wkup);
286 srcomp_value &= ~SRCODE_OVERRIDE_SEL_XS_MASK;
287 writel(srcomp_value, (*ctrl)->control_srcomp_east_side_wkup);
288 }
289}
Sricharan508a58f2011-11-15 09:49:55 -0500290#endif
291
Lokesh Vutla784ab7c2012-05-22 00:03:25 +0000292void config_data_eye_leveling_samples(u32 emif_base)
293{
SRICHARAN R6c709352013-11-08 17:40:37 +0530294 const struct ctrl_ioregs *ioregs;
295
296 get_ioregs(&ioregs);
297
Lokesh Vutla784ab7c2012-05-22 00:03:25 +0000298 /*EMIF_SDRAM_CONFIG_EXT-Read data eye leveling no of samples =4*/
299 if (emif_base == EMIF1_BASE)
SRICHARAN R6c709352013-11-08 17:40:37 +0530300 writel(ioregs->ctrl_emif_sdram_config_ext_final,
301 (*ctrl)->control_emif1_sdram_config_ext);
Lokesh Vutla784ab7c2012-05-22 00:03:25 +0000302 else if (emif_base == EMIF2_BASE)
SRICHARAN R6c709352013-11-08 17:40:37 +0530303 writel(ioregs->ctrl_emif_sdram_config_ext_final,
304 (*ctrl)->control_emif2_sdram_config_ext);
Lokesh Vutla784ab7c2012-05-22 00:03:25 +0000305}
306
Nishanth Menonfc7368e2015-03-09 17:12:07 -0500307void init_cpu_configuration(void)
308{
309 u32 l2actlr;
310
311 asm volatile("mrc p15, 1, %0, c15, c0, 0" : "=r"(l2actlr));
312 /*
313 * L2ACTLR: Ensure to enable the following:
314 * 3: Disable clean/evict push to external
315 * 4: Disable WriteUnique and WriteLineUnique transactions from master
316 * 8: Disable DVM/CMO message broadcast
317 */
318 l2actlr |= 0x118;
319 omap_smc1(OMAP5_SERVICE_L2ACTLR_SET, l2actlr);
320}
321
Sricharan508a58f2011-11-15 09:49:55 -0500322void init_omap_revision(void)
323{
324 /*
325 * For some of the ES2/ES1 boards ID_CODE is not reliable:
326 * Also, ES1 and ES2 have different ARM revisions
327 * So use ARM revision for identification
328 */
329 unsigned int rev = cortex_rev();
330
SRICHARAN Reed7c0f2013-02-12 01:33:41 +0000331 switch (readl(CONTROL_ID_CODE)) {
332 case OMAP5430_CONTROL_ID_CODE_ES1_0:
333 *omap_si_rev = OMAP5430_ES1_0;
334 if (rev == MIDR_CORTEX_A15_R2P2)
335 *omap_si_rev = OMAP5430_ES2_0;
336 break;
337 case OMAP5432_CONTROL_ID_CODE_ES1_0:
338 *omap_si_rev = OMAP5432_ES1_0;
339 if (rev == MIDR_CORTEX_A15_R2P2)
340 *omap_si_rev = OMAP5432_ES2_0;
341 break;
342 case OMAP5430_CONTROL_ID_CODE_ES2_0:
343 *omap_si_rev = OMAP5430_ES2_0;
344 break;
345 case OMAP5432_CONTROL_ID_CODE_ES2_0:
346 *omap_si_rev = OMAP5432_ES2_0;
SRICHARAN Rcdd50a82012-03-12 02:25:39 +0000347 break;
Lokesh Vutlade626882013-02-12 21:29:03 +0000348 case DRA752_CONTROL_ID_CODE_ES1_0:
349 *omap_si_rev = DRA752_ES1_0;
350 break;
Nishanth Menon3ac8c0b2014-01-14 10:54:42 -0600351 case DRA752_CONTROL_ID_CODE_ES1_1:
352 *omap_si_rev = DRA752_ES1_1;
353 break;
Lokesh Vutlaee77a232014-05-15 11:08:38 +0530354 case DRA722_CONTROL_ID_CODE_ES1_0:
355 *omap_si_rev = DRA722_ES1_0;
356 break;
Sricharan508a58f2011-11-15 09:49:55 -0500357 default:
SRICHARAN R087189f2012-03-12 02:25:40 +0000358 *omap_si_rev = OMAP5430_SILICON_ID_INVALID;
Sricharan508a58f2011-11-15 09:49:55 -0500359 }
Nishanth Menonfc7368e2015-03-09 17:12:07 -0500360 init_cpu_configuration();
Sricharan508a58f2011-11-15 09:49:55 -0500361}
SRICHARAN R06964732012-03-12 02:25:52 +0000362
363void reset_cpu(ulong ignored)
364{
365 u32 omap_rev = omap_revision();
366
367 /*
368 * WARM reset is not functional in case of OMAP5430 ES1.0 soc.
369 * So use cold reset in case instead.
370 */
371 if (omap_rev == OMAP5430_ES1_0)
Lokesh Vutlad4e41292013-02-17 23:33:37 +0000372 writel(PRM_RSTCTRL_RESET << 0x1, (*prcm)->prm_rstctrl);
SRICHARAN R06964732012-03-12 02:25:52 +0000373 else
Lokesh Vutlad4e41292013-02-17 23:33:37 +0000374 writel(PRM_RSTCTRL_RESET, (*prcm)->prm_rstctrl);
375}
376
377u32 warm_reset(void)
378{
379 return readl((*prcm)->prm_rstst) & PRM_RSTST_WARM_RESET_MASK;
SRICHARAN R06964732012-03-12 02:25:52 +0000380}
Lokesh Vutla0b1b60c2013-04-17 20:49:40 +0000381
382void setup_warmreset_time(void)
383{
384 u32 rst_time, rst_val;
385
386#ifndef CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC
387 rst_time = CONFIG_DEFAULT_OMAP_RESET_TIME_MAX_USEC;
388#else
389 rst_time = CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC;
390#endif
391 rst_time = usec_to_32k(rst_time) << RSTTIME1_SHIFT;
392
393 if (rst_time > RSTTIME1_MASK)
394 rst_time = RSTTIME1_MASK;
395
396 rst_val = readl((*prcm)->prm_rsttime) & ~RSTTIME1_MASK;
397 rst_val |= rst_time;
398 writel(rst_val, (*prcm)->prm_rsttime);
399}
Praveen Rao5f603762015-03-09 17:12:06 -0500400
401void v7_arch_cp15_set_l2aux_ctrl(u32 l2auxctrl, u32 cpu_midr,
402 u32 cpu_rev_comb, u32 cpu_variant,
403 u32 cpu_rev)
404{
405 omap_smc1(OMAP5_SERVICE_L2ACTLR_SET, l2auxctrl);
406}