Author: jhibbits
Date: Sat Feb  9 21:19:53 2019
New Revision: 343944
URL: https://svnweb.freebsd.org/changeset/base/343944

Log:
  powerpc: Split out the e500mc idling from rest of Book-E
  
  The e500v2 and e500mc (and derivatives) have different idling procedures, so
  make them different functions.
  
  MFC after:    2 weeks

Modified:
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c      Sat Feb  9 21:08:19 2019        
(r343943)
+++ head/sys/powerpc/powerpc/cpu.c      Sat Feb  9 21:19:53 2019        
(r343944)
@@ -89,6 +89,7 @@ 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);
+static void    cpu_idle_e500mc(sbintime_t sbt);
 #if defined(__powerpc64__) && defined(AIM)
 static void    cpu_idle_powerx(sbintime_t);
 static void    cpu_idle_power9(sbintime_t);
@@ -585,10 +586,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:
@@ -754,25 +757,25 @@ cpu_idle_60x(sbintime_t sbt)
 }
 
 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");
+}
+
+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:
-               break;
-       default:
-               powerpc_sync();
-               mtmsr(msr | PSL_WE);
-               break;
-       }
+#ifdef BOOKE_E500
+       powerpc_sync();
+       mtmsr(msr | PSL_WE);
 #endif
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to