Skip to contentSkip to conversation

Fix zImage boot on old Pegasos firmware

PATCH New David Woodhouse 1 participant 1 message Nov 17, 2005 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix zImage boot on old Pegasos firmware

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

arch/powerpc/boot/prom.c +6 -1
index 4bea2f4..e8a6304 100644
@@ -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;
 }
 
Signature · 1 line
dwmw2