aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/riscv/lib/Makefile1
-rw-r--r--arch/riscv/lib/bdinfo.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile
index 9a05b662fd6..65dc49f6fa5 100644
--- a/arch/riscv/lib/Makefile
+++ b/arch/riscv/lib/Makefile
@@ -26,6 +26,7 @@ obj-y += setjmp.o
obj-$(CONFIG_$(SPL_)SMP) += smp.o
obj-$(CONFIG_SPL_BUILD) += spl.o
obj-y += fdt_fixup.o
+obj-$(CONFIG_$(SPL)CMD_BDI) += bdinfo.o
# For building EFI apps
CFLAGS_NON_EFI := -fstack-protector-strong
diff --git a/arch/riscv/lib/bdinfo.c b/arch/riscv/lib/bdinfo.c
new file mode 100644
index 00000000000..7734e51d670
--- /dev/null
+++ b/arch/riscv/lib/bdinfo.c
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * RISC-V-specific information for the 'bdinfo' command
+ */
+
+#include <init.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+void arch_print_bdinfo(void)
+{
+ bdinfo_print_num_l("boot hart", gd->arch.boot_hart);
+
+ if (gd->arch.firmware_fdt_addr)
+ bdinfo_print_num_ll("firmware fdt",
+ (long long)gd->arch.firmware_fdt_addr);
+}