Magnus Damm | 3c92832 | 2009-07-29 15:04:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/sh/boot/romimage/head.S |
| 3 | * |
| 4 | * Board specific setup code, executed before zImage loader |
| 5 | */ |
| 6 | |
| 7 | .text |
Magnus Damm | 6a5a0b9 | 2009-12-04 06:42:35 +0000 | [diff] [blame] | 8 | #include <asm/page.h> |
| 9 | |
Magnus Damm | 3c92832 | 2009-07-29 15:04:05 +0000 | [diff] [blame] | 10 | .global romstart |
| 11 | romstart: |
Magnus Damm | 6a5a0b9 | 2009-12-04 06:42:35 +0000 | [diff] [blame] | 12 | /* include board specific setup code */ |
Magnus Damm | 2d2bcd3 | 2009-08-07 03:58:38 +0900 | [diff] [blame] | 13 | #include <mach/romimage.h> |
Magnus Damm | 6a5a0b9 | 2009-12-04 06:42:35 +0000 | [diff] [blame] | 14 | |
Magnus Damm | 4705b2e | 2010-05-18 14:43:15 +0000 | [diff] [blame] | 15 | #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 |
| 34 | empty_zero_page_dst_adj: |
| 35 | .long PAGE_SIZE |
| 36 | bytes_to_load: |
| 37 | .long end_data - romstart |
| 38 | loader_function: |
| 39 | .long mmcif_loader |
| 40 | loaded_code_offs: |
| 41 | .long loaded_code - romstart |
| 42 | loaded_code: |
| 43 | #endif /* CONFIG_ROMIMAGE_MMCIF */ |
| 44 | |
Magnus Damm | 6a5a0b9 | 2009-12-04 06:42:35 +0000 | [diff] [blame] | 45 | /* copy the empty_zero_page contents to where vmlinux expects it */ |
Magnus Damm | b34bce4 | 2010-05-18 14:42:40 +0000 | [diff] [blame] | 46 | mova extra_data_pos, r0 |
| 47 | mov.l extra_data_size, r1 |
| 48 | add r1, r0 |
Magnus Damm | 6a5a0b9 | 2009-12-04 06:42:35 +0000 | [diff] [blame] | 49 | 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 | |
| 54 | 1: |
| 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 Damm | b34bce4 | 2010-05-18 14:42:40 +0000 | [diff] [blame] | 72 | mova extra_data_pos, r0 |
| 73 | add r1, r0 |
| 74 | mov.l extra_data_size, r1 |
Magnus Damm | 6a5a0b9 | 2009-12-04 06:42:35 +0000 | [diff] [blame] | 75 | add r1, r0 |
| 76 | jmp @r0 |
| 77 | nop |
| 78 | |
| 79 | .align 2 |
| 80 | empty_zero_page_dst: |
| 81 | .long _text |
Magnus Damm | b34bce4 | 2010-05-18 14:42:40 +0000 | [diff] [blame] | 82 | extra_data_pos: |
| 83 | extra_data_size: |
| 84 | .long zero_page_pos - extra_data_pos |