LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] Fix zImage boot on old Pegasos firmware
Date: Thu, 17 Nov 2005 15:24:29 +0000	[thread overview]
Message-ID: <1132241069.28963.169.camel@baythorne.infradead.org> (raw)

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

                 reply	other threads:[~2005-11-17 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1132241069.28963.169.camel@baythorne.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox