/* * Alas we have to mark all PLLs as critical. CPU and DDR PLLs are sources of * CPU cores and DDR controller reference clocks, due to which they obviously * shouldn't be ever gated. SATA and PCIe PLLs are the parents of APB-bus and * DDR controller AXI-bus clocks. If they are gated the system will be * unusable. Moreover disabling SATA and Ethernet PLLs causes automatic reset * of the corresponding subsystems. So until we aren't ready to re-initialize * all the devices consuming those PLLs, they will be marked as critical too.
*/ staticconststruct ccu_pll_info pll_info[] = {
CCU_PLL_INFO(CCU_CPU_PLL, "cpu_pll", "ref_clk", CCU_CPU_PLL_BASE,
CLK_IS_CRITICAL, CCU_PLL_BASIC),
CCU_PLL_INFO(CCU_SATA_PLL, "sata_pll", "ref_clk", CCU_SATA_PLL_BASE,
CLK_IS_CRITICAL | CLK_SET_RATE_GATE, 0),
CCU_PLL_INFO(CCU_DDR_PLL, "ddr_pll", "ref_clk", CCU_DDR_PLL_BASE,
CLK_IS_CRITICAL | CLK_SET_RATE_GATE, 0),
CCU_PLL_INFO(CCU_PCIE_PLL, "pcie_pll", "ref_clk", CCU_PCIE_PLL_BASE,
CLK_IS_CRITICAL, CCU_PLL_BASIC),
CCU_PLL_INFO(CCU_ETH_PLL, "eth_pll", "ref_clk", CCU_ETH_PLL_BASE,
CLK_IS_CRITICAL | CLK_SET_RATE_GATE, 0)
};
data->plls[idx] = ccu_pll_hw_register(&init); if (IS_ERR(data->plls[idx])) {
ret = PTR_ERR(data->plls[idx]);
pr_err("Couldn't register PLL hw '%s'\n",
init.name); goto err_hw_unregister;
}
}
return 0;
err_hw_unregister: for (--idx; idx >= 0; --idx) { if (!!(pll_info[idx].features & CCU_PLL_BASIC) ^ defer) continue;
ccu_pll_hw_unregister(data->plls[idx]);
}
return ret;
}
staticvoid ccu_pll_clk_unregister(struct ccu_pll_data *data, bool defer)
{ int idx;
/* Uninstall only the clocks registered on the specified stage */ for (idx = 0; idx < CCU_PLL_NUM; ++idx) { if (!!(pll_info[idx].features & CCU_PLL_BASIC) ^ defer) continue;
ccu_pll_hw_unregister(data->plls[idx]);
}
}
staticint ccu_pll_of_register(struct ccu_pll_data *data)
{ int ret;
ret = of_clk_add_hw_provider(data->np, ccu_pll_of_clk_hw_get, data); if (ret) {
pr_err("Couldn't register PLL provider of '%s'\n",
of_node_full_name(data->np));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.