Merge https://source.denx.de/u-boot/custodians/u-boot-samsung

[trini: Migrate CONFIG_EXYNOS7420 as part of merging, so espresso7420
still builds]

Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/riscv/include/asm/io.h b/arch/riscv/include/asm/io.h
index 3540773..fc39bb2 100644
--- a/arch/riscv/include/asm/io.h
+++ b/arch/riscv/include/asm/io.h
@@ -64,6 +64,10 @@
 #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 5030892..bfcd204 100644
--- a/arch/riscv/include/asm/sbi.h
+++ b/arch/riscv/include/asm/sbi.h
@@ -152,6 +152,7 @@
 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 2b53896..d427d1b 100644
--- a/arch/riscv/lib/sbi.c
+++ b/arch/riscv/lib/sbi.c
@@ -90,6 +90,25 @@
 }
 
 /**
+ * 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.
  *
diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c
index 5fb32fd..d6a4291 100644
--- a/board/AndesTech/ax25-ae350/ax25-ae350.c
+++ b/board/AndesTech/ax25-ae350/ax25-ae350.c
@@ -57,9 +57,9 @@
 void *board_fdt_blob_setup(int *err)
 {
 	*err = 0;
-#if CONFIG_IS_ENABLED(OF_BOARD)
+#if defined(CONFIG_OF_BOARD)
 	return (void *)(ulong)gd->arch.firmware_fdt_addr;
-#elif CONFIG_IS_ENABLED(OF_SEPARATE)
+#elif defined(CONFIG_OF_SEPARATE)
 	return (void *)CONFIG_SYS_FDT_BASE;
 #else
 	*err = -EINVAL;
diff --git a/board/samsung/espresso7420/Kconfig b/board/samsung/espresso7420/Kconfig
index 62251c5..6a088a2 100644
--- a/board/samsung/espresso7420/Kconfig
+++ b/board/samsung/espresso7420/Kconfig
@@ -1,5 +1,8 @@
 if TARGET_ESPRESSO7420
 
+config EXYNOS7420
+	def_bool y
+
 config SYS_BOARD
 	default "espresso7420"
 	help
diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c
index 65a2c93..c4a9c84 100644
--- a/cmd/riscv/sbi.c
+++ b/cmd/riscv/sbi.c
@@ -49,24 +49,34 @@
 static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,
 		  char *const argv[])
 {
-	int i;
+	int i, impl_id;
 	long ret;
 
 	ret = sbi_get_spec_version();
 	if (ret >= 0)
-		printf("SBI %ld.%ld\n", ret >> 24, ret & 0xffffff);
-	ret = sbi_get_impl_id();
-	if (ret >= 0) {
+		printf("SBI %ld.%ld", ret >> 24, ret & 0xffffff);
+	impl_id = sbi_get_impl_id();
+	if (impl_id >= 0) {
 		for (i = 0; i < ARRAY_SIZE(implementations); ++i) {
-			if (ret == implementations[i].id) {
-				printf("%s\n", implementations[i].name);
+			if (impl_id == implementations[i].id) {
+				long vers;
+
+				printf("\n%s ", implementations[i].name);
+				ret = sbi_get_impl_version(&vers);
+				if (ret < 0)
+					break;
+				if (impl_id == 1)
+					printf("%ld.%ld",
+					       vers >> 16, vers & 0xffff);
+				else
+					printf("0x%lx", vers);
 				break;
 			}
 		}
 		if (i == ARRAY_SIZE(implementations))
-			printf("Unknown implementation ID %ld\n", ret);
+			printf("Unknown implementation ID %ld", ret);
 	}
-	printf("Extensions:\n");
+	printf("\nExtensions:\n");
 	for (i = 0; i < ARRAY_SIZE(extensions); ++i) {
 		ret = sbi_probe_extension(extensions[i].id);
 		if (ret > 0)
diff --git a/common/image-board.c b/common/image-board.c
index e766035..ddf30c6 100644
--- a/common/image-board.c
+++ b/common/image-board.c
@@ -898,7 +898,7 @@
 	debug("## kernel board info at 0x%08lx\n", (ulong)*kbd);
 
 #if defined(DEBUG)
-	if (IS_ENABLED(CONFIG_CMD_BDI)
+	if (IS_ENABLED(CONFIG_CMD_BDI))
 		do_bdinfo(NULL, 0, 0, NULL);
 #endif
 
diff --git a/include/configs/exynos7420-common.h b/include/configs/exynos7420-common.h
index 4a1ecbb..464f927 100644
--- a/include/configs/exynos7420-common.h
+++ b/include/configs/exynos7420-common.h
@@ -10,7 +10,6 @@
 
 /* High Level Configuration Options */
 #define CONFIG_SAMSUNG			/* in a SAMSUNG core */
-#define CONFIG_EXYNOS7420		/* Exynos7 Family */
 #define CONFIG_S5P
 
 #include <asm/arch/cpu.h>		/* get chip and board defs */