xref: /rk3399_rockchip-uboot/arch/arm/include/asm/arch-rockchip/bootrom.h (revision 5821df21ae36d9ef252d346a5abb76be773c5d69)
1 /*
2  * (C) Copyright 2017 Heiko Stuebner <heiko@sntech.de>
3  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
4  *
5  * SPDX-License-Identifier:	GPL-2.0
6  */
7 
8 #ifndef _ASM_ARCH_BOOTROM_H
9 #define _ASM_ARCH_BOOTROM_H
10 
11 /*
12  * Saved Stack pointer address.
13  * Access might be needed in some special cases.
14  */
15 extern u32 SAVE_SP_ADDR;
16 
17 /**
18  * back_to_bootrom() - return to bootrom (for TPL/SPL), passing a
19  *                     result code
20  *
21  * Transfer control back to the Rockchip BROM, restoring necessary
22  * register context and passing a command/result code to the BROM
23  * to instruct its next actions (e.g. continue boot sequence, enter
24  * download mode, ...).
25  *
26  * This function does not return.
27  *
28  * @brom_cmd: indicates how the bootrom should continue the boot
29  *            sequence (e.g. load the next stage)
30  */
31 enum rockchip_bootrom_cmd {
32 	/*
33 	* These can not start at 0, as 0 has a special meaning
34 	* for setjmp().
35 	*/
36 
37 	BROM_BOOT_NEXTSTAGE = 1,  /* continue boot-sequence */
38 	BROM_BOOT_ENTER_DNL,      /* have BROM enter download-mode */
39 };
40 
41 void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd);
42 #endif
43