u-boot/arch/riscv/lib/bdinfo.c
Heinrich Schuchardt 66b5ee9c55 riscv: add RISC-V fields to bdinfo command
The firmware invoking main U-Boot uses

* a0 to pass the boot hart
* a1 to pass a device-tree

Let the bdinfo command print this information, e.g.

    boot hart   = 0x000000000000001b
    firmware fdt= 0x0000000087e00000

The firmware fdt field will only be printed if it is non-zero.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2024-07-22 11:15:11 +08:00

19 lines
390 B
C

// 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);
}