2 * sh7372 lowlevel sleep code for "Core Standby Mode"
4 * Copyright (C) 2011 Magnus Damm
6 * In "Core Standby Mode" the ARM core is off, but L2 cache is still on
8 * Based on mach-omap2/sleep34xx.S
10 * (C) Copyright 2007 Texas Instruments
11 * Karthik Dasu <karthik-dp@ti.com>
13 * (C) Copyright 2004 Texas Instruments, <www.ti.com>
14 * Richard Woodruff <r-woodruff2@ti.com>
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 #include <linux/linkage.h>
33 #include <linux/init.h>
34 #include <asm/memory.h>
35 #include <asm/assembler.h>
37 #if defined(CONFIG_SUSPEND) || defined(CONFIG_CPU_IDLE)
40 .global sh7372_resume_core_standby_a3sm
41 sh7372_resume_core_standby_a3sm:
43 1: .long cpu_resume - PAGE_OFFSET + PLAT_PHYS_OFFSET
45 .global sh7372_do_idle_a3sm
48 * Clear the SCTLR.C bit to prevent further data cache
49 * allocation. Clearing SCTLR.C would make all the data accesses
50 * strongly ordered and would not hit the cache.
52 mrc p15, 0, r0, c1, c0, 0
53 bic r0, r0, #(1 << 2) @ Disable the C bit
54 mcr p15, 0, r0, c1, c0, 0
57 /* disable L2 cache in the aux control register */
58 mrc p15, 0, r10, c1, c0, 1
60 mcr p15, 0, r10, c1, c0, 1
63 * Invalidate data cache again.
68 * The kernel doesn't interwork: v7_flush_dcache_all in particluar will
69 * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled.
70 * This sequence switches back to ARM. Note that .align may insert a
71 * nop: bx pc needs to be word-aligned in order to work.
79 /* Data memory barrier and Data sync barrier */
83 #define SPDCR 0xe6180008
84 #define A3SM (1 << 12)
94 .word v7_flush_dcache_all