1. Apr 13, 2021
  2. Apr 12, 2021
  3. Apr 09, 2021
  4. Apr 05, 2021
  5. Apr 01, 2021
  6. Mar 22, 2021
    • Marouene Boubakri's avatar
      include: headers: Replace __ASSEMBLY__ with __ASSEMBLER__ · bfc85c70
      Marouene Boubakri authored
      
      
      GCC has already a predefined macro __ASSEMBLER__ therefore, it can be
      used without the need to define a new flag with -D__ASSEMBLY__.
      This is useful when adding the library to projects having a build
      system such one can build without the need to make changes.
      THe build system does not use the Makefile in the sources tree.
      
      Signed-off-by: default avatarMarouene Boubakri <marouene.boubakri@nxp.com>
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      bfc85c70
    • Heinrich Schuchardt's avatar
      lib: sbi: illegal CSR 0x306 access in hpm_allowed() · ddad02d6
      Heinrich Schuchardt authored
      
      
      The trap handler sbi_emulate_csr_read() invokes hpm_allowed() which reads
      CSR 0x306 (mcounteren). The K210 does not support CSR 0x306. While trying
      to handle a trap occurring in S-mode code this creates an additional trap
      in M-mode. This results in failure to redirect to S-mode and the system
      hanging in sbi_hart_hang().
      
      In hart_detect_features() we have already determined if CSR 0x306 is
      available and stored that information in the scratch area. We can use this
      information to decide if CSR 0x306 shall be accessed in hpm_allowed() and
      thus avoid the M-mode trap.
      
      Likewise if CSR scounteren is not available we have to avoid reading CSR
      0x106.
      
      Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      ddad02d6
  7. 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
  8. Mar 12, 2021
  9. Mar 03, 2021
  10. Jan 18, 2021
  11. Jan 15, 2021
  12. 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
  13. Jan 07, 2021