diff options
author | Grant Likely <grant.likely@linaro.org> | 2014-08-11 09:03:08 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-08-11 09:03:08 -0400 |
commit | b775e642bf958a02210ac4d4edd1a1b7067c49fa (patch) | |
tree | a3425ead7b2738e6a05249a3c3667d1069782330 /drivers/of | |
parent | 32147e9a8ea54f2ec9914edeede8a9d9dc02e886 (diff) | |
parent | ccdb8ed3b3c739fe99a6f2f474f7ffad3203485d (diff) |
Merge branch 'devicetree/next-console' into devicetree/next
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index b9864806e9b8..e4f95ba0a3eb 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * as published by the Free Software Foundation; either version | 17 | * as published by the Free Software Foundation; either version |
18 | * 2 of the License, or (at your option) any later version. | 18 | * 2 of the License, or (at your option) any later version. |
19 | */ | 19 | */ |
20 | #include <linux/console.h> | ||
20 | #include <linux/ctype.h> | 21 | #include <linux/ctype.h> |
21 | #include <linux/cpu.h> | 22 | #include <linux/cpu.h> |
22 | #include <linux/module.h> | 23 | #include <linux/module.h> |
@@ -35,7 +36,7 @@ struct device_node *of_allnodes; | |||
35 | EXPORT_SYMBOL(of_allnodes); | 36 | EXPORT_SYMBOL(of_allnodes); |
36 | struct device_node *of_chosen; | 37 | struct device_node *of_chosen; |
37 | struct device_node *of_aliases; | 38 | struct device_node *of_aliases; |
38 | static struct device_node *of_stdout; | 39 | struct device_node *of_stdout; |
39 | 40 | ||
40 | static struct kset *of_kset; | 41 | static struct kset *of_kset; |
41 | 42 | ||
@@ -2062,9 +2063,12 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) | |||
2062 | of_chosen = of_find_node_by_path("/chosen@0"); | 2063 | of_chosen = of_find_node_by_path("/chosen@0"); |
2063 | 2064 | ||
2064 | if (of_chosen) { | 2065 | if (of_chosen) { |
2066 | /* linux,stdout-path and /aliases/stdout are for legacy compatibility */ | ||
2065 | const char *name = of_get_property(of_chosen, "stdout-path", NULL); | 2067 | const char *name = of_get_property(of_chosen, "stdout-path", NULL); |
2066 | if (!name) | 2068 | if (!name) |
2067 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); | 2069 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); |
2070 | if (IS_ENABLED(CONFIG_PPC) && !name) | ||
2071 | name = of_get_property(of_aliases, "stdout", NULL); | ||
2068 | if (name) | 2072 | if (name) |
2069 | of_stdout = of_find_node_by_path(name); | 2073 | of_stdout = of_find_node_by_path(name); |
2070 | } | 2074 | } |
@@ -2180,20 +2184,22 @@ const char *of_prop_next_string(struct property *prop, const char *cur) | |||
2180 | EXPORT_SYMBOL_GPL(of_prop_next_string); | 2184 | EXPORT_SYMBOL_GPL(of_prop_next_string); |
2181 | 2185 | ||
2182 | /** | 2186 | /** |
2183 | * of_device_is_stdout_path - check if a device node matches the | 2187 | * of_console_check() - Test and setup console for DT setup |
2184 | * linux,stdout-path property | 2188 | * @dn - Pointer to device node |
2185 | * | 2189 | * @name - Name to use for preferred console without index. ex. "ttyS" |
2186 | * Check if this device node matches the linux,stdout-path property | 2190 | * @index - Index to use for preferred console. |
2187 | * in the chosen node. return true if yes, false otherwise. | 2191 | * |
2192 | * Check if the given device node matches the stdout-path property in the | ||
2193 | * /chosen node. If it does then register it as the preferred console and return | ||
2194 | * TRUE. Otherwise return FALSE. | ||
2188 | */ | 2195 | */ |
2189 | int of_device_is_stdout_path(struct device_node *dn) | 2196 | bool of_console_check(struct device_node *dn, char *name, int index) |
2190 | { | 2197 | { |
2191 | if (!of_stdout) | 2198 | if (!dn || dn != of_stdout || console_set_on_cmdline) |
2192 | return false; | 2199 | return false; |
2193 | 2200 | return add_preferred_console(name, index, NULL); | |
2194 | return of_stdout == dn; | ||
2195 | } | 2201 | } |
2196 | EXPORT_SYMBOL_GPL(of_device_is_stdout_path); | 2202 | EXPORT_SYMBOL_GPL(of_console_check); |
2197 | 2203 | ||
2198 | /** | 2204 | /** |
2199 | * of_find_next_cache_node - Find a node's subsidiary cache | 2205 | * of_find_next_cache_node - Find a node's subsidiary cache |