1. 02 7月, 2020 1 次提交
  2. 19 5月, 2020 1 次提交
  3. 23 4月, 2020 1 次提交
  4. 25 1月, 2020 1 次提交
  5. 18 1月, 2020 1 次提交
  6. 10 12月, 2019 3 次提交
    • L
      spl: opensbi: wait for ack from secondary harts before entering OpenSBI · 0e1233ce
      Lukas Auer 提交于
      At the start, OpenSBI relocates itself to its link address. If the link
      address ranges of U-Boot SPL and OpenSBI overlap, the relocation can
      lead to code corruption if a hart is still running U-Boot SPL during
      relocation. To avoid this problem, the main hart is specified as the
      preferred boot hart to perform the relocation. This fixes the code
      corruption problems based on the assumption that since the main hart
      schedules the secondary harts to enter OpenSBI, it will be the last to
      enter OpenSBI. However it was reported that this assumption is not
      always correct.
      
      To make sure the assumption always holds true, wait for all secondary
      harts to acknowledge the call-function request before entering OpenSBI
      on the main hart.
      Reported-by: NRick Chen <rick@andestech.com>
      Signed-off-by: NLukas Auer <lukas.auer@aisec.fraunhofer.de>
      Reviewed-by: NRick Chen <rick@andestech.com>
      Tested-by: NRick Chen <rick@andestech.com>
      Reviewed-by: NAnup Patel <anup.patel@wdc.com>
      0e1233ce
    • L
      riscv: add option to wait for ack from secondary harts in smp functions · 90ae2814
      Lukas Auer 提交于
      Add a wait option to smp_call_function() to wait for the secondary harts
      to acknowledge the call-function request. The request is considered to
      be acknowledged once each secondary hart has cleared the corresponding
      IPI.
      
      As part of the call-function request, the secondary harts invalidate the
      instruction cache after clearing the IPI. This adds a delay between
      acknowledgment (clear IPI) and fulfillment (call function) of the
      request. We want to use the acknowledgment to be able to judge when the
      request has been completed. Remove the delay by clearing the IPI after
      cache invalidation and just before calling the function from the
      request.
      Signed-off-by: NLukas Auer <lukas.auer@aisec.fraunhofer.de>
      Reviewed-by: NRick Chen <rick@andestech.com>
      Tested-by: NRick Chen <rick@andestech.com>
      Reviewed-by: NAnup Patel <anup.patel@wdc.com>
      90ae2814
    • L
      spl: opensbi: specify main hart as preferred boot hart · b86f6d1e
      Lukas Auer 提交于
      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: NRick Chen <rick@andestech.com>
      Suggested-by: NAnup Patel <Anup.Patel@wdc.com>
      Signed-off-by: NLukas Auer <lukas.auer@aisec.fraunhofer.de>
      Reviewed-by: NRick Chen <rick@andestech.com>
      Tested-by: NRick Chen <rick@andestech.com>
      Reviewed-by: NAnup Patel <anup.patel@wdc.com>
      b86f6d1e
  7. 03 12月, 2019 1 次提交
  8. 26 8月, 2019 1 次提交
    • L
      spl: support booting via RISC-V OpenSBI · 5e30e45c
      Lukas Auer 提交于
      RISC-V OpenSBI is an open-source implementation of the RISC-V Supervisor
      Binary Interface (SBI) specification. It is required by Linux and U-Boot
      running in supervisor mode. This patch adds support for booting via the
      OpenSBI FW_DYNAMIC firmware. It supports OpenSBI version 0.4 and higher.
      
      In this configuration, U-Boot SPL starts in machine mode. After loading
      OpenSBI and U-Boot proper, it will start OpenSBI. All necessary
      parameters are generated by U-Boot SPL and are passed to OpenSBI. U-Boot
      proper is started in supervisor mode by OpenSBI. Support for OpenSBI is
      enabled with CONFIG_SPL_OPENSBI. An additional configuration entry,
      CONFIG_SPL_OPENSBI_LOAD_ADDR, is used to specify the load address of the
      OpenSBI firmware binary. It is not used directly in U-Boot and instead
      is intended to make the value available to scripts such as FIT
      configuration generators.
      
      The header file include/opensbi.h is based on header files from the
      OpenSBI project. They are recent, as of commit bae54f764570 ("firmware:
      Add fw_dynamic firmware").
      Signed-off-by: NLukas Auer <lukas.auer@aisec.fraunhofer.de>
      Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
      Tested-by: NBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: NAnup Patel <anup.patel@wdc.com>
      5e30e45c