@@ -110,9 +110,6 @@ static void __init ar71xx_clocks_init(void)
110
110
ath79_set_clk (ATH79_CLK_CPU , cpu_rate );
111
111
ath79_set_clk (ATH79_CLK_DDR , ddr_rate );
112
112
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 );
116
113
}
117
114
118
115
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)
140
137
ref_clk = ath79_set_clk (ATH79_CLK_REF , AR724X_BASE_FREQ );
141
138
142
139
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 );
146
140
}
147
141
148
142
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)
218
212
ref_clk = ath79_set_clk (ATH79_CLK_REF , ref_rate );
219
213
220
214
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 );
224
215
}
225
216
226
217
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)
353
344
ath79_set_clk (ATH79_CLK_DDR , ddr_rate );
354
345
ath79_set_clk (ATH79_CLK_AHB , ahb_rate );
355
346
356
- clk_add_alias ("wdt" , NULL , "ref" , NULL );
357
- clk_add_alias ("uart" , NULL , "ref" , NULL );
358
-
359
347
iounmap (dpll_base );
360
348
}
361
349
@@ -439,9 +427,6 @@ static void __init qca953x_clocks_init(void)
439
427
ath79_set_clk (ATH79_CLK_CPU , cpu_rate );
440
428
ath79_set_clk (ATH79_CLK_DDR , ddr_rate );
441
429
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 );
445
430
}
446
431
447
432
static void __init qca955x_clocks_init (void )
@@ -524,9 +509,6 @@ static void __init qca955x_clocks_init(void)
524
509
ath79_set_clk (ATH79_CLK_CPU , cpu_rate );
525
510
ath79_set_clk (ATH79_CLK_DDR , ddr_rate );
526
511
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 );
530
512
}
531
513
532
514
static void __init qca956x_clocks_init (void )
@@ -628,13 +610,13 @@ static void __init qca956x_clocks_init(void)
628
610
ath79_set_clk (ATH79_CLK_CPU , cpu_rate );
629
611
ath79_set_clk (ATH79_CLK_DDR , ddr_rate );
630
612
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 );
634
613
}
635
614
636
615
void __init ath79_clocks_init (void )
637
616
{
617
+ const char * wdt ;
618
+ const char * uart ;
619
+
638
620
if (soc_is_ar71xx ())
639
621
ar71xx_clocks_init ();
640
622
else if (soc_is_ar724x () || soc_is_ar913x ())
@@ -651,6 +633,20 @@ void __init ath79_clocks_init(void)
651
633
qca956x_clocks_init ();
652
634
else
653
635
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 );
654
650
}
655
651
656
652
unsigned long __init
0 commit comments