Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * |
| 3 | * Module Name: rsirq - IRQ resource descriptors |
| 4 | * |
| 5 | ******************************************************************************/ |
| 6 | |
| 7 | /* |
David E. Box | 82a8094 | 2015-02-05 15:20:45 +0800 | [diff] [blame] | 8 | * Copyright (C) 2000 - 2015, Intel Corp. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | #include <acpi/acpi.h> |
Len Brown | e2f7a77 | 2009-01-09 00:30:03 -0500 | [diff] [blame] | 45 | #include "accommon.h" |
| 46 | #include "acresrc.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
| 48 | #define _COMPONENT ACPI_RESOURCES |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 49 | ACPI_MODULE_NAME("rsirq") |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | |
| 51 | /******************************************************************************* |
| 52 | * |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 53 | * acpi_rs_get_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | * |
| 55 | ******************************************************************************/ |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 56 | struct acpi_rsconvert_info acpi_rs_get_irq[9] = { |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 57 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ, |
| 58 | ACPI_RS_SIZE(struct acpi_resource_irq), |
| 59 | ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 61 | /* Get the IRQ mask (bytes 1:2) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 63 | {ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]), |
| 64 | AML_OFFSET(irq.irq_mask), |
| 65 | ACPI_RS_OFFSET(data.irq.interrupt_count)}, |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 66 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 67 | /* Set default flags (others are zero) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 69 | {ACPI_RSC_SET8, ACPI_RS_OFFSET(data.irq.triggering), |
| 70 | ACPI_EDGE_SENSITIVE, |
| 71 | 1}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
Bob Moore | 1d5b285 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 73 | /* Get the descriptor length (2 or 3 for IRQ descriptor) */ |
| 74 | |
| 75 | {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.descriptor_length), |
| 76 | AML_OFFSET(irq.descriptor_type), |
| 77 | 0}, |
| 78 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 79 | /* All done if no flag byte present in descriptor */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 80 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 81 | {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3}, |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 82 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 83 | /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 85 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering), |
| 86 | AML_OFFSET(irq.flags), |
| 87 | 0}, |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 88 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 89 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity), |
| 90 | AML_OFFSET(irq.flags), |
| 91 | 3}, |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 92 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 93 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 94 | AML_OFFSET(irq.flags), |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 95 | 4}, |
| 96 | |
| 97 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable), |
| 98 | AML_OFFSET(irq.flags), |
| 99 | 5} |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 100 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | /******************************************************************************* |
| 103 | * |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 104 | * acpi_rs_set_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | * |
| 106 | ******************************************************************************/ |
| 107 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 108 | struct acpi_rsconvert_info acpi_rs_set_irq[14] = { |
Bob Moore | 1d5b285 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 109 | /* Start with a default descriptor of length 3 */ |
| 110 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 111 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ, |
| 112 | sizeof(struct aml_resource_irq), |
| 113 | ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)}, |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 114 | |
| 115 | /* Convert interrupt list to 16-bit IRQ bitmask */ |
| 116 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 117 | {ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]), |
| 118 | AML_OFFSET(irq.irq_mask), |
| 119 | ACPI_RS_OFFSET(data.irq.interrupt_count)}, |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 120 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 121 | /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */ |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 122 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 123 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering), |
| 124 | AML_OFFSET(irq.flags), |
| 125 | 0}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 127 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity), |
| 128 | AML_OFFSET(irq.flags), |
| 129 | 3}, |
| 130 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 131 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 132 | AML_OFFSET(irq.flags), |
| 133 | 4}, |
Bob Moore | 1d5b285 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 134 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 135 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable), |
| 136 | AML_OFFSET(irq.flags), |
| 137 | 5}, |
| 138 | |
Bob Moore | 1d5b285 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 139 | /* |
| 140 | * All done if the output descriptor length is required to be 3 |
| 141 | * (i.e., optimization to 2 bytes cannot be attempted) |
| 142 | */ |
| 143 | {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, |
| 144 | ACPI_RS_OFFSET(data.irq.descriptor_length), |
| 145 | 3}, |
| 146 | |
| 147 | /* Set length to 2 bytes (no flags byte) */ |
| 148 | |
| 149 | {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}, |
| 150 | |
| 151 | /* |
| 152 | * All done if the output descriptor length is required to be 2. |
| 153 | * |
| 154 | * TBD: Perhaps we should check for error if input flags are not |
| 155 | * compatible with a 2-byte descriptor. |
| 156 | */ |
| 157 | {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, |
| 158 | ACPI_RS_OFFSET(data.irq.descriptor_length), |
| 159 | 2}, |
| 160 | |
| 161 | /* Reset length to 3 bytes (descriptor with flags byte) */ |
| 162 | |
| 163 | {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)}, |
| 164 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | /* |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 166 | * Check if the flags byte is necessary. Not needed if the flags are: |
| 167 | * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | */ |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 169 | {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, |
| 170 | ACPI_RS_OFFSET(data.irq.triggering), |
| 171 | ACPI_EDGE_SENSITIVE}, |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 172 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 173 | {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, |
| 174 | ACPI_RS_OFFSET(data.irq.polarity), |
| 175 | ACPI_ACTIVE_HIGH}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 177 | {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, |
| 178 | ACPI_RS_OFFSET(data.irq.sharable), |
| 179 | ACPI_EXCLUSIVE}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | |
Bob Moore | 1d5b285 | 2008-04-10 19:06:43 +0400 | [diff] [blame] | 181 | /* We can optimize to a 2-byte irq_no_flags() descriptor */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 182 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 183 | {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)} |
| 184 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | /******************************************************************************* |
| 187 | * |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 188 | * acpi_rs_convert_ext_irq |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | * |
| 190 | ******************************************************************************/ |
| 191 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 192 | struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = { |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 193 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ, |
| 194 | ACPI_RS_SIZE(struct acpi_resource_extended_irq), |
| 195 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_irq)}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 197 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_IRQ, |
| 198 | sizeof(struct aml_resource_extended_irq), |
| 199 | 0}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | |
Aaron Lu | f7b488e | 2012-12-31 00:07:24 +0000 | [diff] [blame] | 201 | /* |
| 202 | * Flags: Producer/Consumer[0], Triggering[1], Polarity[2], |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 203 | * Sharing[3], Wake[4] |
Aaron Lu | f7b488e | 2012-12-31 00:07:24 +0000 | [diff] [blame] | 204 | */ |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 205 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer), |
| 206 | AML_OFFSET(extended_irq.flags), |
| 207 | 0}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 209 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.triggering), |
| 210 | AML_OFFSET(extended_irq.flags), |
| 211 | 1}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 213 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.polarity), |
| 214 | AML_OFFSET(extended_irq.flags), |
| 215 | 2}, |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 216 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 217 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable), |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 218 | AML_OFFSET(extended_irq.flags), |
| 219 | 3}, |
Bob Moore | 50eca3e | 2005-09-30 19:03:00 -0400 | [diff] [blame] | 220 | |
Bob Moore | 9cea624 | 2012-12-31 00:07:31 +0000 | [diff] [blame] | 221 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.wake_capable), |
| 222 | AML_OFFSET(extended_irq.flags), |
| 223 | 4}, |
| 224 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 225 | /* IRQ Table length (Byte4) */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 227 | {ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count), |
| 228 | AML_OFFSET(extended_irq.interrupt_count), |
Lv Zheng | 3e8214e | 2012-12-19 05:37:15 +0000 | [diff] [blame] | 229 | sizeof(u32)}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 231 | /* Copy every IRQ in the table, each is 32 bits */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 232 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 233 | {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.extended_irq.interrupts[0]), |
| 234 | AML_OFFSET(extended_irq.interrupts[0]), |
Lv Zheng | 3e8214e | 2012-12-19 05:37:15 +0000 | [diff] [blame] | 235 | 0}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 237 | /* Optional resource_source (Index and String) */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 238 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 239 | {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET(data.extended_irq.resource_source), |
| 240 | ACPI_RS_OFFSET(data.extended_irq.interrupts[0]), |
| 241 | sizeof(struct aml_resource_extended_irq)} |
| 242 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | /******************************************************************************* |
| 245 | * |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 246 | * acpi_rs_convert_dma |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | * |
| 248 | ******************************************************************************/ |
| 249 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 250 | struct acpi_rsconvert_info acpi_rs_convert_dma[6] = { |
| 251 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_DMA, |
| 252 | ACPI_RS_SIZE(struct acpi_resource_dma), |
| 253 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_dma)}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 255 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_DMA, |
| 256 | sizeof(struct aml_resource_dma), |
| 257 | 0}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 259 | /* Flags: transfer preference, bus mastering, channel speed */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 260 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 261 | {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.transfer), |
| 262 | AML_OFFSET(dma.flags), |
| 263 | 0}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 265 | {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.dma.bus_master), |
| 266 | AML_OFFSET(dma.flags), |
| 267 | 2}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 269 | {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.type), |
| 270 | AML_OFFSET(dma.flags), |
| 271 | 5}, |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 272 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 273 | /* DMA channel mask bits */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | |
Bob Moore | 0897831 | 2005-10-21 00:00:00 -0400 | [diff] [blame] | 275 | {ACPI_RSC_BITMASK, ACPI_RS_OFFSET(data.dma.channels[0]), |
| 276 | AML_OFFSET(dma.dma_channel_mask), |
| 277 | ACPI_RS_OFFSET(data.dma.channel_count)} |
| 278 | }; |
Lin Ming | e0fe0a8 | 2011-11-16 14:38:13 +0800 | [diff] [blame] | 279 | |
| 280 | /******************************************************************************* |
| 281 | * |
| 282 | * acpi_rs_convert_fixed_dma |
| 283 | * |
| 284 | ******************************************************************************/ |
| 285 | |
| 286 | struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[4] = { |
| 287 | {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA, |
| 288 | ACPI_RS_SIZE(struct acpi_resource_fixed_dma), |
| 289 | ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_dma)}, |
| 290 | |
| 291 | {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA, |
| 292 | sizeof(struct aml_resource_fixed_dma), |
| 293 | 0}, |
| 294 | |
| 295 | /* |
| 296 | * These fields are contiguous in both the source and destination: |
| 297 | * request_lines |
| 298 | * Channels |
| 299 | */ |
Lin Ming | e0fe0a8 | 2011-11-16 14:38:13 +0800 | [diff] [blame] | 300 | {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_dma.request_lines), |
| 301 | AML_OFFSET(fixed_dma.request_lines), |
| 302 | 2}, |
| 303 | |
| 304 | {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_dma.width), |
| 305 | AML_OFFSET(fixed_dma.width), |
| 306 | 1}, |
Lin Ming | e0fe0a8 | 2011-11-16 14:38:13 +0800 | [diff] [blame] | 307 | }; |