Skip to content

Commit c70fc78

Browse files
ozbenhstewartsmith
authored andcommitted
init: Print some more info before booting linux
The kernel command line from nvram and the stdout-path are useful to know when debugging console related problems. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
1 parent 4fc8159 commit c70fc78

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/init.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ void *fdt;
458458
void __noreturn load_and_boot_kernel(bool is_reboot)
459459
{
460460
const struct dt_property *memprop;
461-
const char *cmdline;
461+
const char *cmdline, *stdoutp;
462462
uint64_t mem_top;
463463

464464
memprop = dt_find_property(dt_root, DT_PRIVATE "maxmem");
@@ -507,6 +507,8 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
507507
if (cmdline) {
508508
dt_check_del_prop(dt_chosen, "bootargs");
509509
dt_add_property_string(dt_chosen, "bootargs", cmdline);
510+
prlog(PR_DEBUG, "INIT: Command line from NVRAM: %s\n",
511+
cmdline);
510512
}
511513

512514
op_display(OP_LOG, OP_MOD_INIT, 0x000B);
@@ -534,6 +536,11 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
534536
/* Take processours out of nap */
535537
cpu_set_pm_enable(false);
536538

539+
/* Dump the selected console */
540+
stdoutp = dt_prop_get_def(dt_chosen, "linux,stdout-path", NULL);
541+
printf("INIT: stdout-path: %s\n", stdoutp ? stdoutp : "");
542+
543+
537544
printf("INIT: Starting kernel at 0x%llx, fdt at %p (size 0x%x)\n",
538545
kernel_entry, fdt, fdt_totalsize(fdt));
539546

0 commit comments

Comments
 (0)