linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: dt: Initialize boot_command_line from CONFIG_CMDLINE in case DT does not provide /chosen/bootargs
@ 2016-12-14 21:12 Pali Rohár
  2016-12-14 21:25 ` Pavel Machek
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Pali Rohár @ 2016-12-14 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage") broke
support for setting cmdline on Nokia N900 via CONFIG_CMDLINE.

It is because arm code booted in DT mode parse cmdline only via function
early_init_dt_scan_chosen() and that function does not fill variable
boot_command_line when DTB does not contain /chosen entry. It is called
from function early_init_dt_scan_nodes() in setup_machine_fdt().

This patch fixes it by explicitly filling boot_command_line in function
setup_machine_fdt() after calling early_init_dt_scan_nodes() in case
boot_command_line still remains empty.

Signed-off-by: Pali Roh?r <pali.rohar@gmail.com>
---
 arch/arm/kernel/devtree.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index f676feb..dbe25b1 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -260,6 +260,11 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
 
 	early_init_dt_scan_nodes();
 
+#ifdef CONFIG_CMDLINE
+	if (!boot_command_line[0])
+		strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
+
 	/* Change machine number to match the mdesc we're using */
 	__machine_arch_type = mdesc->nr;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2017-01-02 13:54 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14 21:12 [PATCH] arm: dt: Initialize boot_command_line from CONFIG_CMDLINE in case DT does not provide /chosen/bootargs Pali Rohár
2016-12-14 21:25 ` Pavel Machek
2016-12-14 21:46   ` Tony Lindgren
2016-12-14 22:22 ` Javier Martinez Canillas
2016-12-14 23:52 ` Russell King - ARM Linux
2016-12-15  0:09   ` Pali Rohár
2016-12-15  0:18     ` Robin Murphy
2016-12-15 10:09     ` Russell King - ARM Linux
2016-12-16 11:42       ` Pali Rohár
2016-12-25 22:08         ` Pali Rohár
2017-01-02 13:54           ` Russell King - ARM Linux
2016-12-16 11:46     ` Pali Rohár
2016-12-16 12:13       ` Javier Martinez Canillas
2016-12-16 12:32         ` Pali Rohár
2016-12-16 12:38           ` Javier Martinez Canillas
2016-12-16 12:48             ` Pali Rohár
2016-12-16 12:53               ` Javier Martinez Canillas
2016-12-16 15:40                 ` Tony Lindgren
2016-12-16 16:13                   ` Pali Rohár
2016-12-16 16:21                     ` Tony Lindgren
2016-12-16 16:27                     ` Russell King - ARM Linux
2016-12-16 16:57                   ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).