LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix zImage boot on old Pegasos firmware
@ 2005-11-17 15:24 David Woodhouse
  0 siblings, 0 replies; only message in thread
From: David Woodhouse @ 2005-11-17 15:24 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-dev

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-17 15:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-17 15:24 [PATCH] Fix zImage boot on old Pegasos firmware David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox