2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2017-02-18 18:46:26 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2017 Heiko Stuebner <heiko@sntech.de>
|
2017-10-10 14:21:14 +00:00
|
|
|
* (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
|
2017-02-18 18:46:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_ARCH_BOOTROM_H
|
|
|
|
#define _ASM_ARCH_BOOTROM_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Saved Stack pointer address.
|
|
|
|
* Access might be needed in some special cases.
|
|
|
|
*/
|
|
|
|
extern u32 SAVE_SP_ADDR;
|
|
|
|
|
2017-04-15 19:11:31 +00:00
|
|
|
/**
|
2017-10-10 14:21:14 +00:00
|
|
|
* back_to_bootrom() - return to bootrom (for TPL/SPL), passing a
|
|
|
|
* result code
|
|
|
|
*
|
|
|
|
* Transfer control back to the Rockchip BROM, restoring necessary
|
|
|
|
* register context and passing a command/result code to the BROM
|
|
|
|
* to instruct its next actions (e.g. continue boot sequence, enter
|
|
|
|
* download mode, ...).
|
|
|
|
*
|
|
|
|
* This function does not return.
|
2017-10-10 14:21:16 +00:00
|
|
|
*
|
|
|
|
* @brom_cmd: indicates how the bootrom should continue the boot
|
|
|
|
* sequence (e.g. load the next stage)
|
2017-02-18 18:46:26 +00:00
|
|
|
*/
|
2017-10-10 14:21:14 +00:00
|
|
|
enum rockchip_bootrom_cmd {
|
|
|
|
/*
|
|
|
|
* These can not start at 0, as 0 has a special meaning
|
|
|
|
* for setjmp().
|
|
|
|
*/
|
2017-04-15 19:11:31 +00:00
|
|
|
|
2017-10-10 14:21:14 +00:00
|
|
|
BROM_BOOT_NEXTSTAGE = 1, /* continue boot-sequence */
|
|
|
|
BROM_BOOT_ENTER_DNL, /* have BROM enter download-mode */
|
|
|
|
};
|
|
|
|
|
2017-10-10 14:21:16 +00:00
|
|
|
void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd);
|
2017-02-18 18:46:26 +00:00
|
|
|
|
2017-09-29 17:27:55 +00:00
|
|
|
/**
|
|
|
|
* Boot-device identifiers as used by the BROM
|
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
BROM_BOOTSOURCE_NAND = 1,
|
|
|
|
BROM_BOOTSOURCE_EMMC = 2,
|
|
|
|
BROM_BOOTSOURCE_SPINOR = 3,
|
|
|
|
BROM_BOOTSOURCE_SPINAND = 4,
|
|
|
|
BROM_BOOTSOURCE_SD = 5,
|
|
|
|
BROM_BOOTSOURCE_USB = 10,
|
|
|
|
BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB
|
|
|
|
};
|
|
|
|
|
2019-07-22 11:59:11 +00:00
|
|
|
extern const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1];
|
|
|
|
|
2017-09-29 17:27:55 +00:00
|
|
|
/**
|
|
|
|
* Locations of the boot-device identifier in SRAM
|
|
|
|
*/
|
2019-07-22 11:59:10 +00:00
|
|
|
#define BROM_BOOTSOURCE_ID_ADDR (CONFIG_IRAM_BASE + 0x10)
|
2017-09-29 17:27:55 +00:00
|
|
|
|
2017-02-18 18:46:26 +00:00
|
|
|
#endif
|