В сообщении от 16 сентября 2009 05:16:37 вы написали:
> >  // Recommended tags placement = RAM start + 256
> > -#define PHYSOFFSET_TAGS   0x100
> > +#define PHYSOFFSET_TAGS   0x90100
> 
> Ideally these parameters would get moved to runtime variables that
> default to their current values.  That way, one could change the
> locations by just setting some variables in their haret bootup script.

Here's a patch in attachment to make kernel offset configurable.
One could set OFFSET variable in default.txt to appropriate kernel offset. For 
rx1950 offset is 0x90000

> >  static void
> >  bootLinux(const char *cmd, const char *args)
> >  {
> > +   char w[64];
> > +    if (com_port_open())
> > +    {
> > +        sprintf (w, "\n\rbootLinux() Machine:%x", bootMachineType);
> > +        com_port_write (w, strlen (w));
> > +    }
> >      int bootViaResume = toupper(cmd[0]) == 'R';
> 
> That's a nasty kernel bug (that has been biting us for years).  I
> don't see any portable way to fix this other than by hounding the
> kernel developers.

It's fixed, at least for s3c24xx in recent kernels.

Regards
Vasily
From e9046f938aa7155da4a84c897544d6f02c3997a1 Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <[email protected]>
Date: Wed, 16 Sep 2009 17:06:16 +0300
Subject: [PATCH 1/1] Make kernel offset configurable


Signed-off-by: Vasily Khoruzhick <[email protected]>
---
 src/linboot.cpp |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/linboot.cpp b/src/linboot.cpp
index d44ea11..d27d65e 100644
--- a/src/linboot.cpp
+++ b/src/linboot.cpp
@@ -36,6 +36,8 @@ static char *bootCmdline = "root=/dev/ram0 ro console=tty0";
 static uint32 bootMachineType = 0;
 // Enable framebuffer writes during bootup.
 static uint32 FBDuringBoot = 1;
+// Kernel text offset delta value
+static uint32 kernelOffset = 0x0;
 
 REG_VAR_STR(0, "KERNEL", bootKernel, "Linux kernel file name")
 REG_VAR_STR(0, "INITRD", bootInitrd, "Initial Ram Disk file name")
@@ -44,6 +46,7 @@ REG_VAR_INT(0, "MTYPE", bootMachineType
             , "ARM machine type (see linux/arch/arm/tools/mach-types)")
 REG_VAR_INT(0, "FBDURINGBOOT", FBDuringBoot
             , "Enable/disable writing status lines to screen during boot")
+REG_VAR_INT(0, "OFFSET", kernelOffset, "Kernel text offset delta value")
 
 /*
  * Theory of operation:
@@ -85,10 +88,10 @@ REG_VAR_INT(0, "FBDURINGBOOT", FBDuringBoot
  * Linux utility functions
  ****************************************************************/
 
-// Recommended tags placement = RAM start + 256
-#define PHYSOFFSET_TAGS   0x100
-// Recommended kernel placement = RAM start + 32K
-#define PHYSOFFSET_KERNEL 0x8000
+// Recommended tags placement = RAM start + kernelOffset + 256
+#define PHYSOFFSET_TAGS   (localKernelOffset + 0x100)
+// Recommended kernel placement = RAM start + kernelOffset + 32K
+#define PHYSOFFSET_KERNEL (localKernelOffset + 0x8000)
 // Initrd will be put at the address of kernel + 5MB
 #define PHYSOFFSET_INITRD (PHYSOFFSET_KERNEL + 0x500000)
 // Maximum size of the tags structure.
@@ -154,6 +157,7 @@ struct preloadData {
     uint32 startRam;
 
     char *tags;
+    uint32 kernelOffset;
     uint32 kernelSize;
     uint32 initrdSize;
     const char **indexPages[MAX_INDEX];
@@ -238,6 +242,7 @@ static inline uint32 __preload do_cpuGetPSR(void) {
 static inline int __preload
 fbOverlaps(struct preloadData *pd)
 {
+    uint32 localKernelOffset = pd->kernelOffset;
     return IN_RANGE(pd->physFB, pd->startRam
                     , PHYSOFFSET_INITRD + pd->initrdSize);
 }
@@ -246,6 +251,7 @@ fbOverlaps(struct preloadData *pd)
 static void __preload
 preloader(struct preloadData *data)
 {
+    uint32 localKernelOffset = data->kernelOffset;
     data->fbi.fb = (uint16 *)data->physFB;
     data->fbi.fonts = (unsigned char *)data->physFonts;
     FB_PRINTF(&data->fbi, "In preloader\\n");
@@ -360,6 +366,7 @@ cleanupBootMem(struct bootmem *bm)
 static bootmem *
 prepForKernel(uint32 kernelSize, uint32 initrdSize)
 {
+    uint32 localKernelOffset = kernelOffset;
     // Sanity test.
     if (preload_size > PAGE_SIZE || sizeof(preloadData) > PAGE_SIZE) {
         Output(C_ERROR "Internal error.  Preloader too large");
@@ -476,6 +483,7 @@ prepForKernel(uint32 kernelSize, uint32 initrdSize)
     struct preloadData *pd = (struct preloadData *)pg_data->virtLoc;
     pd->machtype = machType;
     pd->tags = (char *)pg_tag->physLoc;
+    pd->kernelOffset = kernelOffset;
     pd->kernelSize = kernelSize;
     pd->initrdSize = initrdSize;
     for (int i=0; i<indexCount; i++)
-- 
1.6.5.rc1

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Haret mailing list
[email protected]
https://handhelds.org/mailman/listinfo/haret

Reply via email to