aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini2020-08-25 08:18:50 -0400
committerTom Rini2020-08-25 08:18:50 -0400
commit078656186f1037894c45682ca74d0921de8a7010 (patch)
tree20a323869e7d79f9da8996259066c7446beb292a /arch
parent8ee3a24fdc237c76cead618a173740594287dd96 (diff)
parentc92b50a44b95e706b9c0c97544bd7504fe6d36e9 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
- Sipeed Maix support S-mode. - Provide command sbi. - Use fdtdec_get_addr_size_auto_parent to get fu540 cache base address. - Fix a compiler error with CONFIG_SPL_SMP=n. - Fix sifive ram driver 32 compiler warnings. - Fix kendryte/pll.h redefine nop() warning.
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/cpu/fu540/cache.c3
-rw-r--r--arch/riscv/include/asm/sbi.h2
-rw-r--r--arch/riscv/lib/sbi.c36
-rw-r--r--arch/riscv/lib/spl.c2
4 files changed, 41 insertions, 2 deletions
diff --git a/arch/riscv/cpu/fu540/cache.c b/arch/riscv/cpu/fu540/cache.c
index 54de14238cc..78f5ad9d602 100644
--- a/arch/riscv/cpu/fu540/cache.c
+++ b/arch/riscv/cpu/fu540/cache.c
@@ -35,7 +35,8 @@ int cache_enable_ways(void)
if (node < 0)
return node;
- base = fdtdec_get_addr(blob, node, "reg");
+ base = fdtdec_get_addr_size_auto_parent(blob, 0, node, "reg", 0,
+ NULL, false);
if (base == FDT_ADDR_T_NONE)
return FDT_ADDR_T_NONE;
diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h
index 08e1ac0c0e2..53ca316180e 100644
--- a/arch/riscv/include/asm/sbi.h
+++ b/arch/riscv/include/asm/sbi.h
@@ -115,6 +115,8 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
unsigned long asid);
#endif
void sbi_set_timer(uint64_t stime_value);
+long sbi_get_spec_version(void);
+int sbi_get_impl_id(void);
int sbi_probe_extension(int ext);
#endif
diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c
index 8fbc23839dd..77845a73ca3 100644
--- a/arch/riscv/lib/sbi.c
+++ b/arch/riscv/lib/sbi.c
@@ -54,6 +54,42 @@ void sbi_set_timer(uint64_t stime_value)
}
/**
+ * sbi_get_spec_version() - get current SBI specification version
+ *
+ * Return: version id
+ */
+long sbi_get_spec_version(void)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_SPEC_VERSION,
+ 0, 0, 0, 0, 0, 0);
+ if (!ret.error)
+ if (ret.value)
+ return ret.value;
+
+ return -ENOTSUPP;
+}
+
+/**
+ * sbi_get_impl_id() - get SBI implementation ID
+ *
+ * Return: implementation ID
+ */
+int sbi_get_impl_id(void)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_ID,
+ 0, 0, 0, 0, 0, 0);
+ if (!ret.error)
+ if (ret.value)
+ return ret.value;
+
+ return -ENOTSUPP;
+}
+
+/**
* sbi_probe_extension() - Check if an SBI extension ID is supported or not.
* @extid: The extension ID to be probed.
*
diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c
index e24ec5a46c0..5e19d0f36ab 100644
--- a/arch/riscv/lib/spl.c
+++ b/arch/riscv/lib/spl.c
@@ -39,7 +39,7 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
{
typedef void __noreturn (*image_entry_riscv_t)(ulong hart, void *dtb);
void *fdt_blob;
- int ret;
+ __maybe_unused int ret;
#if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL)
fdt_blob = spl_image->fdt_addr;