diff options
author | Sean Anderson <seanga2@gmail.com> | 2020-09-21 07:51:37 -0400 |
---|---|---|
committer | Andes <uboot@andestech.com> | 2020-09-30 08:54:52 +0800 |
commit | f760c9a1fd485beae7612e39576e5fbf77c5d96b (patch) | |
tree | 41e9a807d125707c4b5536a3e19aa63b7645aa5c /drivers/timer/sandbox_timer.c | |
parent | d4990a46485f2f6592ae29f2b822043dbdeae15d (diff) |
riscv: Use a valid bit to ignore already-pending IPIs
Some IPIs may already be pending when U-Boot is started. This could be a
problem if a secondary hart tries to handle an IPI before the boot hart has
initialized the IPI device.
To be specific, the Kendryte K210 ROM-based bootloader does not clear IPIs
before passing control to U-Boot. Without this patch, the secondary hart
jumps to address 0x0 as soon as it enters secondary_hart_loop, and then
hangs in its trap handler.
This commit introduces a valid bit so secondary harts know when and IPI
originates from U-Boot, and it is safe to use the IPI API. The valid bit is
initialized to 0 by board_init_f_init_reserve. Before this, secondary harts
wait in wait_for_gd_init.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Leo Liang <ycliang@andestech.com>
Diffstat (limited to 'drivers/timer/sandbox_timer.c')
0 files changed, 0 insertions, 0 deletions