|
151 | 151 | /* Tegra CPU clock and reset control regs */ |
152 | 152 | #define CLK_RST_CONTROLLER_CPU_CMPLX_STATUS 0x470 |
153 | 153 |
|
| 154 | +#define MUX8(_name, _parents, _offset, \ |
| 155 | + _clk_num, _gate_flags, _clk_id) \ |
| 156 | + TEGRA_INIT_DATA_TABLE(_name, NULL, NULL, _parents, _offset,\ |
| 157 | + 29, MASK(3), 0, 0, 8, 1, TEGRA_DIVIDER_ROUND_UP,\ |
| 158 | + _clk_num, _gate_flags, _clk_id, _parents##_idx, 0,\ |
| 159 | + NULL) |
| 160 | + |
154 | 161 | #ifdef CONFIG_PM_SLEEP |
155 | 162 | static struct cpu_clk_suspend_context { |
156 | 163 | u32 clk_csite_src; |
@@ -777,7 +784,6 @@ static struct tegra_clk tegra114_clks[tegra_clk_max] __initdata = { |
777 | 784 | [tegra_clk_spdif_in] = { .dt_id = TEGRA114_CLK_SPDIF_IN, .present = true }, |
778 | 785 | [tegra_clk_spdif_out] = { .dt_id = TEGRA114_CLK_SPDIF_OUT, .present = true }, |
779 | 786 | [tegra_clk_vi_8] = { .dt_id = TEGRA114_CLK_VI, .present = true }, |
780 | | - [tegra_clk_vi_sensor_8] = { .dt_id = TEGRA114_CLK_VI_SENSOR, .present = true }, |
781 | 787 | [tegra_clk_fuse] = { .dt_id = TEGRA114_CLK_FUSE, .present = true }, |
782 | 788 | [tegra_clk_fuse_burn] = { .dt_id = TEGRA114_CLK_FUSE_BURN, .present = true }, |
783 | 789 | [tegra_clk_clk_32k] = { .dt_id = TEGRA114_CLK_CLK_32K, .present = true }, |
@@ -923,6 +929,13 @@ static struct tegra_devclk devclks[] __initdata = { |
923 | 929 | { .dev_id = "timer", .dt_id = TEGRA114_CLK_TIMER }, |
924 | 930 | }; |
925 | 931 |
|
| 932 | +static const char *mux_pllm_pllc2_c_c3_pllp_plla[] = { |
| 933 | + "pll_m", "pll_c2", "pll_c", "pll_c3", "pll_p", "pll_a_out0" |
| 934 | +}; |
| 935 | +static u32 mux_pllm_pllc2_c_c3_pllp_plla_idx[] = { |
| 936 | + [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 6, |
| 937 | +}; |
| 938 | + |
926 | 939 | static struct clk **clks; |
927 | 940 |
|
928 | 941 | static unsigned long osc_freq; |
@@ -1178,10 +1191,18 @@ static void __init tegra114_pll_init(void __iomem *clk_base, |
1178 | 1191 | clks[TEGRA114_CLK_PLL_E_OUT0] = clk; |
1179 | 1192 | } |
1180 | 1193 |
|
| 1194 | +#define CLK_SOURCE_VI_SENSOR 0x1a8 |
| 1195 | + |
| 1196 | +static struct tegra_periph_init_data tegra_periph_clk_list[] = { |
| 1197 | + MUX8("vi_sensor", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_VI_SENSOR, 20, TEGRA_PERIPH_NO_RESET, TEGRA114_CLK_VI_SENSOR), |
| 1198 | +}; |
| 1199 | + |
1181 | 1200 | static __init void tegra114_periph_clk_init(void __iomem *clk_base, |
1182 | 1201 | void __iomem *pmc_base) |
1183 | 1202 | { |
1184 | 1203 | struct clk *clk; |
| 1204 | + struct tegra_periph_init_data *data; |
| 1205 | + int i; |
1185 | 1206 |
|
1186 | 1207 | /* xusb_ss_div2 */ |
1187 | 1208 | clk = clk_register_fixed_factor(NULL, "xusb_ss_div2", "xusb_ss_src", 0, |
@@ -1209,6 +1230,14 @@ static __init void tegra114_periph_clk_init(void __iomem *clk_base, |
1209 | 1230 | clk_base + CLK_SOURCE_EMC, |
1210 | 1231 | 29, 3, 0, NULL); |
1211 | 1232 |
|
| 1233 | + for (i = 0; i < ARRAY_SIZE(tegra_periph_clk_list); i++) { |
| 1234 | + data = &tegra_periph_clk_list[i]; |
| 1235 | + clk = tegra_clk_register_periph(data->name, |
| 1236 | + data->p.parent_names, data->num_parents, |
| 1237 | + &data->periph, clk_base, data->offset, data->flags); |
| 1238 | + clks[data->clk_id] = clk; |
| 1239 | + } |
| 1240 | + |
1212 | 1241 | tegra_periph_clk_init(clk_base, pmc_base, tegra114_clks, |
1213 | 1242 | &pll_p_params); |
1214 | 1243 | } |
|
0 commit comments