Browse Source

Fix --bootargs default value in spike usage help() function

Commit 191634d285 changed the default kernel boot args from
"console=hvc0 earlycon=sbi" to "console=ttyS0 earlycon", but didn't
updated the spike usage help() function.

This commit introduces a new macro DEFAULT_KERNEL_BOOTARGS in order to
have a single definition. This macro is used everywhere in dts.cc and
spike.cc help() function.

Signed-off-by: Julien Olivain <ju.o@free.fr>
pull/1262/head
Julien Olivain 3 years ago
parent
commit
04dbf0d5be
  1. 4
      riscv/dts.cc
  2. 1
      riscv/platform.h
  3. 3
      spike_main/spike.cc

4
riscv/dts.cc

@ -34,10 +34,10 @@ std::string make_dts(size_t insns_per_rtc_tick, size_t cpu_hz,
s << " linux,initrd-start = <" << (size_t)initrd_start << ">;\n"
" linux,initrd-end = <" << (size_t)initrd_end << ">;\n";
if (!bootargs)
bootargs = "root=/dev/ram console=ttyS0 earlycon";
bootargs = "root=/dev/ram " DEFAULT_KERNEL_BOOTARGS;
} else {
if (!bootargs)
bootargs = "console=ttyS0 earlycon";
bootargs = DEFAULT_KERNEL_BOOTARGS;
}
s << " bootargs = \"";
for (size_t i = 0; i < strlen(bootargs); i++) {

1
riscv/platform.h

@ -2,6 +2,7 @@
#ifndef _RISCV_PLATFORM_H
#define _RISCV_PLATFORM_H
#define DEFAULT_KERNEL_BOOTARGS "console=ttyS0 earlycon"
#define DEFAULT_RSTVEC 0x00001000
#define CLINT_BASE 0x02000000
#define CLINT_SIZE 0x000c0000

3
spike_main/spike.cc

@ -68,7 +68,8 @@ static void help(int exit_code = 1)
fprintf(stderr, " --disable-dtb Don't write the device tree blob into memory\n");
fprintf(stderr, " --kernel=<path> Load kernel flat image into memory\n");
fprintf(stderr, " --initrd=<path> Load kernel initrd into memory\n");
fprintf(stderr, " --bootargs=<args> Provide custom bootargs for kernel [default: console=hvc0 earlycon=sbi]\n");
fprintf(stderr, " --bootargs=<args> Provide custom bootargs for kernel [default: %s]\n",
DEFAULT_KERNEL_BOOTARGS);
fprintf(stderr, " --real-time-clint Increment clint time at real-time rate\n");
fprintf(stderr, " --triggers=<n> Number of supported triggers [default 4]\n");
fprintf(stderr, " --dm-progsize=<words> Progsize for the debug module [default 2]\n");

Loading…
Cancel
Save