1 #ifndef __TI_SYSC_DATA_H__
2 #define __TI_SYSC_DATA_H__
4 enum ti_sysc_module_type {
16 TI_SYSC_OMAP4_USB_HOST_FS,
20 struct ti_sysc_cookie {
25 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets
26 * @midle_shift: Offset of the midle bit
27 * @clkact_shift: Offset of the clockactivity bit
28 * @sidle_shift: Offset of the sidle bit
29 * @enwkup_shift: Offset of the enawakeup bit
30 * @srst_shift: Offset of the softreset bit
31 * @autoidle_shift: Offset of the autoidle bit
32 * @dmadisable_shift: Offset of the dmadisable bit
33 * @emufree_shift; Offset of the emufree bit
35 * Note that 0 is a valid shift, and for ti-sysc.c -ENODEV can be used if a
36 * feature is not available.
49 #define SYSC_QUIRK_LEGACY_IDLE BIT(8)
50 #define SYSC_QUIRK_RESET_STATUS BIT(7)
51 #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
52 #define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
53 #define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
54 #define SYSC_QUIRK_OPT_CLKS_IN_RESET BIT(3)
55 #define SYSC_QUIRK_16BIT BIT(2)
56 #define SYSC_QUIRK_UNCACHED BIT(1)
57 #define SYSC_QUIRK_USE_CLOCKACT BIT(0)
59 #define SYSC_NR_IDLEMODES 4
62 * struct sysc_capabilities - capabilities for an interconnect target module
64 * @sysc_mask: bitmask of supported SYSCONFIG register bits
65 * @regbits: bitmask of SYSCONFIG register bits
66 * @mod_quirks: bitmask of module specific quirks
68 struct sysc_capabilities {
69 const enum ti_sysc_module_type type;
71 const struct sysc_regbits *regbits;
76 * struct sysc_config - configuration for an interconnect target module
77 * @sysc_val: configured value for sysc register
78 * @midlemodes: bitmask of supported master idle modes
79 * @sidlemodes: bitmask of supported master idle modes
80 * @srst_udelay: optional delay needed after OCP soft reset
81 * @quirks: bitmask of enabled quirks
100 * struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module
101 * @name: legacy "ti,hwmods" module name
102 * @module_pa: physical address of the interconnect target module
103 * @module_size: size of the interconnect target module
104 * @offsets: array of register offsets as listed in enum sysc_registers
105 * @nr_offsets: number of registers
106 * @cap: interconnect target module capabilities
107 * @cfg: interconnect target module configuration
109 * This data is enough to allocate a new struct omap_hwmod_class_sysconfig
110 * based on device tree data parsed by ti-sysc driver.
112 struct ti_sysc_module_data {
118 const struct sysc_capabilities *cap;
119 struct sysc_config *cfg;
124 struct ti_sysc_platform_data {
125 struct of_dev_auxdata *auxdata;
126 int (*init_module)(struct device *dev,
127 const struct ti_sysc_module_data *data,
128 struct ti_sysc_cookie *cookie);
129 int (*enable_module)(struct device *dev,
130 const struct ti_sysc_cookie *cookie);
131 int (*idle_module)(struct device *dev,
132 const struct ti_sysc_cookie *cookie);
133 int (*shutdown_module)(struct device *dev,
134 const struct ti_sysc_cookie *cookie);
137 #endif /* __TI_SYSC_DATA_H__ */