public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kumar Gala <galak@kernel.crashing.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] 85xx: Add support for 'cpu disable' command
Date: Tue, 12 Jan 2010 13:03:30 -0600	[thread overview]
Message-ID: <1263323010-30799-3-git-send-email-galak@kernel.crashing.org> (raw)
In-Reply-To: <1263323010-30799-2-git-send-email-galak@kernel.crashing.org>

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

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 cpu/mpc85xx/mp.c |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/cpu/mpc85xx/mp.c b/cpu/mpc85xx/mp.c
index 6ae7f0a..73c7f87 100644
--- a/cpu/mpc85xx/mp.c
+++ b/cpu/mpc85xx/mp.c
@@ -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, 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,
-- 
1.6.0.6

  reply	other threads:[~2010-01-12 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-12 19:03 [U-Boot] [PATCH 1/3] Add support to disable cpu's in multicore processors Kumar Gala
2010-01-12 19:03 ` [U-Boot] [PATCH 2/3] 86xx: Add support for 'cpu disable' command Kumar Gala
2010-01-12 19:03   ` Kumar Gala [this message]
2010-01-12 19:16     ` [U-Boot] [PATCH 3/3] 85xx: " Peter Tyser
2010-01-12 19:36       ` Kumar Gala
2010-01-19 19:19 ` [U-Boot] [PATCH 1/3] Add support to disable cpu's in multicore processors Kumar Gala
2010-01-25 21:25   ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263323010-30799-3-git-send-email-galak@kernel.crashing.org \
    --to=galak@kernel.crashing.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox