diff options
author | John Crispin <blogic@openwrt.org> | 2013-01-19 08:54:24 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-02-17 00:15:17 +0100 |
commit | 740c606e8e79c3e3800afbc32b4e6123da403d6c (patch) | |
tree | d8fad6b56dcdcdfba522011bab2e114d221ba6a3 /arch/mips/lantiq/xway/clk.c | |
parent | 3d18c17e4f1699c3a4f47d2483c5d4c3ab3a242b (diff) | |
download | talos-obmc-linux-740c606e8e79c3e3800afbc32b4e6123da403d6c.tar.gz talos-obmc-linux-740c606e8e79c3e3800afbc32b4e6123da403d6c.zip |
MIPS: lantiq: adds static clock for PP32
The Lantiq DSL SoCs have an internal networking processor. Add code to read
the static clock rate.
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/4815/
Diffstat (limited to 'arch/mips/lantiq/xway/clk.c')
-rw-r--r-- | arch/mips/lantiq/xway/clk.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/mips/lantiq/xway/clk.c b/arch/mips/lantiq/xway/clk.c index 9aa17f79a742..1ab576dc9bd1 100644 --- a/arch/mips/lantiq/xway/clk.c +++ b/arch/mips/lantiq/xway/clk.c @@ -53,6 +53,29 @@ unsigned long ltq_danube_cpu_hz(void) } } +unsigned long ltq_danube_pp32_hz(void) +{ + unsigned int clksys = (ltq_cgu_r32(CGU_SYS) >> 7) & 3; + unsigned long clk; + + switch (clksys) { + case 1: + clk = CLOCK_240M; + break; + case 2: + clk = CLOCK_222M; + break; + case 3: + clk = CLOCK_133M; + break; + default: + clk = CLOCK_266M; + break; + } + + return clk; +} + unsigned long ltq_ar9_sys_hz(void) { if (((ltq_cgu_r32(CGU_SYS) >> 3) & 0x3) == 0x2) @@ -149,3 +172,23 @@ unsigned long ltq_vr9_fpi_hz(void) return clk; } + +unsigned long ltq_vr9_pp32_hz(void) +{ + unsigned int clksys = (ltq_cgu_r32(CGU_SYS) >> 16) & 3; + unsigned long clk; + + switch (clksys) { + case 1: + clk = CLOCK_450M; + break; + case 2: + clk = CLOCK_300M; + break; + default: + clk = CLOCK_500M; + break; + } + + return clk; +} |