blob: 91f29ae252cc55308f1c0a3dec32fcb08131e617 [file] [log] [blame]
Gregory CLEMENTaf05ee52018-12-14 16:16:47 +01001/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2/*
3 * Copyright (c) 2018 Microsemi Corporation
4 */
5
6#include <asm/asm.h>
7#include <asm/regdef.h>
8
9 .set noreorder
10 .extern vcoreiii_tlb_init
Lars Povlsen1470ce22020-02-06 10:45:40 +010011 .extern vcoreiii_ddr_init
Gregory CLEMENT819b57212018-12-14 16:16:48 +010012#ifdef CONFIG_SOC_LUTON
13 .extern pll_init
14#endif
Gregory CLEMENTaf05ee52018-12-14 16:16:47 +010015
16LEAF(lowlevel_init)
17 /*
18 * As we have no stack yet, we can assume the restricted
19 * luxury of the sX-registers without saving them
20 */
Lars Povlsen1470ce22020-02-06 10:45:40 +010021
22 /* Modify ra/s0 such we return to physical NOR location */
23 li t0, 0x0fffffff
24 li t1, CONFIG_SYS_TEXT_BASE
25 and s0, ra, t0
26 add s0, s0, t1
Gregory CLEMENTaf05ee52018-12-14 16:16:47 +010027
28 jal vcoreiii_tlb_init
29 nop
Lars Povlsen1470ce22020-02-06 10:45:40 +010030
Gregory CLEMENT819b57212018-12-14 16:16:48 +010031#ifdef CONFIG_SOC_LUTON
32 jal pll_init
33 nop
34#endif
Lars Povlsen1470ce22020-02-06 10:45:40 +010035
36 /* Initialize DDR controller to enable stack/gd/heap */
370:
38 jal vcoreiii_ddr_init
39 nop
40 bnez v0, 0b /* Retry on error */
41 nop
42
Gregory CLEMENTaf05ee52018-12-14 16:16:47 +010043 jr s0
44 nop
45 END(lowlevel_init)