MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / include / acpi / amlresrc.h
blobb28b6905b71ea2f2ba0b79c1aadeef1043e52378
2 /******************************************************************************
4 * Module Name: amlresrc.h - AML resource descriptors
6 *****************************************************************************/
8 /*
9 * Copyright (C) 2000 - 2004, R. Byron Moore
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
31 * NO WARRANTY
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGES.
46 #ifndef __AMLRESRC_H
47 #define __AMLRESRC_H
50 #define ASL_RESNAME_ADDRESS "_ADR"
51 #define ASL_RESNAME_ALIGNMENT "_ALN"
52 #define ASL_RESNAME_ADDRESSSPACE "_ASI"
53 #define ASL_RESNAME_BASEADDRESS "_BAS"
54 #define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */
55 #define ASL_RESNAME_DECODE "_DEC"
56 #define ASL_RESNAME_DMA "_DMA"
57 #define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
58 #define ASL_RESNAME_GRANULARITY "_GRA"
59 #define ASL_RESNAME_INTERRUPT "_INT"
60 #define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
61 #define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
62 #define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
63 #define ASL_RESNAME_LENGTH "_LEN"
64 #define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
65 #define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
66 #define ASL_RESNAME_MAXADDR "_MAX"
67 #define ASL_RESNAME_MINADDR "_MIN"
68 #define ASL_RESNAME_MAXTYPE "_MAF"
69 #define ASL_RESNAME_MINTYPE "_MIF"
70 #define ASL_RESNAME_REGISTERBITOFFSET "_RBO"
71 #define ASL_RESNAME_REGISTERBITWIDTH "_RBW"
72 #define ASL_RESNAME_RANGETYPE "_RNG"
73 #define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */
74 #define ASL_RESNAME_TRANSLATION "_TRA"
75 #define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
76 #define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */
77 #define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */
80 /* Default sizes for "small" resource descriptors */
82 #define ASL_RDESC_IRQ_SIZE 0x02
83 #define ASL_RDESC_DMA_SIZE 0x02
84 #define ASL_RDESC_ST_DEPEND_SIZE 0x00
85 #define ASL_RDESC_END_DEPEND_SIZE 0x00
86 #define ASL_RDESC_IO_SIZE 0x07
87 #define ASL_RDESC_FIXED_IO_SIZE 0x03
88 #define ASL_RDESC_END_TAG_SIZE 0x01
91 struct asl_resource_node
93 u32 buffer_length;
94 void *buffer;
95 struct asl_resource_node *next;
100 * Resource descriptors defined in the ACPI specification.
102 * Alignment must be BYTE because these descriptors
103 * are used to overlay the AML byte stream.
105 #pragma pack(1)
107 struct asl_irq_format_desc
109 u8 descriptor_type;
110 u16 irq_mask;
111 u8 flags;
115 struct asl_irq_noflags_desc
117 u8 descriptor_type;
118 u16 irq_mask;
122 struct asl_dma_format_desc
124 u8 descriptor_type;
125 u8 dma_channel_mask;
126 u8 flags;
130 struct asl_start_dependent_desc
132 u8 descriptor_type;
133 u8 flags;
137 struct asl_start_dependent_noprio_desc
139 u8 descriptor_type;
143 struct asl_end_dependent_desc
145 u8 descriptor_type;
149 struct asl_io_port_desc
151 u8 descriptor_type;
152 u8 information;
153 u16 address_min;
154 u16 address_max;
155 u8 alignment;
156 u8 length;
160 struct asl_fixed_io_port_desc
162 u8 descriptor_type;
163 u16 base_address;
164 u8 length;
168 struct asl_small_vendor_desc
170 u8 descriptor_type;
171 u8 vendor_defined[7];
175 struct asl_end_tag_desc
177 u8 descriptor_type;
178 u8 checksum;
182 /* LARGE descriptors */
184 struct asl_memory_24_desc
186 u8 descriptor_type;
187 u16 length;
188 u8 information;
189 u16 address_min;
190 u16 address_max;
191 u16 alignment;
192 u16 range_length;
196 struct asl_large_vendor_desc
198 u8 descriptor_type;
199 u16 length;
200 u8 vendor_defined[1];
204 struct asl_memory_32_desc
206 u8 descriptor_type;
207 u16 length;
208 u8 information;
209 u32 address_min;
210 u32 address_max;
211 u32 alignment;
212 u32 range_length;
216 struct asl_fixed_memory_32_desc
218 u8 descriptor_type;
219 u16 length;
220 u8 information;
221 u32 base_address;
222 u32 range_length;
226 struct asl_qword_address_desc
228 u8 descriptor_type;
229 u16 length;
230 u8 resource_type;
231 u8 flags;
232 u8 specific_flags;
233 u64 granularity;
234 u64 address_min;
235 u64 address_max;
236 u64 translation_offset;
237 u64 address_length;
238 u8 optional_fields[2];
242 struct asl_dword_address_desc
244 u8 descriptor_type;
245 u16 length;
246 u8 resource_type;
247 u8 flags;
248 u8 specific_flags;
249 u32 granularity;
250 u32 address_min;
251 u32 address_max;
252 u32 translation_offset;
253 u32 address_length;
254 u8 optional_fields[2];
258 struct asl_word_address_desc
260 u8 descriptor_type;
261 u16 length;
262 u8 resource_type;
263 u8 flags;
264 u8 specific_flags;
265 u16 granularity;
266 u16 address_min;
267 u16 address_max;
268 u16 translation_offset;
269 u16 address_length;
270 u8 optional_fields[2];
274 struct asl_extended_xrupt_desc
276 u8 descriptor_type;
277 u16 length;
278 u8 flags;
279 u8 table_length;
280 u32 interrupt_number[1];
281 /* res_source_index, res_source optional fields follow */
285 struct asl_general_register_desc
287 u8 descriptor_type;
288 u16 length;
289 u8 address_space_id;
290 u8 bit_width;
291 u8 bit_offset;
292 u8 reserved;
293 u64 address;
296 /* restore default alignment */
298 #pragma pack()
300 /* Union of all resource descriptors, sow we can allocate the worst case */
302 union asl_resource_desc
304 struct asl_irq_format_desc irq;
305 struct asl_dma_format_desc dma;
306 struct asl_start_dependent_desc std;
307 struct asl_end_dependent_desc end;
308 struct asl_io_port_desc iop;
309 struct asl_fixed_io_port_desc fio;
310 struct asl_small_vendor_desc smv;
311 struct asl_end_tag_desc et;
313 struct asl_memory_24_desc M24;
314 struct asl_large_vendor_desc lgv;
315 struct asl_memory_32_desc M32;
316 struct asl_fixed_memory_32_desc F32;
317 struct asl_qword_address_desc qas;
318 struct asl_dword_address_desc das;
319 struct asl_word_address_desc was;
320 struct asl_extended_xrupt_desc exx;
321 struct asl_general_register_desc grg;
322 u32 u32_item;
323 u16 u16_item;
324 u8 U8item;
328 #endif