All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Fixes for RISC-V U-Boot SPL / OpenSBI boot flow
@ 2019-12-08 22:28 Lukas Auer
  2019-12-08 22:28 ` [PATCH v2 1/4] spl: opensbi: specify main hart as preferred boot hart Lukas Auer
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Lukas Auer @ 2019-12-08 22:28 UTC (permalink / raw)
  To: u-boot

Rick's recent patch series, which adds support for U-Boot SPL to the
Andes platform, brought several problems of the current U-Boot SPL boot
flow on RISC-V to light. Discussion on the relevant parts starts at [1].

The problem showed itself in the form of code corruption. At start,
OpenSBI relocates itself to its link address. This allows it to be
loaded independently of the link address. In the case that the link
address ranges of U-Boot SPL and OpenSBI overlap, code corruption occurs
if the relocation starts while some harts are still running U-Boot SPL.
This series prevents this problem by specifying the hart that performs
the relocation and then making sure that it is the last hart to enter
OpenSBI, allowing relocation to be completed safely. A recent version of
OpenSBI is required for the changes to work.

This patch series resolves the problems associated with the use case of
overlapping link address ranges. However, it is still recommended to
select non-overlapping ranges for U-Boot SPL and OpenSBI.

[1]: https://lists.denx.de/pipermail/u-boot/2019-November/389385.html

Changes in v2:
- Use the pending register instead of the claim register in the Andes
PLIC implementation

Lukas Auer (4):
  spl: opensbi: specify main hart as preferred boot hart
  riscv: add functions for reading the IPI status
  riscv: add option to wait for ack from secondary harts in smp
    functions
  spl: opensbi: wait for ack from secondary harts before entering
    OpenSBI

 arch/riscv/cpu/start.S        |  2 ++
 arch/riscv/include/asm/smp.h  |  3 ++-
 arch/riscv/lib/andes_plic.c   | 11 +++++++++
 arch/riscv/lib/bootm.c        |  2 +-
 arch/riscv/lib/sbi_ipi.c      | 11 +++++++++
 arch/riscv/lib/sifive_clint.c |  9 ++++++++
 arch/riscv/lib/smp.c          | 43 +++++++++++++++++++++++++++--------
 arch/riscv/lib/spl.c          |  2 +-
 common/spl/spl_opensbi.c      | 13 ++++++++++-
 include/opensbi.h             | 18 ++++++++++++++-
 10 files changed, 100 insertions(+), 14 deletions(-)

-- 
2.21.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-09  2:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-08 22:28 [PATCH v2 0/4] Fixes for RISC-V U-Boot SPL / OpenSBI boot flow Lukas Auer
2019-12-08 22:28 ` [PATCH v2 1/4] spl: opensbi: specify main hart as preferred boot hart Lukas Auer
2019-12-08 22:28 ` [PATCH v2 2/4] riscv: add functions for reading the IPI status Lukas Auer
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA46AD52A@ATCPCS16.andestech.com>
2019-12-09  2:18     ` Rick Chen
2019-12-08 22:28 ` [PATCH v2 3/4] riscv: add option to wait for ack from secondary harts in smp functions Lukas Auer
2019-12-08 22:28 ` [PATCH v2 4/4] spl: opensbi: wait for ack from secondary harts before entering OpenSBI Lukas Auer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.