1. Apr 28, 2021
  2. Apr 24, 2021
  3. Apr 22, 2021
    • Guo Ren's avatar
      lib: utils: reset: Add T-HEAD sample platform reset driver · 49e422c5
      Guo Ren authored
      
      
      This driver is for T-HEAD test chip, fpga. It could work with
      all T-HEAD riscv processors: C9xx series.
      
      example1: (Using io-regs for reset)
      reset: reset-sample {
      	compatible = "thead,reset-sample";
      	plic-delegate = <0xff 0xd81ffffc>;
      	entry-reg = <0xff 0xff019050>;
      	entry-cnt = <4>;
      	control-reg = <0xff 0xff015004>;
      	control-val = <0x1c>;
      	csr-copy = <0x7f3 0x7c0 0x7c1 0x7c2 0x7c3 0x7c5 0x7cc>;
      };
      
      example2: (Using csr-regs for reset)
      reset: reset-sample {
      	compatible = "thead,reset-sample";
      	plic-delegate = <0xff 0xd81ffffc>;
      	using-csr-reset;
      	csr-copy = <0x7c0 0x7c1 0x7c2 0x7c3 0x7c5 0x7cc
      		    0x3b0 0x3b1 0x3b2 0x3b3
      		    0x3b4 0x3b5 0x3b6 0x3b7
      		    0x3a0>;
      };
      
      example3: (Only delegate plic enable to S-mode)
      reset: reset-sample {
      	compatible = "thead,reset-sample";
      	plic-delegate = <0xff 0xd81ffffc>;
      };
      
      After this patch, all T-HEAD c9xx would use platform/generic with fw_dynamic
      as default:
      
      CROSS_COMPILE=riscv64-linux-gnu- PLATFORM=generic FW_PIC=y /usr/bin/make
      
      The platform/thead will be deprecated.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      49e422c5
    • Guo Ren's avatar
      lib: utils: Implement "64bit-mmio" property parsing · c5d06450
      Guo Ren authored
      
      
      Figure out CLINT has_64bit_mmio from DT node and using antonym for
      compatibility.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarAnup Patel <anup.patel@wdc.com>
      c5d06450
  4. Apr 13, 2021
  5. Apr 12, 2021
  6. Apr 09, 2021
  7. Apr 05, 2021
  8. Apr 01, 2021
  9. 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
  10. 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
  11. Mar 12, 2021
  12. Mar 03, 2021
  13. Jan 18, 2021