From 530fb27a57d18128e47cd1530470425436a697d1 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 28 Oct 2019 00:18:32 +0100 Subject: ARM: stm32mp: implement SoC and boot source identification The BSEC OTP holds information about SoC type and package. The Tamp registers hold information from the BootROM about boot source. Add support for both. Additionally, the tamp registers can also hold a request from the operating system about what mode to enter after boot, e.g. boot-into-recovery. A global function is exported for this, but unused so far. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- arch/arm/mach-stm32mp/include/mach/bootsource.h | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 arch/arm/mach-stm32mp/include/mach/bootsource.h (limited to 'arch/arm/mach-stm32mp/include/mach/bootsource.h') diff --git a/arch/arm/mach-stm32mp/include/mach/bootsource.h b/arch/arm/mach-stm32mp/include/mach/bootsource.h new file mode 100644 index 0000000000..1b6f562ac3 --- /dev/null +++ b/arch/arm/mach-stm32mp/include/mach/bootsource.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ +/* + * Copyright (C) 2018, STMicroelectronics - All Rights Reserved + */ + +#ifndef __MACH_STM32_BOOTSOURCE_H__ +#define __MACH_STM32_BOOTSOURCE_H__ + +enum stm32mp_boot_device { + STM32MP_BOOT_FLASH_SD = 0x10, /* .. 0x13 */ + STM32MP_BOOT_FLASH_EMMC = 0x20, /* .. 0x23 */ + STM32MP_BOOT_FLASH_NAND = 0x30, + STM32MP_BOOT_FLASH_NAND_FMC = 0x31, + STM32MP_BOOT_FLASH_NOR = 0x40, + STM32MP_BOOT_FLASH_NOR_QSPI = 0x41, + STM32MP_BOOT_SERIAL_UART = 0x50, /* .. 0x58 */ + STM32MP_BOOT_SERIAL_USB = 0x60, + STM32MP_BOOT_SERIAL_USB_OTG = 0x62, +}; + +enum stm32mp_forced_boot_mode { + STM32MP_BOOT_NORMAL = 0x00, + STM32MP_BOOT_FASTBOOT = 0x01, + STM32MP_BOOT_RECOVERY = 0x02, + STM32MP_BOOT_STM32PROG = 0x03, + STM32MP_BOOT_UMS_MMC0 = 0x10, + STM32MP_BOOT_UMS_MMC1 = 0x11, + STM32MP_BOOT_UMS_MMC2 = 0x12, +}; + +enum stm32mp_forced_boot_mode st32mp_get_forced_boot_mode(void); + +#endif -- cgit v1.2.3