/* Global data of Tegra CPU CAR ops */ staticstruct device_node *tegra_car_np; staticstruct tegra_cpu_car_ops dummy_car_ops; struct tegra_cpu_car_ops *tegra_cpu_car_ops = &dummy_car_ops;
staticint tegra_clk_rst_assert(struct reset_controller_dev *rcdev, unsignedlong id)
{ /* * If peripheral is on the APB bus then we must read the APB bus to * flush the write operation in apb bus. This will avoid peripheral * access after disabling clock. Since the reset driver has no * knowledge of which reset IDs represent which devices, simply do * this all the time.
*/
tegra_read_chipid();
if (id < periph_banks * 32) {
writel_relaxed(BIT(id % 32),
clk_base + periph_regs[id / 32].rst_set_reg); return 0;
} elseif (id < periph_banks * 32 + num_special_reset) { return special_reset_assert(id);
}
val = readl_relaxed(clk_base + CLK_OUT_ENB_Y); if (enable)
val |= CLK_ENB_PLLP_OUT_CPU; else
val &= ~CLK_ENB_PLLP_OUT_CPU;
writel_relaxed(val, clk_base + CLK_OUT_ENB_Y);
}
void tegra_clk_periph_suspend(void)
{ unsignedint i, idx;
idx = 0; for (i = 0; i < periph_banks; i++, idx++)
periph_state_ctx[idx] =
readl_relaxed(clk_base + periph_regs[i].enb_reg);
for (i = 0; i < periph_banks; i++, idx++)
periph_state_ctx[idx] =
readl_relaxed(clk_base + periph_regs[i].rst_reg);
}
void tegra_clk_periph_resume(void)
{ unsignedint i, idx;
idx = 0; for (i = 0; i < periph_banks; i++, idx++)
writel_relaxed(periph_state_ctx[idx],
clk_base + periph_regs[i].enb_reg); /* * All non-boot peripherals will be in reset state on resume. * Wait for 5us of reset propagation delay before de-asserting * the peripherals based on the saved context.
*/
fence_udelay(5, clk_base);
for (i = 0; i < periph_banks; i++, idx++)
writel_relaxed(periph_state_ctx[idx],
clk_base + periph_regs[i].rst_reg);
for (; tbl->clk_id < clk_max; tbl++) {
clk = clks[tbl->clk_id]; if (IS_ERR_OR_NULL(clk)) {
pr_err("%s: invalid entry %ld in clks array for id %d\n",
__func__, PTR_ERR(clk), tbl->clk_id);
WARN_ON(1);
continue;
}
if (tbl->parent_id < clk_max) { struct clk *parent = clks[tbl->parent_id]; if (clk_set_parent(clk, parent)) {
pr_err("%s: Failed to set parent %s of %s\n",
__func__, __clk_get_name(parent),
__clk_get_name(clk));
WARN_ON(1);
}
}
if (tbl->rate) if (clk_set_rate(clk, tbl->rate)) {
pr_err("%s: Failed to set rate %lu of %s\n",
__func__, tbl->rate,
__clk_get_name(clk));
WARN_ON(1);
}
if (tbl->state) if (clk_prepare_enable(clk)) {
pr_err("%s: Failed to enable %s\n", __func__,
__clk_get_name(clk));
WARN_ON(1);
}
}
}
void __init tegra_add_of_provider(struct device_node *np, void *clk_src_onecell_get)
{ int i;
tegra_car_np = np;
for (i = 0; i < clk_num; i++) { if (IS_ERR(clks[i])) {
pr_err
("Tegra clk %d: register failed with %ld\n",
i, PTR_ERR(clks[i]));
} if (!clks[i])
clks[i] = ERR_PTR(-EINVAL);
}
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.