blob: d96ca910c6ed704cedc363ab6419926cc14adeca [file] [log] [blame]
Yoshihiro Shimodaf9913a82007-12-03 22:58:45 +09001/*
2 * (C) Copyright 2007
3 * Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
4 *
5 * (C) Copyright 2007
6 * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
Wolfgang Denk25ddd1f2010-10-26 14:34:52 +020024#include <asm-offsets.h>
Yoshihiro Shimodaf9913a82007-12-03 22:58:45 +090025#include <config.h>
26#include <version.h>
27
28 .text
29 .align 2
30
31 .global _start
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +090032_sh_start:
Yoshihiro Shimodaf9913a82007-12-03 22:58:45 +090033 mov.l ._lowlevel_init, r0
34100: bsrf r0
35 nop
36
37 bsr 1f
38 nop
391: sts pr, r5
40 mov.l ._reloc_dst, r4
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +090041 add #(_sh_start-1b), r5
Yoshihiro Shimodaf9913a82007-12-03 22:58:45 +090042 mov.l ._reloc_dst_end, r6
43
442: mov.l @r5+, r1
45 mov.l r1, @r4
46 add #4, r4
47 cmp/hs r6, r4
48 bf 2b
49
50 mov.l ._bss_start, r4
51 mov.l ._bss_end, r5
52 mov #0, r1
53
543: mov.l r1, @r4 /* bss clear */
55 add #4, r4
56 cmp/hs r5, r4
57 bf 3b
58
59 mov.l ._gd_init, r13 /* global data */
60 mov.l ._stack_init, r15 /* stack */
61
62 mov.l ._sh_generic_init, r0
63 jsr @r0
64 nop
65
66loop:
67 bra loop
68
69 .align 2
70
71._lowlevel_init: .long (lowlevel_init - (100b + 4))
72._reloc_dst: .long reloc_dst
73._reloc_dst_end: .long reloc_dst_end
74._bss_start: .long bss_start
75._bss_end: .long bss_end
Nobuhiro Iwamatsu2024b962010-11-24 13:12:17 +090076._gd_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE)
77._stack_init: .long (_sh_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
Yoshihiro Shimodaf9913a82007-12-03 22:58:45 +090078._sh_generic_init: .long sh_generic_init