diff options
Diffstat (limited to 'recipes-kernel/linux/linux-imx-3.10.17/0010-ENGR00318392-ARM-imx6x-Save-restore-SCU-and-some-CP1.patch')
-rw-r--r-- | recipes-kernel/linux/linux-imx-3.10.17/0010-ENGR00318392-ARM-imx6x-Save-restore-SCU-and-some-CP1.patch | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/recipes-kernel/linux/linux-imx-3.10.17/0010-ENGR00318392-ARM-imx6x-Save-restore-SCU-and-some-CP1.patch b/recipes-kernel/linux/linux-imx-3.10.17/0010-ENGR00318392-ARM-imx6x-Save-restore-SCU-and-some-CP1.patch deleted file mode 100644 index 4459576..0000000 --- a/recipes-kernel/linux/linux-imx-3.10.17/0010-ENGR00318392-ARM-imx6x-Save-restore-SCU-and-some-CP1.patch +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | From 4a46352d23f1f7b4f513487cb1701a8592ba980f Mon Sep 17 00:00:00 2001 | ||
2 | From: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com> | ||
3 | Date: Fri, 13 Jun 2014 15:43:14 -0500 | ||
4 | Subject: [PATCH 10/10] ENGR00318392 ARM:imx6x: Save/restore SCU and some CP15 | ||
5 | registers across suspend/resume | ||
6 | Organization: O.S. Systems Software LTDA. | ||
7 | |||
8 | This patch ensures that the SCU and certain A9 CP15 registers state are maintained across | ||
9 | a suspend/resume cycle: | ||
10 | 1. Need to ensure that SCU standby bit is set again after suspend/resume cycle, else | ||
11 | the system will never WAIT mode after a suspend/resume cycle. This bit should be enabled | ||
12 | on all SMP systems immaterial of whether CPUIDLE is enabled or not. | ||
13 | 2. Several A9 errata workarounds involve setting bits in the ARM diagnostic register. | ||
14 | Save/restore this register across a suspend/resume cycle. | ||
15 | 3. Save and restore the A9 power control register also. | ||
16 | |||
17 | Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@freescale.com> | ||
18 | (cherry picked from commit 7b5b4ef5b3cdc65c0576f87cfa52bcca1bda8b33) | ||
19 | |||
20 | Upstream-Status: Pending | ||
21 | --- | ||
22 | arch/arm/mach-imx/cpuidle-imx6q.c | 5 +---- | ||
23 | arch/arm/mach-imx/platsmp.c | 4 +++- | ||
24 | arch/arm/mach-imx/pm-imx6.c | 36 ++++++++++++++++++++++++++++++++++++ | ||
25 | 3 files changed, 40 insertions(+), 5 deletions(-) | ||
26 | |||
27 | diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c | ||
28 | index d74d0ce..9ffbd34 100644 | ||
29 | --- a/arch/arm/mach-imx/cpuidle-imx6q.c | ||
30 | +++ b/arch/arm/mach-imx/cpuidle-imx6q.c | ||
31 | @@ -1,5 +1,5 @@ | ||
32 | /* | ||
33 | - * Copyright (C) 2012-2013 Freescale Semiconductor, Inc. | ||
34 | + * Copyright (C) 2012-2014 Freescale Semiconductor, Inc. | ||
35 | * | ||
36 | * This program is free software; you can redistribute it and/or modify | ||
37 | * it under the terms of the GNU General Public License version 2 as | ||
38 | @@ -65,9 +65,6 @@ static struct cpuidle_driver imx6q_cpuidle_driver = { | ||
39 | |||
40 | int __init imx6q_cpuidle_init(void) | ||
41 | { | ||
42 | - /* Need to enable SCU standby for entering WAIT modes */ | ||
43 | - imx_scu_standby_enable(); | ||
44 | - | ||
45 | /* Set cache lpm bit for reliable WAIT mode support */ | ||
46 | imx6_set_cache_lpm_in_wait(true); | ||
47 | |||
48 | diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c | ||
49 | index c6e1ab5..d2fa7ec 100644 | ||
50 | --- a/arch/arm/mach-imx/platsmp.c | ||
51 | +++ b/arch/arm/mach-imx/platsmp.c | ||
52 | @@ -1,5 +1,5 @@ | ||
53 | /* | ||
54 | - * Copyright 2011 Freescale Semiconductor, Inc. | ||
55 | + * Copyright 2011-2014 Freescale Semiconductor, Inc. | ||
56 | * Copyright 2011 Linaro Ltd. | ||
57 | * | ||
58 | * The code contained herein is licensed under the GNU General Public | ||
59 | @@ -77,6 +77,8 @@ static void __init imx_smp_init_cpus(void) | ||
60 | void imx_smp_prepare(void) | ||
61 | { | ||
62 | scu_enable(scu_base); | ||
63 | + /* Need to enable SCU standby for entering WAIT mode */ | ||
64 | + imx_scu_standby_enable(); | ||
65 | } | ||
66 | |||
67 | static void __init imx_smp_prepare_cpus(unsigned int max_cpus) | ||
68 | diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c | ||
69 | index de46b87..587cc7e 100644 | ||
70 | --- a/arch/arm/mach-imx/pm-imx6.c | ||
71 | +++ b/arch/arm/mach-imx/pm-imx6.c | ||
72 | @@ -73,6 +73,8 @@ static int (*suspend_in_iram_fn)(void *iram_vbase, | ||
73 | unsigned long iram_pbase, unsigned int cpu_type); | ||
74 | static unsigned int cpu_type; | ||
75 | static void __iomem *ccm_base; | ||
76 | +static unsigned long dcr; | ||
77 | +static unsigned long pcr; | ||
78 | |||
79 | unsigned long save_ttbr1(void) | ||
80 | { | ||
81 | @@ -111,6 +113,34 @@ void imx6_set_cache_lpm_in_wait(bool enable) | ||
82 | } | ||
83 | } | ||
84 | |||
85 | +static void imx6_save_cpu_arch_regs(void) | ||
86 | +{ | ||
87 | + /* Save the Diagnostic Control Register. */ | ||
88 | + asm volatile( | ||
89 | + "mrc p15, 0, %0, c15, c0, 1\n" | ||
90 | + : "=r" (dcr) | ||
91 | + ); | ||
92 | + /* Save the Power Control Register. */ | ||
93 | + asm volatile( | ||
94 | + "mrc p15, 0, %0, c15, c0, 0\n" | ||
95 | + : "=r" (pcr) | ||
96 | + ); | ||
97 | +} | ||
98 | + | ||
99 | +static void imx6_restore_cpu_arch_regs(void) | ||
100 | +{ | ||
101 | + /* Restore the diagnostic Control Register. */ | ||
102 | + asm volatile( | ||
103 | + "mcr p15, 0, %0, c15, c0, 1\n" | ||
104 | + : : "r" (dcr) | ||
105 | + ); | ||
106 | + /* Restore the Power Control Register. */ | ||
107 | + asm volatile( | ||
108 | + "mcr p15, 0, %0, c15, c0, 0\n" | ||
109 | + : : "r" (pcr) | ||
110 | + ); | ||
111 | +} | ||
112 | + | ||
113 | static void imx6_enable_rbc(bool enable) | ||
114 | { | ||
115 | u32 val; | ||
116 | @@ -290,8 +320,14 @@ static int imx6_pm_enter(suspend_state_t state) | ||
117 | imx_gpc_pre_suspend(true); | ||
118 | imx_anatop_pre_suspend(); | ||
119 | imx_set_cpu_jump(0, v7_cpu_resume); | ||
120 | + | ||
121 | + imx6_save_cpu_arch_regs(); | ||
122 | + | ||
123 | /* Zzz ... */ | ||
124 | cpu_suspend(0, imx6_suspend_finish); | ||
125 | + | ||
126 | + imx6_restore_cpu_arch_regs(); | ||
127 | + | ||
128 | if (!cpu_is_imx6sl()) | ||
129 | imx_smp_prepare(); | ||
130 | imx_anatop_post_resume(); | ||
131 | -- | ||
132 | 2.1.0 | ||
133 | |||