Thread (15 messages) 15 messages, 7 authors, 2008-08-06
STALE6515d

[PATCH add immr alias 1/4] powerpc: Teach get_immrbase to use immr alias if it exists.

From: John Rigby <hidden>
Date: 2008-08-05 20:13:46
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

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

Signed-off-by: John Rigby <redacted>
---
 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;
-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help