]> git.baikalelectronics.ru Git - uboot.git/commit
riscv: do not rely on hart ID passed by previous boot stage
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>
Sun, 17 Mar 2019 18:28:39 +0000 (19:28 +0100)
committerAndes <uboot@andestech.com>
Mon, 8 Apr 2019 01:44:26 +0000 (09:44 +0800)
commitbbfbf741403c9b3f8135a3ba11b504a3c6eb42c4
treef3cb4c2d3ab49acd16bcf54f9419a32568ba5b73
parentf0b62626659834ee511b7b77dd1ad19277c50308
riscv: do not rely on hart ID passed by previous boot stage

RISC-V U-Boot expects the hart ID to be passed to it via register a0 by
the previous boot stage. Machine mode firmware such as BBL and OpenSBI
do this when starting their payload (U-Boot) in supervisor mode. If
U-Boot is running in machine mode, this task must be handled by the boot
ROM. Explicitly populate register a0 with the hart ID from the mhartid
CSR to avoid possible problems on RISC-V processors with a boot ROM that
does not handle this task.

Suggested-by: Rick Chen <rick@andestech.com>
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Rick Chen <rick@andestech.com>
arch/riscv/cpu/start.S