},
};
+static u32 mux_table_gen_clk[] = { 0, 5, 6, 7, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, };
+static const char * const gen_clk_parent_names[] = {
+ "xtal", "gp0_pll", "gp1_pll", "hifi_pll", "fclk_div2", "fclk_div3",
+ "fclk_div4", "fclk_div5", "fclk_div7", "mpll0", "mpll1",
+ "mpll2", "mpll3"
+};
+
+static struct clk_mux g12a_gen_clk_sel = {
+ .reg = (void *)HHI_GEN_CLK_CNTL,
+ .mask = 0x1f,
+ .shift = 12,
+ .table = mux_table_gen_clk,
+ .lock = &clk_lock,
+ .hw.init = &(struct clk_init_data){
+ .name = "gen_clk_sel",
+ .ops = &clk_mux_ops,
+ .parent_names = gen_clk_parent_names,
+ .num_parents = ARRAY_SIZE(gen_clk_parent_names),
+ },
+};
+
+static struct clk_divider g12a_gen_clk_div = {
+ .reg = (void *)HHI_GEN_CLK_CNTL,
+ .shift = 0,
+ .width = 11,
+ .lock = &clk_lock,
+ .hw.init = &(struct clk_init_data){
+ .name = "gen_clk_div",
+ .ops = &clk_divider_ops,
+ .parent_names = (const char *[]){ "gen_clk_sel" },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ },
+};
+
+static struct clk_gate g12a_gen_clk = {
+ .reg = (void *)HHI_GEN_CLK_CNTL,
+ .bit_idx = 11,
+ .lock = &clk_lock,
+ .hw.init = &(struct clk_init_data){
+ .name = "gen_clk",
+ .ops = &clk_gate_ops,
+ .parent_names = (const char *[]){ "gen_clk_div" },
+ .num_parents = 1,
+ .flags = CLK_SET_RATE_PARENT,
+ },
+};
+
/* Everything Else (EE) domain gates */
static struct clk_gate g12a_spicc_0 = {
[CLKID_24M] = &g12a_24m.hw,
[CLKID_12M_DIV] = &g12a_12m_div.hw,
[CLKID_12M_GATE] = &g12a_12m_gate.hw,
+ [CLKID_GEN_CLK_SEL] = &g12a_gen_clk_sel.hw,
+ [CLKID_GEN_CLK_DIV] = &g12a_gen_clk_div.hw,
+ [CLKID_GEN_CLK] = &g12a_gen_clk.hw,
+
};
/* Convenience tables to populate base addresses in .probe */
&g12a_efuse,
&g12a_24m,
&g12a_12m_gate,
+ &g12a_gen_clk,
};
static void __init g12a_clkc_init(struct device_node *np)
g12a_12m_div.reg = clk_base
+ (unsigned long)g12a_12m_div.reg;
-
+ g12a_gen_clk_sel.reg = clk_base
+ + (unsigned long)g12a_gen_clk_sel.reg;
+ g12a_gen_clk_div.reg = clk_base
+ + (unsigned long)g12a_gen_clk_div.reg;
/* Populate base address for gates */
for (i = 0; i < ARRAY_SIZE(g12a_clk_gates); i++)
g12a_clk_gates[i]->reg = clk_base +