summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-08-27 17:33:17 +1000
committerSimon Horman <horms@verge.net.au>2008-08-27 17:33:17 +1000
commit61d60261c616d75d6bd380744a78400972dd3e46 (patch)
treedd1a5466a3b35cc0def4dc9293035ed0ccfc5b24
parente64db1cf9213d0ef9ce3c3df0ce9e23b1c2d7604 (diff)
sh: Use dynamic zImage load address
Dynamically calculate SuperH zImage load address instead of hardcoding. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/sh/kexec-zImage-sh.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/kexec/arch/sh/kexec-zImage-sh.c b/kexec/arch/sh/kexec-zImage-sh.c
index 5e4e860..3758056 100644
--- a/kexec/arch/sh/kexec-zImage-sh.c
+++ b/kexec/arch/sh/kexec-zImage-sh.c
@@ -75,7 +75,8 @@ int zImage_sh_load(int argc, char **argv, const char *buf, off_t len,
{
char *command_line;
int opt, k;
- unsigned long empty_zero, area, zero_page_base, zero_page_size;
+ unsigned long empty_zero, zero_page_base, zero_page_size;
+ unsigned long image_base;
char *param;
static const struct option options[] = {
@@ -133,8 +134,12 @@ int zImage_sh_load(int argc, char **argv, const char *buf, off_t len,
add_segment(info, param, zero_page_size,
0x80000000 | zero_page_base, zero_page_size);
- area = empty_zero & 0x1c000000;
- add_segment(info, buf, len, (area | 0x80210000), len);
- info->entry = (void *)(0x80210000 | area);
+ /* load image a bit above the zero page, round up to 64k
+ * the zImage will relocate itself, but only up seems supported.
+ */
+
+ image_base = (empty_zero + (0x10000 - 1)) & ~(0x10000 - 1);
+ add_segment(info, buf, len, image_base, len);
+ info->entry = (void *)image_base;
return 0;
}