diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2015-05-31 10:42:37 -0400 |
---|---|---|
committer | Yoshinori Sato <ysato@users.sourceforge.jp> | 2015-11-08 08:44:39 -0500 |
commit | 78f02cac9515127efd7dc45e82bbbdb969b3302a (patch) | |
tree | 0417d911b99883d9d2770c42bf06e4e1b0c5d8e3 | |
parent | 780ffcd51cb287174e2d5cfe5ece2a7e73db6f37 (diff) |
h8300: zImage fix
- stack fix
- configure base address
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
-rw-r--r-- | arch/h8300/boot/compressed/Makefile | 5 | ||||
-rw-r--r-- | arch/h8300/boot/compressed/head.S | 4 | ||||
-rw-r--r-- | arch/h8300/boot/compressed/misc.c | 7 | ||||
-rw-r--r-- | arch/h8300/boot/compressed/vmlinux.lds | 2 |
4 files changed, 7 insertions, 11 deletions
diff --git a/arch/h8300/boot/compressed/Makefile b/arch/h8300/boot/compressed/Makefile index 87d03b7ee97e..d7bc3fa7f2c6 100644 --- a/arch/h8300/boot/compressed/Makefile +++ b/arch/h8300/boot/compressed/Makefile | |||
@@ -14,11 +14,12 @@ OBJECTS = $(obj)/head.o $(obj)/misc.o | |||
14 | # in order to suppress error message. | 14 | # in order to suppress error message. |
15 | # | 15 | # |
16 | CONFIG_MEMORY_START ?= 0x00400000 | 16 | CONFIG_MEMORY_START ?= 0x00400000 |
17 | CONFIG_BOOT_LINK_OFFSET ?= 0x00140000 | 17 | CONFIG_BOOT_LINK_OFFSET ?= 0x00280000 |
18 | IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)))) | 18 | IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)))) |
19 | 19 | ||
20 | LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 20 | LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
21 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup $(obj)/vmlinux.lds | 21 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup -T $(obj)/vmlinux.lds \ |
22 | --defsym output=$(CONFIG_MEMORY_START) | ||
22 | 23 | ||
23 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | 24 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE |
24 | $(call if_changed,ld) | 25 | $(call if_changed,ld) |
diff --git a/arch/h8300/boot/compressed/head.S b/arch/h8300/boot/compressed/head.S index 74c0d8cc40ba..0436350c1df5 100644 --- a/arch/h8300/boot/compressed/head.S +++ b/arch/h8300/boot/compressed/head.S | |||
@@ -9,8 +9,8 @@ | |||
9 | .section .text..startup,"ax" | 9 | .section .text..startup,"ax" |
10 | .global startup | 10 | .global startup |
11 | startup: | 11 | startup: |
12 | mov.l #startup, sp | ||
12 | mov.l er0, er4 | 13 | mov.l er0, er4 |
13 | mov.l er0, sp | ||
14 | mov.l #__sbss, er0 | 14 | mov.l #__sbss, er0 |
15 | mov.l #__ebss, er1 | 15 | mov.l #__ebss, er1 |
16 | sub.l er0, er1 | 16 | sub.l er0, er1 |
@@ -24,7 +24,7 @@ startup: | |||
24 | bne 1b | 24 | bne 1b |
25 | jsr @decompress_kernel | 25 | jsr @decompress_kernel |
26 | mov.l er4, er0 | 26 | mov.l er4, er0 |
27 | jmp @0x400000 | 27 | jmp @output |
28 | 28 | ||
29 | .align 9 | 29 | .align 9 |
30 | fake_headers_as_bzImage: | 30 | fake_headers_as_bzImage: |
diff --git a/arch/h8300/boot/compressed/misc.c b/arch/h8300/boot/compressed/misc.c index c4f2cfcb117b..6029c5351895 100644 --- a/arch/h8300/boot/compressed/misc.c +++ b/arch/h8300/boot/compressed/misc.c | |||
@@ -28,7 +28,7 @@ static unsigned long free_mem_end_ptr; | |||
28 | 28 | ||
29 | extern char input_data[]; | 29 | extern char input_data[]; |
30 | extern int input_len; | 30 | extern int input_len; |
31 | static unsigned char *output; | 31 | extern char output[]; |
32 | 32 | ||
33 | #define HEAP_SIZE 0x10000 | 33 | #define HEAP_SIZE 0x10000 |
34 | 34 | ||
@@ -56,15 +56,10 @@ void *memcpy(void *dest, const void *src, size_t n) | |||
56 | 56 | ||
57 | static void error(char *x) | 57 | static void error(char *x) |
58 | { | 58 | { |
59 | |||
60 | while (1) | 59 | while (1) |
61 | ; /* Halt */ | 60 | ; /* Halt */ |
62 | } | 61 | } |
63 | 62 | ||
64 | #define STACK_SIZE (4096) | ||
65 | long user_stack[STACK_SIZE]; | ||
66 | long *stack_start = &user_stack[STACK_SIZE]; | ||
67 | |||
68 | void decompress_kernel(void) | 63 | void decompress_kernel(void) |
69 | { | 64 | { |
70 | free_mem_ptr = (unsigned long)&_end; | 65 | free_mem_ptr = (unsigned long)&_end; |
diff --git a/arch/h8300/boot/compressed/vmlinux.lds b/arch/h8300/boot/compressed/vmlinux.lds index a0a3a0ed54ef..44fd209db88a 100644 --- a/arch/h8300/boot/compressed/vmlinux.lds +++ b/arch/h8300/boot/compressed/vmlinux.lds | |||
@@ -27,6 +27,6 @@ SECTIONS | |||
27 | *(.bss*) | 27 | *(.bss*) |
28 | . = ALIGN(0x4) ; | 28 | . = ALIGN(0x4) ; |
29 | __ebss = . ; | 29 | __ebss = . ; |
30 | __end = . ; | ||
31 | } | 30 | } |
31 | _end = . ; | ||
32 | } | 32 | } |