~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/clk/ti.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/clk/ti.h (Version linux-6.12-rc7) and /include/linux/clk/ti.h (Version linux-6.2.16)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*                                                  2 /*
  3  * TI clock drivers support                         3  * TI clock drivers support
  4  *                                                  4  *
  5  * Copyright (C) 2013 Texas Instruments, Inc.       5  * Copyright (C) 2013 Texas Instruments, Inc.
  6  */                                                 6  */
  7 #ifndef __LINUX_CLK_TI_H__                          7 #ifndef __LINUX_CLK_TI_H__
  8 #define __LINUX_CLK_TI_H__                          8 #define __LINUX_CLK_TI_H__
  9                                                     9 
 10 #include <linux/clk-provider.h>                    10 #include <linux/clk-provider.h>
 11 #include <linux/clkdev.h>                          11 #include <linux/clkdev.h>
 12                                                    12 
 13 /**                                                13 /**
 14  * struct clk_omap_reg - OMAP register declara     14  * struct clk_omap_reg - OMAP register declaration
 15  * @offset: offset from the master IP module b     15  * @offset: offset from the master IP module base address
 16  * @bit: register bit offset                   << 
 17  * @index: index of the master IP module           16  * @index: index of the master IP module
 18  * @flags: flags                               << 
 19  */                                                17  */
 20 struct clk_omap_reg {                              18 struct clk_omap_reg {
 21         void __iomem *ptr;                         19         void __iomem *ptr;
 22         u16 offset;                                20         u16 offset;
 23         u8 bit;                                << 
 24         u8 index;                                  21         u8 index;
 25         u8 flags;                                  22         u8 flags;
 26 };                                                 23 };
 27                                                    24 
 28 /**                                                25 /**
 29  * struct dpll_data - DPLL registers and integ     26  * struct dpll_data - DPLL registers and integration data
 30  * @mult_div1_reg: register containing the DPL     27  * @mult_div1_reg: register containing the DPLL M and N bitfields
 31  * @mult_mask: mask of the DPLL M bitfield in      28  * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
 32  * @div1_mask: mask of the DPLL N bitfield in      29  * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
 33  * @clk_bypass: struct clk_hw pointer to the c     30  * @clk_bypass: struct clk_hw pointer to the clock's bypass clock input
 34  * @clk_ref: struct clk_hw pointer to the cloc     31  * @clk_ref: struct clk_hw pointer to the clock's reference clock input
 35  * @control_reg: register containing the DPLL      32  * @control_reg: register containing the DPLL mode bitfield
 36  * @enable_mask: mask of the DPLL mode bitfiel     33  * @enable_mask: mask of the DPLL mode bitfield in @control_reg
 37  * @last_rounded_rate: cache of the last rate      34  * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
 38  * @last_rounded_m: cache of the last M result     35  * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
 39  * @last_rounded_m4xen: cache of the last M4X      36  * @last_rounded_m4xen: cache of the last M4X result of
 40  *                      omap4_dpll_regm4xen_ro     37  *                      omap4_dpll_regm4xen_round_rate()
 41  * @last_rounded_lpmode: cache of the last lpm     38  * @last_rounded_lpmode: cache of the last lpmode result of
 42  *                       omap4_dpll_lpmode_rec     39  *                       omap4_dpll_lpmode_recalc()
 43  * @max_multiplier: maximum valid non-bypass m     40  * @max_multiplier: maximum valid non-bypass multiplier value (actual)
 44  * @last_rounded_n: cache of the last N result     41  * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
 45  * @min_divider: minimum valid non-bypass divi     42  * @min_divider: minimum valid non-bypass divider value (actual)
 46  * @max_divider: maximum valid non-bypass divi     43  * @max_divider: maximum valid non-bypass divider value (actual)
 47  * @max_rate: maximum clock rate for the DPLL      44  * @max_rate: maximum clock rate for the DPLL
 48  * @modes: possible values of @enable_mask         45  * @modes: possible values of @enable_mask
 49  * @autoidle_reg: register containing the DPLL     46  * @autoidle_reg: register containing the DPLL autoidle mode bitfield
 50  * @idlest_reg: register containing the DPLL i     47  * @idlest_reg: register containing the DPLL idle status bitfield
 51  * @autoidle_mask: mask of the DPLL autoidle m     48  * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
 52  * @freqsel_mask: mask of the DPLL jitter corr     49  * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
 53  * @dcc_mask: mask of the DPLL DCC correction      50  * @dcc_mask: mask of the DPLL DCC correction bitfield @mult_div1_reg
 54  * @dcc_rate: rate atleast which DCC @dcc_mask     51  * @dcc_rate: rate atleast which DCC @dcc_mask must be set
 55  * @idlest_mask: mask of the DPLL idle status      52  * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
 56  * @lpmode_mask: mask of the DPLL low-power mo     53  * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
 57  * @m4xen_mask: mask of the DPLL M4X multiplie     54  * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
 58  * @auto_recal_bit: bitshift of the driftguard     55  * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
 59  * @recal_en_bit: bitshift of the PRM_IRQENABL     56  * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
 60  * @recal_st_bit: bitshift of the PRM_IRQSTATU     57  * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
 61  * @ssc_deltam_reg: register containing the DP     58  * @ssc_deltam_reg: register containing the DPLL SSC frequency spreading
 62  * @ssc_modfreq_reg: register containing the D     59  * @ssc_modfreq_reg: register containing the DPLL SSC modulation frequency
 63  * @ssc_modfreq_mant_mask: mask of the mantiss     60  * @ssc_modfreq_mant_mask: mask of the mantissa component in @ssc_modfreq_reg
 64  * @ssc_modfreq_exp_mask: mask of the exponent     61  * @ssc_modfreq_exp_mask: mask of the exponent component in @ssc_modfreq_reg
 65  * @ssc_enable_mask: mask of the DPLL SSC enab     62  * @ssc_enable_mask: mask of the DPLL SSC enable bit in @control_reg
 66  * @ssc_downspread_mask: mask of the DPLL SSC      63  * @ssc_downspread_mask: mask of the DPLL SSC low frequency only bit in
 67  *                       @control_reg              64  *                       @control_reg
 68  * @ssc_modfreq: the DPLL SSC frequency modula     65  * @ssc_modfreq: the DPLL SSC frequency modulation in kHz
 69  * @ssc_deltam: the DPLL SSC frequency spreadi     66  * @ssc_deltam: the DPLL SSC frequency spreading in permille (10th of percent)
 70  * @ssc_downspread: require the only low frequ     67  * @ssc_downspread: require the only low frequency spread of the DPLL in SSC
 71  *                   mode                          68  *                   mode
 72  * @flags: DPLL type/features (see below)          69  * @flags: DPLL type/features (see below)
 73  *                                                 70  *
 74  * Possible values for @flags:                     71  * Possible values for @flags:
 75  * DPLL_J_TYPE: "J-type DPLL" (only some 36xx,     72  * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
 76  *                                                 73  *
 77  * @freqsel_mask is only used on the OMAP34xx      74  * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
 78  *                                                 75  *
 79  * XXX Some DPLLs have multiple bypass inputs,     76  * XXX Some DPLLs have multiple bypass inputs, so it's not technically
 80  * correct to only have one @clk_bypass pointe     77  * correct to only have one @clk_bypass pointer.
 81  *                                                 78  *
 82  * XXX The runtime-variable fields (@last_roun     79  * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
 83  * @last_rounded_n) should be separated from t     80  * @last_rounded_n) should be separated from the runtime-fixed fields
 84  * and placed into a different structure, so t     81  * and placed into a different structure, so that the runtime-fixed data
 85  * can be placed into read-only space.             82  * can be placed into read-only space.
 86  */                                                83  */
 87 struct dpll_data {                                 84 struct dpll_data {
 88         struct clk_omap_reg     mult_div1_reg;     85         struct clk_omap_reg     mult_div1_reg;
 89         u32                     mult_mask;         86         u32                     mult_mask;
 90         u32                     div1_mask;         87         u32                     div1_mask;
 91         struct clk_hw           *clk_bypass;       88         struct clk_hw           *clk_bypass;
 92         struct clk_hw           *clk_ref;          89         struct clk_hw           *clk_ref;
 93         struct clk_omap_reg     control_reg;       90         struct clk_omap_reg     control_reg;
 94         u32                     enable_mask;       91         u32                     enable_mask;
 95         unsigned long           last_rounded_r     92         unsigned long           last_rounded_rate;
 96         u16                     last_rounded_m     93         u16                     last_rounded_m;
 97         u8                      last_rounded_m     94         u8                      last_rounded_m4xen;
 98         u8                      last_rounded_l     95         u8                      last_rounded_lpmode;
 99         u16                     max_multiplier     96         u16                     max_multiplier;
100         u8                      last_rounded_n     97         u8                      last_rounded_n;
101         u8                      min_divider;       98         u8                      min_divider;
102         u16                     max_divider;       99         u16                     max_divider;
103         unsigned long           max_rate;         100         unsigned long           max_rate;
104         u8                      modes;            101         u8                      modes;
105         struct clk_omap_reg     autoidle_reg;     102         struct clk_omap_reg     autoidle_reg;
106         struct clk_omap_reg     idlest_reg;       103         struct clk_omap_reg     idlest_reg;
107         u32                     autoidle_mask;    104         u32                     autoidle_mask;
108         u32                     freqsel_mask;     105         u32                     freqsel_mask;
109         u32                     idlest_mask;      106         u32                     idlest_mask;
110         u32                     dco_mask;         107         u32                     dco_mask;
111         u32                     sddiv_mask;       108         u32                     sddiv_mask;
112         u32                     dcc_mask;         109         u32                     dcc_mask;
113         unsigned long           dcc_rate;         110         unsigned long           dcc_rate;
114         u32                     lpmode_mask;      111         u32                     lpmode_mask;
115         u32                     m4xen_mask;       112         u32                     m4xen_mask;
116         u8                      auto_recal_bit    113         u8                      auto_recal_bit;
117         u8                      recal_en_bit;     114         u8                      recal_en_bit;
118         u8                      recal_st_bit;     115         u8                      recal_st_bit;
119         struct clk_omap_reg     ssc_deltam_reg    116         struct clk_omap_reg     ssc_deltam_reg;
120         struct clk_omap_reg     ssc_modfreq_re    117         struct clk_omap_reg     ssc_modfreq_reg;
121         u32                     ssc_deltam_int    118         u32                     ssc_deltam_int_mask;
122         u32                     ssc_deltam_fra    119         u32                     ssc_deltam_frac_mask;
123         u32                     ssc_modfreq_ma    120         u32                     ssc_modfreq_mant_mask;
124         u32                     ssc_modfreq_ex    121         u32                     ssc_modfreq_exp_mask;
125         u32                     ssc_enable_mas    122         u32                     ssc_enable_mask;
126         u32                     ssc_downspread    123         u32                     ssc_downspread_mask;
127         u32                     ssc_modfreq;      124         u32                     ssc_modfreq;
128         u32                     ssc_deltam;       125         u32                     ssc_deltam;
129         bool                    ssc_downspread    126         bool                    ssc_downspread;
130         u8                      flags;            127         u8                      flags;
131 };                                                128 };
132                                                   129 
133 struct clk_hw_omap;                               130 struct clk_hw_omap;
134                                                   131 
135 /**                                               132 /**
136  * struct clk_hw_omap_ops - OMAP clk ops          133  * struct clk_hw_omap_ops - OMAP clk ops
137  * @find_idlest: find idlest register informat    134  * @find_idlest: find idlest register information for a clock
138  * @find_companion: find companion clock regis    135  * @find_companion: find companion clock register information for a clock,
139  *                  basically converts CM_ICLK    136  *                  basically converts CM_ICLKEN* <-> CM_FCLKEN*
140  * @allow_idle: enables autoidle hardware func    137  * @allow_idle: enables autoidle hardware functionality for a clock
141  * @deny_idle: prevent autoidle hardware funct    138  * @deny_idle: prevent autoidle hardware functionality for a clock
142  */                                               139  */
143 struct clk_hw_omap_ops {                          140 struct clk_hw_omap_ops {
144         void    (*find_idlest)(struct clk_hw_o    141         void    (*find_idlest)(struct clk_hw_omap *oclk,
145                                struct clk_omap    142                                struct clk_omap_reg *idlest_reg,
146                                u8 *idlest_bit,    143                                u8 *idlest_bit, u8 *idlest_val);
147         void    (*find_companion)(struct clk_h    144         void    (*find_companion)(struct clk_hw_omap *oclk,
148                                   struct clk_o    145                                   struct clk_omap_reg *other_reg,
149                                   u8 *other_bi    146                                   u8 *other_bit);
150         void    (*allow_idle)(struct clk_hw_om    147         void    (*allow_idle)(struct clk_hw_omap *oclk);
151         void    (*deny_idle)(struct clk_hw_oma    148         void    (*deny_idle)(struct clk_hw_omap *oclk);
152 };                                                149 };
153                                                   150 
154 /**                                               151 /**
155  * struct clk_hw_omap - OMAP struct clk           152  * struct clk_hw_omap - OMAP struct clk
156  * @node: list_head connecting this clock into    153  * @node: list_head connecting this clock into the full clock list
157  * @enable_reg: register to write to enable th    154  * @enable_reg: register to write to enable the clock (see @enable_bit)
158  * @enable_bit: bitshift to write to enable/di    155  * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
159  * @flags: see "struct clk.flags possibilities    156  * @flags: see "struct clk.flags possibilities" above
160  * @clksel_reg: for clksel clks, register va c    157  * @clksel_reg: for clksel clks, register va containing src/divisor select
161  * @dpll_data: for DPLLs, pointer to struct dp    158  * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
162  * @clkdm_name: clockdomain name that this clo    159  * @clkdm_name: clockdomain name that this clock is contained in
163  * @clkdm: pointer to struct clockdomain, reso    160  * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
164  * @ops: clock ops for this clock                 161  * @ops: clock ops for this clock
165  */                                               162  */
166 struct clk_hw_omap {                              163 struct clk_hw_omap {
167         struct clk_hw           hw;               164         struct clk_hw           hw;
168         struct list_head        node;             165         struct list_head        node;
169         unsigned long           fixed_rate;       166         unsigned long           fixed_rate;
170         u8                      fixed_div;        167         u8                      fixed_div;
171         struct clk_omap_reg     enable_reg;       168         struct clk_omap_reg     enable_reg;
172         u8                      enable_bit;       169         u8                      enable_bit;
173         unsigned long           flags;            170         unsigned long           flags;
174         struct clk_omap_reg     clksel_reg;       171         struct clk_omap_reg     clksel_reg;
175         struct dpll_data        *dpll_data;       172         struct dpll_data        *dpll_data;
176         const char              *clkdm_name;      173         const char              *clkdm_name;
177         struct clockdomain      *clkdm;           174         struct clockdomain      *clkdm;
178         const struct clk_hw_omap_ops    *ops;     175         const struct clk_hw_omap_ops    *ops;
179         u32                     context;          176         u32                     context;
180         int                     autoidle_count    177         int                     autoidle_count;
181 };                                                178 };
182                                                   179 
183 /*                                                180 /*
184  * struct clk_hw_omap.flags possibilities         181  * struct clk_hw_omap.flags possibilities
185  *                                                182  *
186  * XXX document the rest of the clock flags he    183  * XXX document the rest of the clock flags here
187  *                                                184  *
188  * ENABLE_REG_32BIT: (OMAP1 only) clock contro    185  * ENABLE_REG_32BIT: (OMAP1 only) clock control register must be accessed
189  *     with 32bit ops, by default OMAP1 uses 1    186  *     with 32bit ops, by default OMAP1 uses 16bit ops.
190  * CLOCK_IDLE_CONTROL: (OMAP1 only) clock has     187  * CLOCK_IDLE_CONTROL: (OMAP1 only) clock has autoidle support.
191  * CLOCK_NO_IDLE_PARENT: (OMAP1 only) when clo    188  * CLOCK_NO_IDLE_PARENT: (OMAP1 only) when clock is enabled, its parent
192  *     clock is put to no-idle mode.              189  *     clock is put to no-idle mode.
193  * ENABLE_ON_INIT: Clock is enabled on init.      190  * ENABLE_ON_INIT: Clock is enabled on init.
194  * INVERT_ENABLE: By default, clock enable bit    191  * INVERT_ENABLE: By default, clock enable bit behavior is '1' enable, ''
195  *     disable. This inverts the behavior maki    192  *     disable. This inverts the behavior making '' enable and '1' disable.
196  * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT an    193  * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
197  *     bits share the same register.  This fla    194  *     bits share the same register.  This flag allows the
198  *     omap4_dpllmx*() code to determine which    195  *     omap4_dpllmx*() code to determine which GATE_CTRL bit field
199  *     should be used.  This is a temporary so    196  *     should be used.  This is a temporary solution - a better approach
200  *     would be to associate clock type-specif    197  *     would be to associate clock type-specific data with the clock,
201  *     similar to the struct dpll_data approac    198  *     similar to the struct dpll_data approach.
202  */                                               199  */
203 #define ENABLE_REG_32BIT        (1 << 0)          200 #define ENABLE_REG_32BIT        (1 << 0)        /* Use 32-bit access */
204 #define CLOCK_IDLE_CONTROL      (1 << 1)          201 #define CLOCK_IDLE_CONTROL      (1 << 1)
205 #define CLOCK_NO_IDLE_PARENT    (1 << 2)          202 #define CLOCK_NO_IDLE_PARENT    (1 << 2)
206 #define ENABLE_ON_INIT          (1 << 3)          203 #define ENABLE_ON_INIT          (1 << 3)        /* Enable upon framework init */
207 #define INVERT_ENABLE           (1 << 4)          204 #define INVERT_ENABLE           (1 << 4)        /* 0 enables, 1 disables */
208 #define CLOCK_CLKOUTX2          (1 << 5)          205 #define CLOCK_CLKOUTX2          (1 << 5)
209                                                   206 
210 /* CM_CLKEN_PLL*.EN* bit values - not all are     207 /* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
211 #define DPLL_LOW_POWER_STOP     0x1               208 #define DPLL_LOW_POWER_STOP     0x1
212 #define DPLL_LOW_POWER_BYPASS   0x5               209 #define DPLL_LOW_POWER_BYPASS   0x5
213 #define DPLL_LOCKED             0x7               210 #define DPLL_LOCKED             0x7
214                                                   211 
215 /* DPLL Type and DCO Selection Flags */           212 /* DPLL Type and DCO Selection Flags */
216 #define DPLL_J_TYPE             0x1               213 #define DPLL_J_TYPE             0x1
217                                                   214 
218 /* Static memmap indices */                       215 /* Static memmap indices */
219 enum {                                            216 enum {
220         TI_CLKM_CM = 0,                           217         TI_CLKM_CM = 0,
221         TI_CLKM_CM2,                              218         TI_CLKM_CM2,
222         TI_CLKM_PRM,                              219         TI_CLKM_PRM,
223         TI_CLKM_SCRM,                             220         TI_CLKM_SCRM,
224         TI_CLKM_CTRL,                             221         TI_CLKM_CTRL,
225         TI_CLKM_CTRL_AUX,                         222         TI_CLKM_CTRL_AUX,
226         TI_CLKM_PLLSS,                            223         TI_CLKM_PLLSS,
227         CLK_MAX_MEMMAPS                           224         CLK_MAX_MEMMAPS
228 };                                                225 };
229                                                   226 
230 /**                                               227 /**
231  * struct ti_clk_ll_ops - low-level ops for cl    228  * struct ti_clk_ll_ops - low-level ops for clocks
232  * @clk_readl: pointer to register read functi    229  * @clk_readl: pointer to register read function
233  * @clk_writel: pointer to register write func    230  * @clk_writel: pointer to register write function
234  * @clk_rmw: pointer to register read-modify-w    231  * @clk_rmw: pointer to register read-modify-write function
235  * @clkdm_clk_enable: pointer to clockdomain e    232  * @clkdm_clk_enable: pointer to clockdomain enable function
236  * @clkdm_clk_disable: pointer to clockdomain     233  * @clkdm_clk_disable: pointer to clockdomain disable function
237  * @clkdm_lookup: pointer to clockdomain looku    234  * @clkdm_lookup: pointer to clockdomain lookup function
238  * @cm_wait_module_ready: pointer to CM module    235  * @cm_wait_module_ready: pointer to CM module wait ready function
239  * @cm_split_idlest_reg: pointer to CM module     236  * @cm_split_idlest_reg: pointer to CM module function to split idlest reg
240  *                                                237  *
241  * Low-level ops are generally used by the bas    238  * Low-level ops are generally used by the basic clock types (clk-gate,
242  * clk-mux, clk-divider etc.) to provide suppo    239  * clk-mux, clk-divider etc.) to provide support for various low-level
243  * hadrware interfaces (direct MMIO, regmap et    240  * hadrware interfaces (direct MMIO, regmap etc.), and is initialized
244  * by board code. Low-level ops also contain s    241  * by board code. Low-level ops also contain some other platform specific
245  * operations not provided directly by clock d    242  * operations not provided directly by clock drivers.
246  */                                               243  */
247 struct ti_clk_ll_ops {                            244 struct ti_clk_ll_ops {
248         u32     (*clk_readl)(const struct clk_    245         u32     (*clk_readl)(const struct clk_omap_reg *reg);
249         void    (*clk_writel)(u32 val, const s    246         void    (*clk_writel)(u32 val, const struct clk_omap_reg *reg);
250         void    (*clk_rmw)(u32 val, u32 mask,     247         void    (*clk_rmw)(u32 val, u32 mask, const struct clk_omap_reg *reg);
251         int     (*clkdm_clk_enable)(struct clo    248         int     (*clkdm_clk_enable)(struct clockdomain *clkdm, struct clk *clk);
252         int     (*clkdm_clk_disable)(struct cl    249         int     (*clkdm_clk_disable)(struct clockdomain *clkdm,
253                                      struct cl    250                                      struct clk *clk);
254         struct clockdomain * (*clkdm_lookup)(c    251         struct clockdomain * (*clkdm_lookup)(const char *name);
255         int     (*cm_wait_module_ready)(u8 par    252         int     (*cm_wait_module_ready)(u8 part, s16 prcm_mod, u16 idlest_reg,
256                                         u8 idl    253                                         u8 idlest_shift);
257         int     (*cm_split_idlest_reg)(struct     254         int     (*cm_split_idlest_reg)(struct clk_omap_reg *idlest_reg,
258                                        s16 *pr    255                                        s16 *prcm_inst, u8 *idlest_reg_id);
259 };                                                256 };
260                                                   257 
261 #define to_clk_hw_omap(_hw) container_of(_hw,     258 #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
262                                                   259 
263 bool omap2_clk_is_hw_omap(struct clk_hw *hw);     260 bool omap2_clk_is_hw_omap(struct clk_hw *hw);
264 int omap2_clk_disable_autoidle_all(void);         261 int omap2_clk_disable_autoidle_all(void);
265 int omap2_clk_enable_autoidle_all(void);          262 int omap2_clk_enable_autoidle_all(void);
266 int omap2_clk_allow_idle(struct clk *clk);        263 int omap2_clk_allow_idle(struct clk *clk);
267 int omap2_clk_deny_idle(struct clk *clk);         264 int omap2_clk_deny_idle(struct clk *clk);
268 unsigned long omap2_dpllcore_recalc(struct clk    265 unsigned long omap2_dpllcore_recalc(struct clk_hw *hw,
269                                     unsigned l    266                                     unsigned long parent_rate);
270 int omap2_reprogram_dpllcore(struct clk_hw *cl    267 int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate,
271                              unsigned long par    268                              unsigned long parent_rate);
272 void omap2xxx_clkt_dpllcore_init(struct clk_hw    269 void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw);
273 void omap2xxx_clkt_vps_init(void);                270 void omap2xxx_clkt_vps_init(void);
274 unsigned long omap2_get_dpll_rate(struct clk_h    271 unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk);
275                                                   272 
276 void ti_dt_clk_init_retry_clks(void);             273 void ti_dt_clk_init_retry_clks(void);
277 void ti_dt_clockdomains_setup(void);              274 void ti_dt_clockdomains_setup(void);
278 int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *    275 int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *ops);
279                                                   276 
280 struct regmap;                                    277 struct regmap;
281                                                   278 
282 int omap2_clk_provider_init(struct device_node    279 int omap2_clk_provider_init(struct device_node *parent, int index,
283                             struct regmap *sys    280                             struct regmap *syscon, void __iomem *mem);
284 void omap2_clk_legacy_provider_init(int index,    281 void omap2_clk_legacy_provider_init(int index, void __iomem *mem);
285                                                   282 
286 int omap3430_dt_clk_init(void);                   283 int omap3430_dt_clk_init(void);
287 int omap3630_dt_clk_init(void);                   284 int omap3630_dt_clk_init(void);
288 int am35xx_dt_clk_init(void);                     285 int am35xx_dt_clk_init(void);
289 int dm814x_dt_clk_init(void);                     286 int dm814x_dt_clk_init(void);
290 int dm816x_dt_clk_init(void);                     287 int dm816x_dt_clk_init(void);
291 int omap4xxx_dt_clk_init(void);                   288 int omap4xxx_dt_clk_init(void);
292 int omap5xxx_dt_clk_init(void);                   289 int omap5xxx_dt_clk_init(void);
293 int dra7xx_dt_clk_init(void);                     290 int dra7xx_dt_clk_init(void);
294 int am33xx_dt_clk_init(void);                     291 int am33xx_dt_clk_init(void);
295 int am43xx_dt_clk_init(void);                     292 int am43xx_dt_clk_init(void);
296 int omap2420_dt_clk_init(void);                   293 int omap2420_dt_clk_init(void);
297 int omap2430_dt_clk_init(void);                   294 int omap2430_dt_clk_init(void);
298                                                   295 
299 struct ti_clk_features {                          296 struct ti_clk_features {
300         u32 flags;                                297         u32 flags;
301         long fint_min;                            298         long fint_min;
302         long fint_max;                            299         long fint_max;
303         long fint_band1_max;                      300         long fint_band1_max;
304         long fint_band2_min;                      301         long fint_band2_min;
305         u8 dpll_bypass_vals;                      302         u8 dpll_bypass_vals;
306         u8 cm_idlest_val;                         303         u8 cm_idlest_val;
307 };                                                304 };
308                                                   305 
309 #define TI_CLK_DPLL_HAS_FREQSEL                   306 #define TI_CLK_DPLL_HAS_FREQSEL                 BIT(0)
310 #define TI_CLK_DPLL4_DENY_REPROGRAM               307 #define TI_CLK_DPLL4_DENY_REPROGRAM             BIT(1)
311 #define TI_CLK_DISABLE_CLKDM_CONTROL              308 #define TI_CLK_DISABLE_CLKDM_CONTROL            BIT(2)
312 #define TI_CLK_ERRATA_I810                        309 #define TI_CLK_ERRATA_I810                      BIT(3)
313 #define TI_CLK_CLKCTRL_COMPAT                     310 #define TI_CLK_CLKCTRL_COMPAT                   BIT(4)
314 #define TI_CLK_DEVICE_TYPE_GP                     311 #define TI_CLK_DEVICE_TYPE_GP                   BIT(5)
315                                                   312 
316 void ti_clk_setup_features(struct ti_clk_featu    313 void ti_clk_setup_features(struct ti_clk_features *features);
317 const struct ti_clk_features *ti_clk_get_featu    314 const struct ti_clk_features *ti_clk_get_features(void);
318 bool ti_clk_is_in_standby(struct clk *clk);       315 bool ti_clk_is_in_standby(struct clk *clk);
319 int omap3_noncore_dpll_save_context(struct clk    316 int omap3_noncore_dpll_save_context(struct clk_hw *hw);
320 void omap3_noncore_dpll_restore_context(struct    317 void omap3_noncore_dpll_restore_context(struct clk_hw *hw);
321                                                   318 
322 int omap3_core_dpll_save_context(struct clk_hw    319 int omap3_core_dpll_save_context(struct clk_hw *hw);
323 void omap3_core_dpll_restore_context(struct cl    320 void omap3_core_dpll_restore_context(struct clk_hw *hw);
324                                                   321 
325 extern const struct clk_hw_omap_ops clkhwops_o    322 extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll;
326                                                   323 
327 #ifdef CONFIG_ATAGS                               324 #ifdef CONFIG_ATAGS
328 int omap3430_clk_legacy_init(void);               325 int omap3430_clk_legacy_init(void);
329 int omap3430es1_clk_legacy_init(void);            326 int omap3430es1_clk_legacy_init(void);
330 int omap36xx_clk_legacy_init(void);               327 int omap36xx_clk_legacy_init(void);
331 int am35xx_clk_legacy_init(void);                 328 int am35xx_clk_legacy_init(void);
332 #else                                             329 #else
333 static inline int omap3430_clk_legacy_init(voi    330 static inline int omap3430_clk_legacy_init(void) { return -ENXIO; }
334 static inline int omap3430es1_clk_legacy_init(    331 static inline int omap3430es1_clk_legacy_init(void) { return -ENXIO; }
335 static inline int omap36xx_clk_legacy_init(voi    332 static inline int omap36xx_clk_legacy_init(void) { return -ENXIO; }
336 static inline int am35xx_clk_legacy_init(void)    333 static inline int am35xx_clk_legacy_init(void) { return -ENXIO; }
337 #endif                                            334 #endif
338                                                   335 
339                                                   336 
340 #endif                                            337 #endif
341                                                   338 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php