~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-imx/hotplug.c

Version: ~ [ linux-5.8-rc4 ] ~ [ linux-5.7.7 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.50 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.131 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.187 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.229 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.229 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright 2011 Freescale Semiconductor, Inc.
  3  * Copyright 2011 Linaro Ltd.
  4  *
  5  * The code contained herein is licensed under the GNU General Public
  6  * License. You may obtain a copy of the GNU General Public License
  7  * Version 2 or later at the following locations:
  8  *
  9  * http://www.opensource.org/licenses/gpl-license.html
 10  * http://www.gnu.org/copyleft/gpl.html
 11  */
 12 
 13 #include <linux/errno.h>
 14 #include <linux/jiffies.h>
 15 #include <asm/cp15.h>
 16 #include <asm/proc-fns.h>
 17 
 18 #include "common.h"
 19 
 20 static inline void cpu_enter_lowpower(void)
 21 {
 22         unsigned int v;
 23 
 24         asm volatile(
 25                 "mcr    p15, 0, %1, c7, c5, 0\n"
 26         "       mcr     p15, 0, %1, c7, c10, 4\n"
 27         /*
 28          * Turn off coherency
 29          */
 30         "       mrc     p15, 0, %0, c1, c0, 1\n"
 31         "       bic     %0, %0, %3\n"
 32         "       mcr     p15, 0, %0, c1, c0, 1\n"
 33         "       mrc     p15, 0, %0, c1, c0, 0\n"
 34         "       bic     %0, %0, %2\n"
 35         "       mcr     p15, 0, %0, c1, c0, 0\n"
 36           : "=&r" (v)
 37           : "r" (0), "Ir" (CR_C), "Ir" (0x40)
 38           : "cc");
 39 }
 40 
 41 /*
 42  * platform-specific code to shutdown a CPU
 43  *
 44  * Called with IRQs disabled
 45  */
 46 void imx_cpu_die(unsigned int cpu)
 47 {
 48         cpu_enter_lowpower();
 49         /*
 50          * We use the cpu jumping argument register to sync with
 51          * imx_cpu_kill() which is running on cpu0 and waiting for
 52          * the register being cleared to kill the cpu.
 53          */
 54         imx_set_cpu_arg(cpu, ~0);
 55         cpu_do_idle();
 56 }
 57 
 58 int imx_cpu_kill(unsigned int cpu)
 59 {
 60         unsigned long timeout = jiffies + msecs_to_jiffies(50);
 61 
 62         while (imx_get_cpu_arg(cpu) == 0)
 63                 if (time_after(jiffies, timeout))
 64                         return 0;
 65         imx_enable_cpu(cpu, false);
 66         imx_set_cpu_arg(cpu, 0);
 67         return 1;
 68 }
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp