blob: a61b9331450e31155f78f82050f91a61758522da [file] [log] [blame]
Dirk Behmee0e49fe2008-12-14 09:47:15 +01001/*
2 *
3 * Common board functions for OMAP3 based boards.
4 *
5 * (C) Copyright 2004-2008
6 * Texas Instruments, <www.ti.com>
7 *
8 * Author :
9 * Sunil Kumar <sunilsaini05@gmail.com>
10 * Shashi Ranjan <shashiranjanmca05@gmail.com>
11 *
12 * Derived from Beagle Board and 3430 SDP code by
13 * Richard Woodruff <r-woodruff2@ti.com>
14 * Syed Mohammed Khasim <khasim@ti.com>
15 *
16 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +020017 * SPDX-License-Identifier: GPL-2.0+
Dirk Behmee0e49fe2008-12-14 09:47:15 +010018 */
19#include <common.h>
Simon Glassbc0f4ea2014-10-22 21:37:15 -060020#include <dm.h>
Tom Rini28591df2012-08-13 12:03:19 -070021#include <spl.h>
Dirk Behmee0e49fe2008-12-14 09:47:15 +010022#include <asm/io.h>
23#include <asm/arch/sys_proto.h>
24#include <asm/arch/mem.h>
Kim, Heung Jun3b5ac952009-06-20 11:02:17 +020025#include <asm/cache.h>
Aneesh Vd16dd012011-06-16 23:30:53 +000026#include <asm/armv7.h>
Simon Glassbc0f4ea2014-10-22 21:37:15 -060027#include <asm/gpio.h>
Simon Schwarz992dcf72011-09-14 15:29:26 -040028#include <asm/omap_common.h>
Tom Rini05df8912012-04-13 12:20:03 +000029#include <linux/compiler.h>
Dirk Behmee0e49fe2008-12-14 09:47:15 +010030
Tom Rini31dfba42012-08-22 15:31:05 -070031DECLARE_GLOBAL_DATA_PTR;
32
Aneesh Vd16dd012011-06-16 23:30:53 +000033/* Declarations */
Dirk Behmee0e49fe2008-12-14 09:47:15 +010034extern omap3_sysinfo sysinfo;
Tom Rinib759db32012-10-30 22:23:28 -070035#ifndef CONFIG_SYS_L2CACHE_OFF
Aneesh Vd16dd012011-06-16 23:30:53 +000036static void omap3_invalidate_l2_cache_secure(void);
Tom Rinib759db32012-10-30 22:23:28 -070037#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +010038
Simon Glassbc0f4ea2014-10-22 21:37:15 -060039#ifdef CONFIG_DM_GPIO
40static const struct omap_gpio_platdata omap34xx_gpio[] = {
Tom Rini7bc2bca2015-07-31 19:55:09 -040041 { 0, OMAP34XX_GPIO1_BASE },
42 { 1, OMAP34XX_GPIO2_BASE },
43 { 2, OMAP34XX_GPIO3_BASE },
44 { 3, OMAP34XX_GPIO4_BASE },
45 { 4, OMAP34XX_GPIO5_BASE },
46 { 5, OMAP34XX_GPIO6_BASE },
Simon Glassbc0f4ea2014-10-22 21:37:15 -060047};
48
Adam Ford8d70ffd2017-04-09 07:35:12 -050049U_BOOT_DEVICES(omap34xx_gpios) = {
Simon Glassbc0f4ea2014-10-22 21:37:15 -060050 { "gpio_omap", &omap34xx_gpio[0] },
51 { "gpio_omap", &omap34xx_gpio[1] },
52 { "gpio_omap", &omap34xx_gpio[2] },
53 { "gpio_omap", &omap34xx_gpio[3] },
54 { "gpio_omap", &omap34xx_gpio[4] },
55 { "gpio_omap", &omap34xx_gpio[5] },
56};
57
58#else
59
Aneesh V9a390882011-07-21 09:29:29 -040060static const struct gpio_bank gpio_bank_34xx[6] = {
Tom Rini7bc2bca2015-07-31 19:55:09 -040061 { (void *)OMAP34XX_GPIO1_BASE },
62 { (void *)OMAP34XX_GPIO2_BASE },
63 { (void *)OMAP34XX_GPIO3_BASE },
64 { (void *)OMAP34XX_GPIO4_BASE },
65 { (void *)OMAP34XX_GPIO5_BASE },
66 { (void *)OMAP34XX_GPIO6_BASE },
Aneesh V9a390882011-07-21 09:29:29 -040067};
68
69const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
70
Simon Glassbc0f4ea2014-10-22 21:37:15 -060071#endif
72
Dirk Behmee0e49fe2008-12-14 09:47:15 +010073/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +010074 * Routine: secure_unlock
75 * Description: Setup security registers for access
76 * (GP Device only)
77 *****************************************************************************/
78void secure_unlock_mem(void)
79{
Dirk Behmedc7af202009-08-08 09:30:21 +020080 struct pm *pm_rt_ape_base = (struct pm *)PM_RT_APE_BASE_ADDR_ARM;
81 struct pm *pm_gpmc_base = (struct pm *)PM_GPMC_BASE_ADDR_ARM;
82 struct pm *pm_ocm_ram_base = (struct pm *)PM_OCM_RAM_BASE_ADDR_ARM;
83 struct pm *pm_iva2_base = (struct pm *)PM_IVA2_BASE_ADDR_ARM;
84 struct sms *sms_base = (struct sms *)OMAP34XX_SMS_BASE;
Dirk Behmee0e49fe2008-12-14 09:47:15 +010085
86 /* Protection Module Register Target APE (PM_RT) */
87 writel(UNLOCK_1, &pm_rt_ape_base->req_info_permission_1);
88 writel(UNLOCK_1, &pm_rt_ape_base->read_permission_0);
89 writel(UNLOCK_1, &pm_rt_ape_base->wirte_permission_0);
90 writel(UNLOCK_2, &pm_rt_ape_base->addr_match_1);
91
92 writel(UNLOCK_3, &pm_gpmc_base->req_info_permission_0);
93 writel(UNLOCK_3, &pm_gpmc_base->read_permission_0);
94 writel(UNLOCK_3, &pm_gpmc_base->wirte_permission_0);
95
96 writel(UNLOCK_3, &pm_ocm_ram_base->req_info_permission_0);
97 writel(UNLOCK_3, &pm_ocm_ram_base->read_permission_0);
98 writel(UNLOCK_3, &pm_ocm_ram_base->wirte_permission_0);
99 writel(UNLOCK_2, &pm_ocm_ram_base->addr_match_2);
100
101 /* IVA Changes */
102 writel(UNLOCK_3, &pm_iva2_base->req_info_permission_0);
103 writel(UNLOCK_3, &pm_iva2_base->read_permission_0);
104 writel(UNLOCK_3, &pm_iva2_base->wirte_permission_0);
105
106 /* SDRC region 0 public */
107 writel(UNLOCK_1, &sms_base->rg_att0);
108}
109
110/******************************************************************************
111 * Routine: secureworld_exit()
112 * Description: If chip is EMU and boot type is external
113 * configure secure registers and exit secure world
114 * general use.
115 *****************************************************************************/
Jeroen Hofstee69ab3832014-06-16 23:22:23 +0200116void secureworld_exit(void)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100117{
118 unsigned long i;
119
Peter Meerwald7ea4b7c2012-02-02 12:51:02 +0000120 /* configure non-secure access control register */
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100121 __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 2":"=r"(i));
122 /* enabling co-processor CP10 and CP11 accesses in NS world */
123 __asm__ __volatile__("orr %0, %0, #0xC00":"=r"(i));
124 /*
125 * allow allocation of locked TLBs and L2 lines in NS world
126 * allow use of PLE registers in NS world also
127 */
128 __asm__ __volatile__("orr %0, %0, #0x70000":"=r"(i));
129 __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 2":"=r"(i));
130
131 /* Enable ASA in ACR register */
132 __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 1":"=r"(i));
133 __asm__ __volatile__("orr %0, %0, #0x10":"=r"(i));
134 __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 1":"=r"(i));
135
136 /* Exiting secure world */
137 __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 0":"=r"(i));
138 __asm__ __volatile__("orr %0, %0, #0x31":"=r"(i));
139 __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 0":"=r"(i));
140}
141
142/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100143 * Routine: try_unlock_sram()
144 * Description: If chip is GP/EMU(special) type, unlock the SRAM for
145 * general use.
146 *****************************************************************************/
Jeroen Hofstee69ab3832014-06-16 23:22:23 +0200147void try_unlock_memory(void)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100148{
149 int mode;
150 int in_sdram = is_running_in_sdram();
151
152 /*
153 * if GP device unlock device SRAM for general use
154 * secure code breaks for Secure/Emulation device - HS/E/T
155 */
156 mode = get_device_type();
157 if (mode == GP_DEVICE)
158 secure_unlock_mem();
159
160 /*
161 * If device is EMU and boot is XIP external booting
162 * Unlock firewalls and disable L2 and put chip
163 * out of secure world
164 *
165 * Assuming memories are unlocked by the demon who put us in SDRAM
166 */
167 if ((mode <= EMU_DEVICE) && (get_boot_type() == 0x1F)
168 && (!in_sdram)) {
169 secure_unlock_mem();
170 secureworld_exit();
171 }
172
173 return;
174}
175
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300176void early_system_init(void)
177{
178 hw_data_init();
179}
180
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100181/******************************************************************************
182 * Routine: s_init
183 * Description: Does early system init of muxing and clocks.
184 * - Called path is with SRAM stack.
185 *****************************************************************************/
186void s_init(void)
187{
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100188 watchdog_init();
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300189 early_system_init();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100190
191 try_unlock_memory();
192
Aneesh Vd16dd012011-06-16 23:30:53 +0000193#ifndef CONFIG_SYS_L2CACHE_OFF
194 /* Invalidate L2-cache from secure mode */
195 omap3_invalidate_l2_cache_secure();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100196#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100197
198 set_muxconf_regs();
Alexander Holler4e333f62010-12-18 13:24:20 +0100199 sdelay(100);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100200
201 prcm_init();
202
203 per_clocks_enable();
204
Govindraj.R3968a6a2012-02-06 03:55:35 +0000205#ifdef CONFIG_USB_EHCI_OMAP
206 ehci_clocks_enable();
207#endif
Simon Glass0c078ea2015-03-03 08:03:02 -0700208}
Govindraj.R3968a6a2012-02-06 03:55:35 +0000209
Simon Glass0c078ea2015-03-03 08:03:02 -0700210#ifdef CONFIG_SPL_BUILD
211void board_init_f(ulong dummy)
212{
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300213 early_system_init();
Simon Glass0c078ea2015-03-03 08:03:02 -0700214 mem_init();
Adam Ford0d5a1bf2017-07-14 08:53:20 -0500215 /*
216 * Save the boot parameters passed from romcode.
217 * We cannot delay the saving further than this,
218 * to prevent overwrites.
219 */
220 save_omap_boot_params();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100221}
Simon Glass0c078ea2015-03-03 08:03:02 -0700222#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100223
Tom Rini05df8912012-04-13 12:20:03 +0000224/*
225 * Routine: misc_init_r
226 * Description: A basic misc_init_r that just displays the die ID
227 */
228int __weak misc_init_r(void)
229{
Paul Kocialkowski6bc318e2015-08-27 19:37:13 +0200230 omap_die_id_display();
Tom Rini05df8912012-04-13 12:20:03 +0000231
232 return 0;
233}
234
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100235/******************************************************************************
236 * Routine: wait_for_command_complete
237 * Description: Wait for posting to finish on watchdog
238 *****************************************************************************/
Jeroen Hofsteecbc75622014-10-08 22:57:41 +0200239static void wait_for_command_complete(struct watchdog *wd_base)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100240{
241 int pending = 1;
242 do {
243 pending = readl(&wd_base->wwps);
244 } while (pending);
245}
246
247/******************************************************************************
248 * Routine: watchdog_init
249 * Description: Shut down watch dogs
250 *****************************************************************************/
251void watchdog_init(void)
252{
Dirk Behmedc7af202009-08-08 09:30:21 +0200253 struct watchdog *wd2_base = (struct watchdog *)WD2_BASE;
254 struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100255
256 /*
257 * There are 3 watch dogs WD1=Secure, WD2=MPU, WD3=IVA. WD1 is
258 * either taken care of by ROM (HS/EMU) or not accessible (GP).
259 * We need to take care of WD2-MPU or take a PRCM reset. WD3
260 * should not be running and does not generate a PRCM reset.
261 */
262
Wolfgang Denk42b97cb2014-03-25 14:49:48 +0100263 setbits_le32(&prcm_base->fclken_wkup, 0x20);
264 setbits_le32(&prcm_base->iclken_wkup, 0x20);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100265 wait_on_value(ST_WDT2, 0x20, &prcm_base->idlest_wkup, 5);
266
267 writel(WD_UNLOCK1, &wd2_base->wspr);
268 wait_for_command_complete(wd2_base);
269 writel(WD_UNLOCK2, &wd2_base->wspr);
270}
271
272/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100273 * Dummy function to handle errors for EABI incompatibility
274 *****************************************************************************/
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100275void abort(void)
276{
277}
278
Simon Schwarz992dcf72011-09-14 15:29:26 -0400279#if defined(CONFIG_NAND_OMAP_GPMC) & !defined(CONFIG_SPL_BUILD)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100280/******************************************************************************
281 * OMAP3 specific command to switch between NAND HW and SW ecc
282 *****************************************************************************/
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200283static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100284{
Ladislav Michld3bc9852017-03-06 13:54:30 +0100285 int hw, strength = 1;
286
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000287 if (argc < 2 || argc > 3)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100288 goto usage;
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000289
290 if (strncmp(argv[1], "hw", 2) == 0) {
Ladislav Michld3bc9852017-03-06 13:54:30 +0100291 hw = 1;
292 if (argc == 3) {
293 if (strncmp(argv[2], "bch8", 4) == 0)
294 strength = 8;
Heiko Schocher5bf904c2016-06-07 08:55:42 +0200295 else if (strncmp(argv[2], "bch16", 5) == 0)
Ladislav Michld3bc9852017-03-06 13:54:30 +0100296 strength = 16;
297 else if (strncmp(argv[2], "hamming", 7) != 0)
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000298 goto usage;
299 }
300 } else if (strncmp(argv[1], "sw", 2) == 0) {
Ladislav Michld3bc9852017-03-06 13:54:30 +0100301 hw = 0;
302 if (argc == 3) {
303 if (strncmp(argv[2], "bch8", 4) == 0)
304 strength = 8;
305 else if (strncmp(argv[2], "hamming", 7) != 0)
Ash Charles4a5faa82015-02-18 11:25:11 -0800306 goto usage;
307 }
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000308 } else {
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100309 goto usage;
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000310 }
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100311
Ladislav Michld3bc9852017-03-06 13:54:30 +0100312 return -omap_nand_switch_ecc(hw, strength);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100313
314usage:
Sanjeev Premi15af9982009-04-03 14:00:07 +0530315 printf ("Usage: nandecc %s\n", cmdtp->usage);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100316 return 1;
317}
318
319U_BOOT_CMD(
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000320 nandecc, 3, 1, do_switch_ecc,
Robert P. J. Day3ea16c32009-11-17 07:30:23 -0500321 "switch OMAP3 NAND ECC calculation algorithm",
Heiko Schocher5bf904c2016-06-07 08:55:42 +0200322 "hw [hamming|bch8|bch16] - Switch between NAND hardware 1-bit hamming"
323 " and 8-bit/16-bit BCH\n"
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000324 " ecc calculation (second parameter may"
325 " be omitted).\n"
326 "nandecc sw - Switch to NAND software ecc algorithm."
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200327);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100328
Simon Schwarz992dcf72011-09-14 15:29:26 -0400329#endif /* CONFIG_NAND_OMAP_GPMC & !CONFIG_SPL_BUILD */
Sanjeev Premie32ef2e2009-04-27 21:27:27 +0530330
331#ifdef CONFIG_DISPLAY_BOARDINFO
332/**
333 * Print board information
334 */
335int checkboard (void)
336{
337 char *mem_s ;
338
339 if (is_mem_sdr())
340 mem_s = "mSDR";
341 else
342 mem_s = "LPDDR";
343
344 printf("%s + %s/%s\n", sysinfo.board_string, mem_s,
345 sysinfo.nand_string);
346
347 return 0;
348}
349#endif /* CONFIG_DISPLAY_BOARDINFO */
Aneesh Vd16dd012011-06-16 23:30:53 +0000350
351static void omap3_emu_romcode_call(u32 service_id, u32 *parameters)
352{
353 u32 i, num_params = *parameters;
354 u32 *sram_scratch_space = (u32 *)OMAP3_PUBLIC_SRAM_SCRATCH_AREA;
355
356 /*
357 * copy the parameters to an un-cached area to avoid coherency
358 * issues
359 */
360 for (i = 0; i < num_params; i++) {
361 __raw_writel(*parameters, sram_scratch_space);
362 parameters++;
363 sram_scratch_space++;
364 }
365
366 /* Now make the PPA call */
367 do_omap3_emu_romcode_call(service_id, OMAP3_PUBLIC_SRAM_SCRATCH_AREA);
368}
369
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500370void __weak omap3_set_aux_cr_secure(u32 acr)
Aneesh Vd16dd012011-06-16 23:30:53 +0000371{
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500372 struct emu_hal_params emu_romcode_params;
373
374 emu_romcode_params.num_params = 1;
375 emu_romcode_params.param1 = acr;
376 omap3_emu_romcode_call(OMAP3_EMU_HAL_API_WRITE_ACR,
377 (u32 *)&emu_romcode_params);
Aneesh Vd16dd012011-06-16 23:30:53 +0000378}
379
Siarhei Siamashkafe038a72017-03-06 03:16:53 +0200380void v7_arch_cp15_set_l2aux_ctrl(u32 l2auxctrl, u32 cpu_midr,
381 u32 cpu_rev_comb, u32 cpu_variant,
382 u32 cpu_rev)
383{
384 if (get_device_type() == GP_DEVICE)
385 omap_smc1(OMAP3_GP_ROMCODE_API_WRITE_L2ACR, l2auxctrl);
386
387 /* L2 Cache Auxiliary Control Register is not banked */
388}
389
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500390void v7_arch_cp15_set_acr(u32 acr, u32 cpu_midr, u32 cpu_rev_comb,
391 u32 cpu_variant, u32 cpu_rev)
Aneesh Vd16dd012011-06-16 23:30:53 +0000392{
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500393 /* Write ACR - affects secure banked bits */
394 if (get_device_type() == GP_DEVICE)
395 omap_smc1(OMAP3_GP_ROMCODE_API_WRITE_ACR, acr);
396 else
397 omap3_set_aux_cr_secure(acr);
Nishanth Menon3e46e3e2015-03-09 17:12:08 -0500398
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500399 /* Write ACR - affects non-secure banked bits - some erratas need it */
400 asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
Aneesh Vd16dd012011-06-16 23:30:53 +0000401}
402
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500403
Aneesh Vd16dd012011-06-16 23:30:53 +0000404#ifndef CONFIG_SYS_L2CACHE_OFF
Tom Rinib759db32012-10-30 22:23:28 -0700405static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)
406{
407 u32 acr;
408
409 /* Read ACR */
410 asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
411 acr &= ~clear_bits;
412 acr |= set_bits;
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500413 v7_arch_cp15_set_acr(acr, 0, 0, 0, 0);
Tom Rinib759db32012-10-30 22:23:28 -0700414
Tom Rinib759db32012-10-30 22:23:28 -0700415}
416
Aneesh Vd16dd012011-06-16 23:30:53 +0000417/* Invalidate the entire L2 cache from secure mode */
418static void omap3_invalidate_l2_cache_secure(void)
419{
420 if (get_device_type() == GP_DEVICE) {
Nishanth Menona816cc32015-03-09 17:12:05 -0500421 omap_smc1(OMAP3_GP_ROMCODE_API_L2_INVAL, 0);
Aneesh Vd16dd012011-06-16 23:30:53 +0000422 } else {
423 struct emu_hal_params emu_romcode_params;
424 emu_romcode_params.num_params = 1;
425 emu_romcode_params.param1 = 0;
426 omap3_emu_romcode_call(OMAP3_EMU_HAL_API_L2_INVAL,
427 (u32 *)&emu_romcode_params);
428 }
429}
430
431void v7_outer_cache_enable(void)
432{
Aneesh Vd16dd012011-06-16 23:30:53 +0000433
434 /*
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500435 * Set L2EN
Aneesh Vd16dd012011-06-16 23:30:53 +0000436 * On some revisions L2EN bit is banked on some revisions it's not
437 * No harm in setting both banked bits(in fact this is required
438 * by an erratum)
439 */
440 omap3_update_aux_cr(0x2, 0);
441}
442
Aneesh Ve0db71d2012-02-16 03:40:15 +0000443void omap3_outer_cache_disable(void)
Aneesh Vd16dd012011-06-16 23:30:53 +0000444{
Aneesh Vd16dd012011-06-16 23:30:53 +0000445 /*
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500446 * Clear L2EN
Aneesh Vd16dd012011-06-16 23:30:53 +0000447 * On some revisions L2EN bit is banked on some revisions it's not
448 * No harm in clearing both banked bits(in fact this is required
449 * by an erratum)
450 */
451 omap3_update_aux_cr(0, 0x2);
452}
Robert P. J. Day3bb3c292012-11-13 07:57:54 +0000453#endif /* !CONFIG_SYS_L2CACHE_OFF */