linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH add immr alias 1/4] powerpc: Teach get_immrbase to use immr alias if it exists.
@ 2008-08-05 20:13 John Rigby
  2008-08-05 20:13 ` [PATCH add immr alias 2/4] powerpc: 5121: Add immr alias to MPC5121 ADS device tree John Rigby
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: John Rigby @ 2008-08-05 20:13 UTC (permalink / raw)
  To: linuxppc-dev

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;
-- 

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-08-06  3:41 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-05 20:13 [PATCH add immr alias 1/4] powerpc: Teach get_immrbase to use immr alias if it exists John Rigby
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

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).