1
2
3#ifndef __TI_SYSC_DATA_H__
4#define __TI_SYSC_DATA_H__
5
6enum ti_sysc_module_type {
7 TI_SYSC_OMAP2,
8 TI_SYSC_OMAP2_TIMER,
9 TI_SYSC_OMAP3_SHAM,
10 TI_SYSC_OMAP3_AES,
11 TI_SYSC_OMAP4,
12 TI_SYSC_OMAP4_TIMER,
13 TI_SYSC_OMAP4_SIMPLE,
14 TI_SYSC_OMAP34XX_SR,
15 TI_SYSC_OMAP36XX_SR,
16 TI_SYSC_OMAP4_SR,
17 TI_SYSC_OMAP4_MCASP,
18 TI_SYSC_OMAP4_USB_HOST_FS,
19 TI_SYSC_DRA7_MCAN,
20 TI_SYSC_PRUSS,
21};
22
23struct ti_sysc_cookie {
24 void *data;
25 void *clkdm;
26};
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42struct sysc_regbits {
43 s8 midle_shift;
44 s8 clkact_shift;
45 s8 sidle_shift;
46 s8 enwkup_shift;
47 s8 srst_shift;
48 s8 autoidle_shift;
49 s8 dmadisable_shift;
50 s8 emufree_shift;
51};
52
53#define SYSC_MODULE_QUIRK_ENA_RESETDONE BIT(25)
54#define SYSC_MODULE_QUIRK_PRUSS BIT(24)
55#define SYSC_MODULE_QUIRK_DSS_RESET BIT(23)
56#define SYSC_MODULE_QUIRK_RTC_UNLOCK BIT(22)
57#define SYSC_QUIRK_CLKDM_NOAUTO BIT(21)
58#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)
59#define SYSC_MODULE_QUIRK_AESS BIT(19)
60#define SYSC_MODULE_QUIRK_SGX BIT(18)
61#define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
62#define SYSC_MODULE_QUIRK_I2C BIT(16)
63#define SYSC_MODULE_QUIRK_WDT BIT(15)
64#define SYSS_QUIRK_RESETDONE_INVERTED BIT(14)
65#define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13)
66#define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12)
67#define SYSC_QUIRK_SWSUP_SIDLE BIT(11)
68#define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10)
69#define SYSC_QUIRK_LEGACY_IDLE BIT(9)
70#define SYSC_QUIRK_RESET_STATUS BIT(8)
71#define SYSC_QUIRK_NO_IDLE BIT(7)
72#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
73#define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
74#define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
75#define SYSC_QUIRK_OPT_CLKS_IN_RESET BIT(3)
76#define SYSC_QUIRK_16BIT BIT(2)
77#define SYSC_QUIRK_UNCACHED BIT(1)
78#define SYSC_QUIRK_USE_CLOCKACT BIT(0)
79
80#define SYSC_NR_IDLEMODES 4
81
82
83
84
85
86
87
88
89struct sysc_capabilities {
90 const enum ti_sysc_module_type type;
91 const u32 sysc_mask;
92 const struct sysc_regbits *regbits;
93 const u32 mod_quirks;
94};
95
96
97
98
99
100
101
102
103
104
105struct sysc_config {
106 u32 sysc_val;
107 u32 syss_mask;
108 u8 midlemodes;
109 u8 sidlemodes;
110 u8 srst_udelay;
111 u32 quirks;
112};
113
114enum sysc_registers {
115 SYSC_REVISION,
116 SYSC_SYSCONFIG,
117 SYSC_SYSSTATUS,
118 SYSC_MAX_REGS,
119};
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134struct ti_sysc_module_data {
135 const char *name;
136 u64 module_pa;
137 u32 module_size;
138 int *offsets;
139 int nr_offsets;
140 const struct sysc_capabilities *cap;
141 struct sysc_config *cfg;
142};
143
144struct device;
145struct clk;
146
147struct ti_sysc_platform_data {
148 struct of_dev_auxdata *auxdata;
149 bool (*soc_type_gp)(void);
150 int (*init_clockdomain)(struct device *dev, struct clk *fck,
151 struct clk *ick, struct ti_sysc_cookie *cookie);
152 void (*clkdm_deny_idle)(struct device *dev,
153 const struct ti_sysc_cookie *cookie);
154 void (*clkdm_allow_idle)(struct device *dev,
155 const struct ti_sysc_cookie *cookie);
156 int (*init_module)(struct device *dev,
157 const struct ti_sysc_module_data *data,
158 struct ti_sysc_cookie *cookie);
159 int (*enable_module)(struct device *dev,
160 const struct ti_sysc_cookie *cookie);
161 int (*idle_module)(struct device *dev,
162 const struct ti_sysc_cookie *cookie);
163 int (*shutdown_module)(struct device *dev,
164 const struct ti_sysc_cookie *cookie);
165};
166
167#endif
168