grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Claim on IEEE1275


From: Hollis Blanchard
Subject: Re: Claim on IEEE1275
Date: Sun, 2 Jan 2005 12:29:15 -0600
User-agent: Mutt/1.5.6+20040907i

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  <address@hidden>
        * 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;
 
 
+
+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;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]