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
This commit is contained in:
jhibbits 2019-02-09 21:19:53 +00:00
parent b673a11d47
commit 9745f424d1

View File

@ -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:
@ -753,26 +756,26 @@ cpu_idle_60x(sbintime_t sbt)
#endif
}
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:
#ifdef BOOKE_E500
powerpc_sync();
mtmsr(msr | PSL_WE);
break;
}
#endif
}