blob: 77fc221aa50581f9d5208fc5abeb47fcf358c9f1 [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 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09006 */
7
Wolfgang Denk0191e472010-10-26 14:34:52 +02008#include <asm-offsets.h>
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09009#include <config.h>
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090010
11 .text
12 .align 2
13
14 .global _start
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090015_sh_start:
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090016 mov.l ._lowlevel_init, r0
17100: bsrf r0
18 nop
19
20 bsr 1f
21 nop
221: sts pr, r5
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010023 mov.l ._reloc_dst, r4
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090024 add #(_sh_start-1b), r5
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010025 mov.l ._reloc_dst_end, r6
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090026
272: mov.l @r5+, r1
28 mov.l r1, @r4
29 add #4, r4
30 cmp/hs r6, r4
31 bf 2b
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010032
33 mov.l ._bss_start, r4
34 mov.l ._bss_end, r5
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090035 mov #0, r1
36
Wolfgang Denk0a5c2142007-12-27 01:52:50 +0100373: mov.l r1, @r4 /* bss clear */
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090038 add #4, r4
39 cmp/hs r5, r4
40 bf 3b
41
42 mov.l ._gd_init, r13 /* global data */
43 mov.l ._stack_init, r15 /* stack */
44
Simon Glass6c2afb82016-05-14 18:49:29 -060045 #TODO(sh maintainer): Fix this up to call the correct code
46 #mov.l ._sh_generic_init, r0
47 #jsr @r0
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010048 nop
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090049
50loop:
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 Iwamatsua0dbe932010-11-24 13:12:17 +090060._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
61._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
Simon Glass6c2afb82016-05-14 18:49:29 -060062#._sh_generic_init: .long sh_generic_init