2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2013-03-25 23:22:26 +00:00
|
|
|
/*
|
2014-01-24 19:46:16 +00:00
|
|
|
* Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
|
2013-03-25 23:22:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Tegra cache routines */
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch-tegra/ap.h>
|
2019-04-15 09:32:19 +00:00
|
|
|
#if IS_ENABLED(CONFIG_TEGRA_GP_PADCTRL)
|
2013-03-25 23:22:26 +00:00
|
|
|
#include <asm/arch/gp_padctrl.h>
|
2019-04-15 09:32:19 +00:00
|
|
|
#endif
|
2013-03-25 23:22:26 +00:00
|
|
|
|
2015-03-04 23:36:00 +00:00
|
|
|
#ifndef CONFIG_ARM64
|
2013-03-25 23:22:26 +00:00
|
|
|
void config_cache(void)
|
|
|
|
{
|
|
|
|
u32 reg = 0;
|
|
|
|
|
|
|
|
/* enable SMP mode and FW for CPU0, by writing to Auxiliary Ctl reg */
|
|
|
|
asm volatile(
|
|
|
|
"mrc p15, 0, r0, c1, c0, 1\n"
|
|
|
|
"orr r0, r0, #0x41\n"
|
|
|
|
"mcr p15, 0, r0, c1, c0, 1\n");
|
|
|
|
|
2014-01-24 19:46:16 +00:00
|
|
|
/* Currently, only Tegra114+ needs this L2 cache change to boot Linux */
|
|
|
|
if (tegra_get_chip() < CHIPID_TEGRA114)
|
2013-03-25 23:22:26 +00:00
|
|
|
return;
|
2014-01-24 19:46:16 +00:00
|
|
|
|
2013-03-25 23:22:26 +00:00
|
|
|
/*
|
|
|
|
* Systems with an architectural L2 cache must not use the PL310.
|
|
|
|
* Config L2CTLR here for a data RAM latency of 3 cycles.
|
|
|
|
*/
|
|
|
|
asm("mrc p15, 1, %0, c9, c0, 2" : : "r" (reg));
|
|
|
|
reg &= ~7;
|
|
|
|
reg |= 2;
|
|
|
|
asm("mcr p15, 1, %0, c9, c0, 2" : : "r" (reg));
|
|
|
|
}
|
2015-03-04 23:36:00 +00:00
|
|
|
#endif
|