aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-02-11 10:17:55 +0000
committerJohn Crispin <blogic@openwrt.org>2015-02-11 10:17:55 +0000
commitc291f76d24a4190551a42b7b77a2cfeb3f4d36f9 (patch)
tree8f9211217d7e2cbaa78d10b596d81e646b3b9aad /target/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
parent0e26998162921c65cbfe2814e500c81ca7b50dad (diff)
downloadupstream-c291f76d24a4190551a42b7b77a2cfeb3f4d36f9.tar.gz
upstream-c291f76d24a4190551a42b7b77a2cfeb3f4d36f9.tar.bz2
upstream-c291f76d24a4190551a42b7b77a2cfeb3f4d36f9.zip
brcm2708: update to v3.18
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44392 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch')
-rwxr-xr-xtarget/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch b/target/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
new file mode 100755
index 0000000000..da9219cde0
--- /dev/null
+++ b/target/linux/brcm2708/patches-3.18/0065-fdt-Add-support-for-the-CONFIG_CMDLINE_EXTEND-option.patch
@@ -0,0 +1,63 @@
+From b99050b7f7480499855dec85be2deac75db5fc62 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Fri, 5 Dec 2014 17:26:26 +0000
+Subject: [PATCH 65/99] fdt: Add support for the CONFIG_CMDLINE_EXTEND option
+
+---
+ drivers/of/fdt.c | 29 ++++++++++++++++++++++++-----
+ 1 file changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
+index 2e2b6d0..badc6a3 100644
+--- a/drivers/of/fdt.c
++++ b/drivers/of/fdt.c
+@@ -901,22 +901,38 @@ int __init early_init_dt_scan_chosen(uns
+
+ /* Retrieve command line */
+ p = of_get_flat_dt_prop(node, "bootargs", &l);
+- if (p != NULL && l > 0)
+- strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
+- p = of_get_flat_dt_prop(node, "bootargs-append", &l);
+- if (p != NULL && l > 0)
+- strlcat(data, p, min_t(int, strlen(data) + (int)l, COMMAND_LINE_SIZE));
+
+ /*
+ * CONFIG_CMDLINE is meant to be a default in case nothing else
+ * managed to set the command line, unless CONFIG_CMDLINE_FORCE
+ * is set in which case we override whatever was found earlier.
++ *
++ * However, it can be useful to be able to treat the default as
++ * a starting point to be extended using CONFIG_CMDLINE_EXTEND.
+ */
++ ((char *)data)[0] = '\0';
++
+ #ifdef CONFIG_CMDLINE
+-#ifndef CONFIG_CMDLINE_FORCE
+- if (!((char *)data)[0])
++ strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
++
++ if (p != NULL && l > 0) {
++#if defined(CONFIG_CMDLINE_EXTEND)
++ int len = strlen(data);
++ if (len > 0) {
++ strlcat(data, " ", COMMAND_LINE_SIZE);
++ len++;
++ }
++ strlcpy((char *)data + len, p, min((int)l, COMMAND_LINE_SIZE - len));
++#elif defined(CONFIG_CMDLINE_FORCE)
++ pr_warning("Ignoring bootargs property (using the default kernel command line)\n");
++#else
++ /* Neither extend nor force - just override */
++ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
+ #endif
+- strlcpy(data, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
++ }
++#else /* CONFIG_CMDLINE */
++ if (p != NULL && l > 0)
++ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE));
+ #endif /* CONFIG_CMDLINE */
+
+ pr_debug("Command line is: %s\n", (char*)data);
+--
+1.8.3.2
+