9 #include <linux/module.h>
10 #include <linux/kernel.h>
21 #define BASE_CLK 13000000
24 #define RO_CLK 60000000
26 #define ACCR_D0CS (1 << 26)
27 #define ACCR_PCCE (1 << 11)
30 static unsigned char hss_mult[4] = { 8, 12, 16, 24 };
39 unsigned long acsr, xclkcfg;
43 __asm__ __volatile__(
"mrc\tp14, 0, %0, c6, c0, 0" :
"=r"(xclkcfg));
49 xn = (acsr >> 8) & 0x7;
50 hss = (acsr >> 14) & 0x3;
58 HSS = (
ro) ?
RO_CLK : hss_mult[hss] * BASE_CLK;
61 pr_info(
"RO Mode clock: %d.%02dMHz (%sactive)\n",
64 pr_info(
"Run Mode clock: %d.%02dMHz (*%d)\n",
65 XL / 1000000, (XL % 1000000) / 10000, xl);
66 pr_info(
"Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n",
67 XN / 1000000, (XN % 1000000) / 10000, xn,
69 pr_info(
"HSIO bus clock: %d.%02dMHz\n",
70 HSS / 1000000, (HSS % 1000000) / 10000);
79 static unsigned long clk_pxa3xx_ac97_getrate(
struct clk *
clk)
81 unsigned long rate = 312000000;
82 unsigned long ac97_div;
89 rate /= (ac97_div >> 12) & 0x7fff;
90 rate *= (ac97_div & 0xfff);
98 static unsigned long clk_pxa3xx_hsio_getrate(
struct clk *
clk)
101 unsigned int hss, hsio_clk;
105 hss = (acsr >> 14) & 0x3;
112 static unsigned int smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
113 static unsigned int df_clkdiv[4] = { 1, 2, 4, 1 };
115 static unsigned long clk_pxa3xx_smemc_getrate(
struct clk *
clk)
117 unsigned long acsr =
ACSR;
120 return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] /
121 df_clkdiv[(memclkcfg >> 16) & 0x3];
126 unsigned long mask = 1ul << (clk->
cken & 0x1f);
130 else if (clk->
cken < 64)
138 unsigned long mask = 1ul << (clk->
cken & 0x1f);
142 else if (clk->
cken < 64)
156 .getrate = clk_pxa3xx_hsio_getrate,
162 .getrate = clk_pxa3xx_ac97_getrate,
168 .getrate = clk_pxa3xx_smemc_getrate,
171 static void clk_pout_enable(
struct clk *
clk)
176 static void clk_pout_disable(
struct clk *
clk)
182 .enable = clk_pout_enable,
183 .disable = clk_pout_disable,
205 #define pxa3xx_clock_suspend NULL
206 #define pxa3xx_clock_resume NULL