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/
This commit is contained in:
John Crispin
2013-01-19 08:54:24 +00:00
parent 3d18c17e4f
commit 740c606e8e
6 changed files with 69 additions and 10 deletions

View File

@@ -26,13 +26,15 @@
#include "prom.h"
/* lantiq socs have 3 static clocks */
static struct clk cpu_clk_generic[3];
static struct clk cpu_clk_generic[4];
void clkdev_add_static(unsigned long cpu, unsigned long fpi, unsigned long io)
void clkdev_add_static(unsigned long cpu, unsigned long fpi,
unsigned long io, unsigned long ppe)
{
cpu_clk_generic[0].rate = cpu;
cpu_clk_generic[1].rate = fpi;
cpu_clk_generic[2].rate = io;
cpu_clk_generic[3].rate = ppe;
}
struct clk *clk_get_cpu(void)
@@ -51,6 +53,12 @@ struct clk *clk_get_io(void)
return &cpu_clk_generic[2];
}
struct clk *clk_get_ppe(void)
{
return &cpu_clk_generic[3];
}
EXPORT_SYMBOL_GPL(clk_get_ppe);
static inline int clk_good(struct clk *clk)
{
return clk && !IS_ERR(clk);