blob: 0c24cb5f22ddc46f05e4c11416f1306a7618e53e [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
Simon Glass72cc5382022-10-20 18:22:39 -060024 li t1, CONFIG_TEXT_BASE
Lars Povlsen1470ce22020-02-06 10:45:40 +010025 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)