blob: e9a5b89491773e38c7da97654878b596b93a3e19 [file] [log] [blame]
Andrey Petrovc854b492017-06-05 14:10:17 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2015 Google Inc.
5 * Copyright 2017 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef _SOC_CANNONLAKE_GPIO_SOC_DEFS_H_
18#define _SOC_CANNONLAKE_GPIO_SOC_DEFS_H_
19
20/*
21 * There are 9 GPIO groups. GPP_A -> GPP_H and GPD. GPD is the special case
22 * where that group is not so generic. So most of the fixed numbers and macros
23 * are based on the GPP groups. The GPIO groups are accessed through register
24 * blocks called communities.
25 */
26#define GPP_A 0
27#define GPP_B 1
28#define GPP_G 2
29#define GPP_D 3
30#define GPP_F 4
31#define GPP_H 5
32#define GPP_C 6
33#define GPP_E 7
34#define GPD 8
35#define GPIO_NUM_GROUPS 9
36#define GPIO_MAX_NUM_PER_GROUP 24
37
38/*
39 * GPIOs are ordered monotonically increasing to match ACPI/OS driver.
40 */
41
42/* Group A */
43#define GPP_A0 0
44#define GPP_A1 1
45#define GPP_A2 2
46#define GPP_A3 3
47#define GPP_A4 4
48#define GPP_A5 5
49#define GPP_A6 6
50#define GPP_A7 7
51#define GPP_A8 8
52#define GPP_A9 9
53#define GPP_A10 10
54#define GPP_A11 11
55#define GPP_A12 12
56#define GPP_A13 13
57#define GPP_A14 14
58#define GPP_A15 15
59#define GPP_A16 16
60#define GPP_A17 17
61#define GPP_A18 18
62#define GPP_A19 19
63#define GPP_A20 20
64#define GPP_A21 21
65#define GPP_A22 22
66#define GPP_A23 23
67/* Group B */
68#define GPP_B0 24
69#define GPP_B1 25
70#define GPP_B2 26
71#define GPP_B3 27
72#define GPP_B4 28
73#define GPP_B5 29
74#define GPP_B6 30
75#define GPP_B7 31
76#define GPP_B8 32
77#define GPP_B9 33
78#define GPP_B10 34
79#define GPP_B11 35
80#define GPP_B12 36
81#define GPP_B13 37
82#define GPP_B14 38
83#define GPP_B15 39
84#define GPP_B16 40
85#define GPP_B17 41
86#define GPP_B18 42
87#define GPP_B19 43
88#define GPP_B20 44
89#define GPP_B21 45
90#define GPP_B22 46
91#define GPP_B23 47
92/* Group G */
93#define GPP_G0 48
94#define GPP_G1 49
95#define GPP_G2 50
96#define GPP_G3 51
97#define GPP_G4 52
98#define GPP_G5 53
99#define GPP_G6 54
100#define GPP_G7 55
101
102#define NUM_GPIO_COM0_PADS (GPP_G7 - GPP_A0 + 1)
103
104/* Group D */
105#define GPP_D0 56
106#define GPP_D1 57
107#define GPP_D2 58
108#define GPP_D3 59
109#define GPP_D4 60
110#define GPP_D5 61
111#define GPP_D6 62
112#define GPP_D7 63
113#define GPP_D8 64
114#define GPP_D9 65
115#define GPP_D10 66
116#define GPP_D11 67
117#define GPP_D12 68
118#define GPP_D13 69
119#define GPP_D14 70
120#define GPP_D15 71
121#define GPP_D16 72
122#define GPP_D17 73
123#define GPP_D18 74
124#define GPP_D19 75
125#define GPP_D20 76
126#define GPP_D21 77
127#define GPP_D22 78
128#define GPP_D23 79
129/* Group F */
130#define GPP_F0 80
131#define GPP_F1 81
132#define GPP_F2 82
133#define GPP_F3 83
134#define GPP_F4 84
135#define GPP_F5 85
136#define GPP_F6 86
137#define GPP_F7 87
138#define GPP_F8 88
139#define GPP_F9 89
140#define GPP_F10 90
141#define GPP_F11 91
142#define GPP_F12 92
143#define GPP_F13 93
144#define GPP_F14 94
145#define GPP_F15 95
146#define GPP_F16 96
147#define GPP_F17 97
148#define GPP_F18 98
149#define GPP_F19 99
150#define GPP_F20 100
151#define GPP_F21 101
152#define GPP_F22 102
153#define GPP_F23 103
154/* Group H */
155#define GPP_H0 104
156#define GPP_H1 105
157#define GPP_H2 106
158#define GPP_H3 107
159#define GPP_H4 108
160#define GPP_H5 109
161#define GPP_H6 110
162#define GPP_H7 111
163#define GPP_H8 112
164#define GPP_H9 113
165#define GPP_H10 114
166#define GPP_H11 115
167#define GPP_H12 116
168#define GPP_H13 117
169#define GPP_H14 118
170#define GPP_H15 119
171#define GPP_H16 120
172#define GPP_H17 121
173#define GPP_H18 122
174#define GPP_H19 123
175#define GPP_H20 124
176#define GPP_H21 125
177#define GPP_H22 126
178#define GPP_H23 127
179
180#define NUM_GPIO_COM1_PADS (GPP_H23 - GPP_D0 + 1)
181
182/* Group C */
183#define GPP_C0 128
184#define GPP_C1 129
185#define GPP_C2 130
186#define GPP_C3 131
187#define GPP_C4 132
188#define GPP_C5 133
189#define GPP_C6 134
190#define GPP_C7 135
191#define GPP_C8 136
192#define GPP_C9 137
193#define GPP_C10 138
194#define GPP_C11 139
195#define GPP_C12 140
196#define GPP_C13 141
197#define GPP_C14 142
198#define GPP_C15 143
199#define GPP_C16 144
200#define GPP_C17 145
201#define GPP_C18 146
202#define GPP_C19 147
203#define GPP_C20 148
204#define GPP_C21 149
205#define GPP_C22 150
206#define GPP_C23 151
207/* Group E */
208#define GPP_E0 152
209#define GPP_E1 153
210#define GPP_E2 154
211#define GPP_E3 155
212#define GPP_E4 156
213#define GPP_E5 157
214#define GPP_E6 158
215#define GPP_E7 159
216#define GPP_E8 160
217#define GPP_E9 161
218#define GPP_E10 162
219#define GPP_E11 163
220#define GPP_E12 164
221#define GPP_E13 165
222#define GPP_E14 166
223#define GPP_E15 167
224#define GPP_E16 168
225#define GPP_E17 169
226#define GPP_E18 170
227#define GPP_E19 171
228#define GPP_E20 172
229#define GPP_E21 173
230#define GPP_E22 174
231#define GPP_E23 175
232
233#define NUM_GPIO_COM3_PADS (GPP_E23 - GPP_C0 + 1)
234
235/* Group GPD */
236#define GPD0 176
237#define GPD1 177
238#define GPD2 178
239#define GPD3 179
240#define GPD4 180
241#define GPD5 181
242#define GPD6 182
243#define GPD7 183
244#define GPD8 184
245#define GPD9 185
246#define GPD10 186
247#define GPD11 187
248
249#define NUM_GPIO_COM2_PADS (GPD11 - GPD0 + 1)
250
251#endif