blob: 4671d1b82150f6aa077854ddd69b13b52738a8d7 [file] [log] [blame]
Magnus Damm3c928322009-07-29 15:04:05 +00001/*
2 * linux/arch/sh/boot/romimage/head.S
3 *
4 * Board specific setup code, executed before zImage loader
5 */
6
7.text
Magnus Damm6a5a0b92009-12-04 06:42:35 +00008 #include <asm/page.h>
9
Magnus Damm3c928322009-07-29 15:04:05 +000010 .global romstart
11romstart:
Magnus Damm6a5a0b92009-12-04 06:42:35 +000012 /* include board specific setup code */
Magnus Damm2d2bcd32009-08-07 03:58:38 +090013#include <mach/romimage.h>
Magnus Damm6a5a0b92009-12-04 06:42:35 +000014
Magnus Damm4705b2e2010-05-18 14:43:15 +000015#ifdef CONFIG_ROMIMAGE_MMCIF
16 /* load the romImage to above the empty zero page */
17 mov.l empty_zero_page_dst, r4
18 mov.l empty_zero_page_dst_adj, r5
19 add r5, r4
20 mov.l bytes_to_load, r5
21 mov.l loader_function, r7
22 jsr @r7
23 mov r4, r15
24
25 mov.l empty_zero_page_dst, r4
26 mov.l empty_zero_page_dst_adj, r5
27 add r5, r4
28 mov.l loaded_code_offs, r5
29 add r5, r4
30 jmp @r4
31 nop
32
33 .balign 4
34empty_zero_page_dst_adj:
35 .long PAGE_SIZE
36bytes_to_load:
37 .long end_data - romstart
38loader_function:
39 .long mmcif_loader
40loaded_code_offs:
41 .long loaded_code - romstart
42loaded_code:
43#endif /* CONFIG_ROMIMAGE_MMCIF */
44
Magnus Damm6a5a0b92009-12-04 06:42:35 +000045 /* copy the empty_zero_page contents to where vmlinux expects it */
Magnus Dammb34bce42010-05-18 14:42:40 +000046 mova extra_data_pos, r0
47 mov.l extra_data_size, r1
48 add r1, r0
Magnus Damm6a5a0b92009-12-04 06:42:35 +000049 mov.l empty_zero_page_dst, r1
50 mov #(PAGE_SHIFT - 4), r4
51 mov #1, r3
52 shld r4, r3 /* r3 = PAGE_SIZE / 16 */
53
541:
55 mov.l @r0, r4
56 mov.l @(4, r0), r5
57 mov.l @(8, r0), r6
58 mov.l @(12, r0), r7
59 add #16,r0
60 mov.l r4, @r1
61 mov.l r5, @(4, r1)
62 mov.l r6, @(8, r1)
63 mov.l r7, @(12, r1)
64 dt r3
65 add #16,r1
66 bf 1b
67
68 /* jump to the zImage entry point located after the zero page data */
69 mov #PAGE_SHIFT, r4
70 mov #1, r1
71 shld r4, r1
Magnus Dammb34bce42010-05-18 14:42:40 +000072 mova extra_data_pos, r0
73 add r1, r0
74 mov.l extra_data_size, r1
Magnus Damm6a5a0b92009-12-04 06:42:35 +000075 add r1, r0
76 jmp @r0
77 nop
78
79 .align 2
80empty_zero_page_dst:
81 .long _text
Magnus Dammb34bce42010-05-18 14:42:40 +000082extra_data_pos:
83extra_data_size:
84 .long zero_page_pos - extra_data_pos