diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-08-13 18:56:37 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-08-20 12:28:05 -0700 |
commit | baac1d36d15d16fc064a901918bf844a36e97b1b (patch) | |
tree | 5901e7718fa200cd812da6cc93f97b29f36e8a11 /arch | |
parent | 8b5163eb988067093064ecb10265da27fd000cad (diff) | |
download | op-kernel-dev-baac1d36d15d16fc064a901918bf844a36e97b1b.zip op-kernel-dev-baac1d36d15d16fc064a901918bf844a36e97b1b.tar.gz |
xtensa: make bootparam parsing optional
A kernel may not need any boot parameters from the bootloader, allow
disabling bootparam parsing in that case.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/xtensa/Kconfig | 9 | ||||
-rw-r--r-- | arch/xtensa/boot/boot-elf/bootstrap.S | 6 | ||||
-rw-r--r-- | arch/xtensa/kernel/setup.c | 8 |
3 files changed, 22 insertions, 1 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 44b20da..bc766b6 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -473,6 +473,15 @@ config BUILTIN_DTB string "DTB to build into the kernel image" depends on OF +config PARSE_BOOTPARAM + bool "Parse bootparam block" + default y + help + Parse parameters passed to the kernel from the bootloader. It may + be disabled if the kernel is known to run without the bootloader. + + If unsure, say Y. + config BLK_DEV_SIMDISK tristate "Host file-based simulated block device support" default n diff --git a/arch/xtensa/boot/boot-elf/bootstrap.S b/arch/xtensa/boot/boot-elf/bootstrap.S index b6aa853..718c99d 100644 --- a/arch/xtensa/boot/boot-elf/bootstrap.S +++ b/arch/xtensa/boot/boot-elf/bootstrap.S @@ -42,7 +42,10 @@ RomInitAddr: .word KERNELOFFSET #endif RomBootParam: - .word _bootparam +#ifndef CONFIG_PARSE_BOOTPARAM + .word 0 +#else + .word _bootparam _bootparam: .short BP_TAG_FIRST .short 4 @@ -50,6 +53,7 @@ _bootparam: .short BP_TAG_LAST .short 0 .long 0 +#endif .align 4 _SetupMMU: diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 4161878..351283b 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -79,6 +79,7 @@ static char __initdata command_line[COMMAND_LINE_SIZE]; static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; #endif +#ifdef CONFIG_PARSE_BOOTPARAM /* * Boot parameter parsing. * @@ -176,6 +177,13 @@ static int __init parse_bootparam(const bp_tag_t* tag) return 0; } +#else +static int __init parse_bootparam(const bp_tag_t *tag) +{ + pr_info("Ignoring boot parameters at %p\n", tag); + return 0; +} +#endif #ifdef CONFIG_OF |