20 #include <linux/kernel.h>
24 #include <mach/common.h>
27 #define RTFRQCR IOMEM(0xe6150000)
28 #define SYFRQCR IOMEM(0xe6150004)
29 #define CMFRQCR IOMEM(0xe61500E0)
30 #define VCLKCR1 IOMEM(0xe6150008)
31 #define VCLKCR2 IOMEM(0xe615000C)
32 #define VCLKCR3 IOMEM(0xe615001C)
33 #define FMSICKCR IOMEM(0xe6150010)
34 #define FMSOCKCR IOMEM(0xe6150014)
35 #define FSICKCR IOMEM(0xe6150018)
36 #define PLLC1CR IOMEM(0xe6150028)
37 #define PLLC2CR IOMEM(0xe615002C)
38 #define SUBUSBCKCR IOMEM(0xe6150080)
39 #define SPUCKCR IOMEM(0xe6150084)
40 #define MSUCKCR IOMEM(0xe6150088)
41 #define MVI3CKCR IOMEM(0xe6150090)
42 #define HDMICKCR IOMEM(0xe6150094)
43 #define MFCK1CR IOMEM(0xe6150098)
44 #define MFCK2CR IOMEM(0xe615009C)
45 #define DSITCKCR IOMEM(0xe6150060)
46 #define DSIPCKCR IOMEM(0xe6150064)
47 #define SMSTPCR0 IOMEM(0xe6150130)
48 #define SMSTPCR1 IOMEM(0xe6150134)
49 #define SMSTPCR2 IOMEM(0xe6150138)
50 #define SMSTPCR3 IOMEM(0xe615013C)
51 #define SMSTPCR4 IOMEM(0xe6150140)
54 static struct clk r_clk = {
75 static unsigned long div2_recalc(
struct clk *
clk)
77 return clk->
parent->rate / 2;
81 .recalc = div2_recalc,
85 static struct clk extalc1_div2_clk = {
91 static struct clk extal2_div2_clk = {
97 static struct clk extal2_div4_clk = {
99 .parent = &extal2_div2_clk,
103 static unsigned long pllc1_recalc(
struct clk *
clk)
105 unsigned long mult = 1;
114 .recalc = pllc1_recalc,
117 static struct clk pllc1_clk = {
118 .ops = &pllc1_clk_ops,
120 .parent = &extalc1_div2_clk,
124 static struct clk pllc1_div2_clk = {
125 .ops = &div2_clk_ops,
126 .parent = &pllc1_clk,
130 static unsigned long pllc2_recalc(
struct clk *clk)
132 unsigned long mult = 1;
141 .recalc = pllc2_recalc,
144 static struct clk pllc2_clk = {
145 .ops = &pllc2_clk_ops,
147 .parent = &extalc1_div2_clk,
162 static void div4_kick(
struct clk *clk)
172 static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
173 24, 32, 36, 48, 0, 72, 96, 0 };
181 .div_mult_table = &div4_div_mult_table,
189 #define DIV4(_reg, _bit, _mask, _flags) \
190 SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags)
213 static struct clk div6_clks[] = {
239 #define MSTP(_parent, _reg, _bit, _flags) \
240 SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
242 static struct clk mstp_clks[] = {
348 for (k = 0; !ret && (k <
ARRAY_SIZE(main_clks)); k++)
365 panic(
"failed to setup sh7377 clocks\n");