aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Boivie <victor.boivie@sonyericsson.com>2011-05-04 12:07:55 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-12 05:13:22 -0400
commit4394c1244249198c6b85093d46935b761b36ae05 (patch)
tree3a0c30dc915b85ee5b2190eaa3ed2c6ad530aab0
parentc1b0db56604b4ccc55a325104b14093aeedeb829 (diff)
ARM: 6893/1: Allow for kernel command line concatenation
This patch allows the provided CONFIG_CMDLINE to be concatenated with the one provided by the boot loader. This is useful to merge the static values defined in CONFIG_CMDLINE with the boot loader's (possibly) more dynamic values, such as startup reasons and more. Signed-off-by: Victor Boivie <victor.boivie@sonyericsson.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@sonyericsson.com> Signed-off-by: Oskar Andero <oskar.andero@sonyericsson.com> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/Kconfig21
-rw-r--r--arch/arm/kernel/setup.c13
2 files changed, 27 insertions, 7 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3f3faaa55d81..7fd33a337130 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1747,16 +1747,31 @@ config CMDLINE
1747 time by entering them here. As a minimum, you should specify the 1747 time by entering them here. As a minimum, you should specify the
1748 memory size and the root device (e.g., mem=64M root=/dev/nfs). 1748 memory size and the root device (e.g., mem=64M root=/dev/nfs).
1749 1749
1750choice
1751 prompt "Kernel command line type" if CMDLINE != ""
1752 default CMDLINE_FROM_BOOTLOADER
1753
1754config CMDLINE_FROM_BOOTLOADER
1755 bool "Use bootloader kernel arguments if available"
1756 help
1757 Uses the command-line options passed by the boot loader. If
1758 the boot loader doesn't provide any, the default kernel command
1759 string provided in CMDLINE will be used.
1760
1761config CMDLINE_EXTEND
1762 bool "Extend bootloader kernel arguments"
1763 help
1764 The command-line arguments provided by the boot loader will be
1765 appended to the default kernel command string.
1766
1750config CMDLINE_FORCE 1767config CMDLINE_FORCE
1751 bool "Always use the default kernel command string" 1768 bool "Always use the default kernel command string"
1752 depends on CMDLINE != ""
1753 help 1769 help
1754 Always use the default kernel command string, even if the boot 1770 Always use the default kernel command string, even if the boot
1755 loader passes other arguments to the kernel. 1771 loader passes other arguments to the kernel.
1756 This is useful if you cannot or don't want to change the 1772 This is useful if you cannot or don't want to change the
1757 command-line options your boot loader passes to the kernel. 1773 command-line options your boot loader passes to the kernel.
1758 1774endchoice
1759 If unsure, say N.
1760 1775
1761config XIP_KERNEL 1776config XIP_KERNEL
1762 bool "Kernel Execute-In-Place from ROM" 1777 bool "Kernel Execute-In-Place from ROM"
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 006c1e884eaf..6dce209a623b 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -672,11 +672,16 @@ __tagtable(ATAG_REVISION, parse_tag_revision);
672 672
673static int __init parse_tag_cmdline(const struct tag *tag) 673static int __init parse_tag_cmdline(const struct tag *tag)
674{ 674{
675#ifndef CONFIG_CMDLINE_FORCE 675#if defined(CONFIG_CMDLINE_EXTEND)
676 strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); 676 strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
677#else 677 strlcat(default_command_line, tag->u.cmdline.cmdline,
678 COMMAND_LINE_SIZE);
679#elif defined(CONFIG_CMDLINE_FORCE)
678 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n"); 680 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
679#endif /* CONFIG_CMDLINE_FORCE */ 681#else
682 strlcpy(default_command_line, tag->u.cmdline.cmdline,
683 COMMAND_LINE_SIZE);
684#endif
680 return 0; 685 return 0;
681} 686}
682 687