riscv: Add machine name to kernel boot log and stack dump output
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 25 Nov 2020 11:44:15 +0000 (19:44 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Thu, 14 Jan 2021 23:08:59 +0000 (15:08 -0800)
Add the machine name to kernel boot-up log, and install
the machine name to stack dump for DT boot mode.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/setup.c

index 90a4e06..4945b50 100644 (file)
@@ -214,8 +214,15 @@ static void __init init_resources(void)
 static void __init parse_dtb(void)
 {
        /* Early scan of device tree from init memory */
-       if (early_init_dt_scan(dtb_early_va))
+       if (early_init_dt_scan(dtb_early_va)) {
+               const char *name = of_flat_dt_get_machine_name();
+
+               if (name) {
+                       pr_info("Machine model: %s\n", name);
+                       dump_stack_set_arch_desc("%s (DT)", name);
+               }
                return;
+       }
 
        pr_err("No DTB passed to the kernel\n");
 #ifdef CONFIG_CMDLINE_FORCE