diff options
author | Tom Rini | 2021-11-08 21:44:02 -0500 |
---|---|---|
committer | Tom Rini | 2021-11-08 21:44:02 -0500 |
commit | b842340a108f463e66aaaca75c0831a224612190 (patch) | |
tree | f4f49ea253d1ec7fc7f62bb7f5ee342bb91bef0a /arch | |
parent | f8ed9059001d803b0eae4b49178789aa0e29edec (diff) | |
parent | 990e1e4beae546ddc9c50854c0588d1bea494cd2 (diff) |
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
Diffstat (limited to 'arch')
-rw-r--r-- | arch/riscv/include/asm/io.h | 4 | ||||
-rw-r--r-- | arch/riscv/include/asm/sbi.h | 1 | ||||
-rw-r--r-- | arch/riscv/lib/sbi.c | 19 |
3 files changed, 24 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h index 3540773c4fe..fc39bb2c701 100644 --- a/arch/riscv/include/asm/io.h +++ b/arch/riscv/include/asm/io.h @@ -64,6 +64,10 @@ static inline phys_addr_t map_to_sysmem(const void *ptr) #define __raw_readl(a) __arch_getl(a) #define __raw_readq(a) __arch_getq(a) +/* adding for cadence_qspi_apb.c */ +#define memcpy_fromio(a, c, l) memcpy((a), (c), (l)) +#define memcpy_toio(c, a, l) memcpy((c), (a), (l)) + #define dmb() mb() #define __iormb() rmb() #define __iowmb() wmb() diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 5030892b479..bfcd2049537 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -152,6 +152,7 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask, void sbi_set_timer(uint64_t stime_value); long sbi_get_spec_version(void); int sbi_get_impl_id(void); +int sbi_get_impl_version(long *version); int sbi_probe_extension(int ext); void sbi_srst_reset(unsigned long type, unsigned long reason); diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c index 2b53896b8a3..d427d1b29ea 100644 --- a/arch/riscv/lib/sbi.c +++ b/arch/riscv/lib/sbi.c @@ -90,6 +90,25 @@ int sbi_get_impl_id(void) } /** + * sbi_get_impl_version() - get SBI implementation version + * + * @version: pointer to receive version + * Return: 0 on success, -ENOTSUPP otherwise + */ +int sbi_get_impl_version(long *version) +{ + struct sbiret ret; + + ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_VERSION, + 0, 0, 0, 0, 0, 0); + if (ret.error) + return -ENOTSUPP; + if (version) + *version = ret.value; + return 0; +} + +/** * sbi_probe_extension() - Check if an SBI extension ID is supported or not. * @extid: The extension ID to be probed. * |