linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: John Rigby <jrigby@freescale.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH add immr alias 1/4] powerpc: Teach get_immrbase to use immr alias if it exists.
Date: Tue,  5 Aug 2008 14:13:37 -0600	[thread overview]
Message-ID: <1217967220-30557-1-git-send-email-jrigby@freescale.com> (raw)

This will allow the eventual removal of device_type = "soc"
properties in soc nodes.

Signed-off-by: John Rigby <jrigby@freescale.com>
---
 arch/powerpc/sysdev/fsl_soc.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 214388e..2643395 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -45,14 +45,35 @@ extern void init_fec_ioports(struct fs_platform_info*);
 extern void init_smc_ioports(struct fs_uart_platform_info*);
 static phys_addr_t immrbase = -1;
 
+/* 
+ * Some chips call this immr some ccsr, we
+ * use the term immr for both.
+ */
 phys_addr_t get_immrbase(void)
 {
-	struct device_node *soc;
+	struct device_node *soc = NULL;
+	struct device_node *np;
+	const char *path;
+
 
 	if (immrbase != -1)
 		return immrbase;
 
-	soc = of_find_node_by_type(NULL, "soc");
+	/*
+	 * First look for an immr alias
+	 */
+	np = of_find_node_by_name(NULL, "/aliases");
+	if (np) {
+		path = of_get_property(np, "immr", NULL);
+		if (path)
+			soc = of_find_node_by_name(NULL, path);
+	}
+	/*
+	 * If no immr alias then fall back to finding
+	 * it by device_type
+	 */
+	if (!soc)
+		soc = of_find_node_by_type(NULL, "soc");
 	if (soc) {
 		int size;
 		u32 naddr;
-- 

             reply	other threads:[~2008-08-05 20:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 20:13 John Rigby [this message]
2008-08-05 20:13 ` [PATCH add immr alias 2/4] powerpc: 5121: Add immr alias to MPC5121 ADS device tree John Rigby
2008-08-05 20:13   ` [PATCH add immr alias 3/4] powerpc: 83xx: Add immr aliases to 83xx device trees John Rigby
2008-08-05 20:13     ` [PATCH add immr alias 4/4] powerpc: 8[56]xx: Add immr aliases to 8[56]xx " John Rigby
2008-08-05 21:05   ` [PATCH add immr alias 2/4] powerpc: 5121: Add immr alias to MPC5121 ADS device tree Grant Likely
2008-08-05 21:05     ` Grant Likely
2008-08-05 21:17       ` John Rigby
2008-08-05 21:20         ` Scott Wood
2008-08-05 21:38           ` John Rigby
2008-08-05 21:08     ` Scott Wood
2008-08-05 21:12       ` Grant Likely
2008-08-05 21:19         ` Scott Wood
2008-08-05 23:46           ` Anton Vorontsov
2008-08-05 20:43 ` [PATCH add immr alias 1/4] powerpc: Teach get_immrbase to use immr alias if it exists Arnd Bergmann
2008-08-05 20:49   ` Scott Wood
2008-08-05 20:50     ` Kumar Gala
2008-08-05 21:08     ` Grant Likely
2008-08-06  3:41 ` Stephen Rothwell

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=1217967220-30557-1-git-send-email-jrigby@freescale.com \
    --to=jrigby@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    /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;
as well as URLs for NNTP newsgroup(s).