Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Altera Corporation <www.altera.com> |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 5 | */ |
| 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 |
| 12 | save_boot_params: |
Albert ARIBAUD | 9852cc6 | 2014-04-15 16:13:51 +0200 | [diff] [blame] | 13 | /* no parameter to save */ |
Dinh Nguyen | ad51f7c | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 14 | bx lr |
| 15 | |
| 16 | |
| 17 | /* Set up the platform, once the cpu has been initialized */ |
| 18 | .globl lowlevel_init |
| 19 | lowlevel_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 |