blob: a1d5ee42ef881f782e596632cfd0057f3fc8d1a2 [file] [log] [blame]
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09001/*
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +09002 * (C) Copyright 2007, 2010
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09003 * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 */
20
Wolfgang Denk0191e472010-10-26 14:34:52 +020021#include <asm-offsets.h>
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090022#include <config.h>
23#include <version.h>
24
25 .text
26 .align 2
27
28 .global _start
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090029_sh_start:
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090030 mov.l ._lowlevel_init, r0
31100: bsrf r0
32 nop
33
34 bsr 1f
35 nop
361: sts pr, r5
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010037 mov.l ._reloc_dst, r4
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090038 add #(_sh_start-1b), r5
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010039 mov.l ._reloc_dst_end, r6
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090040
412: mov.l @r5+, r1
42 mov.l r1, @r4
43 add #4, r4
44 cmp/hs r6, r4
45 bf 2b
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010046
47 mov.l ._bss_start, r4
48 mov.l ._bss_end, r5
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090049 mov #0, r1
50
Wolfgang Denk0a5c2142007-12-27 01:52:50 +0100513: mov.l r1, @r4 /* bss clear */
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090052 add #4, r4
53 cmp/hs r5, r4
54 bf 3b
55
56 mov.l ._gd_init, r13 /* global data */
57 mov.l ._stack_init, r15 /* stack */
58
59 mov.l ._sh_generic_init, r0
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010060 jsr @r0
61 nop
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090062
63loop:
64 bra loop
65
66 .align 2
67
68._lowlevel_init: .long (lowlevel_init - (100b + 4))
69._reloc_dst: .long reloc_dst
70._reloc_dst_end: .long reloc_dst_end
71._bss_start: .long bss_start
72._bss_end: .long bss_end
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090073._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
74._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090075._sh_generic_init: .long sh_generic_init