1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __TI_SYSC_DATA_H__
4 #define __TI_SYSC_DATA_H__
6 enum ti_sysc_module_type {
18 TI_SYSC_OMAP4_USB_HOST_FS,
22 struct ti_sysc_cookie {
28 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets
29 * @midle_shift: Offset of the midle bit
30 * @clkact_shift: Offset of the clockactivity bit
31 * @sidle_shift: Offset of the sidle bit
32 * @enwkup_shift: Offset of the enawakeup bit
33 * @srst_shift: Offset of the softreset bit
34 * @autoidle_shift: Offset of the autoidle bit
35 * @dmadisable_shift: Offset of the dmadisable bit
36 * @emufree_shift; Offset of the emufree bit
38 * Note that 0 is a valid shift, and for ti-sysc.c -ENODEV can be used if a
39 * feature is not available.
52 #define SYSC_MODULE_QUIRK_SGX BIT(18)
53 #define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
54 #define SYSC_MODULE_QUIRK_I2C BIT(16)
55 #define SYSC_MODULE_QUIRK_WDT BIT(15)
56 #define SYSS_QUIRK_RESETDONE_INVERTED BIT(14)
57 #define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13)
58 #define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12)
59 #define SYSC_QUIRK_SWSUP_SIDLE BIT(11)
60 #define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10)
61 #define SYSC_QUIRK_LEGACY_IDLE BIT(9)
62 #define SYSC_QUIRK_RESET_STATUS BIT(8)
63 #define SYSC_QUIRK_NO_IDLE BIT(7)
64 #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
65 #define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
66 #define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
67 #define SYSC_QUIRK_OPT_CLKS_IN_RESET BIT(3)
68 #define SYSC_QUIRK_16BIT BIT(2)
69 #define SYSC_QUIRK_UNCACHED BIT(1)
70 #define SYSC_QUIRK_USE_CLOCKACT BIT(0)
72 #define SYSC_NR_IDLEMODES 4
75 * struct sysc_capabilities - capabilities for an interconnect target module
76 * @type: sysc type identifier for the module
77 * @sysc_mask: bitmask of supported SYSCONFIG register bits
78 * @regbits: bitmask of SYSCONFIG register bits
79 * @mod_quirks: bitmask of module specific quirks
81 struct sysc_capabilities {
82 const enum ti_sysc_module_type type;
84 const struct sysc_regbits *regbits;
89 * struct sysc_config - configuration for an interconnect target module
90 * @sysc_val: configured value for sysc register
91 * @syss_mask: configured mask value for SYSSTATUS register
92 * @midlemodes: bitmask of supported master idle modes
93 * @sidlemodes: bitmask of supported slave idle modes
94 * @srst_udelay: optional delay needed after OCP soft reset
95 * @quirks: bitmask of enabled quirks
106 enum sysc_registers {
114 * struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module
115 * @name: legacy "ti,hwmods" module name
116 * @module_pa: physical address of the interconnect target module
117 * @module_size: size of the interconnect target module
118 * @offsets: array of register offsets as listed in enum sysc_registers
119 * @nr_offsets: number of registers
120 * @cap: interconnect target module capabilities
121 * @cfg: interconnect target module configuration
123 * This data is enough to allocate a new struct omap_hwmod_class_sysconfig
124 * based on device tree data parsed by ti-sysc driver.
126 struct ti_sysc_module_data {
132 const struct sysc_capabilities *cap;
133 struct sysc_config *cfg;
139 struct ti_sysc_platform_data {
140 struct of_dev_auxdata *auxdata;
141 int (*init_clockdomain)(struct device *dev, struct clk *fck,
142 struct clk *ick, struct ti_sysc_cookie *cookie);
143 void (*clkdm_deny_idle)(struct device *dev,
144 const struct ti_sysc_cookie *cookie);
145 void (*clkdm_allow_idle)(struct device *dev,
146 const struct ti_sysc_cookie *cookie);
147 int (*init_module)(struct device *dev,
148 const struct ti_sysc_module_data *data,
149 struct ti_sysc_cookie *cookie);
150 int (*enable_module)(struct device *dev,
151 const struct ti_sysc_cookie *cookie);
152 int (*idle_module)(struct device *dev,
153 const struct ti_sysc_cookie *cookie);
154 int (*shutdown_module)(struct device *dev,
155 const struct ti_sysc_cookie *cookie);
158 #endif /* __TI_SYSC_DATA_H__ */