1. Jul 19, 2023
    • Anup Patel's avatar
      lib: utils/gpio: Fix RV32 compile error for designware GPIO driver · 057eb10b
      Anup Patel authored
      Currently, we see following compile error in the designeware GPIO driver
      for RV32 systems:
      
      lib/utils/gpio/fdt_gpio_designware.c:115:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        115 |         chip->dr = (void *)addr + (bank * 0xc);
            |                    ^
      lib/utils/gpio/fdt_gpio_designware.c:116:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        116 |         chip->ext = (void *)addr + (bank * 4) + 0x50;
      
      We fix the above error using an explicit type-cast to 'unsigned long'.
      
      Fixes: 7828eeba
      
       ("gpio/desginware: add Synopsys DesignWare APB GPIO support")
      Signed-off-by: default avatarAnup Patel <apatel@ventanamicro.com>
      Reviewed-by: default avatarXiang W <wxjstz@126.com>
      057eb10b
  2. Jul 09, 2023
  3. Jul 07, 2023
  4. Jul 05, 2023
  5. Jun 23, 2023
  6. Jun 21, 2023
  7. Jun 15, 2023
  8. Jun 14, 2023
  9. Jun 06, 2023
  10. Jun 05, 2023
  11. Jun 04, 2023
    • Andrew Jones's avatar
      lib: sbi: Align system suspend errors with spec · bdde2ecd
      Andrew Jones authored
      
      
      The spec says sbi_system_suspend() will return SBI_ERR_INVALID_PARAM
      when "sleep_type is reserved or is platform-specific and unimplemented"
      and SBI_ERR_NOT_SUPPORTED when sleep_type "is not reserved and is
      implemented, but the platform does not support it due to one or more
      missing dependencies." Ensure SBI_ERR_INVALID_PARAM is returned for
      reserved sleep types and that the system suspend driver can choose
      which of the two error types to return itself by returning an error
      from its check function rather than a boolean.
      
      Signed-off-by: default avatarAndrew Jones <ajones@ventanamicro.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      bdde2ecd
    • Heinrich Schuchardt's avatar
      lib: utils/ipi: buffer overrun aclint_mswi_cold_init · df75e099
      Heinrich Schuchardt authored
      The parameter checks in aclint_mswi_cold_init() don't guard against a
      buffer overrun.
      
      mswi_hartid2data is defined as an array of SBI_HARTMASK_MAX_BITS entries.
      The current check allows
      
          mswi->hart_count = ACLINT_MSWI_MAX_HARTS
          mswi->first_hartid = SBI_HARTMASK_MAX_BITS - 1.
      
      With these values mswi_hartid2data will be accessed at index
      
          SBI_HARTMASK_MAX_BITS + SBI_HARTMASK_MAX_BITS - 2.
      
      We have to check the sum of mswi->first_hartid and mswi->hart_count.
      
      Furthermore mswi->hart_count = 0 would not make much sense.
      
      Addresses-Coverity-ID: 1529705 ("Out-of-bounds write")
      Fixes: 5a049fe1
      
       ("lib: utils/ipi: Add ACLINT MSWI library")
      Signed-off-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
      Reviewed-by: default avatarXiang W <wxjstz@126.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      df75e099
  12. May 26, 2023
  13. May 22, 2023
    • Filip Filmar's avatar
      Makefile: Dereference symlinks on install · d4c46e0f
      Filip Filmar authored
      
      
      Adds the `-L` flag (follow symlinks) to the `cp` commands used to
      install `libsbi.a` and `include/sbi/*`.
      
      This should make no difference in regular compilation. However,
      it does make a difference when compiling with bazel.  Namely,
      bazel's sandboxing will turn all the source files into symlinks.
      After installation with `cp` the destination files will be
      symlinks pointing to the sandbox symlinks. As the sandbox files
      are removed when compilation ends, the just-copied symlinks
      become dangling symlinks.
      
      The resulting include files will be
      unusable due to the dangling symlink issues. Adding `-L` when
      copying ensures that the files obtained by executing the `install`
      targets are always dereferenced to files, rather than symlinks,
      eliminating this issue.
      
      Signed-off-by: default avatarFilip Filmar <fmil@google.com>
      Reviewed-by: default avatarXiang W <wxjstz@126.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      d4c46e0f
  14. May 21, 2023