Commit d0a57bd5 authored by Peter De Schrijver's avatar Peter De Schrijver

clk: tegra: make tegra_clocks_apply_init_table() arch_initcall

tegra_clocks_apply_init_table() needs to be called after the udelay
loop has been calibrated (see commit
441f199a ("clk: tegra: defer
application of init table") for why that is).  On existing Tegra SoCs
this was done by calling tegra_clocks_apply_init_table() from
tegra_dt_init(). To make this also work on ARM64, we need to change
this into an initcall. tegra_dt_init() is called from
customize_machine which is an arch_initcall. Therefore this should
also work on existing 32bit Tegra SoCs.

Tested on Tegra20 (ventana), Tegra30 (beaverboard), Tegra124 (jetson TK1) and
Tegra132.
Signed-off-by: default avatarPeter De Schrijver <pdeschrijver@nvidia.com>
[paul@pwsan.com: tweaked the commit message]
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarPaul Walmsley <pwalmsley@nvidia.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
parent ca036b26
...@@ -91,8 +91,6 @@ static void __init tegra_dt_init(void) ...@@ -91,8 +91,6 @@ static void __init tegra_dt_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct device *parent = NULL; struct device *parent = NULL;
tegra_clocks_apply_init_table();
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
if (!soc_dev_attr) if (!soc_dev_attr)
goto out; goto out;
......
...@@ -302,10 +302,13 @@ struct clk ** __init tegra_lookup_dt_id(int clk_id, ...@@ -302,10 +302,13 @@ struct clk ** __init tegra_lookup_dt_id(int clk_id,
tegra_clk_apply_init_table_func tegra_clk_apply_init_table; tegra_clk_apply_init_table_func tegra_clk_apply_init_table;
void __init tegra_clocks_apply_init_table(void) static int __init tegra_clocks_apply_init_table(void)
{ {
if (!tegra_clk_apply_init_table) if (!tegra_clk_apply_init_table)
return; return 0;
tegra_clk_apply_init_table(); tegra_clk_apply_init_table();
return 0;
} }
arch_initcall(tegra_clocks_apply_init_table);
...@@ -120,6 +120,4 @@ static inline void tegra_cpu_clock_resume(void) ...@@ -120,6 +120,4 @@ static inline void tegra_cpu_clock_resume(void)
} }
#endif #endif
void tegra_clocks_apply_init_table(void);
#endif /* __LINUX_CLK_TEGRA_H_ */ #endif /* __LINUX_CLK_TEGRA_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment