diff options
Diffstat (limited to 'arch/arm/plat-spear/include/plat/clock.h')
-rw-r--r-- | arch/arm/plat-spear/include/plat/clock.h | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h index 2572260f990..863d9e98392 100644 --- a/arch/arm/plat-spear/include/plat/clock.h +++ b/arch/arm/plat-spear/include/plat/clock.h | |||
@@ -54,7 +54,7 @@ struct pclk_info { | |||
54 | struct pclk_sel { | 54 | struct pclk_sel { |
55 | struct pclk_info *pclk_info; | 55 | struct pclk_info *pclk_info; |
56 | u8 pclk_count; | 56 | u8 pclk_count; |
57 | unsigned int *pclk_sel_reg; | 57 | void __iomem *pclk_sel_reg; |
58 | unsigned int pclk_sel_mask; | 58 | unsigned int pclk_sel_mask; |
59 | }; | 59 | }; |
60 | 60 | ||
@@ -67,6 +67,7 @@ struct pclk_sel { | |||
67 | * @en_reg_bit: clk enable/disable bit | 67 | * @en_reg_bit: clk enable/disable bit |
68 | * @ops: clk enable/disable ops - generic_clkops selected if NULL | 68 | * @ops: clk enable/disable ops - generic_clkops selected if NULL |
69 | * @recalc: pointer to clock rate recalculate function | 69 | * @recalc: pointer to clock rate recalculate function |
70 | * @div_factor: division factor to parent clock. Only for recalc = follow_parent | ||
70 | * @pclk: current parent clk | 71 | * @pclk: current parent clk |
71 | * @pclk_sel: pointer to parent selection structure | 72 | * @pclk_sel: pointer to parent selection structure |
72 | * @pclk_sel_shift: register shift for selecting parent of this clock | 73 | * @pclk_sel_shift: register shift for selecting parent of this clock |
@@ -78,10 +79,11 @@ struct clk { | |||
78 | unsigned int usage_count; | 79 | unsigned int usage_count; |
79 | unsigned int flags; | 80 | unsigned int flags; |
80 | unsigned long rate; | 81 | unsigned long rate; |
81 | unsigned int *en_reg; | 82 | void __iomem *en_reg; |
82 | u8 en_reg_bit; | 83 | u8 en_reg_bit; |
83 | const struct clkops *ops; | 84 | const struct clkops *ops; |
84 | void (*recalc) (struct clk *); | 85 | void (*recalc) (struct clk *); |
86 | unsigned int div_factor; | ||
85 | 87 | ||
86 | struct clk *pclk; | 88 | struct clk *pclk; |
87 | struct pclk_sel *pclk_sel; | 89 | struct pclk_sel *pclk_sel; |
@@ -93,23 +95,65 @@ struct clk { | |||
93 | }; | 95 | }; |
94 | 96 | ||
95 | /* pll configuration structure */ | 97 | /* pll configuration structure */ |
98 | struct pll_clk_masks { | ||
99 | u32 mode_mask; | ||
100 | u32 mode_shift; | ||
101 | |||
102 | u32 norm_fdbk_m_mask; | ||
103 | u32 norm_fdbk_m_shift; | ||
104 | u32 dith_fdbk_m_mask; | ||
105 | u32 dith_fdbk_m_shift; | ||
106 | u32 div_p_mask; | ||
107 | u32 div_p_shift; | ||
108 | u32 div_n_mask; | ||
109 | u32 div_n_shift; | ||
110 | }; | ||
111 | |||
96 | struct pll_clk_config { | 112 | struct pll_clk_config { |
97 | unsigned int *mode_reg; | 113 | void __iomem *mode_reg; |
98 | unsigned int *cfg_reg; | 114 | void __iomem *cfg_reg; |
115 | struct pll_clk_masks *masks; | ||
99 | }; | 116 | }; |
100 | 117 | ||
101 | /* ahb and apb bus configuration structure */ | 118 | /* ahb and apb bus configuration structure */ |
119 | struct bus_clk_masks { | ||
120 | u32 mask; | ||
121 | u32 shift; | ||
122 | }; | ||
123 | |||
102 | struct bus_clk_config { | 124 | struct bus_clk_config { |
103 | unsigned int *reg; | 125 | void __iomem *reg; |
104 | unsigned int mask; | 126 | struct bus_clk_masks *masks; |
105 | unsigned int shift; | 127 | }; |
128 | |||
129 | /* Aux clk configuration structure: applicable to UART and FIRDA */ | ||
130 | struct aux_clk_masks { | ||
131 | u32 eq_sel_mask; | ||
132 | u32 eq_sel_shift; | ||
133 | u32 eq1_mask; | ||
134 | u32 eq2_mask; | ||
135 | u32 xscale_sel_mask; | ||
136 | u32 xscale_sel_shift; | ||
137 | u32 yscale_sel_mask; | ||
138 | u32 yscale_sel_shift; | ||
106 | }; | 139 | }; |
107 | 140 | ||
108 | /* | ||
109 | * Aux clk configuration structure: applicable to GPT, UART and FIRDA | ||
110 | */ | ||
111 | struct aux_clk_config { | 141 | struct aux_clk_config { |
112 | unsigned int *synth_reg; | 142 | void __iomem *synth_reg; |
143 | struct aux_clk_masks *masks; | ||
144 | }; | ||
145 | |||
146 | /* GPT clk configuration structure */ | ||
147 | struct gpt_clk_masks { | ||
148 | u32 mscale_sel_mask; | ||
149 | u32 mscale_sel_shift; | ||
150 | u32 nscale_sel_mask; | ||
151 | u32 nscale_sel_shift; | ||
152 | }; | ||
153 | |||
154 | struct gpt_clk_config { | ||
155 | void __iomem *synth_reg; | ||
156 | struct gpt_clk_masks *masks; | ||
113 | }; | 157 | }; |
114 | 158 | ||
115 | /* platform specific clock functions */ | 159 | /* platform specific clock functions */ |
@@ -118,7 +162,7 @@ void recalc_root_clocks(void); | |||
118 | 162 | ||
119 | /* clock recalc functions */ | 163 | /* clock recalc functions */ |
120 | void follow_parent(struct clk *clk); | 164 | void follow_parent(struct clk *clk); |
121 | void pll1_clk_recalc(struct clk *clk); | 165 | void pll_clk_recalc(struct clk *clk); |
122 | void bus_clk_recalc(struct clk *clk); | 166 | void bus_clk_recalc(struct clk *clk); |
123 | void gpt_clk_recalc(struct clk *clk); | 167 | void gpt_clk_recalc(struct clk *clk); |
124 | void aux_clk_recalc(struct clk *clk); | 168 | void aux_clk_recalc(struct clk *clk); |