2018-12-14 15:16:47 +00:00
|
|
|
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Microsemi Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm/asm.h>
|
|
|
|
#include <asm/regdef.h>
|
|
|
|
|
|
|
|
.set noreorder
|
|
|
|
.extern vcoreiii_tlb_init
|
2020-02-06 09:45:40 +00:00
|
|
|
.extern vcoreiii_ddr_init
|
2018-12-14 15:16:48 +00:00
|
|
|
#ifdef CONFIG_SOC_LUTON
|
|
|
|
.extern pll_init
|
|
|
|
#endif
|
2018-12-14 15:16:47 +00:00
|
|
|
|
|
|
|
LEAF(lowlevel_init)
|
|
|
|
/*
|
|
|
|
* As we have no stack yet, we can assume the restricted
|
|
|
|
* luxury of the sX-registers without saving them
|
|
|
|
*/
|
2020-02-06 09:45:40 +00:00
|
|
|
|
|
|
|
/* Modify ra/s0 such we return to physical NOR location */
|
|
|
|
li t0, 0x0fffffff
|
2022-10-21 00:22:39 +00:00
|
|
|
li t1, CONFIG_TEXT_BASE
|
2020-02-06 09:45:40 +00:00
|
|
|
and s0, ra, t0
|
|
|
|
add s0, s0, t1
|
2018-12-14 15:16:47 +00:00
|
|
|
|
|
|
|
jal vcoreiii_tlb_init
|
|
|
|
nop
|
2020-02-06 09:45:40 +00:00
|
|
|
|
2018-12-14 15:16:48 +00:00
|
|
|
#ifdef CONFIG_SOC_LUTON
|
|
|
|
jal pll_init
|
|
|
|
nop
|
|
|
|
#endif
|
2020-02-06 09:45:40 +00:00
|
|
|
|
|
|
|
/* Initialize DDR controller to enable stack/gd/heap */
|
|
|
|
0:
|
|
|
|
jal vcoreiii_ddr_init
|
|
|
|
nop
|
|
|
|
bnez v0, 0b /* Retry on error */
|
|
|
|
nop
|
|
|
|
|
2018-12-14 15:16:47 +00:00
|
|
|
jr s0
|
|
|
|
nop
|
|
|
|
END(lowlevel_init)
|