blob: 2d25fc60a0eec6cdfb5f1f784286b631b10fd4d3 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Dirk Behmee0e49fe2008-12-14 09:47:15 +01002/*
3 *
4 * Common board functions for OMAP3 based boards.
5 *
6 * (C) Copyright 2004-2008
7 * Texas Instruments, <www.ti.com>
8 *
9 * Author :
10 * Sunil Kumar <sunilsaini05@gmail.com>
11 * Shashi Ranjan <shashiranjanmca05@gmail.com>
12 *
13 * Derived from Beagle Board and 3430 SDP code by
14 * Richard Woodruff <r-woodruff2@ti.com>
15 * Syed Mohammed Khasim <khasim@ti.com>
16 *
Dirk Behmee0e49fe2008-12-14 09:47:15 +010017 */
18#include <common.h>
Simon Glassbc0f4ea2014-10-22 21:37:15 -060019#include <dm.h>
Tom Rini28591df2012-08-13 12:03:19 -070020#include <spl.h>
Dirk Behmee0e49fe2008-12-14 09:47:15 +010021#include <asm/io.h>
22#include <asm/arch/sys_proto.h>
23#include <asm/arch/mem.h>
Kim, Heung Jun3b5ac952009-06-20 11:02:17 +020024#include <asm/cache.h>
Aneesh Vd16dd012011-06-16 23:30:53 +000025#include <asm/armv7.h>
Simon Glassbc0f4ea2014-10-22 21:37:15 -060026#include <asm/gpio.h>
Simon Schwarz992dcf72011-09-14 15:29:26 -040027#include <asm/omap_common.h>
Tom Rini05df8912012-04-13 12:20:03 +000028#include <linux/compiler.h>
Dirk Behmee0e49fe2008-12-14 09:47:15 +010029
Aneesh Vd16dd012011-06-16 23:30:53 +000030/* Declarations */
Dirk Behmee0e49fe2008-12-14 09:47:15 +010031extern omap3_sysinfo sysinfo;
Tom Rinib759db32012-10-30 22:23:28 -070032#ifndef CONFIG_SYS_L2CACHE_OFF
Aneesh Vd16dd012011-06-16 23:30:53 +000033static void omap3_invalidate_l2_cache_secure(void);
Tom Rinib759db32012-10-30 22:23:28 -070034#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +010035
Simon Glassbc0f4ea2014-10-22 21:37:15 -060036#ifdef CONFIG_DM_GPIO
37static const struct omap_gpio_platdata omap34xx_gpio[] = {
Tom Rini7bc2bca2015-07-31 19:55:09 -040038 { 0, OMAP34XX_GPIO1_BASE },
39 { 1, OMAP34XX_GPIO2_BASE },
40 { 2, OMAP34XX_GPIO3_BASE },
41 { 3, OMAP34XX_GPIO4_BASE },
42 { 4, OMAP34XX_GPIO5_BASE },
43 { 5, OMAP34XX_GPIO6_BASE },
Simon Glassbc0f4ea2014-10-22 21:37:15 -060044};
45
Adam Ford8d70ffd2017-04-09 07:35:12 -050046U_BOOT_DEVICES(omap34xx_gpios) = {
Simon Glassbc0f4ea2014-10-22 21:37:15 -060047 { "gpio_omap", &omap34xx_gpio[0] },
48 { "gpio_omap", &omap34xx_gpio[1] },
49 { "gpio_omap", &omap34xx_gpio[2] },
50 { "gpio_omap", &omap34xx_gpio[3] },
51 { "gpio_omap", &omap34xx_gpio[4] },
52 { "gpio_omap", &omap34xx_gpio[5] },
53};
54
55#else
56
Aneesh V9a390882011-07-21 09:29:29 -040057static const struct gpio_bank gpio_bank_34xx[6] = {
Tom Rini7bc2bca2015-07-31 19:55:09 -040058 { (void *)OMAP34XX_GPIO1_BASE },
59 { (void *)OMAP34XX_GPIO2_BASE },
60 { (void *)OMAP34XX_GPIO3_BASE },
61 { (void *)OMAP34XX_GPIO4_BASE },
62 { (void *)OMAP34XX_GPIO5_BASE },
63 { (void *)OMAP34XX_GPIO6_BASE },
Aneesh V9a390882011-07-21 09:29:29 -040064};
65
66const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
67
Simon Glassbc0f4ea2014-10-22 21:37:15 -060068#endif
69
Dirk Behmee0e49fe2008-12-14 09:47:15 +010070/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +010071 * Routine: secure_unlock
72 * Description: Setup security registers for access
73 * (GP Device only)
74 *****************************************************************************/
75void secure_unlock_mem(void)
76{
Dirk Behmedc7af202009-08-08 09:30:21 +020077 struct pm *pm_rt_ape_base = (struct pm *)PM_RT_APE_BASE_ADDR_ARM;
78 struct pm *pm_gpmc_base = (struct pm *)PM_GPMC_BASE_ADDR_ARM;
79 struct pm *pm_ocm_ram_base = (struct pm *)PM_OCM_RAM_BASE_ADDR_ARM;
80 struct pm *pm_iva2_base = (struct pm *)PM_IVA2_BASE_ADDR_ARM;
81 struct sms *sms_base = (struct sms *)OMAP34XX_SMS_BASE;
Dirk Behmee0e49fe2008-12-14 09:47:15 +010082
83 /* Protection Module Register Target APE (PM_RT) */
84 writel(UNLOCK_1, &pm_rt_ape_base->req_info_permission_1);
85 writel(UNLOCK_1, &pm_rt_ape_base->read_permission_0);
86 writel(UNLOCK_1, &pm_rt_ape_base->wirte_permission_0);
87 writel(UNLOCK_2, &pm_rt_ape_base->addr_match_1);
88
89 writel(UNLOCK_3, &pm_gpmc_base->req_info_permission_0);
90 writel(UNLOCK_3, &pm_gpmc_base->read_permission_0);
91 writel(UNLOCK_3, &pm_gpmc_base->wirte_permission_0);
92
93 writel(UNLOCK_3, &pm_ocm_ram_base->req_info_permission_0);
94 writel(UNLOCK_3, &pm_ocm_ram_base->read_permission_0);
95 writel(UNLOCK_3, &pm_ocm_ram_base->wirte_permission_0);
96 writel(UNLOCK_2, &pm_ocm_ram_base->addr_match_2);
97
98 /* IVA Changes */
99 writel(UNLOCK_3, &pm_iva2_base->req_info_permission_0);
100 writel(UNLOCK_3, &pm_iva2_base->read_permission_0);
101 writel(UNLOCK_3, &pm_iva2_base->wirte_permission_0);
102
103 /* SDRC region 0 public */
104 writel(UNLOCK_1, &sms_base->rg_att0);
105}
106
107/******************************************************************************
108 * Routine: secureworld_exit()
109 * Description: If chip is EMU and boot type is external
110 * configure secure registers and exit secure world
111 * general use.
112 *****************************************************************************/
Jeroen Hofstee69ab3832014-06-16 23:22:23 +0200113void secureworld_exit(void)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100114{
115 unsigned long i;
116
Peter Meerwald7ea4b7c2012-02-02 12:51:02 +0000117 /* configure non-secure access control register */
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100118 __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 2":"=r"(i));
119 /* enabling co-processor CP10 and CP11 accesses in NS world */
120 __asm__ __volatile__("orr %0, %0, #0xC00":"=r"(i));
121 /*
122 * allow allocation of locked TLBs and L2 lines in NS world
123 * allow use of PLE registers in NS world also
124 */
125 __asm__ __volatile__("orr %0, %0, #0x70000":"=r"(i));
126 __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 2":"=r"(i));
127
128 /* Enable ASA in ACR register */
129 __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 1":"=r"(i));
130 __asm__ __volatile__("orr %0, %0, #0x10":"=r"(i));
131 __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 1":"=r"(i));
132
133 /* Exiting secure world */
134 __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 0":"=r"(i));
135 __asm__ __volatile__("orr %0, %0, #0x31":"=r"(i));
136 __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 0":"=r"(i));
137}
138
139/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100140 * Routine: try_unlock_sram()
141 * Description: If chip is GP/EMU(special) type, unlock the SRAM for
142 * general use.
143 *****************************************************************************/
Jeroen Hofstee69ab3832014-06-16 23:22:23 +0200144void try_unlock_memory(void)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100145{
146 int mode;
147 int in_sdram = is_running_in_sdram();
148
149 /*
150 * if GP device unlock device SRAM for general use
151 * secure code breaks for Secure/Emulation device - HS/E/T
152 */
153 mode = get_device_type();
154 if (mode == GP_DEVICE)
155 secure_unlock_mem();
156
157 /*
158 * If device is EMU and boot is XIP external booting
159 * Unlock firewalls and disable L2 and put chip
160 * out of secure world
161 *
162 * Assuming memories are unlocked by the demon who put us in SDRAM
163 */
164 if ((mode <= EMU_DEVICE) && (get_boot_type() == 0x1F)
165 && (!in_sdram)) {
166 secure_unlock_mem();
167 secureworld_exit();
168 }
169
170 return;
171}
172
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300173void early_system_init(void)
174{
175 hw_data_init();
176}
177
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100178/******************************************************************************
179 * Routine: s_init
180 * Description: Does early system init of muxing and clocks.
181 * - Called path is with SRAM stack.
182 *****************************************************************************/
183void s_init(void)
184{
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100185 watchdog_init();
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300186 early_system_init();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100187
188 try_unlock_memory();
189
Aneesh Vd16dd012011-06-16 23:30:53 +0000190#ifndef CONFIG_SYS_L2CACHE_OFF
191 /* Invalidate L2-cache from secure mode */
192 omap3_invalidate_l2_cache_secure();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100193#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100194
195 set_muxconf_regs();
Alexander Holler4e333f62010-12-18 13:24:20 +0100196 sdelay(100);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100197
198 prcm_init();
199
200 per_clocks_enable();
201
Govindraj.R3968a6a2012-02-06 03:55:35 +0000202#ifdef CONFIG_USB_EHCI_OMAP
203 ehci_clocks_enable();
204#endif
Simon Glass0c078ea2015-03-03 08:03:02 -0700205}
Govindraj.R3968a6a2012-02-06 03:55:35 +0000206
Simon Glass0c078ea2015-03-03 08:03:02 -0700207#ifdef CONFIG_SPL_BUILD
208void board_init_f(ulong dummy)
209{
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300210 early_system_init();
Simon Glass0c078ea2015-03-03 08:03:02 -0700211 mem_init();
Adam Ford0d5a1bf2017-07-14 08:53:20 -0500212 /*
213 * Save the boot parameters passed from romcode.
214 * We cannot delay the saving further than this,
215 * to prevent overwrites.
216 */
217 save_omap_boot_params();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100218}
Simon Glass0c078ea2015-03-03 08:03:02 -0700219#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100220
Tom Rini05df8912012-04-13 12:20:03 +0000221/*
222 * Routine: misc_init_r
223 * Description: A basic misc_init_r that just displays the die ID
224 */
225int __weak misc_init_r(void)
226{
Paul Kocialkowski6bc318e2015-08-27 19:37:13 +0200227 omap_die_id_display();
Tom Rini05df8912012-04-13 12:20:03 +0000228
229 return 0;
230}
231
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100232/******************************************************************************
233 * Routine: wait_for_command_complete
234 * Description: Wait for posting to finish on watchdog
235 *****************************************************************************/
Jeroen Hofsteecbc75622014-10-08 22:57:41 +0200236static void wait_for_command_complete(struct watchdog *wd_base)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100237{
238 int pending = 1;
239 do {
240 pending = readl(&wd_base->wwps);
241 } while (pending);
242}
243
244/******************************************************************************
245 * Routine: watchdog_init
246 * Description: Shut down watch dogs
247 *****************************************************************************/
248void watchdog_init(void)
249{
Dirk Behmedc7af202009-08-08 09:30:21 +0200250 struct watchdog *wd2_base = (struct watchdog *)WD2_BASE;
251 struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100252
253 /*
254 * There are 3 watch dogs WD1=Secure, WD2=MPU, WD3=IVA. WD1 is
255 * either taken care of by ROM (HS/EMU) or not accessible (GP).
256 * We need to take care of WD2-MPU or take a PRCM reset. WD3
257 * should not be running and does not generate a PRCM reset.
258 */
259
Wolfgang Denk42b97cb2014-03-25 14:49:48 +0100260 setbits_le32(&prcm_base->fclken_wkup, 0x20);
261 setbits_le32(&prcm_base->iclken_wkup, 0x20);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100262 wait_on_value(ST_WDT2, 0x20, &prcm_base->idlest_wkup, 5);
263
264 writel(WD_UNLOCK1, &wd2_base->wspr);
265 wait_for_command_complete(wd2_base);
266 writel(WD_UNLOCK2, &wd2_base->wspr);
267}
268
269/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100270 * Dummy function to handle errors for EABI incompatibility
271 *****************************************************************************/
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100272void abort(void)
273{
274}
275
Simon Schwarz992dcf72011-09-14 15:29:26 -0400276#if defined(CONFIG_NAND_OMAP_GPMC) & !defined(CONFIG_SPL_BUILD)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100277/******************************************************************************
278 * OMAP3 specific command to switch between NAND HW and SW ecc
279 *****************************************************************************/
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200280static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100281{
Ladislav Michld3bc9852017-03-06 13:54:30 +0100282 int hw, strength = 1;
283
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000284 if (argc < 2 || argc > 3)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100285 goto usage;
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000286
287 if (strncmp(argv[1], "hw", 2) == 0) {
Ladislav Michld3bc9852017-03-06 13:54:30 +0100288 hw = 1;
289 if (argc == 3) {
290 if (strncmp(argv[2], "bch8", 4) == 0)
291 strength = 8;
Heiko Schocher5bf904c2016-06-07 08:55:42 +0200292 else if (strncmp(argv[2], "bch16", 5) == 0)
Ladislav Michld3bc9852017-03-06 13:54:30 +0100293 strength = 16;
294 else if (strncmp(argv[2], "hamming", 7) != 0)
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000295 goto usage;
296 }
297 } else if (strncmp(argv[1], "sw", 2) == 0) {
Ladislav Michld3bc9852017-03-06 13:54:30 +0100298 hw = 0;
299 if (argc == 3) {
300 if (strncmp(argv[2], "bch8", 4) == 0)
301 strength = 8;
302 else if (strncmp(argv[2], "hamming", 7) != 0)
Ash Charles4a5faa82015-02-18 11:25:11 -0800303 goto usage;
304 }
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000305 } else {
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100306 goto usage;
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000307 }
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100308
Ladislav Michld3bc9852017-03-06 13:54:30 +0100309 return -omap_nand_switch_ecc(hw, strength);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100310
311usage:
Sanjeev Premi15af9982009-04-03 14:00:07 +0530312 printf ("Usage: nandecc %s\n", cmdtp->usage);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100313 return 1;
314}
315
316U_BOOT_CMD(
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000317 nandecc, 3, 1, do_switch_ecc,
Robert P. J. Day3ea16c32009-11-17 07:30:23 -0500318 "switch OMAP3 NAND ECC calculation algorithm",
Heiko Schocher5bf904c2016-06-07 08:55:42 +0200319 "hw [hamming|bch8|bch16] - Switch between NAND hardware 1-bit hamming"
320 " and 8-bit/16-bit BCH\n"
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000321 " ecc calculation (second parameter may"
322 " be omitted).\n"
323 "nandecc sw - Switch to NAND software ecc algorithm."
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200324);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100325
Simon Schwarz992dcf72011-09-14 15:29:26 -0400326#endif /* CONFIG_NAND_OMAP_GPMC & !CONFIG_SPL_BUILD */
Sanjeev Premie32ef2e2009-04-27 21:27:27 +0530327
328#ifdef CONFIG_DISPLAY_BOARDINFO
329/**
330 * Print board information
331 */
332int checkboard (void)
333{
334 char *mem_s ;
335
336 if (is_mem_sdr())
337 mem_s = "mSDR";
338 else
339 mem_s = "LPDDR";
340
341 printf("%s + %s/%s\n", sysinfo.board_string, mem_s,
342 sysinfo.nand_string);
343
344 return 0;
345}
346#endif /* CONFIG_DISPLAY_BOARDINFO */
Aneesh Vd16dd012011-06-16 23:30:53 +0000347
348static void omap3_emu_romcode_call(u32 service_id, u32 *parameters)
349{
350 u32 i, num_params = *parameters;
351 u32 *sram_scratch_space = (u32 *)OMAP3_PUBLIC_SRAM_SCRATCH_AREA;
352
353 /*
354 * copy the parameters to an un-cached area to avoid coherency
355 * issues
356 */
357 for (i = 0; i < num_params; i++) {
358 __raw_writel(*parameters, sram_scratch_space);
359 parameters++;
360 sram_scratch_space++;
361 }
362
363 /* Now make the PPA call */
364 do_omap3_emu_romcode_call(service_id, OMAP3_PUBLIC_SRAM_SCRATCH_AREA);
365}
366
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500367void __weak omap3_set_aux_cr_secure(u32 acr)
Aneesh Vd16dd012011-06-16 23:30:53 +0000368{
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500369 struct emu_hal_params emu_romcode_params;
370
371 emu_romcode_params.num_params = 1;
372 emu_romcode_params.param1 = acr;
373 omap3_emu_romcode_call(OMAP3_EMU_HAL_API_WRITE_ACR,
374 (u32 *)&emu_romcode_params);
Aneesh Vd16dd012011-06-16 23:30:53 +0000375}
376
Siarhei Siamashkafe038a72017-03-06 03:16:53 +0200377void v7_arch_cp15_set_l2aux_ctrl(u32 l2auxctrl, u32 cpu_midr,
378 u32 cpu_rev_comb, u32 cpu_variant,
379 u32 cpu_rev)
380{
381 if (get_device_type() == GP_DEVICE)
382 omap_smc1(OMAP3_GP_ROMCODE_API_WRITE_L2ACR, l2auxctrl);
383
384 /* L2 Cache Auxiliary Control Register is not banked */
385}
386
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500387void v7_arch_cp15_set_acr(u32 acr, u32 cpu_midr, u32 cpu_rev_comb,
388 u32 cpu_variant, u32 cpu_rev)
Aneesh Vd16dd012011-06-16 23:30:53 +0000389{
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500390 /* Write ACR - affects secure banked bits */
391 if (get_device_type() == GP_DEVICE)
392 omap_smc1(OMAP3_GP_ROMCODE_API_WRITE_ACR, acr);
393 else
394 omap3_set_aux_cr_secure(acr);
Nishanth Menon3e46e3e2015-03-09 17:12:08 -0500395
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500396 /* Write ACR - affects non-secure banked bits - some erratas need it */
397 asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
Aneesh Vd16dd012011-06-16 23:30:53 +0000398}
399
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500400
Aneesh Vd16dd012011-06-16 23:30:53 +0000401#ifndef CONFIG_SYS_L2CACHE_OFF
Tom Rinib759db32012-10-30 22:23:28 -0700402static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)
403{
404 u32 acr;
405
406 /* Read ACR */
407 asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
408 acr &= ~clear_bits;
409 acr |= set_bits;
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500410 v7_arch_cp15_set_acr(acr, 0, 0, 0, 0);
Tom Rinib759db32012-10-30 22:23:28 -0700411
Tom Rinib759db32012-10-30 22:23:28 -0700412}
413
Aneesh Vd16dd012011-06-16 23:30:53 +0000414/* Invalidate the entire L2 cache from secure mode */
415static void omap3_invalidate_l2_cache_secure(void)
416{
417 if (get_device_type() == GP_DEVICE) {
Nishanth Menona816cc32015-03-09 17:12:05 -0500418 omap_smc1(OMAP3_GP_ROMCODE_API_L2_INVAL, 0);
Aneesh Vd16dd012011-06-16 23:30:53 +0000419 } else {
420 struct emu_hal_params emu_romcode_params;
421 emu_romcode_params.num_params = 1;
422 emu_romcode_params.param1 = 0;
423 omap3_emu_romcode_call(OMAP3_EMU_HAL_API_L2_INVAL,
424 (u32 *)&emu_romcode_params);
425 }
426}
427
428void v7_outer_cache_enable(void)
429{
Aneesh Vd16dd012011-06-16 23:30:53 +0000430
431 /*
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500432 * Set L2EN
Aneesh Vd16dd012011-06-16 23:30:53 +0000433 * On some revisions L2EN bit is banked on some revisions it's not
434 * No harm in setting both banked bits(in fact this is required
435 * by an erratum)
436 */
437 omap3_update_aux_cr(0x2, 0);
438}
439
Aneesh Ve0db71d2012-02-16 03:40:15 +0000440void omap3_outer_cache_disable(void)
Aneesh Vd16dd012011-06-16 23:30:53 +0000441{
Aneesh Vd16dd012011-06-16 23:30:53 +0000442 /*
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500443 * Clear L2EN
Aneesh Vd16dd012011-06-16 23:30:53 +0000444 * On some revisions L2EN bit is banked on some revisions it's not
445 * No harm in clearing both banked bits(in fact this is required
446 * by an erratum)
447 */
448 omap3_update_aux_cr(0, 0x2);
449}
Robert P. J. Day3bb3c292012-11-13 07:57:54 +0000450#endif /* !CONFIG_SYS_L2CACHE_OFF */