blob: 2f2e9fcc7c89e4809e247bc61bb06bc968dcee35 [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
10/* Save the parameter pass in by previous boot loader */
11.global save_boot_params
12save_boot_params:
Albert ARIBAUD9852cc62014-04-15 16:13:51 +020013 /* no parameter to save */
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000014 bx lr
15
16
17/* Set up the platform, once the cpu has been initialized */
18.globl lowlevel_init
19lowlevel_init:
20
21 /* Remap */
22#ifdef CONFIG_SPL_BUILD
23 /*
24 * SPL : configure the remap (L3 NIC-301 GPV)
25 * so the on-chip RAM at lower memory instead ROM.
26 */
27 ldr r0, =SOCFPGA_L3REGS_ADDRESS
28 mov r1, #0x19
29 str r1, [r0]
30#else
31 /*
32 * U-Boot : configure the remap (L3 NIC-301 GPV)
33 * so the SDRAM at lower memory instead on-chip RAM.
34 */
35 ldr r0, =SOCFPGA_L3REGS_ADDRESS
36 mov r1, #0x2
37 str r1, [r0]
38
39 /* Private components security */
40
41 /*
42 * U-Boot : configure private timer, global timer and cpu
43 * component access as non secure for kernel stage (as required
44 * by kernel)
45 */
46 mrc p15,4,r0,c15,c0,0
47 add r1, r0, #0x54
48 ldr r2, [r1]
49 orr r2, r2, #0xff
50 orr r2, r2, #0xf00
51 str r2, [r1]
52#endif /* #ifdef CONFIG_SPL_BUILD */
53 mov pc, lr