1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * (C) Copyright 2016
4 * Cédric Schieli <cschieli@gmail.com>
5 */
6
7#include <config.h>
8
9.align 8
10.global fw_dtb_pointer
11fw_dtb_pointer:
12#ifdef CONFIG_ARM64
13	.dword 0x0
14#else
15	.word 0x0
16#endif
17
18/*
19 * Routine: save_boot_params (called after reset from start.S)
20 * Description: save ATAG/FDT address provided by the firmware at boot time
21 */
22
23.global save_boot_params
24save_boot_params:
25
26	/* The firmware provided ATAG/FDT address can be found in r2/x0 */
27#ifdef CONFIG_ARM64
28	adr	x8, fw_dtb_pointer
29	str	x0, [x8]
30#else
31	str	r2, fw_dtb_pointer
32#endif
33
34	/* Returns */
35	b	save_boot_params_ret
36