Commit 78f02cac authored by Yoshinori Sato's avatar Yoshinori Sato

h8300: zImage fix

- stack fix
- configure base address
Signed-off-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
parent 780ffcd5
...@@ -14,11 +14,12 @@ OBJECTS = $(obj)/head.o $(obj)/misc.o ...@@ -14,11 +14,12 @@ OBJECTS = $(obj)/head.o $(obj)/misc.o
# in order to suppress error message. # in order to suppress error message.
# #
CONFIG_MEMORY_START ?= 0x00400000 CONFIG_MEMORY_START ?= 0x00400000
CONFIG_BOOT_LINK_OFFSET ?= 0x00140000 CONFIG_BOOT_LINK_OFFSET ?= 0x00280000
IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)))) IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET))))
LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup $(obj)/vmlinux.lds LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup -T $(obj)/vmlinux.lds \
--defsym output=$(CONFIG_MEMORY_START)
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
$(call if_changed,ld) $(call if_changed,ld)
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
.section .text..startup,"ax" .section .text..startup,"ax"
.global startup .global startup
startup: startup:
mov.l #startup, sp
mov.l er0, er4 mov.l er0, er4
mov.l er0, sp
mov.l #__sbss, er0 mov.l #__sbss, er0
mov.l #__ebss, er1 mov.l #__ebss, er1
sub.l er0, er1 sub.l er0, er1
...@@ -24,7 +24,7 @@ startup: ...@@ -24,7 +24,7 @@ startup:
bne 1b bne 1b
jsr @decompress_kernel jsr @decompress_kernel
mov.l er4, er0 mov.l er4, er0
jmp @0x400000 jmp @output
.align 9 .align 9
fake_headers_as_bzImage: fake_headers_as_bzImage:
......
...@@ -28,7 +28,7 @@ static unsigned long free_mem_end_ptr; ...@@ -28,7 +28,7 @@ static unsigned long free_mem_end_ptr;
extern char input_data[]; extern char input_data[];
extern int input_len; extern int input_len;
static unsigned char *output; extern char output[];
#define HEAP_SIZE 0x10000 #define HEAP_SIZE 0x10000
...@@ -56,15 +56,10 @@ void *memcpy(void *dest, const void *src, size_t n) ...@@ -56,15 +56,10 @@ void *memcpy(void *dest, const void *src, size_t n)
static void error(char *x) static void error(char *x)
{ {
while (1) while (1)
; /* Halt */ ; /* Halt */
} }
#define STACK_SIZE (4096)
long user_stack[STACK_SIZE];
long *stack_start = &user_stack[STACK_SIZE];
void decompress_kernel(void) void decompress_kernel(void)
{ {
free_mem_ptr = (unsigned long)&_end; free_mem_ptr = (unsigned long)&_end;
......
...@@ -27,6 +27,6 @@ SECTIONS ...@@ -27,6 +27,6 @@ SECTIONS
*(.bss*) *(.bss*)
. = ALIGN(0x4) ; . = ALIGN(0x4) ;
__ebss = . ; __ebss = . ;
__end = . ;
} }
_end = . ;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment