u-boot-brain/common/spl
Lukas Auer b86f6d1e64 spl: opensbi: specify main hart as preferred boot hart
OpenSBI uses a relocation lottery to determine the hart to relocate
OpenSBI to its link address. In the U-Boot SPL boot flow, the main hart
schedules the secondary harts to enter OpenSBI before doing so itself.
One of the secondary harts will therefore always be the winner of the
relocation lottery. This is problematic if the link address ranges of
OpenSBI and U-Boot SPL overlap. OpenSBI will be relocated and therefore
overwrite U-Boot SPL while some harts may still run it, leading to code
corruption.

Avoid this problem by specifying the main hart as the preferred boot
hart to perform the OpenSBI relocation. The main hart will be the last
hart to enter OpenSBI, relocation can therefore occur safely.

The boot hart field was added to version 2 of the OpenSBI FW_DYNAMIC
info structure. The header file include/opensbi.h is synchronized with
include/sbi/fw_dynamic.h from the OpenSBI project to update the info
structure. The header file is recent as of commit
7a13beb21326 ("firmware: Add preferred boot HART field in struct
fw_dynamic_info").

Reported-by: Rick Chen <rick@andestech.com>
Suggested-by: Anup Patel <Anup.Patel@wdc.com>
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Rick Chen <rick@andestech.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-12-10 08:23:10 +08:00
..
Kconfig spl: cache: Allow cache drivers in SPL 2019-12-10 08:23:10 +08:00
Makefile spl: separate SPL_FRAMEWORK config for spl and tpl 2019-11-17 17:22:53 +08:00
spl_atf.c common: Move some cache and MMU functions out of common.h 2019-12-02 18:23:55 -05:00
spl_bootrom.c spl: pass args to board_return_to_bootrom 2019-10-08 16:35:16 +02:00
spl_dfu.c env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
spl_ext.c env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
spl_fat.c env: Move env_get() to env.h 2019-08-11 16:43:41 -04:00
spl_fit.c imx: replace CONFIG_SECURE_BOOT with CONFIG_IMX_HAB 2019-10-08 16:36:37 +02:00
spl_mmc.c spl: spl_mmc: fix getting raw_sect when boot from emmc boot partition 2019-10-29 10:09:44 +08:00
spl_nand.c spl: nand: support loading i.MX container format file 2019-10-08 16:36:36 +02:00
spl_net.c env: Move env_init() to env.h 2019-08-11 16:43:41 -04:00
spl_nor.c spl: nor: Provide falcon boot support for NOR memories 2019-11-03 17:04:16 +01:00
spl_onenand.c spl: Weed out CONFIG_SYS_TEXT_BASE usage 2018-09-25 21:48:43 -04:00
spl_opensbi.c spl: opensbi: specify main hart as preferred boot hart 2019-12-10 08:23:10 +08:00
spl_optee.S Rockchip-focused changes for v2018.11-rc2: 2018-10-05 13:40:42 -04:00
spl_ram.c spl: Kconfig: Drop the _SUPPORT postfix from SPL_DFU 2019-01-26 08:13:54 -05:00
spl_sata.c spl: sata: support U-Boot load from raw sata disk 2019-07-24 14:15:36 -04:00
spl_sdp.c Fixes for 2019.07 2019-06-28 08:00:22 -04:00
spl_spi.c spl: spi: support loading i.MX container format file 2019-10-08 16:36:36 +02:00
spl_ubi.c ubispl: add support for loading volumes by name 2019-07-09 07:00:25 +02:00
spl_usb.c usb: Rename SPL_USB_SUPPORT to SPL_USB_STORAGE 2019-02-15 22:01:15 +01:00
spl_xip.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spl_ymodem.c spl: ymodem: Fix loading of fit image 2019-12-03 08:44:14 -05:00
spl.c Revert "spl: fix entry_point equal to load_addr" 2019-12-06 09:56:03 -05:00