[PATCH] ppc64: linux,rtas* fixes

Anton Blanchard anton at samba.org
Fri Nov 19 18:32:11 EST 2004


Move the linux,rtas* properties into the /rtas node and make them 32bit.
Use rtas-size and avoid duplicating it in linux,rtas-size.

Signed-off-by: Anton Blanchard <anton at samba.org>

diff -puN arch/ppc64/kernel/prom_init.c~ppc64:linux.rtas_fixes.patch?id=432 arch/ppc64/kernel/prom_init.c
--- gr_base2/arch/ppc64/kernel/prom_init.c~ppc64:linux.rtas_fixes.patch?id=432	2004-11-14 16:01:43.138791178 -0600
+++ gr_base2-anton/arch/ppc64/kernel/prom_init.c	2004-11-16 00:44:16.371850845 -0600
@@ -701,9 +701,9 @@ static void __init prom_instantiate_rtas
 {
 	unsigned long offset = reloc_offset();
 	struct prom_t *_prom = PTRRELOC(&prom);
-	phandle prom_rtas;
-	u64 base, entry = 0;
-        u32 size = 0;
+	phandle prom_rtas, rtas_node;
+	u32 base, entry = 0;
+	u32 size = 0;
 
 	prom_debug("prom_instantiate_rtas: start...\n");
 
@@ -723,12 +723,12 @@ static void __init prom_instantiate_rtas
 	}
 	prom_printf("instantiating rtas at 0x%x", base);
 
-	prom_rtas = call_prom("open", 1, 1, ADDR("/rtas"));
+	rtas_node = call_prom("open", 1, 1, ADDR("/rtas"));
 	prom_printf("...");
 
 	if (call_prom("call-method", 3, 2,
 		      ADDR("instantiate-rtas"),
-		      prom_rtas, base) != PROM_ERROR) {
+		      rtas_node, base) != PROM_ERROR) {
 		entry = (long)_prom->args.rets[1];
 	}
 	if (entry == 0) {
@@ -739,9 +739,8 @@ static void __init prom_instantiate_rtas
 
 	reserve_mem(base, size);
 
-	prom_setprop(_prom->chosen, "linux,rtas-base", &base, sizeof(base));
-	prom_setprop(_prom->chosen, "linux,rtas-entry", &entry, sizeof(entry));
-	prom_setprop(_prom->chosen, "linux,rtas-size", &size, sizeof(size));
+	prom_setprop(prom_rtas, "linux,rtas-base", &base, sizeof(base));
+	prom_setprop(prom_rtas, "linux,rtas-entry", &entry, sizeof(entry));
 
 	prom_debug("rtas base     = 0x%x\n", base);
 	prom_debug("rtas entry    = 0x%x\n", entry);
diff -puN arch/ppc64/kernel/rtas.c~ppc64:linux.rtas_fixes.patch?id=432 arch/ppc64/kernel/rtas.c
--- gr_base2/arch/ppc64/kernel/rtas.c~ppc64:linux.rtas_fixes.patch?id=432	2004-11-14 16:01:43.144790340 -0600
+++ gr_base2-anton/arch/ppc64/kernel/rtas.c	2004-11-14 16:01:43.159788246 -0600
@@ -573,15 +573,15 @@ void __init rtas_initialize(void)
 	 */
 	rtas.dev = of_find_node_by_name(NULL, "rtas");
 	if (rtas.dev) {
-		u64 *basep, *entryp;
+		u32 *basep, *entryp;
 		u32 *sizep;
 
-		basep = (u64 *)get_property(of_chosen, "linux,rtas-base", NULL);
-		sizep = (u32 *)get_property(of_chosen, "linux,rtas-size", NULL);
+		basep = (u32 *)get_property(rtas.dev, "linux,rtas-base", NULL);
+		sizep = (u32 *)get_property(rtas.dev, "rtas-size", NULL);
 		if (basep != NULL && sizep != NULL) {
 			rtas.base = *basep;
 			rtas.size = *sizep;
-			entryp = (u64 *)get_property(of_chosen, "linux,rtas-entry", NULL);
+			entryp = (u32 *)get_property(rtas.dev, "linux,rtas-entry", NULL);
 			if (entryp == NULL) /* Ugh */
 				rtas.entry = rtas.base;
 			else
_



More information about the Linuxppc64-dev mailing list