aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/amlresrc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi/amlresrc.h')
-rw-r--r--include/acpi/amlresrc.h380
1 files changed, 166 insertions, 214 deletions
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index b20ec303df07..051786e4b210 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -42,29 +42,27 @@
42 * POSSIBILITY OF SUCH DAMAGES. 42 * POSSIBILITY OF SUCH DAMAGES.
43 */ 43 */
44 44
45
46#ifndef __AMLRESRC_H 45#ifndef __AMLRESRC_H
47#define __AMLRESRC_H 46#define __AMLRESRC_H
48 47
49
50#define ASL_RESNAME_ADDRESS "_ADR" 48#define ASL_RESNAME_ADDRESS "_ADR"
51#define ASL_RESNAME_ALIGNMENT "_ALN" 49#define ASL_RESNAME_ALIGNMENT "_ALN"
52#define ASL_RESNAME_ADDRESSSPACE "_ASI" 50#define ASL_RESNAME_ADDRESSSPACE "_ASI"
53#define ASL_RESNAME_ACCESSSIZE "_ASZ" 51#define ASL_RESNAME_ACCESSSIZE "_ASZ"
54#define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" 52#define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT"
55#define ASL_RESNAME_BASEADDRESS "_BAS" 53#define ASL_RESNAME_BASEADDRESS "_BAS"
56#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ 54#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */
57#define ASL_RESNAME_DECODE "_DEC" 55#define ASL_RESNAME_DECODE "_DEC"
58#define ASL_RESNAME_DMA "_DMA" 56#define ASL_RESNAME_DMA "_DMA"
59#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 57#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
60#define ASL_RESNAME_GRANULARITY "_GRA" 58#define ASL_RESNAME_GRANULARITY "_GRA"
61#define ASL_RESNAME_INTERRUPT "_INT" 59#define ASL_RESNAME_INTERRUPT "_INT"
62#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 60#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
63#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 61#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
64#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 62#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
65#define ASL_RESNAME_LENGTH "_LEN" 63#define ASL_RESNAME_LENGTH "_LEN"
66#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 64#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
67#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 65#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
68#define ASL_RESNAME_MAXADDR "_MAX" 66#define ASL_RESNAME_MAXADDR "_MAX"
69#define ASL_RESNAME_MINADDR "_MIN" 67#define ASL_RESNAME_MINADDR "_MIN"
70#define ASL_RESNAME_MAXTYPE "_MAF" 68#define ASL_RESNAME_MAXTYPE "_MAF"
@@ -72,12 +70,11 @@
72#define ASL_RESNAME_REGISTERBITOFFSET "_RBO" 70#define ASL_RESNAME_REGISTERBITOFFSET "_RBO"
73#define ASL_RESNAME_REGISTERBITWIDTH "_RBW" 71#define ASL_RESNAME_REGISTERBITWIDTH "_RBW"
74#define ASL_RESNAME_RANGETYPE "_RNG" 72#define ASL_RESNAME_RANGETYPE "_RNG"
75#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 73#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */
76#define ASL_RESNAME_TRANSLATION "_TRA" 74#define ASL_RESNAME_TRANSLATION "_TRA"
77#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 75#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
78#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ 76#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */
79#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ 77#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */
80
81 78
82/* Default sizes for "small" resource descriptors */ 79/* Default sizes for "small" resource descriptors */
83 80
@@ -89,15 +86,12 @@
89#define ASL_RDESC_FIXED_IO_SIZE 0x03 86#define ASL_RDESC_FIXED_IO_SIZE 0x03
90#define ASL_RDESC_END_TAG_SIZE 0x01 87#define ASL_RDESC_END_TAG_SIZE 0x01
91 88
92 89struct asl_resource_node {
93struct asl_resource_node 90 u32 buffer_length;
94{ 91 void *buffer;
95 u32 buffer_length; 92 struct asl_resource_node *next;
96 void *buffer;
97 struct asl_resource_node *next;
98}; 93};
99 94
100
101/* 95/*
102 * Resource descriptors defined in the ACPI specification. 96 * Resource descriptors defined in the ACPI specification.
103 * 97 *
@@ -106,214 +100,175 @@ struct asl_resource_node
106 */ 100 */
107#pragma pack(1) 101#pragma pack(1)
108 102
109struct asl_irq_format_desc 103struct asl_irq_format_desc {
110{ 104 u8 descriptor_type;
111 u8 descriptor_type; 105 u16 irq_mask;
112 u16 irq_mask; 106 u8 flags;
113 u8 flags;
114}; 107};
115 108
116 109struct asl_irq_noflags_desc {
117struct asl_irq_noflags_desc 110 u8 descriptor_type;
118{ 111 u16 irq_mask;
119 u8 descriptor_type;
120 u16 irq_mask;
121}; 112};
122 113
123 114struct asl_dma_format_desc {
124struct asl_dma_format_desc 115 u8 descriptor_type;
125{ 116 u8 dma_channel_mask;
126 u8 descriptor_type; 117 u8 flags;
127 u8 dma_channel_mask;
128 u8 flags;
129}; 118};
130 119
131 120struct asl_start_dependent_desc {
132struct asl_start_dependent_desc 121 u8 descriptor_type;
133{ 122 u8 flags;
134 u8 descriptor_type;
135 u8 flags;
136}; 123};
137 124
138 125struct asl_start_dependent_noprio_desc {
139struct asl_start_dependent_noprio_desc 126 u8 descriptor_type;
140{
141 u8 descriptor_type;
142}; 127};
143 128
144 129struct asl_end_dependent_desc {
145struct asl_end_dependent_desc 130 u8 descriptor_type;
146{
147 u8 descriptor_type;
148}; 131};
149 132
150 133struct asl_io_port_desc {
151struct asl_io_port_desc 134 u8 descriptor_type;
152{ 135 u8 information;
153 u8 descriptor_type; 136 u16 address_min;
154 u8 information; 137 u16 address_max;
155 u16 address_min; 138 u8 alignment;
156 u16 address_max; 139 u8 length;
157 u8 alignment;
158 u8 length;
159}; 140};
160 141
161 142struct asl_fixed_io_port_desc {
162struct asl_fixed_io_port_desc 143 u8 descriptor_type;
163{ 144 u16 base_address;
164 u8 descriptor_type; 145 u8 length;
165 u16 base_address;
166 u8 length;
167}; 146};
168 147
169 148struct asl_small_vendor_desc {
170struct asl_small_vendor_desc 149 u8 descriptor_type;
171{ 150 u8 vendor_defined[7];
172 u8 descriptor_type;
173 u8 vendor_defined[7];
174}; 151};
175 152
176 153struct asl_end_tag_desc {
177struct asl_end_tag_desc 154 u8 descriptor_type;
178{ 155 u8 checksum;
179 u8 descriptor_type;
180 u8 checksum;
181}; 156};
182 157
183
184/* LARGE descriptors */ 158/* LARGE descriptors */
185 159
186struct asl_memory_24_desc 160struct asl_memory_24_desc {
187{ 161 u8 descriptor_type;
188 u8 descriptor_type; 162 u16 length;
189 u16 length; 163 u8 information;
190 u8 information; 164 u16 address_min;
191 u16 address_min; 165 u16 address_max;
192 u16 address_max; 166 u16 alignment;
193 u16 alignment; 167 u16 range_length;
194 u16 range_length;
195}; 168};
196 169
197 170struct asl_large_vendor_desc {
198struct asl_large_vendor_desc 171 u8 descriptor_type;
199{ 172 u16 length;
200 u8 descriptor_type; 173 u8 vendor_defined[1];
201 u16 length;
202 u8 vendor_defined[1];
203}; 174};
204 175
205 176struct asl_memory_32_desc {
206struct asl_memory_32_desc 177 u8 descriptor_type;
207{ 178 u16 length;
208 u8 descriptor_type; 179 u8 information;
209 u16 length; 180 u32 address_min;
210 u8 information; 181 u32 address_max;
211 u32 address_min; 182 u32 alignment;
212 u32 address_max; 183 u32 range_length;
213 u32 alignment;
214 u32 range_length;
215}; 184};
216 185
217 186struct asl_fixed_memory_32_desc {
218struct asl_fixed_memory_32_desc 187 u8 descriptor_type;
219{ 188 u16 length;
220 u8 descriptor_type; 189 u8 information;
221 u16 length; 190 u32 base_address;
222 u8 information; 191 u32 range_length;
223 u32 base_address;
224 u32 range_length;
225}; 192};
226 193
227 194struct asl_extended_address_desc {
228struct asl_extended_address_desc 195 u8 descriptor_type;
229{ 196 u16 length;
230 u8 descriptor_type; 197 u8 resource_type;
231 u16 length; 198 u8 flags;
232 u8 resource_type; 199 u8 specific_flags;
233 u8 flags; 200 u8 revision_iD;
234 u8 specific_flags; 201 u8 reserved;
235 u8 revision_iD; 202 u64 granularity;
236 u8 reserved; 203 u64 address_min;
237 u64 granularity; 204 u64 address_max;
238 u64 address_min; 205 u64 translation_offset;
239 u64 address_max; 206 u64 address_length;
240 u64 translation_offset; 207 u64 type_specific_attributes;
241 u64 address_length; 208 u8 optional_fields[2]; /* Used for length calculation only */
242 u64 type_specific_attributes;
243 u8 optional_fields[2]; /* Used for length calculation only */
244}; 209};
245 210
246#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ 211#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */
247 212
248 213struct asl_qword_address_desc {
249struct asl_qword_address_desc 214 u8 descriptor_type;
250{ 215 u16 length;
251 u8 descriptor_type; 216 u8 resource_type;
252 u16 length; 217 u8 flags;
253 u8 resource_type; 218 u8 specific_flags;
254 u8 flags; 219 u64 granularity;
255 u8 specific_flags; 220 u64 address_min;
256 u64 granularity; 221 u64 address_max;
257 u64 address_min; 222 u64 translation_offset;
258 u64 address_max; 223 u64 address_length;
259 u64 translation_offset; 224 u8 optional_fields[2];
260 u64 address_length;
261 u8 optional_fields[2];
262}; 225};
263 226
264 227struct asl_dword_address_desc {
265struct asl_dword_address_desc 228 u8 descriptor_type;
266{ 229 u16 length;
267 u8 descriptor_type; 230 u8 resource_type;
268 u16 length; 231 u8 flags;
269 u8 resource_type; 232 u8 specific_flags;
270 u8 flags; 233 u32 granularity;
271 u8 specific_flags; 234 u32 address_min;
272 u32 granularity; 235 u32 address_max;
273 u32 address_min; 236 u32 translation_offset;
274 u32 address_max; 237 u32 address_length;
275 u32 translation_offset; 238 u8 optional_fields[2];
276 u32 address_length;
277 u8 optional_fields[2];
278}; 239};
279 240
280 241struct asl_word_address_desc {
281struct asl_word_address_desc 242 u8 descriptor_type;
282{ 243 u16 length;
283 u8 descriptor_type; 244 u8 resource_type;
284 u16 length; 245 u8 flags;
285 u8 resource_type; 246 u8 specific_flags;
286 u8 flags; 247 u16 granularity;
287 u8 specific_flags; 248 u16 address_min;
288 u16 granularity; 249 u16 address_max;
289 u16 address_min; 250 u16 translation_offset;
290 u16 address_max; 251 u16 address_length;
291 u16 translation_offset; 252 u8 optional_fields[2];
292 u16 address_length;
293 u8 optional_fields[2];
294}; 253};
295 254
296 255struct asl_extended_xrupt_desc {
297struct asl_extended_xrupt_desc 256 u8 descriptor_type;
298{ 257 u16 length;
299 u8 descriptor_type; 258 u8 flags;
300 u16 length; 259 u8 table_length;
301 u8 flags; 260 u32 interrupt_number[1];
302 u8 table_length;
303 u32 interrupt_number[1];
304 /* res_source_index, res_source optional fields follow */ 261 /* res_source_index, res_source optional fields follow */
305}; 262};
306 263
307 264struct asl_general_register_desc {
308struct asl_general_register_desc 265 u8 descriptor_type;
309{ 266 u16 length;
310 u8 descriptor_type; 267 u8 address_space_id;
311 u16 length; 268 u8 bit_width;
312 u8 address_space_id; 269 u8 bit_offset;
313 u8 bit_width; 270 u8 access_size; /* ACPI 3.0, was Reserved */
314 u8 bit_offset; 271 u64 address;
315 u8 access_size; /* ACPI 3.0, was Reserved */
316 u64 address;
317}; 272};
318 273
319/* restore default alignment */ 274/* restore default alignment */
@@ -322,32 +277,29 @@ struct asl_general_register_desc
322 277
323/* Union of all resource descriptors, so we can allocate the worst case */ 278/* Union of all resource descriptors, so we can allocate the worst case */
324 279
325union asl_resource_desc 280union asl_resource_desc {
326{ 281 struct asl_irq_format_desc irq;
327 struct asl_irq_format_desc irq; 282 struct asl_dma_format_desc dma;
328 struct asl_dma_format_desc dma; 283 struct asl_start_dependent_desc std;
329 struct asl_start_dependent_desc std; 284 struct asl_end_dependent_desc end;
330 struct asl_end_dependent_desc end; 285 struct asl_io_port_desc iop;
331 struct asl_io_port_desc iop; 286 struct asl_fixed_io_port_desc fio;
332 struct asl_fixed_io_port_desc fio; 287 struct asl_small_vendor_desc smv;
333 struct asl_small_vendor_desc smv; 288 struct asl_end_tag_desc et;
334 struct asl_end_tag_desc et; 289
335 290 struct asl_memory_24_desc M24;
336 struct asl_memory_24_desc M24; 291 struct asl_large_vendor_desc lgv;
337 struct asl_large_vendor_desc lgv; 292 struct asl_memory_32_desc M32;
338 struct asl_memory_32_desc M32; 293 struct asl_fixed_memory_32_desc F32;
339 struct asl_fixed_memory_32_desc F32; 294 struct asl_qword_address_desc qas;
340 struct asl_qword_address_desc qas; 295 struct asl_dword_address_desc das;
341 struct asl_dword_address_desc das; 296 struct asl_word_address_desc was;
342 struct asl_word_address_desc was; 297 struct asl_extended_address_desc eas;
343 struct asl_extended_address_desc eas; 298 struct asl_extended_xrupt_desc exx;
344 struct asl_extended_xrupt_desc exx; 299 struct asl_general_register_desc grg;
345 struct asl_general_register_desc grg; 300 u32 u32_item;
346 u32 u32_item; 301 u16 u16_item;
347 u16 u16_item; 302 u8 U8item;
348 u8 U8item;
349}; 303};
350 304
351
352#endif 305#endif
353