mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
The bootsource ids reported by BootROM of RK3528 and RK3576 for e.g. SPI NOR and USB differs slightly compared to prior SoCs: - Booting from sfc0 (ROCK 4D) report the normal bootsource id 0x3. - Booting from sfc1 M1 (NanoPi M5) report a new bootsource id 0x23. - Booting from sfc1 M0 has not been tested (no board using this config). - Booting from USB report a new bootsource id 0x81 on RK3528 and RK3576. Add a helper function to read the bootsource id. This helper function will be used to translate the new values to the common BROM_BOOTSOURCE enum values on RK3528 and RK3576. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
70 lines
1.7 KiB
C
70 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* (C) Copyright 2017 Heiko Stuebner <heiko@sntech.de>
|
|
* (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
|
|
*/
|
|
|
|
#ifndef _ASM_ARCH_BOOTROM_H
|
|
#define _ASM_ARCH_BOOTROM_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
/*
|
|
* Saved Stack pointer address.
|
|
* Access might be needed in some special cases.
|
|
*/
|
|
extern u32 SAVE_SP_ADDR;
|
|
|
|
/**
|
|
* 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.
|
|
*
|
|
* @brom_cmd: indicates how the bootrom should continue the boot
|
|
* sequence (e.g. load the next stage)
|
|
*/
|
|
enum rockchip_bootrom_cmd {
|
|
/*
|
|
* These can not start at 0, as 0 has a special meaning
|
|
* for setjmp().
|
|
*/
|
|
|
|
BROM_BOOT_NEXTSTAGE = 1, /* continue boot-sequence */
|
|
BROM_BOOT_ENTER_DNL, /* have BROM enter download-mode */
|
|
};
|
|
|
|
void back_to_bootrom(enum rockchip_bootrom_cmd brom_cmd);
|
|
|
|
/**
|
|
* Boot-device identifiers as used by the BROM
|
|
*/
|
|
enum {
|
|
BROM_BOOTSOURCE_UNKNOWN = 0,
|
|
BROM_BOOTSOURCE_NAND = 1,
|
|
BROM_BOOTSOURCE_EMMC = 2,
|
|
BROM_BOOTSOURCE_SPINOR = 3,
|
|
BROM_BOOTSOURCE_SPINAND = 4,
|
|
BROM_BOOTSOURCE_SD = 5,
|
|
BROM_BOOTSOURCE_I2C = 8,
|
|
BROM_BOOTSOURCE_SPI = 9,
|
|
BROM_BOOTSOURCE_USB = 10,
|
|
BROM_LAST_BOOTSOURCE = BROM_BOOTSOURCE_USB
|
|
};
|
|
|
|
extern const char * const boot_devices[BROM_LAST_BOOTSOURCE + 1];
|
|
|
|
/**
|
|
* Locations of the boot-device identifier in SRAM
|
|
*/
|
|
#define BROM_BOOTSOURCE_ID_ADDR (CFG_IRAM_BASE + 0x10)
|
|
|
|
u32 read_brom_bootsource_id(void);
|
|
|
|
#endif
|