Skip to content

Commit 4782c0a

Browse files
digetxthierryreding
authored andcommitted
clk: tegra: Don't deassert reset on enabling clocks
The Tegra clock driver contains legacy code which deasserts hardware reset when peripheral clocks are enabled. This behaviour comes from a pre-CCF era of the Tegra drivers. This is unacceptable for modern kernel drivers which use generic CCF and reset-control APIs because it breaks assumptions of the drivers about clk/reset sequences and about reset-propagation delays. Hence remove the awkward legacy behaviour from the clk driver. In particular PMC driver assumes that hardware blocks remains in reset while power domain is turning on, but the clk driver deasserts the reset before power clamp is removed, hence breaking the driver's assumption. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 5d0f1c8 commit 4782c0a

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

drivers/clk/tegra/clk-periph-gate.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ static void clk_periph_enable_locked(struct clk_hw *hw)
5555
write_enb_set(periph_clk_to_bit(gate), gate);
5656
udelay(2);
5757

58-
if (!(gate->flags & TEGRA_PERIPH_NO_RESET) &&
59-
!(gate->flags & TEGRA_PERIPH_MANUAL_RESET)) {
60-
if (read_rst(gate) & periph_clk_to_bit(gate)) {
61-
udelay(5); /* reset propogation delay */
62-
write_rst_clr(periph_clk_to_bit(gate), gate);
63-
}
64-
}
65-
6658
if (gate->flags & TEGRA_PERIPH_WAR_1005168) {
6759
writel_relaxed(0, gate->clk_base + LVL2_CLK_GATE_OVRE);
6860
writel_relaxed(BIT(22), gate->clk_base + LVL2_CLK_GATE_OVRE);

drivers/clk/tegra/clk-tegra30.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ static struct tegra_periph_init_data tegra_periph_clk_list[] = {
10061006
TEGRA_INIT_DATA_MUX("dam0", mux_pllacp_clkm, CLK_SOURCE_DAM0, 108, 0, TEGRA30_CLK_DAM0),
10071007
TEGRA_INIT_DATA_MUX("dam1", mux_pllacp_clkm, CLK_SOURCE_DAM1, 109, 0, TEGRA30_CLK_DAM1),
10081008
TEGRA_INIT_DATA_MUX("dam2", mux_pllacp_clkm, CLK_SOURCE_DAM2, 110, 0, TEGRA30_CLK_DAM2),
1009-
TEGRA_INIT_DATA_INT("3d2", mux_pllmcpa, CLK_SOURCE_3D2, 98, TEGRA_PERIPH_MANUAL_RESET, TEGRA30_CLK_GR3D2),
1009+
TEGRA_INIT_DATA_INT("3d2", mux_pllmcpa, CLK_SOURCE_3D2, 98, 0, TEGRA30_CLK_GR3D2),
10101010
TEGRA_INIT_DATA_INT("se", mux_pllpcm_clkm, CLK_SOURCE_SE, 127, 0, TEGRA30_CLK_SE),
10111011
TEGRA_INIT_DATA_MUX8("hdmi", mux_pllpmdacd2_clkm, CLK_SOURCE_HDMI, 51, 0, TEGRA30_CLK_HDMI),
10121012
TEGRA_INIT_DATA("pwm", NULL, NULL, pwm_parents, CLK_SOURCE_PWM, 28, 2, 0, 0, 8, 1, 0, 17, TEGRA_PERIPH_ON_APB, TEGRA30_CLK_PWM),

drivers/clk/tegra/clk.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,6 @@ struct tegra_clk_periph_regs {
553553
* Flags:
554554
* TEGRA_PERIPH_NO_RESET - This flag indicates that reset is not allowed
555555
* for this module.
556-
* TEGRA_PERIPH_MANUAL_RESET - This flag indicates not to reset module
557-
* after clock enable and driver for the module is responsible for
558-
* doing reset.
559556
* TEGRA_PERIPH_ON_APB - If peripheral is in the APB bus then read the
560557
* bus to flush the write operation in apb bus. This flag indicates
561558
* that this peripheral is in apb bus.
@@ -577,7 +574,6 @@ struct tegra_clk_periph_gate {
577574
#define TEGRA_CLK_PERIPH_GATE_MAGIC 0x17760309
578575

579576
#define TEGRA_PERIPH_NO_RESET BIT(0)
580-
#define TEGRA_PERIPH_MANUAL_RESET BIT(1)
581577
#define TEGRA_PERIPH_ON_APB BIT(2)
582578
#define TEGRA_PERIPH_WAR_1005168 BIT(3)
583579
#define TEGRA_PERIPH_NO_DIV BIT(4)

0 commit comments

Comments
 (0)