Skip to contentSkip to conversation

85xx: Add support for 'cpu disable' command

PATCH New Kumar Gala 1 participant 1 message Jan 12, 2010

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH v2 3/3 85xx: Add support for 'cpu disable' command

Support disabling of a core via user command 'cpu disable'.

---
* Fixed the FSL_CORENET case to be setbits_be32(..., 1 << nr) instead of (..., nr), pointed out by Peter T.

- k

 cpu/mpc85xx/mp.c |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)
cpu/mpc85xx/mp.c +26 -2
index 6ae7f0a..3ac4e14 100644
@@ -68,11 +68,35 @@ int cpu_status(int nr)
 	return 0;
 }
 
+#ifdef CONFIG_FSL_CORENET
 int cpu_disable(int nr)
 {
-	/* dummy function so common/cmd_mp.c will build */
-	return 1;
+	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+	setbits_be32(&gur->coredisrl, 1 << nr);
+
+	return 0;
 }
+#else
+int cpu_disable(int nr)
+{
+	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+
+	switch (nr) {
+	case 0:
+		setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_CPU0);
+		break;
+	case 1:
+		setbits_be32(&gur->devdisr, MPC85xx_DEVDISR_CPU1);
+		break;
+	default:
+		printf("Invalid cpu number for disable %d\n", nr);
+		return 1;
+	}
+	
+	return 0;
+}
+#endif
 
 static u8 boot_entry_map[4] = {
 	0,
Signature · 1 line
1.6.0.6