From: Hollis Blanchard <hollis@penguinppc.org>
To: grub-devel@gnu.org
Subject: Re: Claim on IEEE1275
Date: Sun, 2 Jan 2005 12:29:15 -0600 [thread overview]
Message-ID: <20050102182915.GA27227@miracle> (raw)
This patch implements the idea I described: only use "map" in virtual
mode, and report errors instead of treating them as fatal. It fixes
Linux loading on briQ (and most likely Pegasos). May I check it in?
2005-01-02 Hollis Blanchard <hollis@penguinppc.org>
* boot/powerpc/ieee1275/cmain.c (grub_ieee1275_realmode): New
variable.
(find_options): New function.
(cmain): Call find_options.
* include/grub/powerpc/ieee1275/ieee1275.h
(grub_ieee1275_realmode): New extern.
* kern/powerpc/ieee1275/openfw.c (grub_claimmap): Only call
grub_map if grub_ieee1275_realmode is false. Print map failures,
but return success.
Index: boot/powerpc/ieee1275/cmain.c
===================================================================
RCS file: /cvsroot/grub/grub2/boot/powerpc/ieee1275/cmain.c,v
retrieving revision 1.5
diff -u -p -r1.5 cmain.c
--- boot/powerpc/ieee1275/cmain.c 27 Dec 2004 13:46:20 -0000 1.5
+++ boot/powerpc/ieee1275/cmain.c 2 Jan 2005 17:40:57 -0000
@@ -37,8 +37,21 @@ struct module_info
intptr_t (*grub_ieee1275_entry_fn) (void *);
grub_uint32_t grub_ieee1275_flags;
+int grub_ieee1275_realmode;
\f
+
+static void
+find_options (void)
+{
+ grub_ieee1275_phandle_t options;
+
+ grub_ieee1275_finddevice ("/options", &options);
+
+ grub_ieee1275_get_property (options, "real-mode?", &grub_ieee1275_realmode,
+ sizeof (grub_ieee1275_realmode), 0);
+}
+
/* Setup the argument vector and pass control over to the main
function. */
void
@@ -72,6 +85,8 @@ cmain (uint32_t r3, uint32_t r4 __attrib
grub_ieee1275_entry_fn = (intptr_t (*)(void *)) r5;
}
+ find_options ();
+
/* If any argument was passed to the kernel (us), they are
put in the bootargs property of /chosen. The string can
be null (just the nul-character), so check that the size
Index: include/grub/powerpc/ieee1275/ieee1275.h
===================================================================
RCS file: /cvsroot/grub/grub2/include/grub/powerpc/ieee1275/ieee1275.h,v
retrieving revision 1.10
diff -u -p -r1.10 ieee1275.h
--- include/grub/powerpc/ieee1275/ieee1275.h 27 Dec 2004 13:46:20 -0000 1.10
+++ include/grub/powerpc/ieee1275/ieee1275.h 2 Jan 2005 17:40:58 -0000
@@ -66,6 +66,7 @@ typedef intptr_t grub_ieee1275_phandle_t
extern intptr_t (*grub_ieee1275_entry_fn) (void *);
extern grub_uint32_t grub_ieee1275_flags;
+extern int grub_ieee1275_realmode;
/* Old World firmware fails seek when "dev:0" is opened. */
#define GRUB_IEEE1275_NO_PARTITION_0 0x1
Index: kern/powerpc/ieee1275/openfw.c
===================================================================
RCS file: /cvsroot/grub/grub2/kern/powerpc/ieee1275/openfw.c,v
retrieving revision 1.6
diff -u -p -r1.6 openfw.c
--- kern/powerpc/ieee1275/openfw.c 27 Dec 2004 13:46:20 -0000 1.6
+++ kern/powerpc/ieee1275/openfw.c 2 Jan 2005 17:40:58 -0000
@@ -189,10 +189,9 @@ grub_claimmap (grub_addr_t addr, grub_si
{
if (grub_ieee1275_claim (addr, size, 0, 0))
return -1;
- if (grub_map (addr, addr, size, 0x00))
- {
- grub_ieee1275_release (addr, size);
- return -1;
- }
+
+ if ((! grub_ieee1275_realmode) && grub_map (addr, addr, size, 0x00))
+ grub_printf ("map failed: address 0x%x, size 0x%x\n", addr, size);
+
return 0;
}
next reply other threads:[~2005-01-02 19:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-02 18:29 Hollis Blanchard [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-12-28 23:02 Claim on IEEE1275 Marco Gerards
2004-12-29 5:40 ` Hollis Blanchard
2004-12-29 11:20 ` Marco Gerards
2004-12-29 17:11 ` Hollis Blanchard
2004-12-29 17:36 ` Marco Gerards
2004-12-29 21:28 ` Hollis Blanchard
2005-01-01 20:49 ` Hollis Blanchard
2005-01-02 1:36 ` Hollis Blanchard
2005-01-02 13:40 ` Marco Gerards
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=20050102182915.GA27227@miracle \
--to=hollis@penguinppc.org \
--cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.