Skip to content

Commit c309f7f

Browse files
committed
Merge branch 'for_3.10/omap_generic_cleanup_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux into omap-for-v3.10/cleanup-v2
2 parents cdcbdfb + fd1c078 commit c309f7f

File tree

9 files changed

+51
-92
lines changed

9 files changed

+51
-92
lines changed

arch/arm/mach-omap2/cpuidle34xx.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
107107
{
108108
struct omap3_idle_statedata *cx = &omap3_idle_data[index];
109109

110-
local_fiq_disable();
111-
112110
if (omap_irq_pending() || need_resched())
113111
goto return_sleep_time;
114112

@@ -143,7 +141,6 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
143141
clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]);
144142

145143
return_sleep_time:
146-
local_fiq_enable();
147144

148145
return index;
149146
}

arch/arm/mach-omap2/cpuidle44xx.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ static int omap4_enter_idle_simple(struct cpuidle_device *dev,
7070
struct cpuidle_driver *drv,
7171
int index)
7272
{
73-
local_fiq_disable();
7473
omap_do_wfi();
75-
local_fiq_enable();
76-
7774
return index;
7875
}
7976

@@ -84,8 +81,6 @@ static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
8481
struct omap4_idle_statedata *cx = &omap4_idle_data[index];
8582
int cpu_id = smp_processor_id();
8683

87-
local_fiq_disable();
88-
8984
/*
9085
* CPU0 has to wait and stay ON until CPU1 is OFF state.
9186
* This is necessary to honour hardware recommondation
@@ -158,8 +153,6 @@ static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
158153
cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
159154
cpu_done[dev->cpu] = false;
160155

161-
local_fiq_enable();
162-
163156
return index;
164157
}
165158

arch/arm/mach-omap2/omap-hotplug.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
#include <linux/smp.h>
2020
#include <linux/io.h>
2121

22-
#include <asm/cacheflush.h>
2322
#include "omap-wakeupgen.h"
24-
2523
#include "common.h"
26-
2724
#include "powerdomain.h"
2825

2926
/*
@@ -35,9 +32,6 @@ void __ref omap4_cpu_die(unsigned int cpu)
3532
unsigned int boot_cpu = 0;
3633
void __iomem *base = omap_get_wakeupgen_base();
3734

38-
flush_cache_all();
39-
dsb();
40-
4135
/*
4236
* we're ready for shutdown now, so do it
4337
*/

arch/arm/mach-omap2/omap-smp.c

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/io.h>
2222
#include <linux/irqchip/arm-gic.h>
2323

24-
#include <asm/cacheflush.h>
2524
#include <asm/smp_scu.h>
2625

2726
#include "omap-secure.h"
@@ -103,9 +102,6 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
103102
else
104103
__raw_writel(0x20, base + OMAP_AUX_CORE_BOOT_0);
105104

106-
flush_cache_all();
107-
smp_wmb();
108-
109105
if (!cpu1_clkdm)
110106
cpu1_clkdm = clkdm_lookup("mpu1_clkdm");
111107

@@ -168,38 +164,6 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
168164
return 0;
169165
}
170166

