diff mbox

[U-Boot,1/2] ARM: Add save_boot_params for ARMv8

Message ID 20160718230151.1670-1-swarren@wwwdotorg.org
State Accepted
Commit 0e2b5350d9523c9b2dca57b98c89f031691d23e3
Delegated to: Tom Warren
Headers show

Commit Message

Stephen Warren July 18, 2016, 11:01 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Implement a hook to allow boards to save boot-time CPU state for later
use. When U-Boot is chain-loaded by another bootloader, CPU registers may
contain useful information such as system configuration information. This
feature mirrors the equivalent ARMv7 feature.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/cpu/armv8/start.S | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tom Rini July 20, 2016, 2:21 a.m. UTC | #1
On Mon, Jul 18, 2016 at 05:01:50PM -0600, Stephen Warren wrote:

> From: Stephen Warren <swarren@nvidia.com>
> 
> Implement a hook to allow boards to save boot-time CPU state for later
> use. When U-Boot is chain-loaded by another bootloader, CPU registers may
> contain useful information such as system configuration information. This
> feature mirrors the equivalent ARMv7 feature.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini July 21, 2016, 7:15 p.m. UTC | #2
On Thu, Jul 21, 2016 at 04:16:57PM +0000, Tom Warren wrote:

> Tom,
> 
> I'm going to take these 2 in via Tegra if that's OK with you. Expect a PR later today.

Sounds good, thanks!
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/start.S b/arch/arm/cpu/armv8/start.S
index dfce46920668..f77fa44ad6c3 100644
--- a/arch/arm/cpu/armv8/start.S
+++ b/arch/arm/cpu/armv8/start.S
@@ -53,6 +53,11 @@  _bss_end_ofs:
 	.quad	__bss_end - _start
 
 reset:
+	/* Allow the board to save important registers */
+	b	save_boot_params
+.globl	save_boot_params_ret
+save_boot_params_ret:
+
 #ifdef CONFIG_SYS_RESET_SCTRL
 	bl reset_sctrl
 #endif
@@ -288,3 +293,7 @@  ENTRY(c_runtime_cpu_setup)
 
 	ret
 ENDPROC(c_runtime_cpu_setup)
+
+WEAK(save_boot_params)
+	b	save_boot_params_ret	/* back to my caller */
+ENDPROC(save_boot_params)