Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2017 19:40:17 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323684 - head/sys/powerpc/powerpc
Message-ID:  <201709171940.v8HJeHmQ018020@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Sun Sep 17 19:40:17 2017
New Revision: 323684
URL: https://svnweb.freebsd.org/changeset/base/323684

Log:
  Print the correct bitmask for the running Book-E CPU
  
  All the Book-E world is no longer e500v{1,2}.  e500mc the 64-bit derivatives do
  not use the DOZE/NAP bits with MSR[WE], instead using the `wait' instruction to
  wait for interrupts, and SoC plane controls (via CCSR) for power management.
  
  MFC after:	1 week

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

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Sun Sep 17 19:14:38 2017	(r323683)
+++ head/sys/powerpc/powerpc/cpu.c	Sun Sep 17 19:40:17 2017	(r323684)
@@ -530,16 +530,32 @@ cpu_booke_setup(int cpuid, uint16_t vers)
 {
 #ifdef BOOKE_E500
 	register_t hid0;
+	const char *bitmask;
 
 	hid0 = mfspr(SPR_HID0);
 
-	/* Programe power-management mode. */
-	hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
-	hid0 |= HID0_DOZE;
+	switch (vers) {
+	case FSL_E500mc:
+		bitmask = HID0_E500MC_BITMASK;
+		break;
+	case FSL_E5500:
+	case FSL_E6500:
+		bitmask = HID0_E5500_BITMASK;
+		break;
+	case FSL_E500v1:
+	case FSL_E500v2:
+		/* Only e500v1/v2 support HID0 power management setup. */
 
-	mtspr(SPR_HID0, hid0);
+		/* Programe power-management mode. */
+		hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP);
+		hid0 |= HID0_DOZE;
 
-	printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK);
+		mtspr(SPR_HID0, hid0);
+	default:
+		bitmask = HID0_E500_BITMASK;
+		break;
+	}
+	printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, bitmask);
 #endif
 
 	if (cpu_idle_hook == NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709171940.v8HJeHmQ018020>