Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 1 | /* |
Nobuhiro Iwamatsu | 2024b96 | 2010-11-24 13:12:17 +0900 | [diff] [blame] | 2 | * (C) Copyright 2007, 2010 |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 3 | * Nobuhiro Iwamatsu <iwamatsu@nigauri.org> |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 6 | */ |
| 7 | |
Wolfgang Denk | 25ddd1f | 2010-10-26 14:34:52 +0200 | [diff] [blame] | 8 | #include <asm-offsets.h> |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 9 | #include <config.h> |
| 10 | #include <version.h> |
| 11 | |
| 12 | .text |
| 13 | .align 2 |
| 14 | |
| 15 | .global _start |
Nobuhiro Iwamatsu | 2024b96 | 2010-11-24 13:12:17 +0900 | [diff] [blame] | 16 | _sh_start: |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 17 | mov.l ._lowlevel_init, r0 |
| 18 | 100: bsrf r0 |
| 19 | nop |
| 20 | |
| 21 | bsr 1f |
| 22 | nop |
| 23 | 1: sts pr, r5 |
Wolfgang Denk | 61fb15c5 | 2007-12-27 01:52:50 +0100 | [diff] [blame] | 24 | mov.l ._reloc_dst, r4 |
Nobuhiro Iwamatsu | 2024b96 | 2010-11-24 13:12:17 +0900 | [diff] [blame] | 25 | add #(_sh_start-1b), r5 |
Wolfgang Denk | 61fb15c5 | 2007-12-27 01:52:50 +0100 | [diff] [blame] | 26 | mov.l ._reloc_dst_end, r6 |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 27 | |
| 28 | 2: mov.l @r5+, r1 |
| 29 | mov.l r1, @r4 |
| 30 | add #4, r4 |
| 31 | cmp/hs r6, r4 |
| 32 | bf 2b |
Wolfgang Denk | 61fb15c5 | 2007-12-27 01:52:50 +0100 | [diff] [blame] | 33 | |
| 34 | mov.l ._bss_start, r4 |
| 35 | mov.l ._bss_end, r5 |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 36 | mov #0, r1 |
| 37 | |
Wolfgang Denk | 61fb15c5 | 2007-12-27 01:52:50 +0100 | [diff] [blame] | 38 | 3: mov.l r1, @r4 /* bss clear */ |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 39 | add #4, r4 |
| 40 | cmp/hs r5, r4 |
| 41 | bf 3b |
| 42 | |
| 43 | mov.l ._gd_init, r13 /* global data */ |
| 44 | mov.l ._stack_init, r15 /* stack */ |
| 45 | |
| 46 | mov.l ._sh_generic_init, r0 |
Wolfgang Denk | 61fb15c5 | 2007-12-27 01:52:50 +0100 | [diff] [blame] | 47 | jsr @r0 |
| 48 | nop |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 49 | |
| 50 | loop: |
| 51 | bra loop |
| 52 | |
| 53 | .align 2 |
| 54 | |
| 55 | ._lowlevel_init: .long (lowlevel_init - (100b + 4)) |
| 56 | ._reloc_dst: .long reloc_dst |
| 57 | ._reloc_dst_end: .long reloc_dst_end |
| 58 | ._bss_start: .long bss_start |
| 59 | ._bss_end: .long bss_end |
Nobuhiro Iwamatsu | 2024b96 | 2010-11-24 13:12:17 +0900 | [diff] [blame] | 60 | ._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE) |
| 61 | ._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) |
Nobuhiro Iwamatsu | 0b135cf | 2007-05-13 20:58:00 +0900 | [diff] [blame] | 62 | ._sh_generic_init: .long sh_generic_init |