Commit 76ebc134 authored by Peter De Schrijver's avatar Peter De Schrijver

clk: tegra: move periph clocks to common file

Introduce a new file for peripheral clocks common between several Tegra
SoCs and move Tegra114 to this new infrastructure. Also PLLP and the PLLP_OUT
clocks will be initialized here.
Signed-off-by: default avatarPeter De Schrijver <pdeschrijver@nvidia.com>
parent 6609dbe4
...@@ -7,7 +7,7 @@ obj-y += clk-pll.o ...@@ -7,7 +7,7 @@ obj-y += clk-pll.o
obj-y += clk-pll-out.o obj-y += clk-pll-out.o
obj-y += clk-super.o obj-y += clk-super.o
obj-y += clk-tegra-audio.o obj-y += clk-tegra-audio.o
obj-y += clk-tegra-periph.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
This diff is collapsed.
This diff is collapsed.
...@@ -973,7 +973,7 @@ static void __init tegra20_periph_clk_init(void) ...@@ -973,7 +973,7 @@ static void __init tegra20_periph_clk_init(void)
for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) { for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) {
data = &tegra_periph_clk_list[i]; data = &tegra_periph_clk_list[i];
clk = tegra_clk_register_periph(data->name, data->parent_names, clk = tegra_clk_register_periph(data->name, data->p.parent_names,
data->num_parents, &data->periph, data->num_parents, &data->periph,
clk_base, data->offset, data->flags); clk_base, data->offset, data->flags);
clk_register_clkdev(clk, data->con_id, data->dev_id); clk_register_clkdev(clk, data->con_id, data->dev_id);
...@@ -983,7 +983,7 @@ static void __init tegra20_periph_clk_init(void) ...@@ -983,7 +983,7 @@ static void __init tegra20_periph_clk_init(void)
for (i = 0; i < ARRAY_SIZE(tegra_periph_nodiv_clk_list); i++) { for (i = 0; i < ARRAY_SIZE(tegra_periph_nodiv_clk_list); i++) {
data = &tegra_periph_nodiv_clk_list[i]; data = &tegra_periph_nodiv_clk_list[i];
clk = tegra_clk_register_periph_nodiv(data->name, clk = tegra_clk_register_periph_nodiv(data->name,
data->parent_names, data->p.parent_names,
data->num_parents, &data->periph, data->num_parents, &data->periph,
clk_base, data->offset); clk_base, data->offset);
clk_register_clkdev(clk, data->con_id, data->dev_id); clk_register_clkdev(clk, data->con_id, data->dev_id);
......
...@@ -1616,7 +1616,7 @@ static void __init tegra30_periph_clk_init(void) ...@@ -1616,7 +1616,7 @@ static void __init tegra30_periph_clk_init(void)
for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) { for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) {
data = &tegra_periph_clk_list[i]; data = &tegra_periph_clk_list[i];
clk = tegra_clk_register_periph(data->name, data->parent_names, clk = tegra_clk_register_periph(data->name, data->p.parent_names,
data->num_parents, &data->periph, data->num_parents, &data->periph,
clk_base, data->offset, data->flags); clk_base, data->offset, data->flags);
clk_register_clkdev(clk, data->con_id, data->dev_id); clk_register_clkdev(clk, data->con_id, data->dev_id);
...@@ -1626,7 +1626,7 @@ static void __init tegra30_periph_clk_init(void) ...@@ -1626,7 +1626,7 @@ static void __init tegra30_periph_clk_init(void)
for (i = 0; i < ARRAY_SIZE(tegra_periph_nodiv_clk_list); i++) { for (i = 0; i < ARRAY_SIZE(tegra_periph_nodiv_clk_list); i++) {
data = &tegra_periph_nodiv_clk_list[i]; data = &tegra_periph_nodiv_clk_list[i];
clk = tegra_clk_register_periph_nodiv(data->name, clk = tegra_clk_register_periph_nodiv(data->name,
data->parent_names, data->p.parent_names,
data->num_parents, &data->periph, data->num_parents, &data->periph,
clk_base, data->offset); clk_base, data->offset);
clk_register_clkdev(clk, data->con_id, data->dev_id); clk_register_clkdev(clk, data->con_id, data->dev_id);
......
...@@ -460,7 +460,10 @@ struct clk *tegra_clk_register_periph_nodiv(const char *name, ...@@ -460,7 +460,10 @@ struct clk *tegra_clk_register_periph_nodiv(const char *name,
struct tegra_periph_init_data { struct tegra_periph_init_data {
const char *name; const char *name;
int clk_id; int clk_id;
const char **parent_names; union {
const char **parent_names;
const char *parent_name;
} p;
int num_parents; int num_parents;
struct tegra_clk_periph periph; struct tegra_clk_periph periph;
u32 offset; u32 offset;
...@@ -477,7 +480,7 @@ struct tegra_periph_init_data { ...@@ -477,7 +480,7 @@ struct tegra_periph_init_data {
{ \ { \
.name = _name, \ .name = _name, \
.clk_id = _clk_id, \ .clk_id = _clk_id, \
.parent_names = _parent_names, \ .p.parent_names = _parent_names, \
.num_parents = ARRAY_SIZE(_parent_names), \ .num_parents = ARRAY_SIZE(_parent_names), \
.periph = TEGRA_CLK_PERIPH(_mux_shift, _mux_mask, \ .periph = TEGRA_CLK_PERIPH(_mux_shift, _mux_mask, \
_mux_flags, _div_shift, \ _mux_flags, _div_shift, \
...@@ -597,6 +600,10 @@ void tegra_audio_clk_init(void __iomem *clk_base, ...@@ -597,6 +600,10 @@ void tegra_audio_clk_init(void __iomem *clk_base,
void __iomem *pmc_base, struct tegra_clk *tegra_clks, void __iomem *pmc_base, struct tegra_clk *tegra_clks,
struct tegra_clk_pll_params *pll_params); struct tegra_clk_pll_params *pll_params);
void tegra_periph_clk_init(void __iomem *clk_base, void __iomem *pmc_base,
struct tegra_clk *tegra_clks,
struct tegra_clk_pll_params *pll_params);
void tegra114_clock_tune_cpu_trimmers_high(void); void tegra114_clock_tune_cpu_trimmers_high(void);
void tegra114_clock_tune_cpu_trimmers_low(void); void tegra114_clock_tune_cpu_trimmers_low(void);
void tegra114_clock_tune_cpu_trimmers_init(void); void tegra114_clock_tune_cpu_trimmers_init(void);
......
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