diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-01-01 02:47:40 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-01-01 02:47:40 +0000 |
commit | e13a7f7a36d05e1e0c6d72b3d0c4cd76bf28ffb1 (patch) | |
tree | b6d22b953c5f3ecd118777f5ad688cc08248ddef /sys/powerpc/powerpc | |
parent | b8e70bf7efef670381034d0f5a8ded060def0121 (diff) | |
download | FreeBSD-src-e13a7f7a36d05e1e0c6d72b3d0c4cd76bf28ffb1.zip FreeBSD-src-e13a7f7a36d05e1e0c6d72b3d0c4cd76bf28ffb1.tar.gz |
Extend idle support for newer Book-E cores.
Newer Book-E cores (e500mc, e5500, e6500) do not support the WE bit in the MSR,
and instead delegate CPU idling to the SoC.
Perhaps in the future the QORIQ_DPAA option for the mpc85xx platform will become
a subclass, which will eliminate most of the #ifdef's.
Diffstat (limited to 'sys/powerpc/powerpc')
-rw-r--r-- | sys/powerpc/powerpc/cpu.c | 13 | ||||
-rw-r--r-- | sys/powerpc/powerpc/platform.c | 14 | ||||
-rw-r--r-- | sys/powerpc/powerpc/platform_if.m | 24 |
3 files changed, 39 insertions, 12 deletions
diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index 43190ae..1d68531 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -607,12 +607,6 @@ cpu_idle(int busy) busy, curcpu); } -int -cpu_idle_wakeup(int cpu) -{ - return (0); -} - static void cpu_idle_60x(sbintime_t sbt) { @@ -651,14 +645,9 @@ cpu_idle_60x(sbintime_t sbt) static void cpu_idle_booke(sbintime_t sbt) { - register_t msr; - - msr = mfmsr(); #ifdef E500 - /* Freescale E500 core RM section 6.4.1. */ - __asm __volatile("msync; mtmsr %0; isync" :: - "r" (msr | PSL_WE)); + platform_cpu_idle(PCPU_GET(cpuid)); #endif } diff --git a/sys/powerpc/powerpc/platform.c b/sys/powerpc/powerpc/platform.c index 8168758..b29ad92 100644 --- a/sys/powerpc/powerpc/platform.c +++ b/sys/powerpc/powerpc/platform.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include <sys/lock.h> #include <sys/ktr.h> #include <sys/mutex.h> +#include <sys/proc.h> #include <sys/systm.h> #include <sys/smp.h> #include <sys/sysctl.h> @@ -252,6 +253,19 @@ cpu_reset() PLATFORM_RESET(plat_obj); } +int +cpu_idle_wakeup(int cpu) +{ + return (PLATFORM_IDLE_WAKEUP(plat_obj, cpu)); +} + +void +platform_cpu_idle(int cpu) +{ + + PLATFORM_IDLE(plat_obj, cpu); +} + /* * Platform install routines. Highest priority wins, using the same * algorithm as bus attachment. diff --git a/sys/powerpc/powerpc/platform_if.m b/sys/powerpc/powerpc/platform_if.m index dfa2be1..a562b32 100644 --- a/sys/powerpc/powerpc/platform_if.m +++ b/sys/powerpc/powerpc/platform_if.m @@ -84,6 +84,14 @@ CODE { { return; } + static void platform_null_idle(platform_t plat, int cpu) + { + return; + } + static int platform_null_idle_wakeup(platform_t plat, int cpu) + { + return (0); + } }; /** @@ -211,6 +219,22 @@ METHOD void reset { }; /** + * @brief Idle a CPU + */ +METHOD void idle { + platform_t _plat; + int _cpu; +} DEFAULT platform_null_idle; + +/** + * @brief Wake up an idle CPU + */ +METHOD int idle_wakeup { + platform_t _plat; + int _cpu; +} DEFAULT platform_null_idle_wakeup; + +/** * @brief Suspend the CPU */ METHOD void sleep { |