diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2017-03-13 13:34:36 -0400 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2017-03-13 16:47:20 -0400 |
commit | fbe22d280014e783fe2454db2a0ba44fc4f68a5a (patch) | |
tree | 6210fb99a4704fd52fd3af840fa8e1f7c48a167b | |
parent | e8cd8da934f29a0aca2c4bd96310a0b6ba6e31a7 (diff) |
xtensa: ISS: update kernel command line in platform_setup
Move platform_setup call higher in initialization sequence so that it
could change kernel command line.
Check command line passed to simulator in ISS platform_stup and update
kernel command line if there's anything.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r-- | arch/xtensa/kernel/setup.c | 5 | ||||
-rw-r--r-- | arch/xtensa/platforms/iss/setup.c | 21 |
2 files changed, 23 insertions, 3 deletions
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 8fd4be610607..48ffc58ca38a 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -317,8 +317,9 @@ static inline int mem_reserve(unsigned long start, unsigned long end) | |||
317 | 317 | ||
318 | void __init setup_arch(char **cmdline_p) | 318 | void __init setup_arch(char **cmdline_p) |
319 | { | 319 | { |
320 | strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); | ||
321 | *cmdline_p = command_line; | 320 | *cmdline_p = command_line; |
321 | platform_setup(cmdline_p); | ||
322 | strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE); | ||
322 | 323 | ||
323 | /* Reserve some memory regions */ | 324 | /* Reserve some memory regions */ |
324 | 325 | ||
@@ -379,8 +380,6 @@ void __init setup_arch(char **cmdline_p) | |||
379 | 380 | ||
380 | unflatten_and_copy_device_tree(); | 381 | unflatten_and_copy_device_tree(); |
381 | 382 | ||
382 | platform_setup(cmdline_p); | ||
383 | |||
384 | #ifdef CONFIG_SMP | 383 | #ifdef CONFIG_SMP |
385 | smp_init_cpus(); | 384 | smp_init_cpus(); |
386 | #endif | 385 | #endif |
diff --git a/arch/xtensa/platforms/iss/setup.c b/arch/xtensa/platforms/iss/setup.c index 3742ee63282f..f4bbb28026f8 100644 --- a/arch/xtensa/platforms/iss/setup.c +++ b/arch/xtensa/platforms/iss/setup.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * Joe Taylor <joe@tensilica.com> | 8 | * Joe Taylor <joe@tensilica.com> |
9 | * | 9 | * |
10 | * Copyright 2001 - 2005 Tensilica Inc. | 10 | * Copyright 2001 - 2005 Tensilica Inc. |
11 | * Copyright 2017 Cadence Design Systems Inc. | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 13 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 14 | * under the terms of the GNU General Public License as published by the |
@@ -15,6 +16,7 @@ | |||
15 | * option) any later version. | 16 | * option) any later version. |
16 | * | 17 | * |
17 | */ | 18 | */ |
19 | #include <linux/bootmem.h> | ||
18 | #include <linux/stddef.h> | 20 | #include <linux/stddef.h> |
19 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
20 | #include <linux/init.h> | 22 | #include <linux/init.h> |
@@ -76,5 +78,24 @@ static struct notifier_block iss_panic_block = { | |||
76 | 78 | ||
77 | void __init platform_setup(char **p_cmdline) | 79 | void __init platform_setup(char **p_cmdline) |
78 | { | 80 | { |
81 | int argc = simc_argc(); | ||
82 | int argv_size = simc_argv_size(); | ||
83 | |||
84 | if (argc > 1) { | ||
85 | void **argv = alloc_bootmem(argv_size); | ||
86 | char *cmdline = alloc_bootmem(argv_size); | ||
87 | int i; | ||
88 | |||
89 | cmdline[0] = 0; | ||
90 | simc_argv((void *)argv); | ||
91 | |||
92 | for (i = 1; i < argc; ++i) { | ||
93 | if (i > 1) | ||
94 | strcat(cmdline, " "); | ||
95 | strcat(cmdline, argv[i]); | ||
96 | } | ||
97 | *p_cmdline = cmdline; | ||
98 | } | ||
99 | |||
79 | atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); | 100 | atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block); |
80 | } | 101 | } |