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,
23 struct ti_sysc_cookie {
29 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets
30 * @midle_shift: Offset of the midle bit
31 * @clkact_shift: Offset of the clockactivity bit
32 * @sidle_shift: Offset of the sidle bit
33 * @enwkup_shift: Offset of the enawakeup bit
34 * @srst_shift: Offset of the softreset bit
35 * @autoidle_shift: Offset of the autoidle bit
36 * @dmadisable_shift: Offset of the dmadisable bit
37 * @emufree_shift; Offset of the emufree bit
39 * Note that 0 is a valid shift, and for ti-sysc.c -ENODEV can be used if a
40 * feature is not available.
53 #define SYSC_MODULE_QUIRK_PRUSS BIT(24)
54 #define SYSC_MODULE_QUIRK_DSS_RESET BIT(23)
55 #define SYSC_MODULE_QUIRK_RTC_UNLOCK BIT(22)
56 #define SYSC_QUIRK_CLKDM_NOAUTO BIT(21)
57 #define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)
58 #define SYSC_MODULE_QUIRK_AESS BIT(19)
59 #define SYSC_MODULE_QUIRK_SGX BIT(18)
60 #define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
61 #define SYSC_MODULE_QUIRK_I2C BIT(16)
62 #define SYSC_MODULE_QUIRK_WDT BIT(15)
63 #define SYSS_QUIRK_RESETDONE_INVERTED BIT(14)
64 #define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13)
65 #define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12)
66 #define SYSC_QUIRK_SWSUP_SIDLE BIT(11)
67 #define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10)
68 #define SYSC_QUIRK_LEGACY_IDLE BIT(9)
69 #define SYSC_QUIRK_RESET_STATUS BIT(8)
70 #define SYSC_QUIRK_NO_IDLE BIT(7)
71 #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
72 #define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
73 #define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
74 #define SYSC_QUIRK_OPT_CLKS_IN_RESET BIT(3)
75 #define SYSC_QUIRK_16BIT BIT(2)
76 #define SYSC_QUIRK_UNCACHED BIT(1)
77 #define SYSC_QUIRK_USE_CLOCKACT BIT(0)
79 #define SYSC_NR_IDLEMODES 4
82 * struct sysc_capabilities - capabilities for an interconnect target module
83 * @type: sysc type identifier for the module
84 * @sysc_mask: bitmask of supported SYSCONFIG register bits
85 * @regbits: bitmask of SYSCONFIG register bits
86 * @mod_quirks: bitmask of module specific quirks
88 struct sysc_capabilities {
89 const enum ti_sysc_module_type type;
91 const struct sysc_regbits *regbits;
96 * struct sysc_config - configuration for an interconnect target module
97 * @sysc_val: configured value for sysc register
98 * @syss_mask: configured mask value for SYSSTATUS register
99 * @midlemodes: bitmask of supported master idle modes
100 * @sidlemodes: bitmask of supported slave idle modes
101 * @srst_udelay: optional delay needed after OCP soft reset
102 * @quirks: bitmask of enabled quirks
113 enum sysc_registers {
121 * struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module
122 * @name: legacy "ti,hwmods" module name
123 * @module_pa: physical address of the interconnect target module
124 * @module_size: size of the interconnect target module
125 * @offsets: array of register offsets as listed in enum sysc_registers
126 * @nr_offsets: number of registers
127 * @cap: interconnect target module capabilities
128 * @cfg: interconnect target module configuration
130 * This data is enough to allocate a new struct omap_hwmod_class_sysconfig
131 * based on device tree data parsed by ti-sysc driver.
133 struct ti_sysc_module_data {
139 const struct sysc_capabilities *cap;
140 struct sysc_config *cfg;
146 struct ti_sysc_platform_data {
147 struct of_dev_auxdata *auxdata;
148 bool (*soc_type_gp)(void);
149 int (*init_clockdomain)(struct device *dev, struct clk *fck,
150 struct clk *ick, struct ti_sysc_cookie *cookie);
151 void (*clkdm_deny_idle)(struct device *dev,
152 const struct ti_sysc_cookie *cookie);
153 void (*clkdm_allow_idle)(struct device *dev,
154 const struct ti_sysc_cookie *cookie);
155 int (*init_module)(struct device *dev,
156 const struct ti_sysc_module_data *data,
157 struct ti_sysc_cookie *cookie);
158 int (*enable_module)(struct device *dev,
159 const struct ti_sysc_cookie *cookie);
160 int (*idle_module)(struct device *dev,
161 const struct ti_sysc_cookie *cookie);
162 int (*shutdown_module)(struct device *dev,
163 const struct ti_sysc_cookie *cookie);
166 #endif /* __TI_SYSC_DATA_H__ */