blob: 5b92a015715b4b8da5bba91f0b82607e86e9130d [file] [log] [blame]
Nobuhiro Iwamatsu5b6918e2008-08-31 22:48:33 +09001/*
2 * Copyright (C) 2007,2008 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
3 * Copyright (C) 2008 Renesas Solutions Corp.
4
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Nobuhiro Iwamatsu5b6918e2008-08-31 22:48:33 +09006 */
7
Wolfgang Denk0191e472010-10-26 14:34:52 +02008#include <asm-offsets.h>
Nobuhiro Iwamatsu5b6918e2008-08-31 22:48:33 +09009#include <config.h>
10#include <version.h>
11
12 .text
13 .align 2
14
15 .global _start
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090016_sh_start:
Nobuhiro Iwamatsu5b6918e2008-08-31 22:48:33 +090017 .long 0x00000010 /* Ppower ON reset PC*/
18 .long 0x00000000
19 .long 0x00000010 /* Manual reset PC */
20 .long 0x00000000
21_init:
22 mov.l ._lowlevel_init, r0
23100: bsrf r0
24 nop
25 bsr 1f
26 nop
271: sts pr, r5
28 mov.l ._reloc_dst, r4
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090029 add #(_sh_start-1b), r5
Nobuhiro Iwamatsu5b6918e2008-08-31 22:48:33 +090030 mov.l ._reloc_dst_end, r6
31
322: mov.l @r5+, r1
33 mov.l r1, @r4
34 add #4, r4
35 cmp/hs r6, r4
36 bf 2b
37
38 mov.l ._bss_start, r4
39 mov.l ._bss_end, r5
40 mov #0, r1
41
423: mov.l r1, @r4 /* bss clear */
43 add #4, r4
44 cmp/hs r5, r4
45 bf 3b
46
47 mov.l ._gd_init, r13 /* global data */
48 mov.l ._stack_init, r15 /* stack */
49
50 mov.l ._sh_generic_init, r0
51 jsr @r0
52 nop
53
54loop:
55 bra loop
56
57 .align 2
58
59._lowlevel_init: .long (lowlevel_init - (100b + 4))
60._reloc_dst: .long reloc_dst
61._reloc_dst_end: .long reloc_dst_end
62._bss_start: .long bss_start
63._bss_end: .long bss_end
Nobuhiro Iwamatsua0dbe932010-11-24 13:12:17 +090064._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
65._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
Nobuhiro Iwamatsu5b6918e2008-08-31 22:48:33 +090066._sh_generic_init: .long sh_generic_init