diff options
author | Tony Lindgren <tony@atomide.com> | 2018-02-22 17:05:14 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2018-02-26 17:16:10 -0500 |
commit | 3bb37c8e6e6a6191233c97f294cecba10bb5fc50 (patch) | |
tree | 27b3f19b802a077b256102c8a9a0a567602b194f /drivers/bus | |
parent | 62020f231232215df73ca54669e38fe3f1d1b29a (diff) |
bus: ti-sysc: Handle stdout-path for debug console
If we have stdout-path specified for earlycon, we must prevent
the debug console from idling until runtime PM kicks in.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/ti-sysc.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 2bb0d0061624..7d82d5add7c1 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c | |||
@@ -206,6 +206,50 @@ static int sysc_parse_and_check_child_range(struct sysc *ddata) | |||
206 | return 0; | 206 | return 0; |
207 | } | 207 | } |
208 | 208 | ||
209 | static struct device_node *stdout_path; | ||
210 | |||
211 | static void sysc_init_stdout_path(struct sysc *ddata) | ||
212 | { | ||
213 | struct device_node *np = NULL; | ||
214 | const char *uart; | ||
215 | |||
216 | if (IS_ERR(stdout_path)) | ||
217 | return; | ||
218 | |||
219 | if (stdout_path) | ||
220 | return; | ||
221 | |||
222 | np = of_find_node_by_path("/chosen"); | ||
223 | if (!np) | ||
224 | goto err; | ||
225 | |||
226 | uart = of_get_property(np, "stdout-path", NULL); | ||
227 | if (!uart) | ||
228 | goto err; | ||
229 | |||
230 | np = of_find_node_by_path(uart); | ||
231 | if (!np) | ||
232 | goto err; | ||
233 | |||
234 | stdout_path = np; | ||
235 | |||
236 | return; | ||
237 | |||
238 | err: | ||
239 | stdout_path = ERR_PTR(-ENODEV); | ||
240 | } | ||
241 | |||
242 | static void sysc_check_quirk_stdout(struct sysc *ddata, | ||
243 | struct device_node *np) | ||
244 | { | ||
245 | sysc_init_stdout_path(ddata); | ||
246 | if (np != stdout_path) | ||
247 | return; | ||
248 | |||
249 | ddata->cfg.quirks |= SYSC_QUIRK_NO_IDLE_ON_INIT | | ||
250 | SYSC_QUIRK_NO_RESET_ON_INIT; | ||
251 | } | ||
252 | |||
209 | /** | 253 | /** |
210 | * sysc_check_one_child - check child configuration | 254 | * sysc_check_one_child - check child configuration |
211 | * @ddata: device driver data | 255 | * @ddata: device driver data |
@@ -224,6 +268,8 @@ static int sysc_check_one_child(struct sysc *ddata, | |||
224 | if (name) | 268 | if (name) |
225 | dev_warn(ddata->dev, "really a child ti,hwmods property?"); | 269 | dev_warn(ddata->dev, "really a child ti,hwmods property?"); |
226 | 270 | ||
271 | sysc_check_quirk_stdout(ddata, np); | ||
272 | |||
227 | return 0; | 273 | return 0; |
228 | } | 274 | } |
229 | 275 | ||