[PATCH] Fix zImage boot on old Pegasos firmware

DORMANTno replies

From: David Woodhouse <dwmw2@infradead.org>
Date: 2005-11-17 15:24:39
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

If a claim fails, the Pegasos firmware pretends it never even made it
into the prom, rather than indicating that it tried and failed.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/arch/powerpc/boot/prom.c b/arch/powerpc/boot/prom.c
index 4bea2f4..e8a6304 100644
--- a/arch/powerpc/boot/prom.c
+++ b/arch/powerpc/boot/prom.c
@@ -116,6 +116,7 @@ finddevice(const char *name)
 void *
 claim(unsigned long virt, unsigned long size, unsigned long align)
 {
+	int ret;
 	struct prom_args {
 		char *service;
 		int nargs;
@@ -132,7 +133,11 @@ claim(unsigned long virt, unsigned long 
 	args.virt = virt;
 	args.size = size;
 	args.align = align;
-	(*prom)(&args);
+	ret = (*prom)(&args);
+	/* The original Pegasos II firmware claims that the call never made 
+	   it into the prom, rather than returning failure correctly */
+	if (ret)
+		return (void *)-1;
 	return args.ret;
 }
 
-- 
dwmw2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help