diff options
author | Magnus Damm <damm@opensource.se> | 2009-12-04 01:42:35 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-04 02:26:20 -0500 |
commit | 6a5a0b9139b19dd1a107870269a35bc9cf18d2dc (patch) | |
tree | 6212ed4ee2d0cc3f84edd26173bad5c4d6470338 /arch/sh/boot | |
parent | 6e8a0d11a088ed51b1b649d3a1127a7bda3700a0 (diff) |
sh: include empty zero page in romImage
This patch updates the romImage code to include the
empty_zero_page contents from vmlinux. Without this
patch the empty zero page is lef uninitialized.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boot')
-rw-r--r-- | arch/sh/boot/romimage/Makefile | 12 | ||||
-rw-r--r-- | arch/sh/boot/romimage/head.S | 38 |
2 files changed, 47 insertions, 3 deletions
diff --git a/arch/sh/boot/romimage/Makefile b/arch/sh/boot/romimage/Makefile index 5806eee84f6f..f473a24a2d92 100644 --- a/arch/sh/boot/romimage/Makefile +++ b/arch/sh/boot/romimage/Makefile | |||
@@ -4,16 +4,22 @@ | |||
4 | # create an image suitable for burning to flash from zImage | 4 | # create an image suitable for burning to flash from zImage |
5 | # | 5 | # |
6 | 6 | ||
7 | targets := vmlinux head.o | 7 | targets := vmlinux head.o zeropage.bin piggy.o |
8 | 8 | ||
9 | OBJECTS = $(obj)/head.o | 9 | OBJECTS = $(obj)/head.o |
10 | LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext 0 -e romstart | 10 | LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext 0 -e romstart \ |
11 | -T $(obj)/../../kernel/vmlinux.lds | ||
11 | 12 | ||
12 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE | 13 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE |
13 | $(call if_changed,ld) | 14 | $(call if_changed,ld) |
14 | @: | 15 | @: |
15 | 16 | ||
17 | OBJCOPYFLAGS += -j .empty_zero_page | ||
18 | |||
19 | $(obj)/zeropage.bin: vmlinux FORCE | ||
20 | $(call if_changed,objcopy) | ||
21 | |||
16 | LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T | 22 | LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T |
17 | 23 | ||
18 | $(obj)/piggy.o: $(obj)/vmlinux.scr arch/sh/boot/zImage FORCE | 24 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE |
19 | $(call if_changed,ld) | 25 | $(call if_changed,ld) |
diff --git a/arch/sh/boot/romimage/head.S b/arch/sh/boot/romimage/head.S index 219bc626dd71..93e779a405ec 100644 --- a/arch/sh/boot/romimage/head.S +++ b/arch/sh/boot/romimage/head.S | |||
@@ -5,6 +5,44 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | .text | 7 | .text |
8 | #include <asm/page.h> | ||
9 | |||
8 | .global romstart | 10 | .global romstart |
9 | romstart: | 11 | romstart: |
12 | /* include board specific setup code */ | ||
10 | #include <mach/romimage.h> | 13 | #include <mach/romimage.h> |
14 | |||
15 | /* copy the empty_zero_page contents to where vmlinux expects it */ | ||
16 | mova empty_zero_page_src, r0 | ||
17 | mov.l empty_zero_page_dst, r1 | ||
18 | mov #(PAGE_SHIFT - 4), r4 | ||
19 | mov #1, r3 | ||
20 | shld r4, r3 /* r3 = PAGE_SIZE / 16 */ | ||
21 | |||
22 | 1: | ||
23 | mov.l @r0, r4 | ||
24 | mov.l @(4, r0), r5 | ||
25 | mov.l @(8, r0), r6 | ||
26 | mov.l @(12, r0), r7 | ||
27 | add #16,r0 | ||
28 | mov.l r4, @r1 | ||
29 | mov.l r5, @(4, r1) | ||
30 | mov.l r6, @(8, r1) | ||
31 | mov.l r7, @(12, r1) | ||
32 | dt r3 | ||
33 | add #16,r1 | ||
34 | bf 1b | ||
35 | |||
36 | /* jump to the zImage entry point located after the zero page data */ | ||
37 | mov #PAGE_SHIFT, r4 | ||
38 | mov #1, r1 | ||
39 | shld r4, r1 | ||
40 | mova empty_zero_page_src, r0 | ||
41 | add r1, r0 | ||
42 | jmp @r0 | ||
43 | nop | ||
44 | |||
45 | .align 2 | ||
46 | empty_zero_page_dst: | ||
47 | .long _text | ||
48 | empty_zero_page_src: | ||