All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Claim on IEEE1275
@ 2005-01-02 18:29 Hollis Blanchard
  0 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2005-01-02 18:29 UTC (permalink / raw)
  To: grub-devel

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;
 }



^ permalink raw reply	[flat|nested] 10+ messages in thread
* Claim on IEEE1275
@ 2004-12-28 23:02 Marco Gerards
  2004-12-29  5:40 ` Hollis Blanchard
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Gerards @ 2004-12-28 23:02 UTC (permalink / raw)
  To: grub-devel

Hi,

Some minutes ago I have committed a patch that removes the stack
initialization code.  This seems to work perfectly fine for both the
PegasosII and the newworld mac.  This was required for loading linux
on the PegasosII.  Without this change linux crashed when decompressing
itself.  It's ok for me to restore this code when the problem is
found.  But at the moment this seems like a fine fix.

Only one problem remains for loading linux on the PegasosII.  The
grub_claimmap call fails because the map fails.  I think this is
because the firmware already maps the memory.

Hollis, is the map call really required?  We can better go back to
using grub_ieee1275_claim if it is not.  If it is required, do you
have an idea of how to detect this?

Thanks,
Marco





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-01-02 19:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-02 18:29 Claim on IEEE1275 Hollis Blanchard
  -- strict thread matches above, loose matches on Subject: below --
2004-12-28 23:02 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

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.