blob: afed773c63171d49ba4c17275ce1e66845214186 [file] [log] [blame]
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00001/*
2 * Copyright (C) 2012 Altera Corporation <www.altera.com>
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00005 */
6
7#include <config.h>
8#include <version.h>
9
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000010/* Set up the platform, once the cpu has been initialized */
11.globl lowlevel_init
12lowlevel_init:
13
14 /* Remap */
15#ifdef CONFIG_SPL_BUILD
16 /*
17 * SPL : configure the remap (L3 NIC-301 GPV)
18 * so the on-chip RAM at lower memory instead ROM.
19 */
20 ldr r0, =SOCFPGA_L3REGS_ADDRESS
21 mov r1, #0x19
22 str r1, [r0]
23#else
24 /*
25 * U-Boot : configure the remap (L3 NIC-301 GPV)
26 * so the SDRAM at lower memory instead on-chip RAM.
27 */
28 ldr r0, =SOCFPGA_L3REGS_ADDRESS
29 mov r1, #0x2
30 str r1, [r0]
31
32 /* Private components security */
33
34 /*
35 * U-Boot : configure private timer, global timer and cpu
36 * component access as non secure for kernel stage (as required
37 * by kernel)
38 */
39 mrc p15,4,r0,c15,c0,0
40 add r1, r0, #0x54
41 ldr r2, [r1]
42 orr r2, r2, #0xff
43 orr r2, r2, #0xf00
44 str r2, [r1]
45#endif /* #ifdef CONFIG_SPL_BUILD */
46 mov pc, lr