Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Cédric Schieli | ade243a | 2016-11-11 11:59:07 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2016 |
| 4 | * Cédric Schieli <cschieli@gmail.com> |
Cédric Schieli | ade243a | 2016-11-11 11:59:07 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <config.h> |
| 8 | |
Cédric Schieli | ade243a | 2016-11-11 11:59:07 +0100 | [diff] [blame] | 9 | /* |
| 10 | * Routine: save_boot_params (called after reset from start.S) |
| 11 | * Description: save ATAG/FDT address provided by the firmware at boot time |
| 12 | */ |
| 13 | |
| 14 | .global save_boot_params |
| 15 | save_boot_params: |
| 16 | |
| 17 | /* The firmware provided ATAG/FDT address can be found in r2/x0 */ |
| 18 | #ifdef CONFIG_ARM64 |
| 19 | adr x8, fw_dtb_pointer |
| 20 | str x0, [x8] |
| 21 | #else |
Matthias Brugger | 3796449 | 2019-11-19 16:01:02 +0100 | [diff] [blame] | 22 | ldr r8, =fw_dtb_pointer |
| 23 | str r2, [r8] |
Cédric Schieli | ade243a | 2016-11-11 11:59:07 +0100 | [diff] [blame] | 24 | #endif |
| 25 | |
| 26 | /* Returns */ |
| 27 | b save_boot_params_ret |