blob: f5350b90643c0bf13d7293e926df5d47a33788b0 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09002/*
Vladimir Zapolskiy946c8c82016-11-28 00:15:33 +02003 * Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
4 * Copyright (C) 2007, 2010 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09005 */
6
Wolfgang Denk0191e472010-10-26 14:34:52 +02007#include <asm-offsets.h>
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09008#include <config.h>
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +09009
10 .text
11 .align 2
12
13 .global _start
Vladimir Zapolskiy946c8c82016-11-28 00:15:33 +020014_start:
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090015 mov.l ._lowlevel_init, r0
16100: bsrf r0
17 nop
18
19 bsr 1f
20 nop
211: sts pr, r5
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010022 mov.l ._reloc_dst, r4
Vladimir Zapolskiy946c8c82016-11-28 00:15:33 +020023 add #(_start-1b), r5
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010024 mov.l ._reloc_dst_end, r6
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090025
262: mov.l @r5+, r1
27 mov.l r1, @r4
28 add #4, r4
29 cmp/hs r6, r4
30 bf 2b
Wolfgang Denk0a5c2142007-12-27 01:52:50 +010031
32 mov.l ._bss_start, r4
33 mov.l ._bss_end, r5
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090034 mov #0, r1
35
Wolfgang Denk0a5c2142007-12-27 01:52:50 +0100363: mov.l r1, @r4 /* bss clear */
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090037 add #4, r4
38 cmp/hs r5, r4
39 bf 3b
40
41 mov.l ._gd_init, r13 /* global data */
42 mov.l ._stack_init, r15 /* stack */
43
Vladimir Zapolskiy946c8c82016-11-28 00:15:33 +020044 mov.l ._sh_generic_init, r0
45 jsr @r0
46 mov #0, r4
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090047
48loop:
49 bra loop
50
51 .align 2
52
53._lowlevel_init: .long (lowlevel_init - (100b + 4))
Vladimir Zapolskiy946c8c82016-11-28 00:15:33 +020054._reloc_dst: .long _start
Nobuhiro Iwamatsu970dc332007-05-13 20:58:00 +090055._reloc_dst_end: .long reloc_dst_end
56._bss_start: .long bss_start
57._bss_end: .long bss_end
Vladimir Zapolskiy946c8c82016-11-28 00:15:33 +020058._gd_init: .long (_start - GENERATED_GBL_DATA_SIZE)
59._stack_init: .long (_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
60._sh_generic_init: .long board_init_f