2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2007-05-13 11:58:00 +00:00
|
|
|
/*
|
2016-11-27 22:15:33 +00:00
|
|
|
* Copyright (C) 2016 Vladimir Zapolskiy <vz@mleia.com>
|
|
|
|
* Copyright (C) 2007, 2010 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
2007-05-13 11:58:00 +00:00
|
|
|
*/
|
|
|
|
|
2010-10-26 12:34:52 +00:00
|
|
|
#include <asm-offsets.h>
|
2007-05-13 11:58:00 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 2
|
|
|
|
|
|
|
|
.global _start
|
2016-11-27 22:15:33 +00:00
|
|
|
_start:
|
2007-05-13 11:58:00 +00:00
|
|
|
mov.l ._lowlevel_init, r0
|
|
|
|
100: bsrf r0
|
|
|
|
nop
|
|
|
|
|
|
|
|
bsr 1f
|
|
|
|
nop
|
|
|
|
1: sts pr, r5
|
2007-12-27 00:52:50 +00:00
|
|
|
mov.l ._reloc_dst, r4
|
2016-11-27 22:15:33 +00:00
|
|
|
add #(_start-1b), r5
|
2007-12-27 00:52:50 +00:00
|
|
|
mov.l ._reloc_dst_end, r6
|
2019-09-01 16:05:03 +00:00
|
|
|
#ifdef CONFIG_OF_SEPARATE
|
|
|
|
mov.l ._reloc_size, r0
|
|
|
|
add r5, r0
|
|
|
|
add #4, r0
|
|
|
|
mov.l @r0, r0
|
|
|
|
swap.b r0, r0
|
|
|
|
swap.w r0, r0
|
|
|
|
swap.b r0, r0
|
|
|
|
add #4, r0
|
|
|
|
add r0, r6
|
|
|
|
#endif
|
2007-05-13 11:58:00 +00:00
|
|
|
|
|
|
|
2: mov.l @r5+, r1
|
|
|
|
mov.l r1, @r4
|
|
|
|
add #4, r4
|
|
|
|
cmp/hs r6, r4
|
|
|
|
bf 2b
|
2007-12-27 00:52:50 +00:00
|
|
|
|
2019-09-01 16:05:03 +00:00
|
|
|
#ifndef CONFIG_OF_SEPARATE
|
2007-12-27 00:52:50 +00:00
|
|
|
mov.l ._bss_start, r4
|
|
|
|
mov.l ._bss_end, r5
|
2007-05-13 11:58:00 +00:00
|
|
|
mov #0, r1
|
|
|
|
|
2007-12-27 00:52:50 +00:00
|
|
|
3: mov.l r1, @r4 /* bss clear */
|
2007-05-13 11:58:00 +00:00
|
|
|
add #4, r4
|
|
|
|
cmp/hs r5, r4
|
|
|
|
bf 3b
|
2019-09-01 16:05:03 +00:00
|
|
|
#endif
|
2007-05-13 11:58:00 +00:00
|
|
|
|
|
|
|
mov.l ._gd_init, r13 /* global data */
|
|
|
|
mov.l ._stack_init, r15 /* stack */
|
2020-05-09 20:02:50 +00:00
|
|
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
|
|
|
|
mov.l ._gd_malloc_base, r14
|
|
|
|
mov.l r15, @r14
|
|
|
|
#endif
|
2016-11-27 22:15:33 +00:00
|
|
|
mov.l ._sh_generic_init, r0
|
|
|
|
jsr @r0
|
|
|
|
mov #0, r4
|
2007-05-13 11:58:00 +00:00
|
|
|
|
|
|
|
loop:
|
|
|
|
bra loop
|
|
|
|
|
|
|
|
.align 2
|
|
|
|
|
|
|
|
._lowlevel_init: .long (lowlevel_init - (100b + 4))
|
2016-11-27 22:15:33 +00:00
|
|
|
._reloc_dst: .long _start
|
2007-05-13 11:58:00 +00:00
|
|
|
._reloc_dst_end: .long reloc_dst_end
|
2019-09-01 16:05:03 +00:00
|
|
|
._reloc_size: .long (_end - _start)
|
2007-05-13 11:58:00 +00:00
|
|
|
._bss_start: .long bss_start
|
|
|
|
._bss_end: .long bss_end
|
2016-11-27 22:15:33 +00:00
|
|
|
._gd_init: .long (_start - GENERATED_GBL_DATA_SIZE)
|
2020-05-09 20:02:50 +00:00
|
|
|
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
|
|
|
|
._gd_malloc_base: .long (_start - GENERATED_GBL_DATA_SIZE + GD_MALLOC_BASE)
|
|
|
|
#endif
|
2016-11-27 22:15:33 +00:00
|
|
|
._stack_init: .long (_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16)
|
|
|
|
._sh_generic_init: .long board_init_f
|