Skip to content

Commit 4a0e89b

Browse files
nbd168paulburton
authored andcommitted
MIPS: ath79: move legacy "wdt" and "uart" clock aliases out of soc init
Preparation for reusing functions for DT Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: James Hogan <jhogan@kernel.org> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org
1 parent 9b56e0d commit 4a0e89b

File tree

1 file changed

+17
-21
lines changed

1 file changed

+17
-21
lines changed

arch/mips/ath79/clock.c

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ static void __init ar71xx_clocks_init(void)
110110
ath79_set_clk(ATH79_CLK_CPU, cpu_rate);
111111
ath79_set_clk(ATH79_CLK_DDR, ddr_rate);
112112
ath79_set_clk(ATH79_CLK_AHB, ahb_rate);
113-
114-
clk_add_alias("wdt", NULL, "ahb", NULL);
115-
clk_add_alias("uart", NULL, "ahb", NULL);
116113
}
117114

118115
static void __init ar724x_clk_init(struct clk *ref_clk, void __iomem *pll_base)
@@ -140,9 +137,6 @@ static void __init ar724x_clocks_init(void)
140137
ref_clk = ath79_set_clk(ATH79_CLK_REF, AR724X_BASE_FREQ);
141138

142139
ar724x_clk_init(ref_clk, ath79_pll_base);
143-
144-
clk_add_alias("wdt", NULL, "ahb", NULL);
145-
clk_add_alias("uart", NULL, "ahb", NULL);
146140
}
147141

148142
static void __init ar9330_clk_init(struct clk *ref_clk, void __iomem *pll_base)
@@ -218,9 +212,6 @@ static void __init ar933x_clocks_init(void)
218212
ref_clk = ath79_set_clk(ATH79_CLK_REF, ref_rate);
219213

220214
ar9330_clk_init(ref_clk, ath79_pll_base);
221-
222-
clk_add_alias("wdt", NULL, "ahb", NULL);
223-
clk_add_alias("uart", NULL, "ref", NULL);
224215
}
225216

226217
static u32 __init ar934x_get_pll_freq(u32 ref, u32 ref_div, u32 nint, u32 nfrac,
@@ -353,9 +344,6 @@ static void __init ar934x_clocks_init(void)
353344
ath79_set_clk(ATH79_CLK_DDR, ddr_rate);
354345
ath79_set_clk(ATH79_CLK_AHB, ahb_rate);
355346

356-
clk_add_alias("wdt", NULL, "ref", NULL);
357-
clk_add_alias("uart", NULL, "ref", NULL);
358-
359347
iounmap(dpll_base);
360348
}
361349

@@ -439,9 +427,6 @@ static void __init qca953x_clocks_init(void)
439427
ath79_set_clk(ATH79_CLK_CPU, cpu_rate);
440428
ath79_set_clk(ATH79_CLK_DDR, ddr_rate);
441429
ath79_set_clk(ATH79_CLK_AHB, ahb_rate);
442-
443-
clk_add_alias("wdt", NULL, "ref", NULL);
444-
clk_add_alias("uart", NULL, "ref", NULL);
445430
}
446431

447432
static void __init qca955x_clocks_init(void)
@@ -524,9 +509,6 @@ static void __init qca955x_clocks_init(void)
524509
ath79_set_clk(ATH79_CLK_CPU, cpu_rate);
525510
ath79_set_clk(ATH79_CLK_DDR, ddr_rate);
526511
ath79_set_clk(ATH79_CLK_AHB, ahb_rate);
527-
528-
clk_add_alias("wdt", NULL, "ref", NULL);
529-
clk_add_alias("uart", NULL, "ref", NULL);
530512
}
531513

532514
static void __init qca956x_clocks_init(void)
@@ -628,13 +610,13 @@ static void __init qca956x_clocks_init(void)
628610
ath79_set_clk(ATH79_CLK_CPU, cpu_rate);
629611
ath79_set_clk(ATH79_CLK_DDR, ddr_rate);
630612
ath79_set_clk(ATH79_CLK_AHB, ahb_rate);
631-
632-
clk_add_alias("wdt", NULL, "ref", NULL);
633-
clk_add_alias("uart", NULL, "ref", NULL);
634613
}
635614

636615
void __init ath79_clocks_init(void)
637616
{
617+
const char *wdt;
618+
const char *uart;
619+
638620
if (soc_is_ar71xx())
639621
ar71xx_clocks_init();
640622
else if (soc_is_ar724x() || soc_is_ar913x())
@@ -651,6 +633,20 @@ void __init ath79_clocks_init(void)
651633
qca956x_clocks_init();
652634
else
653635
BUG();
636+
637+
if (soc_is_ar71xx() || soc_is_ar724x() || soc_is_ar913x()) {
638+
wdt = "ahb";
639+
uart = "ahb";
640+
} else if (soc_is_ar933x()) {
641+
wdt = "ahb";
642+
uart = "ref";
643+
} else {
644+
wdt = "ref";
645+
uart = "ref";
646+
}
647+
648+
clk_add_alias("wdt", NULL, wdt, NULL);
649+
clk_add_alias("uart", NULL, uart, NULL);
654650
}
655651

656652
unsigned long __init

0 commit comments

Comments
 (0)