blob: 21644b5e679b5cff14f2a04ce9bfd5659e895cdc [file] [log] [blame]
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +09001/*
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +09002 * (C) Copyright 2007, 2010
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +09003 * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +09006 */
7
Wolfgang Denk25ddd1f2010-10-26 14:34:52 +02008#include <asm-offsets.h>
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +09009#include <config.h>
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090010
11 .text
12 .align 2
13
14 .global _start
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +090015_sh_start:
Nobuhiro Iwamatsu0b135cf2007-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 Denk61fb15c52007-12-27 01:52:50 +010023 mov.l ._reloc_dst, r4
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +090024 add #(_sh_start-1b), r5
Wolfgang Denk61fb15c52007-12-27 01:52:50 +010025 mov.l ._reloc_dst_end, r6
Nobuhiro Iwamatsu0b135cf2007-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 Denk61fb15c52007-12-27 01:52:50 +010032
33 mov.l ._bss_start, r4
34 mov.l ._bss_end, r5
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090035 mov #0, r1
36
Wolfgang Denk61fb15c52007-12-27 01:52:50 +0100373: mov.l r1, @r4 /* bss clear */
Nobuhiro Iwamatsu0b135cf2007-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
45 mov.l ._sh_generic_init, r0
Wolfgang Denk61fb15c52007-12-27 01:52:50 +010046 jsr @r0
47 nop
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090048
49loop:
50 bra loop
51
52 .align 2
53
54._lowlevel_init: .long (lowlevel_init - (100b + 4))
55._reloc_dst: .long reloc_dst
56._reloc_dst_end: .long reloc_dst_end
57._bss_start: .long bss_start
58._bss_end: .long bss_end
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +090059._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
60._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
Nobuhiro Iwamatsu0b135cf2007-05-13 20:58:00 +090061._sh_generic_init: .long sh_generic_init