171-
static void __init wakeup_secondary(void)
172-
{
173-
void *startup_addr = omap_secondary_startup;
174-
void __iomem *base = omap_get_wakeupgen_base();
175-
176-
if (cpu_is_omap446x()) {
177-
startup_addr = omap_secondary_startup_4460;
178-
pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD;
179-
}
180-
181-
/*
182-
* Write the address of secondary startup routine into the
183-
* AuxCoreBoot1 where ROM code will jump and start executing
184-
* on secondary core once out of WFE
185-
* A barrier is added to ensure that write buffer is drained
186-
*/
187-
if (omap_secure_apis_support())
188-
omap_auxcoreboot_addr(virt_to_phys(startup_addr));
189-
else
190-
__raw_writel(virt_to_phys(omap5_secondary_startup),
191-
base + OMAP_AUX_CORE_BOOT_1);
192-
193-
smp_wmb();
194-
195-
/*
196-
* Send a 'sev' to wake the secondary core from WFE.
197-
* Drain the outstanding writes to memory
198-
*/
199-
dsb_sev();
200-
mb();
201-
}
202-
203167
/*
204168
* Initialise the CPU possible map early - this describes the CPUs
205169
* which may be present or become present in the system.
@@ -235,14 +199,33 @@ static void __init omap4_smp_init_cpus(void)
235199

236200
static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
237201
{
202+
void *startup_addr = omap_secondary_startup;
203+
void __iomem *base = omap_get_wakeupgen_base();
238204

239205
/*
240206
* Initialise the SCU and wake up the secondary core using
241207
* wakeup_secondary().
242208
*/
243209
if (scu_base)
244210
scu_enable(scu_base);
245-
wakeup_secondary();
211+
212+
if (cpu_is_omap446x()) {
213+
startup_addr = omap_secondary_startup_4460;
214+
pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD;
215+
}
216+
217+
/*
218+
* Write the address of secondary startup routine into the
219+
* AuxCoreBoot1 where ROM code will jump and start executing
220+
* on secondary core once out of WFE
221+
* A barrier is added to ensure that write buffer is drained
222+
*/
223+
if (omap_secure_apis_support())
224+
omap_auxcoreboot_addr(virt_to_phys(startup_addr));
225+
else
226+
__raw_writel(virt_to_phys(omap5_secondary_startup),
227+
base + OMAP_AUX_CORE_BOOT_1);
228+
246229
}
247230

248231
struct smp_operations omap4_smp_ops __initdata = {

arch/arm/mach-omap2/omap4-common.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/of_platform.h>
2323
#include <linux/export.h>
2424
#include <linux/irqchip/arm-gic.h>
25+
#include <linux/of_address.h>
2526

2627
#include <asm/hardware/cache-l2x0.h>
2728
#include <asm/mach/map.h>
@@ -258,6 +259,21 @@ omap_early_initcall(omap4_sar_ram_init);
258259

259260
void __init omap_gic_of_init(void)
260261
{
262+
struct device_node *np;
263+
264+
/* Extract GIC distributor and TWD bases for OMAP4460 ROM Errata WA */
265+
if (!cpu_is_omap446x())
266+
goto skip_errata_init;
267+
268+
np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
269+
gic_dist_base_addr = of_iomap(np, 0);
270+
WARN_ON(!gic_dist_base_addr);
271+
272+
np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
273+
twd_base = of_iomap(np, 0);
274+
WARN_ON(!twd_base);
275+
276+
skip_errata_init:
261277
omap_wakeupgen_init();
262278
irqchip_init();
263279
}

arch/arm/mach-omap2/omap4-sar-layout.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
#define SAR_BANK4_OFFSET0x3000
2121

2222
/* Scratch pad memory offsets from SAR_BANK1 */
23-
#define SCU_OFFSET00xd00
24-
#define SCU_OFFSET10xd04
25-
#define OMAP_TYPE_OFFSET0xd10
26-
#define L2X0_SAVE_OFFSET00xd14
27-
#define L2X0_SAVE_OFFSET10xd18
28-
#define L2X0_AUXCTRL_OFFSET0xd1c
29-
#define L2X0_PREFETCH_CTRL_OFFSET0xd20
23+
#define SCU_OFFSET00xfe4
24+
#define SCU_OFFSET10xfe8
25+
#define OMAP_TYPE_OFFSET0xfec
26+
#define L2X0_SAVE_OFFSET00xff0
27+
#define L2X0_SAVE_OFFSET10xff4
28+
#define L2X0_AUXCTRL_OFFSET0xff8
29+
#define L2X0_PREFETCH_CTRL_OFFSET0xffc
3030

3131
/* CPUx Wakeup Non-Secure Physical Address offsets in SAR_BANK3 */
3232
#define CPU0_WAKEUP_NS_PA_ADDR_OFFSET0xa04

arch/arm/mach-omap2/pm24xx.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,17 @@ static int omap2_can_sleep(void)
200200

201201
static void omap2_pm_idle(void)
202202
{
203-
local_fiq_disable();
204-
205203
if (!omap2_can_sleep()) {
206204
if (omap_irq_pending())
207-
goto out;
205+
return;
208206
omap2_enter_mpu_retention();
209-
goto out;
207+
return;
210208
}
211209

212210
if (omap_irq_pending())
213-
goto out;
211+
return;
214212

215213
omap2_enter_full_retention();
216-
217-
out:
218-
local_fiq_enable();
219214
}
220215

221216
static void __init prcm_setup_regs(void)

arch/arm/mach-omap2/pm34xx.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,19 +346,14 @@ void omap_sram_idle(void)
346346

347347
static void omap3_pm_idle(void)
348348
{
349-
local_fiq_disable();
350-
351349
if (omap_irq_pending())
352-
goto out;
350+
return;
353351

354352
trace_cpu_idle(1, smp_processor_id());
355353

356354
omap_sram_idle();
357355

358356
trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
359-
360-
out:
361-
local_fiq_enable();
362357
}
363358

364359
#ifdef CONFIG_SUSPEND
@@ -757,14 +752,12 @@ int __init omap3_pm_init(void)
757752
pr_err("Memory allocation failed when allocating for secure sram context\n");
758753

759754
local_irq_disable();
760-
local_fiq_disable();
761755

762756
omap_dma_global_context_save();
763757
omap3_save_secure_ram_context();
764758
omap_dma_global_context_restore();
765759

766760
local_irq_enable();
767-
local_fiq_enable();
768761
}
769762

