2018-05-07 05:58:06 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2013-03-26 07:22:26 +08:00
|
|
|
/*
|
2014-01-25 03:46:16 +08:00
|
|
|
* Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
|
2013-03-26 07:22:26 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* Tegra cache routines */
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch-tegra/ap.h>
|
2019-04-15 17:32:19 +08:00
|
|
|
#if IS_ENABLED(CONFIG_TEGRA_GP_PADCTRL)
|
2013-03-26 07:22:26 +08:00
|
|
|
#include <asm/arch/gp_padctrl.h>
|
2019-04-15 17:32:19 +08:00
|
|
|
#endif
|
2013-03-26 07:22:26 +08:00
|
|
|
|
2015-03-05 07:36:00 +08:00
|
|
|
#ifndef CONFIG_ARM64
|
2013-03-26 07:22:26 +08: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-25 03:46:16 +08:00
|
|
|
/* Currently, only Tegra114+ needs this L2 cache change to boot Linux */
|
|
|
|
if (tegra_get_chip() < CHIPID_TEGRA114)
|
2013-03-26 07:22:26 +08:00
|
|
|
return;
|
2014-01-25 03:46:16 +08:00
|
|
|
|
2013-03-26 07:22:26 +08: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-05 07:36:00 +08:00
|
|
|
#endif
|