mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
arch: riscv: support kernel command line forcing when no DTB passed
CONFIG_CMDLINE_FORCE doesn't work on RISC-V when no DTB is passed into the kernel. This is because the code that forces the kernel command line only runs if a valid DTB is present at boot. During debugging, it's useful to have the ability to force kernel command lines even when no DTB is present. This patch adds support for doing so. Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com> Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
d0df00e30e
commit
8fd6e05c74
@ -149,7 +149,14 @@ asmlinkage void __init setup_vm(void)
|
||||
|
||||
void __init parse_dtb(unsigned int hartid, void *dtb)
|
||||
{
|
||||
early_init_dt_scan(__va(dtb));
|
||||
if (!early_init_dt_scan(__va(dtb)))
|
||||
return;
|
||||
|
||||
pr_err("No DTB passed to the kernel\n");
|
||||
#ifdef CONFIG_CMDLINE_FORCE
|
||||
strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
|
||||
pr_info("Forcing kernel command line to: %s\n", boot_command_line);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init setup_bootmem(void)
|
||||
|
Loading…
Reference in New Issue
Block a user