]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xtensa: make bootparam parsing optional
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 14 Aug 2018 01:56:37 +0000 (18:56 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 20 Aug 2018 19:28:05 +0000 (12:28 -0700)
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>
arch/xtensa/Kconfig
arch/xtensa/boot/boot-elf/bootstrap.S
arch/xtensa/kernel/setup.c

index 44b20da404be67573306bd312472ba9c12a541a6..bc766b6b63440c634945c6a2622919d6ea31006a 100644 (file)
@@ -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
index b6aa85328ac0ccc05936bcf9b477499e7bbbbfe7..718c99dcfe7a9557c2814a1ef499dad2dc737ac8 100644 (file)
@@ -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:
index 41618788cc9ed5f37753a2a06d82d8ece06ed750..351283b60df6174af90cfd789f991f58da68f131 100644 (file)
@@ -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