blob: 60de0d6052135ae699e886506ab6ac9b8da317dc [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 Glassfa4689a2019-12-06 21:41:35 -070036#if CONFIG_IS_ENABLED(DM_GPIO)
Adam Ford15e2ad62019-05-29 15:42:53 -050037#if !CONFIG_IS_ENABLED(OF_CONTROL)
38/* Manually initialize GPIO banks when OF_CONTROL doesn't */
Simon Glassbc0f4ea2014-10-22 21:37:15 -060039static const struct omap_gpio_platdata omap34xx_gpio[] = {
Tom Rini7bc2bca2015-07-31 19:55:09 -040040 { 0, OMAP34XX_GPIO1_BASE },
41 { 1, OMAP34XX_GPIO2_BASE },
42 { 2, OMAP34XX_GPIO3_BASE },
43 { 3, OMAP34XX_GPIO4_BASE },
44 { 4, OMAP34XX_GPIO5_BASE },
45 { 5, OMAP34XX_GPIO6_BASE },
Simon Glassbc0f4ea2014-10-22 21:37:15 -060046};
47
Adam Ford8d70ffd2017-04-09 07:35:12 -050048U_BOOT_DEVICES(omap34xx_gpios) = {
Simon Glassbc0f4ea2014-10-22 21:37:15 -060049 { "gpio_omap", &omap34xx_gpio[0] },
50 { "gpio_omap", &omap34xx_gpio[1] },
51 { "gpio_omap", &omap34xx_gpio[2] },
52 { "gpio_omap", &omap34xx_gpio[3] },
53 { "gpio_omap", &omap34xx_gpio[4] },
54 { "gpio_omap", &omap34xx_gpio[5] },
55};
Adam Ford15e2ad62019-05-29 15:42:53 -050056#endif
Simon Glassbc0f4ea2014-10-22 21:37:15 -060057#else
58
Aneesh V9a390882011-07-21 09:29:29 -040059static const struct gpio_bank gpio_bank_34xx[6] = {
Tom Rini7bc2bca2015-07-31 19:55:09 -040060 { (void *)OMAP34XX_GPIO1_BASE },
61 { (void *)OMAP34XX_GPIO2_BASE },
62 { (void *)OMAP34XX_GPIO3_BASE },
63 { (void *)OMAP34XX_GPIO4_BASE },
64 { (void *)OMAP34XX_GPIO5_BASE },
65 { (void *)OMAP34XX_GPIO6_BASE },
Aneesh V9a390882011-07-21 09:29:29 -040066};
67
68const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
69
Simon Glassbc0f4ea2014-10-22 21:37:15 -060070#endif
71
Dirk Behmee0e49fe2008-12-14 09:47:15 +010072/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +010073 * Routine: secure_unlock
74 * Description: Setup security registers for access
75 * (GP Device only)
76 *****************************************************************************/
77void secure_unlock_mem(void)
78{
Dirk Behmedc7af202009-08-08 09:30:21 +020079 struct pm *pm_rt_ape_base = (struct pm *)PM_RT_APE_BASE_ADDR_ARM;
80 struct pm *pm_gpmc_base = (struct pm *)PM_GPMC_BASE_ADDR_ARM;
81 struct pm *pm_ocm_ram_base = (struct pm *)PM_OCM_RAM_BASE_ADDR_ARM;
82 struct pm *pm_iva2_base = (struct pm *)PM_IVA2_BASE_ADDR_ARM;
83 struct sms *sms_base = (struct sms *)OMAP34XX_SMS_BASE;
Dirk Behmee0e49fe2008-12-14 09:47:15 +010084
85 /* Protection Module Register Target APE (PM_RT) */
86 writel(UNLOCK_1, &pm_rt_ape_base->req_info_permission_1);
87 writel(UNLOCK_1, &pm_rt_ape_base->read_permission_0);
88 writel(UNLOCK_1, &pm_rt_ape_base->wirte_permission_0);
89 writel(UNLOCK_2, &pm_rt_ape_base->addr_match_1);
90
91 writel(UNLOCK_3, &pm_gpmc_base->req_info_permission_0);
92 writel(UNLOCK_3, &pm_gpmc_base->read_permission_0);
93 writel(UNLOCK_3, &pm_gpmc_base->wirte_permission_0);
94
95 writel(UNLOCK_3, &pm_ocm_ram_base->req_info_permission_0);
96 writel(UNLOCK_3, &pm_ocm_ram_base->read_permission_0);
97 writel(UNLOCK_3, &pm_ocm_ram_base->wirte_permission_0);
98 writel(UNLOCK_2, &pm_ocm_ram_base->addr_match_2);
99
100 /* IVA Changes */
101 writel(UNLOCK_3, &pm_iva2_base->req_info_permission_0);
102 writel(UNLOCK_3, &pm_iva2_base->read_permission_0);
103 writel(UNLOCK_3, &pm_iva2_base->wirte_permission_0);
104
105 /* SDRC region 0 public */
106 writel(UNLOCK_1, &sms_base->rg_att0);
107}
108
109/******************************************************************************
110 * Routine: secureworld_exit()
111 * Description: If chip is EMU and boot type is external
112 * configure secure registers and exit secure world
113 * general use.
114 *****************************************************************************/
Jeroen Hofstee69ab3832014-06-16 23:22:23 +0200115void secureworld_exit(void)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100116{
117 unsigned long i;
118
Peter Meerwald7ea4b7c2012-02-02 12:51:02 +0000119 /* configure non-secure access control register */
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100120 __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 2":"=r"(i));
121 /* enabling co-processor CP10 and CP11 accesses in NS world */
122 __asm__ __volatile__("orr %0, %0, #0xC00":"=r"(i));
123 /*
124 * allow allocation of locked TLBs and L2 lines in NS world
125 * allow use of PLE registers in NS world also
126 */
127 __asm__ __volatile__("orr %0, %0, #0x70000":"=r"(i));
128 __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 2":"=r"(i));
129
130 /* Enable ASA in ACR register */
131 __asm__ __volatile__("mrc p15, 0, %0, c1, c0, 1":"=r"(i));
132 __asm__ __volatile__("orr %0, %0, #0x10":"=r"(i));
133 __asm__ __volatile__("mcr p15, 0, %0, c1, c0, 1":"=r"(i));
134
135 /* Exiting secure world */
136 __asm__ __volatile__("mrc p15, 0, %0, c1, c1, 0":"=r"(i));
137 __asm__ __volatile__("orr %0, %0, #0x31":"=r"(i));
138 __asm__ __volatile__("mcr p15, 0, %0, c1, c1, 0":"=r"(i));
139}
140
141/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100142 * Routine: try_unlock_sram()
143 * Description: If chip is GP/EMU(special) type, unlock the SRAM for
144 * general use.
145 *****************************************************************************/
Jeroen Hofstee69ab3832014-06-16 23:22:23 +0200146void try_unlock_memory(void)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100147{
148 int mode;
149 int in_sdram = is_running_in_sdram();
150
151 /*
152 * if GP device unlock device SRAM for general use
153 * secure code breaks for Secure/Emulation device - HS/E/T
154 */
155 mode = get_device_type();
156 if (mode == GP_DEVICE)
157 secure_unlock_mem();
158
159 /*
160 * If device is EMU and boot is XIP external booting
161 * Unlock firewalls and disable L2 and put chip
162 * out of secure world
163 *
164 * Assuming memories are unlocked by the demon who put us in SDRAM
165 */
166 if ((mode <= EMU_DEVICE) && (get_boot_type() == 0x1F)
167 && (!in_sdram)) {
168 secure_unlock_mem();
169 secureworld_exit();
170 }
171
172 return;
173}
174
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300175void early_system_init(void)
176{
177 hw_data_init();
178}
179
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100180/******************************************************************************
181 * Routine: s_init
182 * Description: Does early system init of muxing and clocks.
183 * - Called path is with SRAM stack.
184 *****************************************************************************/
185void s_init(void)
186{
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100187 watchdog_init();
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300188 early_system_init();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100189
190 try_unlock_memory();
191
Aneesh Vd16dd012011-06-16 23:30:53 +0000192#ifndef CONFIG_SYS_L2CACHE_OFF
193 /* Invalidate L2-cache from secure mode */
194 omap3_invalidate_l2_cache_secure();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100195#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100196
197 set_muxconf_regs();
Alexander Holler4e333f62010-12-18 13:24:20 +0100198 sdelay(100);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100199
200 prcm_init();
201
202 per_clocks_enable();
203
Govindraj.R3968a6a2012-02-06 03:55:35 +0000204#ifdef CONFIG_USB_EHCI_OMAP
205 ehci_clocks_enable();
206#endif
Simon Glass0c078ea2015-03-03 08:03:02 -0700207}
Govindraj.R3968a6a2012-02-06 03:55:35 +0000208
Simon Glass0c078ea2015-03-03 08:03:02 -0700209#ifdef CONFIG_SPL_BUILD
210void board_init_f(ulong dummy)
211{
Semen Protsenkoa8cb0222017-06-02 18:00:00 +0300212 early_system_init();
Simon Glass0c078ea2015-03-03 08:03:02 -0700213 mem_init();
Adam Ford0d5a1bf2017-07-14 08:53:20 -0500214 /*
215 * Save the boot parameters passed from romcode.
216 * We cannot delay the saving further than this,
217 * to prevent overwrites.
218 */
219 save_omap_boot_params();
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100220}
Simon Glass0c078ea2015-03-03 08:03:02 -0700221#endif
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100222
Tom Rini05df8912012-04-13 12:20:03 +0000223/*
224 * Routine: misc_init_r
225 * Description: A basic misc_init_r that just displays the die ID
226 */
227int __weak misc_init_r(void)
228{
Paul Kocialkowski6bc318e2015-08-27 19:37:13 +0200229 omap_die_id_display();
Tom Rini05df8912012-04-13 12:20:03 +0000230
231 return 0;
232}
233
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100234/******************************************************************************
235 * Routine: wait_for_command_complete
236 * Description: Wait for posting to finish on watchdog
237 *****************************************************************************/
Jeroen Hofsteecbc75622014-10-08 22:57:41 +0200238static void wait_for_command_complete(struct watchdog *wd_base)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100239{
240 int pending = 1;
241 do {
242 pending = readl(&wd_base->wwps);
243 } while (pending);
244}
245
246/******************************************************************************
247 * Routine: watchdog_init
248 * Description: Shut down watch dogs
249 *****************************************************************************/
250void watchdog_init(void)
251{
Dirk Behmedc7af202009-08-08 09:30:21 +0200252 struct watchdog *wd2_base = (struct watchdog *)WD2_BASE;
253 struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100254
255 /*
256 * There are 3 watch dogs WD1=Secure, WD2=MPU, WD3=IVA. WD1 is
257 * either taken care of by ROM (HS/EMU) or not accessible (GP).
258 * We need to take care of WD2-MPU or take a PRCM reset. WD3
259 * should not be running and does not generate a PRCM reset.
260 */
261
Wolfgang Denk42b97cb2014-03-25 14:49:48 +0100262 setbits_le32(&prcm_base->fclken_wkup, 0x20);
263 setbits_le32(&prcm_base->iclken_wkup, 0x20);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100264 wait_on_value(ST_WDT2, 0x20, &prcm_base->idlest_wkup, 5);
265
266 writel(WD_UNLOCK1, &wd2_base->wspr);
267 wait_for_command_complete(wd2_base);
268 writel(WD_UNLOCK2, &wd2_base->wspr);
269}
270
271/******************************************************************************
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100272 * Dummy function to handle errors for EABI incompatibility
273 *****************************************************************************/
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100274void abort(void)
275{
276}
277
Simon Schwarz992dcf72011-09-14 15:29:26 -0400278#if defined(CONFIG_NAND_OMAP_GPMC) & !defined(CONFIG_SPL_BUILD)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100279/******************************************************************************
280 * OMAP3 specific command to switch between NAND HW and SW ecc
281 *****************************************************************************/
Wolfgang Denk6262d0212010-06-28 22:00:46 +0200282static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100283{
Ladislav Michld3bc9852017-03-06 13:54:30 +0100284 int hw, strength = 1;
285
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000286 if (argc < 2 || argc > 3)
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100287 goto usage;
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000288
289 if (strncmp(argv[1], "hw", 2) == 0) {
Ladislav Michld3bc9852017-03-06 13:54:30 +0100290 hw = 1;
291 if (argc == 3) {
292 if (strncmp(argv[2], "bch8", 4) == 0)
293 strength = 8;
Heiko Schocher5bf904c2016-06-07 08:55:42 +0200294 else if (strncmp(argv[2], "bch16", 5) == 0)
Ladislav Michld3bc9852017-03-06 13:54:30 +0100295 strength = 16;
296 else if (strncmp(argv[2], "hamming", 7) != 0)
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000297 goto usage;
298 }
299 } else if (strncmp(argv[1], "sw", 2) == 0) {
Ladislav Michld3bc9852017-03-06 13:54:30 +0100300 hw = 0;
301 if (argc == 3) {
302 if (strncmp(argv[2], "bch8", 4) == 0)
303 strength = 8;
304 else if (strncmp(argv[2], "hamming", 7) != 0)
Ash Charles4a5faa82015-02-18 11:25:11 -0800305 goto usage;
306 }
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000307 } else {
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100308 goto usage;
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000309 }
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100310
Ladislav Michld3bc9852017-03-06 13:54:30 +0100311 return -omap_nand_switch_ecc(hw, strength);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100312
313usage:
Sanjeev Premi15af9982009-04-03 14:00:07 +0530314 printf ("Usage: nandecc %s\n", cmdtp->usage);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100315 return 1;
316}
317
318U_BOOT_CMD(
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000319 nandecc, 3, 1, do_switch_ecc,
Robert P. J. Day3ea16c32009-11-17 07:30:23 -0500320 "switch OMAP3 NAND ECC calculation algorithm",
Heiko Schocher5bf904c2016-06-07 08:55:42 +0200321 "hw [hamming|bch8|bch16] - Switch between NAND hardware 1-bit hamming"
322 " and 8-bit/16-bit BCH\n"
Andreas Bießmann1e4eccf2013-04-04 23:52:50 +0000323 " ecc calculation (second parameter may"
324 " be omitted).\n"
325 "nandecc sw - Switch to NAND software ecc algorithm."
Wolfgang Denkc54781c2009-05-24 17:06:54 +0200326);
Dirk Behmee0e49fe2008-12-14 09:47:15 +0100327
Simon Schwarz992dcf72011-09-14 15:29:26 -0400328#endif /* CONFIG_NAND_OMAP_GPMC & !CONFIG_SPL_BUILD */
Sanjeev Premie32ef2e2009-04-27 21:27:27 +0530329
330#ifdef CONFIG_DISPLAY_BOARDINFO
331/**
332 * Print board information
333 */
334int checkboard (void)
335{
336 char *mem_s ;
337
338 if (is_mem_sdr())
339 mem_s = "mSDR";
340 else
341 mem_s = "LPDDR";
342
343 printf("%s + %s/%s\n", sysinfo.board_string, mem_s,
344 sysinfo.nand_string);
345
346 return 0;
347}
348#endif /* CONFIG_DISPLAY_BOARDINFO */
Aneesh Vd16dd012011-06-16 23:30:53 +0000349
350static void omap3_emu_romcode_call(u32 service_id, u32 *parameters)
351{
352 u32 i, num_params = *parameters;
353 u32 *sram_scratch_space = (u32 *)OMAP3_PUBLIC_SRAM_SCRATCH_AREA;
354
355 /*
356 * copy the parameters to an un-cached area to avoid coherency
357 * issues
358 */
359 for (i = 0; i < num_params; i++) {
360 __raw_writel(*parameters, sram_scratch_space);
361 parameters++;
362 sram_scratch_space++;
363 }
364
365 /* Now make the PPA call */
366 do_omap3_emu_romcode_call(service_id, OMAP3_PUBLIC_SRAM_SCRATCH_AREA);
367}
368
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500369void __weak omap3_set_aux_cr_secure(u32 acr)
Aneesh Vd16dd012011-06-16 23:30:53 +0000370{
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500371 struct emu_hal_params emu_romcode_params;
372
373 emu_romcode_params.num_params = 1;
374 emu_romcode_params.param1 = acr;
375 omap3_emu_romcode_call(OMAP3_EMU_HAL_API_WRITE_ACR,
376 (u32 *)&emu_romcode_params);
Aneesh Vd16dd012011-06-16 23:30:53 +0000377}
378
Siarhei Siamashkafe038a72017-03-06 03:16:53 +0200379void v7_arch_cp15_set_l2aux_ctrl(u32 l2auxctrl, u32 cpu_midr,
380 u32 cpu_rev_comb, u32 cpu_variant,
381 u32 cpu_rev)
382{
383 if (get_device_type() == GP_DEVICE)
384 omap_smc1(OMAP3_GP_ROMCODE_API_WRITE_L2ACR, l2auxctrl);
385
386 /* L2 Cache Auxiliary Control Register is not banked */
387}
388
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500389void v7_arch_cp15_set_acr(u32 acr, u32 cpu_midr, u32 cpu_rev_comb,
390 u32 cpu_variant, u32 cpu_rev)
Aneesh Vd16dd012011-06-16 23:30:53 +0000391{
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500392 /* Write ACR - affects secure banked bits */
393 if (get_device_type() == GP_DEVICE)
394 omap_smc1(OMAP3_GP_ROMCODE_API_WRITE_ACR, acr);
395 else
396 omap3_set_aux_cr_secure(acr);
Nishanth Menon3e46e3e2015-03-09 17:12:08 -0500397
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500398 /* Write ACR - affects non-secure banked bits - some erratas need it */
399 asm volatile ("mcr p15, 0, %0, c1, c0, 1" : : "r" (acr));
Aneesh Vd16dd012011-06-16 23:30:53 +0000400}
401
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500402
Aneesh Vd16dd012011-06-16 23:30:53 +0000403#ifndef CONFIG_SYS_L2CACHE_OFF
Tom Rinib759db32012-10-30 22:23:28 -0700404static void omap3_update_aux_cr(u32 set_bits, u32 clear_bits)
405{
406 u32 acr;
407
408 /* Read ACR */
409 asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
410 acr &= ~clear_bits;
411 acr |= set_bits;
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500412 v7_arch_cp15_set_acr(acr, 0, 0, 0, 0);
Tom Rinib759db32012-10-30 22:23:28 -0700413
Tom Rinib759db32012-10-30 22:23:28 -0700414}
415
Aneesh Vd16dd012011-06-16 23:30:53 +0000416/* Invalidate the entire L2 cache from secure mode */
417static void omap3_invalidate_l2_cache_secure(void)
418{
419 if (get_device_type() == GP_DEVICE) {
Nishanth Menona816cc32015-03-09 17:12:05 -0500420 omap_smc1(OMAP3_GP_ROMCODE_API_L2_INVAL, 0);
Aneesh Vd16dd012011-06-16 23:30:53 +0000421 } else {
422 struct emu_hal_params emu_romcode_params;
423 emu_romcode_params.num_params = 1;
424 emu_romcode_params.param1 = 0;
425 omap3_emu_romcode_call(OMAP3_EMU_HAL_API_L2_INVAL,
426 (u32 *)&emu_romcode_params);
427 }
428}
429
430void v7_outer_cache_enable(void)
431{
Aneesh Vd16dd012011-06-16 23:30:53 +0000432
433 /*
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500434 * Set L2EN
Aneesh Vd16dd012011-06-16 23:30:53 +0000435 * On some revisions L2EN bit is banked on some revisions it's not
436 * No harm in setting both banked bits(in fact this is required
437 * by an erratum)
438 */
439 omap3_update_aux_cr(0x2, 0);
440}
441
Aneesh Ve0db71d2012-02-16 03:40:15 +0000442void omap3_outer_cache_disable(void)
Aneesh Vd16dd012011-06-16 23:30:53 +0000443{
Aneesh Vd16dd012011-06-16 23:30:53 +0000444 /*
Nishanth Menon53fee1e2015-03-09 17:12:09 -0500445 * Clear L2EN
Aneesh Vd16dd012011-06-16 23:30:53 +0000446 * On some revisions L2EN bit is banked on some revisions it's not
447 * No harm in clearing both banked bits(in fact this is required
448 * by an erratum)
449 */
450 omap3_update_aux_cr(0, 0x2);
451}
Robert P. J. Day3bb3c292012-11-13 07:57:54 +0000452#endif /* !CONFIG_SYS_L2CACHE_OFF */