grub-devel
[Top][All Lists]
Advanced

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

Raspberry pi support


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Raspberry pi support
Date: Sun, 07 Apr 2013 19:20:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Based on Leif Lindholm's patches I could go to GRUB console on raspberry pi.
The biggest problem is that cache flushing is simply skipped. Another problem
is that due to different linux image format linux loader doesn't work. I didn't
test grub-install but fed GRUB to uboot using kermit.
Is there any advantage in building armv6 binary by default unless user overrides
through TARGET_CFLAGS?
Some of the fixes are to make tools work on amd64


=== modified file 'conf/Makefile.common'
--- conf/Makefile.common        2013-04-07 00:41:07 +0000
+++ conf/Makefile.common        2013-04-07 16:08:07 +0000
@@ -40,8 +40,7 @@
 if COND_arm
 # Image entry point always in ARM (A32) state - ensure proper functionality if
 # the rest is built for the Thumb (T32) state.
-  CFLAGS_PLATFORM += -mthumb-interwork -mno-unaligned-access -mlong-calls
-  CCASFLAGS_PLATFORM = -Wa,-mimplicit-it=thumb
+  CFLAGS_PLATFORM += -mthumb-interwork -march=armv6 -mlong-calls
   LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
 endif
 

=== modified file 'configure.ac'
--- configure.ac        2013-04-07 00:41:07 +0000
+++ configure.ac        2013-04-07 16:08:07 +0000
@@ -717,7 +717,7 @@
 fi
 
 # Check for libgcc symbols
-AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 
_restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 
__moddi3 __divdi3 __ctzdi2 __ctzsi2)
+AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 
_restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 
__moddi3 __divdi3 __ctzdi2 __ctzsi2 __aeabi_ulcmp)
 
 if test "x$TARGET_APPLE_CC" = x1 ; then
 CFLAGS="$TARGET_CFLAGS -nostdlib"

=== modified file 'grub-core/kern/arm/dl.c'
--- grub-core/kern/arm/dl.c     2013-04-07 00:41:07 +0000
+++ grub-core/kern/arm/dl.c     2013-04-07 16:08:07 +0000
@@ -27,9 +27,6 @@
 #ifdef GRUB_UTIL
 # include <grub/util/misc.h>
 #else
-# if !defined(__thumb2__)
-#  error "Relocations not implemented for A32 ("ARM") instruction set yet!"
-# endif
 
 grub_err_t reloc_jump24 (grub_uint32_t *addr, Elf32_Addr sym_addr);
 grub_err_t reloc_thm_call (grub_uint16_t *addr, Elf32_Addr sym_addr);
@@ -169,8 +166,8 @@
     }
 
 #ifdef GRUB_UTIL
-  grub_util_info ("    relative destination = 0x%08x",
-                 (unsigned int)target + offset);
+  grub_util_info ("    relative destination = 0x%08lx",
+                 (unsigned long)target + offset);
 #endif
 
   /* Reassemble instruction word */
@@ -358,6 +355,7 @@
              return retval;
          }
          break;
+       case R_ARM_CALL:
        case R_ARM_JUMP24:
          {
            retval = reloc_jump24 (target, sym_addr);

=== modified file 'grub-core/kern/dl.c'
--- grub-core/kern/dl.c 2013-03-19 19:25:09 +0000
+++ grub-core/kern/dl.c 2013-04-07 16:08:07 +0000
@@ -588,7 +588,7 @@
 {
   grub_dprintf ("modules", "flushing 0x%lx bytes at %p\n",
                (unsigned long) mod->sz, mod->base);
-  grub_arch_sync_caches (mod->base, mod->sz);
+  //  grub_arch_sync_caches (mod->base, mod->sz);
 }
 
 /* Load a module from core memory.  */

=== modified file 'include/grub/libgcc.h'
--- include/grub/libgcc.h       2013-04-07 00:41:07 +0000
+++ include/grub/libgcc.h       2013-04-07 16:08:07 +0000
@@ -122,4 +122,5 @@
 void EXPORT_FUNC (__aeabi_uidiv) (void);
 void EXPORT_FUNC (__aeabi_uidivmod) (void);
 void EXPORT_FUNC (__wrap___clear_cache) (void *, void *);
+void EXPORT_FUNC (__aeabi_ulcmp) (void);
 #endif

=== modified file 'include/grub/uboot/api_public.h'
--- include/grub/uboot/api_public.h     2013-04-07 00:41:07 +0000
+++ include/grub/uboot/api_public.h     2013-04-07 16:08:07 +0000
@@ -61,9 +61,6 @@
 
 typedef int (*scp_t) (int, int *, ...);
 
-typedef grub_uint16_t uint16_t;
-typedef grub_uint32_t uint32_t;
-
 #define API_SIG_VERSION        1
 #define API_SIG_MAGIC  "UBootAPI"
 #define API_SIG_MAGLEN 8
@@ -71,8 +68,8 @@
 struct api_signature
 {
   char magic[API_SIG_MAGLEN];  /* magic string */
-  uint16_t version;            /* API version */
-  uint32_t checksum;           /* checksum of this sig struct */
+  grub_uint16_t version;       /* API version */
+  grub_uint32_t checksum;      /* checksum of this sig struct */
   scp_t syscall;               /* entry point to the API */
 };
 

=== modified file 'util/grub-mkimagexx.c'
--- util/grub-mkimagexx.c       2013-04-07 00:41:07 +0000
+++ util/grub-mkimagexx.c       2013-04-07 16:08:07 +0000
@@ -553,7 +553,7 @@
                   case R_ARM_THM_CALL:
                   case R_ARM_THM_JUMP24:
                     {
-                      grub_util_info ("  
THM_JUMP24:\ttarget=0x%08x\toffset=(0x%08x)", (unsigned int) target, sym_addr);
+                      grub_util_info ("  
THM_JUMP24:\ttarget=0x%08lx\toffset=(0x%08x)",        (unsigned long) target, 
sym_addr);
                       sym_addr -= offset;
                       /* Thumb instructions can be 16-bit aligned */
                       reloc_thm_call ((grub_uint16_t *) target, sym_addr);



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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