Skip to content

Commit 9bd0bd2

Browse files
981213tsbogend
authored andcommitted
MIPS: ralink: drop ralink_clk_init for mt7621
ralink_clk_init is only called in arch/mips/ralink/clk.c which isn't compiled for mt7621. And it doesn't export a proper cpu clock. Drop this unused function. Signed-off-by: Chuanhong Guo <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 3895006 commit 9bd0bd2

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

arch/mips/ralink/mt7621.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020

2121
#include "common.h"
2222

23-
#define SYSC_REG_SYSCFG 0x10
24-
#define SYSC_REG_CPLL_CLKCFG0 0x2c
25-
#define SYSC_REG_CUR_CLK_STS 0x44
26-
#define CPU_CLK_SEL (BIT(30) | BIT(31))
27-
2823
#define MT7621_GPIO_MODE_UART1 1
2924
#define MT7621_GPIO_MODE_I2C 2
3025
#define MT7621_GPIO_MODE_UART3_MASK 0x3
@@ -115,44 +110,6 @@ phys_addr_t mips_cpc_default_phys_base(void)
115110
panic("Cannot detect cpc address");
116111
}
117112

118-
void __init ralink_clk_init(void)
119-
{
120-
int cpu_fdiv = 0;
121-
int cpu_ffrac = 0;
122-
int fbdiv = 0;
123-
u32 clk_sts, syscfg;
124-
u8 clk_sel = 0, xtal_mode;
125-
u32 cpu_clk;
126-
127-
if ((rt_sysc_r32(SYSC_REG_CPLL_CLKCFG0) & CPU_CLK_SEL) != 0)
128-
clk_sel = 1;
129-
130-
switch (clk_sel) {
131-
case 0:
132-
clk_sts = rt_sysc_r32(SYSC_REG_CUR_CLK_STS);
133-
cpu_fdiv = ((clk_sts >> 8) & 0x1F);
134-
cpu_ffrac = (clk_sts & 0x1F);
135-
cpu_clk = (500 * cpu_ffrac / cpu_fdiv) * 1000 * 1000;
136-
break;
137-
138-
case 1:
139-
fbdiv = ((rt_sysc_r32(0x648) >> 4) & 0x7F) + 1;
140-
syscfg = rt_sysc_r32(SYSC_REG_SYSCFG);
141-
xtal_mode = (syscfg >> 6) & 0x7;
142-
if (xtal_mode >= 6) {
143-
/* 25Mhz Xtal */
144-
cpu_clk = 25 * fbdiv * 1000 * 1000;
145-
} else if (xtal_mode >= 3) {
146-
/* 40Mhz Xtal */
147-
cpu_clk = 40 * fbdiv * 1000 * 1000;
148-
} else {
149-
/* 20Mhz Xtal */
150-
cpu_clk = 20 * fbdiv * 1000 * 1000;
151-
}
152-
break;
153-
}
154-
}
155-
156113
void __init ralink_of_remap(void)
157114
{
158115
rt_sysc_membase = plat_of_remap_node("mtk,mt7621-sysc");

0 commit comments

Comments
 (0)