aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-05 18:57:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-05 18:57:04 -0400
commiteb3d3ec567e868c8a3bfbfdfc9465ffd52983d11 (patch)
tree75acf38b8d73cd281e5ce4dcc941faf48e244b98 /arch/arm/mach-tegra
parentc3c55a07203947f72afa50a3218460b27307c47d (diff)
parentbd63ce27d9d62bc40a962b991cbbbe4f0dc913d2 (diff)
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm into next
Pull ARM updates from Russell King: - Major clean-up of the L2 cache support code. The existing mess was becoming rather unmaintainable through all the additions that others have done over time. This turns it into a much nicer structure, and implements a few performance improvements as well. - Clean up some of the CP15 control register tweaks for alignment support, moving some code and data into alignment.c - DMA properties for ARM, from Santosh and reviewed by DT people. This adds DT properties to specify bus translations we can't discover automatically, and to indicate whether devices are coherent. - Hibernation support for ARM - Make ftrace work with read-only text in modules - add suspend support for PJ4B CPUs - rework interrupt masking for undefined instruction handling, which allows us to enable interrupts earlier in the handling of these exceptions. - support for big endian page tables - fix stacktrace support to exclude stacktrace functions from the trace, and add save_stack_trace_regs() implementation so that kprobes can record stack traces. - Add support for the Cortex-A17 CPU. - Remove last vestiges of ARM710 support. - Removal of ARM "meminfo" structure, finally converting us solely to memblock to handle the early memory initialisation. * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (142 commits) ARM: ensure C page table setup code follows assembly code (part II) ARM: ensure C page table setup code follows assembly code ARM: consolidate last remaining open-coded alignment trap enable ARM: remove global cr_no_alignment ARM: remove CPU_CP15 conditional from alignment.c ARM: remove unused adjust_cr() function ARM: move "noalign" command line option to alignment.c ARM: provide common method to clear bits in CPU control register ARM: 8025/1: Get rid of meminfo ARM: 8060/1: mm: allow sub-architectures to override PCI I/O memory type ARM: 8066/1: correction for ARM patch 8031/2 ARM: 8049/1: ftrace/add save_stack_trace_regs() implementation ARM: 8065/1: remove last use of CONFIG_CPU_ARM710 ARM: 8062/1: Modify ldrt fixup handler to re-execute the userspace instruction ARM: 8047/1: rwsem: use asm-generic rwsem implementation ARM: l2c: trial at enabling some Cortex-A9 optimisations ARM: l2c: add warnings for stuff modifying aux_ctrl register values ARM: l2c: print a warning with L2C-310 caches if the cache size is modified ARM: l2c: remove old .set_debug method ARM: l2c: kill L2X0_AUX_CTRL_MASK before anyone else makes use of this ...
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/pm.h2
-rw-r--r--arch/arm/mach-tegra/reset-handler.S11
-rw-r--r--arch/arm/mach-tegra/sleep.h31
-rw-r--r--arch/arm/mach-tegra/tegra.c32
4 files changed, 6 insertions, 70 deletions
diff --git a/arch/arm/mach-tegra/pm.h b/arch/arm/mach-tegra/pm.h
index 6e92a7c2ecbd..f4a89698e5b0 100644
--- a/arch/arm/mach-tegra/pm.h
+++ b/arch/arm/mach-tegra/pm.h
@@ -35,8 +35,6 @@ void tegra20_sleep_core_init(void);
35void tegra30_lp1_iram_hook(void); 35void tegra30_lp1_iram_hook(void);
36void tegra30_sleep_core_init(void); 36void tegra30_sleep_core_init(void);
37 37
38extern unsigned long l2x0_saved_regs_addr;
39
40void tegra_clear_cpu_in_lp2(void); 38void tegra_clear_cpu_in_lp2(void);
41bool tegra_set_cpu_in_lp2(void); 39bool tegra_set_cpu_in_lp2(void);
42 40
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index 8c1ba4fea384..578d4d1ad648 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -19,7 +19,6 @@
19 19
20#include <asm/cache.h> 20#include <asm/cache.h>
21#include <asm/asm-offsets.h> 21#include <asm/asm-offsets.h>
22#include <asm/hardware/cache-l2x0.h>
23 22
24#include "flowctrl.h" 23#include "flowctrl.h"
25#include "fuse.h" 24#include "fuse.h"
@@ -78,8 +77,10 @@ ENTRY(tegra_resume)
78 str r1, [r0] 77 str r1, [r0]
79#endif 78#endif
80 79
80#ifdef CONFIG_CACHE_L2X0
81 /* L2 cache resume & re-enable */ 81 /* L2 cache resume & re-enable */
82 l2_cache_resume r0, r1, r2, l2x0_saved_regs_addr 82 bl l2c310_early_resume
83#endif
83end_ca9_scu_l2_resume: 84end_ca9_scu_l2_resume:
84 mov32 r9, 0xc0f 85 mov32 r9, 0xc0f
85 cmp r8, r9 86 cmp r8, r9
@@ -89,12 +90,6 @@ end_ca9_scu_l2_resume:
89ENDPROC(tegra_resume) 90ENDPROC(tegra_resume)
90#endif 91#endif
91 92
92#ifdef CONFIG_CACHE_L2X0
93 .globl l2x0_saved_regs_addr
94l2x0_saved_regs_addr:
95 .long 0
96#endif
97
98 .align L1_CACHE_SHIFT 93 .align L1_CACHE_SHIFT
99ENTRY(__tegra_cpu_reset_handler_start) 94ENTRY(__tegra_cpu_reset_handler_start)
100 95
diff --git a/arch/arm/mach-tegra/sleep.h b/arch/arm/mach-tegra/sleep.h
index a4edbb3abd3d..339fe42cd6fb 100644
--- a/arch/arm/mach-tegra/sleep.h
+++ b/arch/arm/mach-tegra/sleep.h
@@ -120,37 +120,6 @@
120 mov \tmp1, \tmp1, lsr #8 120 mov \tmp1, \tmp1, lsr #8
121.endm 121.endm
122 122
123/* Macro to resume & re-enable L2 cache */
124#ifndef L2X0_CTRL_EN
125#define L2X0_CTRL_EN 1
126#endif
127
128#ifdef CONFIG_CACHE_L2X0
129.macro l2_cache_resume, tmp1, tmp2, tmp3, phys_l2x0_saved_regs
130 W(adr) \tmp1, \phys_l2x0_saved_regs
131 ldr \tmp1, [\tmp1]
132 ldr \tmp2, [\tmp1, #L2X0_R_PHY_BASE]
133 ldr \tmp3, [\tmp2, #L2X0_CTRL]
134 tst \tmp3, #L2X0_CTRL_EN
135 bne exit_l2_resume
136 ldr \tmp3, [\tmp1, #L2X0_R_TAG_LATENCY]
137 str \tmp3, [\tmp2, #L2X0_TAG_LATENCY_CTRL]
138 ldr \tmp3, [\tmp1, #L2X0_R_DATA_LATENCY]
139 str \tmp3, [\tmp2, #L2X0_DATA_LATENCY_CTRL]
140 ldr \tmp3, [\tmp1, #L2X0_R_PREFETCH_CTRL]
141 str \tmp3, [\tmp2, #L2X0_PREFETCH_CTRL]
142 ldr \tmp3, [\tmp1, #L2X0_R_PWR_CTRL]
143 str \tmp3, [\tmp2, #L2X0_POWER_CTRL]
144 ldr \tmp3, [\tmp1, #L2X0_R_AUX_CTRL]
145 str \tmp3, [\tmp2, #L2X0_AUX_CTRL]
146 mov \tmp3, #L2X0_CTRL_EN
147 str \tmp3, [\tmp2, #L2X0_CTRL]
148exit_l2_resume:
149.endm
150#else /* CONFIG_CACHE_L2X0 */
151.macro l2_cache_resume, tmp1, tmp2, tmp3, phys_l2x0_saved_regs
152.endm
153#endif /* CONFIG_CACHE_L2X0 */
154#else 123#else
155void tegra_pen_lock(void); 124void tegra_pen_lock(void);
156void tegra_pen_unlock(void); 125void tegra_pen_unlock(void);
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 6191603379e1..15ac9fcc96b1 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -70,40 +70,12 @@ u32 tegra_uart_config[3] = {
70 0, 70 0,
71}; 71};
72 72
73static void __init tegra_init_cache(void)
74{
75#ifdef CONFIG_CACHE_L2X0
76 static const struct of_device_id pl310_ids[] __initconst = {
77 { .compatible = "arm,pl310-cache", },
78 {}
79 };
80
81 struct device_node *np;
82 int ret;
83 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
84 u32 aux_ctrl, cache_type;
85
86 np = of_find_matching_node(NULL, pl310_ids);
87 if (!np)
88 return;
89
90 cache_type = readl(p + L2X0_CACHE_TYPE);
91 aux_ctrl = (cache_type & 0x700) << (17-8);
92 aux_ctrl |= 0x7C400001;
93
94 ret = l2x0_of_init(aux_ctrl, 0x8200c3fe);
95 if (!ret)
96 l2x0_saved_regs_addr = virt_to_phys(&l2x0_saved_regs);
97#endif
98}
99
100static void __init tegra_init_early(void) 73static void __init tegra_init_early(void)
101{ 74{
102 of_register_trusted_foundations(); 75 of_register_trusted_foundations();
103 tegra_apb_io_init(); 76 tegra_apb_io_init();
104 tegra_init_fuse(); 77 tegra_init_fuse();
105 tegra_cpu_reset_handler_init(); 78 tegra_cpu_reset_handler_init();
106 tegra_init_cache();
107 tegra_powergate_init(); 79 tegra_powergate_init();
108 tegra_hotplug_init(); 80 tegra_hotplug_init();
109} 81}
@@ -191,8 +163,10 @@ static const char * const tegra_dt_board_compat[] = {
191}; 163};
192 164
193DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)") 165DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
194 .map_io = tegra_map_common_io, 166 .l2c_aux_val = 0x3c400001,
167 .l2c_aux_mask = 0xc20fc3fe,
195 .smp = smp_ops(tegra_smp_ops), 168 .smp = smp_ops(tegra_smp_ops),
169 .map_io = tegra_map_common_io,
196 .init_early = tegra_init_early, 170 .init_early = tegra_init_early,
197 .init_irq = tegra_dt_init_irq, 171 .init_irq = tegra_dt_init_irq,
198 .init_machine = tegra_dt_init, 172 .init_machine = tegra_dt_init,