770763
omap3_save_scratchpad_contents();

arch/arm/mach-omap2/pm44xx.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
131131
*/
132132
static void omap_default_idle(void)
133133
{
134-
local_fiq_disable();
135-
136134
omap_do_wfi();
137-
138-
local_fiq_enable();
139135
}
140136

141137
/**
@@ -147,8 +143,8 @@ static void omap_default_idle(void)
147143
int __init omap4_pm_init(void)
148144
{
149145
int ret;
150-
struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm, *l4wkup;
151-
struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm;
146+
struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm;
147+
struct clockdomain *ducati_clkdm, *l3_2_clkdm;
152148

153149
if (omap_rev() == OMAP4430_REV_ES1_0) {
154150
WARN(1, "Power Management not supported on OMAP4430 ES1.0\n");
@@ -175,27 +171,19 @@ int __init omap4_pm_init(void)
175171
* MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as
176172
* expected. The hardware recommendation is to enable static
177173
* dependencies for these to avoid system lock ups or random crashes.
178-
* The L4 wakeup depedency is added to workaround the OCP sync hardware
179-
* BUG with 32K synctimer which lead to incorrect timer value read
180-
* from the 32K counter. The BUG applies for GPTIMER1 and WDT2 which
181-
* are part of L4 wakeup clockdomain.
182174
*/
183175
mpuss_clkdm = clkdm_lookup("mpuss_clkdm");
184176
emif_clkdm = clkdm_lookup("l3_emif_clkdm");
185177
l3_1_clkdm = clkdm_lookup("l3_1_clkdm");
186178
l3_2_clkdm = clkdm_lookup("l3_2_clkdm");
187-
l4_per_clkdm = clkdm_lookup("l4_per_clkdm");
188-
l4wkup = clkdm_lookup("l4_wkup_clkdm");
189179
ducati_clkdm = clkdm_lookup("ducati_clkdm");
190-
if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) || (!l4wkup) ||
191-
(!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm))
180+
if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) ||
181+
(!l3_2_clkdm) || (!ducati_clkdm))
192182
goto err2;
193183

194184
ret = clkdm_add_wkdep(mpuss_clkdm, emif_clkdm);
195185
ret |= clkdm_add_wkdep(mpuss_clkdm, l3_1_clkdm);
196186
ret |= clkdm_add_wkdep(mpuss_clkdm, l3_2_clkdm);
197-
ret |= clkdm_add_wkdep(mpuss_clkdm, l4_per_clkdm);
198-
ret |= clkdm_add_wkdep(mpuss_clkdm, l4wkup);
199187
ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm);
200188
ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm);
201189
if (ret) {

0 commit comments

Comments
 (0)