Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340061
b: refs/heads/master
c: 29a0e7b
h: refs/heads/master
i:
  340059: 18bc316
v: v3
  • Loading branch information
Joseph Lo authored and Stephen Warren committed Nov 15, 2012
1 parent e96794c commit 74e68c5
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d552920a02759cdc45d8507868de10ac2f5b9a18
refs/heads/master: 29a0e7beab8e05be53d5b9c050253a4dc417041e
6 changes: 5 additions & 1 deletion trunk/arch/arm/mach-tegra/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "pmc.h"
#include "apbio.h"
#include "sleep.h"
#include "pm.h"

/*
* Storage for debug-macro.S's state.
Expand Down Expand Up @@ -117,14 +118,17 @@ static __initdata struct tegra_clk_init_table tegra30_clk_init_table[] = {
static void __init tegra_init_cache(void)
{
#ifdef CONFIG_CACHE_L2X0
int ret;
void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
u32 aux_ctrl, cache_type;

cache_type = readl(p + L2X0_CACHE_TYPE);
aux_ctrl = (cache_type & 0x700) << (17-8);
aux_ctrl |= 0x7C400001;

l2x0_of_init(aux_ctrl, 0x8200c3fe);
ret = l2x0_of_init(aux_ctrl, 0x8200c3fe);
if (!ret)
l2x0_saved_regs_addr = virt_to_phys(&l2x0_saved_regs);
#endif

}
Expand Down
11 changes: 11 additions & 0 deletions trunk/arch/arm/mach-tegra/headsmp.S
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <linux/init.h>

#include <asm/cache.h>
#include <asm/asm-offsets.h>
#include <asm/hardware/cache-l2x0.h>

#include "flowctrl.h"
#include "iomap.h"
Expand Down Expand Up @@ -113,10 +115,19 @@ ENTRY(tegra_resume)
str r1, [r0]
#endif

/* L2 cache resume & re-enable */
l2_cache_resume r0, r1, r2, l2x0_saved_regs_addr

b cpu_resume
ENDPROC(tegra_resume)
#endif

#ifdef CONFIG_CACHE_L2X0
.globl l2x0_saved_regs_addr
l2x0_saved_regs_addr:
.long 0
#endif

.align L1_CACHE_SHIFT
ENTRY(__tegra_cpu_reset_handler_start)

Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-tegra/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,9 @@ void tegra_idle_lp2_last(u32 cpu_on_time, u32 cpu_off_time)

cpu_cluster_pm_enter();
suspend_cpu_complex();
outer_disable();

cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);

outer_resume();
restore_cpu_complex();
cpu_cluster_pm_exit();
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-tegra/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#ifndef _MACH_TEGRA_PM_H_
#define _MACH_TEGRA_PM_H_

extern unsigned long l2x0_saved_regs_addr;

void save_cpu_arch_register(void);
void restore_cpu_arch_register(void);

Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/arm/mach-tegra/sleep.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <asm/assembler.h>
#include <asm/cache.h>
#include <asm/cp15.h>
#include <asm/hardware/cache-l2x0.h>

#include "iomap.h"

Expand Down Expand Up @@ -98,6 +99,12 @@ ENTRY(tegra_shut_off_mmu)
dsb
mcr p15, 0, r3, c1, c0, 0
isb
#ifdef CONFIG_CACHE_L2X0
/* Disable L2 cache */
mov32 r4, TEGRA_ARM_PERIF_BASE + 0x3000
mov r5, #0
str r5, [r4, #L2X0_CTRL]
#endif
mov pc, r0
ENDPROC(tegra_shut_off_mmu)
.popsection
Expand Down
32 changes: 32 additions & 0 deletions trunk/arch/arm/mach-tegra/sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,38 @@
str \tmp2, [\tmp1] @ invalidate SCU tags for CPU
dsb
.endm

/* Macro to resume & re-enable L2 cache */
#ifndef L2X0_CTRL_EN
#define L2X0_CTRL_EN 1
#endif

#ifdef CONFIG_CACHE_L2X0
.macro l2_cache_resume, tmp1, tmp2, tmp3, phys_l2x0_saved_regs
adr \tmp1, \phys_l2x0_saved_regs
ldr \tmp1, [\tmp1]
ldr \tmp2, [\tmp1, #L2X0_R_PHY_BASE]
ldr \tmp3, [\tmp2, #L2X0_CTRL]
tst \tmp3, #L2X0_CTRL_EN
bne exit_l2_resume
ldr \tmp3, [\tmp1, #L2X0_R_TAG_LATENCY]
str \tmp3, [\tmp2, #L2X0_TAG_LATENCY_CTRL]
ldr \tmp3, [\tmp1, #L2X0_R_DATA_LATENCY]
str \tmp3, [\tmp2, #L2X0_DATA_LATENCY_CTRL]
ldr \tmp3, [\tmp1, #L2X0_R_PREFETCH_CTRL]
str \tmp3, [\tmp2, #L2X0_PREFETCH_CTRL]
ldr \tmp3, [\tmp1, #L2X0_R_PWR_CTRL]
str \tmp3, [\tmp2, #L2X0_POWER_CTRL]
ldr \tmp3, [\tmp1, #L2X0_R_AUX_CTRL]
str \tmp3, [\tmp2, #L2X0_AUX_CTRL]
mov \tmp3, #L2X0_CTRL_EN
str \tmp3, [\tmp2, #L2X0_CTRL]
exit_l2_resume:
.endm
#else /* CONFIG_CACHE_L2X0 */
.macro l2_cache_resume, tmp1, tmp2, tmp3, phys_l2x0_saved_regs
.endm
#endif /* CONFIG_CACHE_L2X0 */
#else
void tegra_resume(void);
int tegra_sleep_cpu_finish(unsigned long);
Expand Down

0 comments on commit 74e68c5

Please sign in to comment.