Skip to content

Commit

Permalink
of: support passing console options with stdout-path
Browse files Browse the repository at this point in the history
Support specifying console options (like with console=ttyXN,<options>)
by appending them to the stdout-path property after a separating ':'.

Example:
        stdout-path = "uart0:115200";

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
[grant.likely: minor rework to shorten the diffstat]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
  • Loading branch information
Leif Lindholm authored and Grant Likely committed Dec 3, 2014
1 parent 75c28c0 commit 7914a7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ EXPORT_SYMBOL(of_root);
struct device_node *of_chosen;
struct device_node *of_aliases;
struct device_node *of_stdout;
static const char *of_stdout_options;

struct kset *of_kset;

Expand Down Expand Up @@ -1852,7 +1853,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
if (IS_ENABLED(CONFIG_PPC) && !name)
name = of_get_property(of_aliases, "stdout", NULL);
if (name)
of_stdout = of_find_node_by_path(name);
of_stdout = of_find_node_opts_by_path(name, &of_stdout_options);
}

if (!of_aliases)
Expand Down Expand Up @@ -1978,7 +1979,8 @@ bool of_console_check(struct device_node *dn, char *name, int index)
{
if (!dn || dn != of_stdout || console_set_on_cmdline)
return false;
return !add_preferred_console(name, index, NULL);
return !add_preferred_console(name, index,
kstrdup(of_stdout_options, GFP_KERNEL));
}
EXPORT_SYMBOL_GPL(of_console_check);

Expand Down

0 comments on commit 7914a7c

Please sign in to comment.