Date: Sun, 24 Feb 2019 20:49:17 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r344498 - stable/12/sys/powerpc/powerpc Message-ID: <201902242049.x1OKnHg0031117@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Sun Feb 24 20:49:16 2019 New Revision: 344498 URL: https://svnweb.freebsd.org/changeset/base/344498 Log: MFC r343763, r343944, r343946 r343763: powerpc: Don't idle with the wait instruction on booke r343944: powerpc: Split out the e500mc idling from rest of Book-E r343946: powerpc: Fix AIM build Modified: stable/12/sys/powerpc/powerpc/cpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/12/sys/powerpc/powerpc/cpu.c Sun Feb 24 20:29:11 2019 (r344497) +++ stable/12/sys/powerpc/powerpc/cpu.c Sun Feb 24 20:49:16 2019 (r344498) @@ -89,6 +89,9 @@ int powerpc_pow_enabled; void (*cpu_idle_hook)(sbintime_t) = NULL; static void cpu_idle_60x(sbintime_t); static void cpu_idle_booke(sbintime_t); +#ifdef BOOKE_E500 +static void cpu_idle_e500mc(sbintime_t sbt); +#endif #if defined(__powerpc64__) && defined(AIM) static void cpu_idle_powerx(sbintime_t); static void cpu_idle_power9(sbintime_t); @@ -585,10 +588,12 @@ cpu_booke_setup(int cpuid, uint16_t vers) switch (vers) { case FSL_E500mc: bitmask = HID0_E500MC_BITMASK; + cpu_idle_hook = cpu_idle_e500mc; break; case FSL_E5500: case FSL_E6500: bitmask = HID0_E5500_BITMASK; + cpu_idle_hook = cpu_idle_e500mc; break; case FSL_E500v1: case FSL_E500v2: @@ -753,31 +758,28 @@ cpu_idle_60x(sbintime_t sbt) #endif } +#ifdef BOOKE_E500 static void +cpu_idle_e500mc(sbintime_t sbt) +{ + /* + * Base binutils doesn't know what the 'wait' instruction is, so + * use the opcode encoding here. + */ + __asm __volatile(".long 0x7c00007c"); +} +#endif + +static void cpu_idle_booke(sbintime_t sbt) { register_t msr; - uint16_t vers; msr = mfmsr(); - vers = mfpvr() >> 16; -#ifdef BOOKE - switch (vers) { - case FSL_E500mc: - case FSL_E5500: - case FSL_E6500: - /* - * Base binutils doesn't know what the 'wait' instruction is, so - * use the opcode encoding here. - */ - __asm __volatile(".long 0x7c00007c"); - break; - default: - powerpc_sync(); - mtmsr(msr | PSL_WE); - break; - } +#ifdef BOOKE_E500 + powerpc_sync(); + mtmsr(msr | PSL_WE); #endif }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902242049.x1OKnHg0031117>