1. Mar 19, 2021
    • Vincent Chen's avatar
      firmware: Support position independent execution · 0f20e8ad
      Vincent Chen authored
      
      
      Enable OpenSBI to support position independent execution. Because the
      position independent code will cause an additional GOT reference when
      accessing the global variables, it will reduce performance a bit. Therefore,
      the position independent execution is disabled by default. Users can
      through specifying "FW_PIC=y" on the make command to enable this feature.
      
      In theory, after enabling position-independent execution, the OpenSBI
      can run at arbitrary address with appropriate alignment. Therefore, the
      original relocation mechanism will be skipped. In other words, OpenSBI will
      directly run at the load address without any code movement.
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      0f20e8ad
    • Vincent Chen's avatar
      firmware: Use lla to access all global symbols · 22d8ee97
      Vincent Chen authored
      
      
      When OpenSBI is compiled as fPIE mode, the assembler will translate "la"
      to GOT reference pattern. It will cause to cost an additional load
      instruction when obtaining the symbol address. However, if the symbol
      locates within the positive or negative 2GB region, we can use "lla"
      instead of "la" to avoid unneeded GOT references. This patch assumes that
      the OpenSBI image excluding the payload does not exceed 2GB. Based on
      this assumption, all "la" instructions are replaced by "lla" to avoid
      performance degradation when compiling as fPIE mode.
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      22d8ee97
  2. Mar 12, 2021
  3. Mar 03, 2021
  4. Jan 18, 2021
  5. Jan 15, 2021
  6. Jan 12, 2021
    • Anup Patel's avatar
      lib: sbi: Allow platforms to provide root domain memory regions · db56341d
      Anup Patel authored
      
      
      Currently, the root domain memory regions are fixed in generic
      code but some of the platforms may want to explicitly define
      memory regions for the root domain.
      
      This patch adds optional domains_root_regions() platform callback
      which platforms can use to provide platform specific root domain
      memory regions. Due to this changes, the root domain should also
      undergo all sanity checks (just like regular domain) so we use
      sbi_domain_register() to register root domain.
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      db56341d
  7. Jan 07, 2021
    • Vijai Kumar K's avatar
      lib: utils: Fix shakti uart implementation · 0d49c3bc
      Vijai Kumar K authored
      
      
      Fix uart_putc implementation.
      Due to a bug in the IP, this went unnoticed.
      Use macros instead of magic numbers to make the code
      more readable.
      
      Signed-off-by: default avatarVijai Kumar K <vijai@behindbytes.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      0d49c3bc
    • Anup Patel's avatar
      lib: sbi: Allow custom local TLB flush function · 12394a26
      Anup Patel authored
      
      
      Currently, we have fixed TLB flush types supported by the
      remote TLB library. This approach is not flexible and does
      not allow custom local TLB flush function. For example,
      after updating PMP entries on a set of HARTs at runtime,
      we have to flush TLB on these HARTs as well.
      
      To support custom local TLB flush function, we replace the
      "type" field of "struct sbi_tlb_info" with a local TLB flush
      function pointer. We also provide definitions of standard TLB
      flush operations (such as fence_i, sfence.vma, hfence.vvma,
      hfence.gvma, etc).
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      12394a26
    • Anup Patel's avatar
      lib: sbi: Introduce sbi_trap_exit() API · b7df5e43
      Anup Patel authored
      
      
      We introduce sbi_trap_exit() API which can help non-firmware
      (i.e. generic or platform) code to force exit trap/interrupt
      handling and resume execution at context pointed by parameter
      "const struct sbi_trap_regs *regs".
      
      This new sbi_trap_exit() API will help Keystone Enclave project
      to resume execution of enclave from custom SBI call handler.
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      b7df5e43
    • Anup Patel's avatar
      lib: sbi: Replace args with trap registers in ecall handler · 80bc5065
      Anup Patel authored
      
      
      We had added args pointer in ecall handler to ensure that ecall
      handler only implements functionality and does not deal with
      SBI calling convention. This also helped us to keep SBI calling
      convention related code in one place at sbi_ecall_handler().
      
      The Keystone Enclavce project needs access to the trap regsiters
      in their ecall handler so that they can context switch enclaves
      in custom SBI calls. To help the Keystone Enclave project, we
      replace the args pointer in ecall handler parameter with a const
      pointer to trap registers.
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      80bc5065
  8. Dec 24, 2020
  9. Dec 16, 2020
  10. Dec 13, 2020
  11. Dec 04, 2020