1/* 2 * Some or all of this work - Copyright (c) 2006 - 2016, Intel Corp. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without modification, 6 * are permitted provided that the following conditions are met: 7 * 8 * Redistributions of source code must retain the above copyright notice, 9 * this list of conditions and the following disclaimer. 10 * Redistributions in binary form must reproduce the above copyright notice, 11 * this list of conditions and the following disclaimer in the documentation 12 * and/or other materials provided with the distribution. 13 * Neither the name of Intel Corporation nor the names of its contributors 14 * may be used to endorse or promote products derived from this software 15 * without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29/* 30 * Resource Descriptor macros 31 * 32 * DMA Resource Descriptor Macro 33 */ 34 35Name (p404, Package() { 36 ResourceTemplate () { 37 DMA (Compatibility, NotBusMaster, Transfer8) {0} 38 }, 39 ResourceTemplate () { 40 DMA (Compatibility, NotBusMaster, Transfer8_16) {1} 41 }, 42 ResourceTemplate () { 43 DMA (Compatibility, NotBusMaster, Transfer16) {2} 44 }, 45 ResourceTemplate () { 46 DMA (Compatibility, BusMaster, Transfer8) {3} 47 }, 48 ResourceTemplate () { 49 DMA (Compatibility, BusMaster, Transfer8_16) {4} 50 }, 51 ResourceTemplate () { 52 DMA (Compatibility, BusMaster, Transfer16) {5} 53 }, 54 ResourceTemplate () { 55 DMA (TypeA, NotBusMaster, Transfer8) {6} 56 }, 57 ResourceTemplate () { 58 DMA (TypeA, NotBusMaster, Transfer8_16) {7} 59 }, 60 ResourceTemplate () { 61 DMA (TypeA, NotBusMaster, Transfer16) {0} 62 }, 63 ResourceTemplate () { 64 DMA (TypeA, BusMaster, Transfer8) {1} 65 }, 66 ResourceTemplate () { 67 DMA (TypeA, BusMaster, Transfer8_16) {2} 68 }, 69 ResourceTemplate () { 70 DMA (TypeA, BusMaster, Transfer16) {3} 71 }, 72 ResourceTemplate () { 73 DMA (TypeB, NotBusMaster, Transfer8) {4} 74 }, 75 ResourceTemplate () { 76 DMA (TypeB, NotBusMaster, Transfer8_16) {5} 77 }, 78 ResourceTemplate () { 79 DMA (TypeB, NotBusMaster, Transfer16) {6} 80 }, 81 ResourceTemplate () { 82 DMA (TypeB, BusMaster, Transfer8) {7} 83 }, 84 ResourceTemplate () { 85 DMA (TypeB, BusMaster, Transfer8_16) {0} 86 }, 87 ResourceTemplate () { 88 DMA (TypeB, BusMaster, Transfer16) {1} 89 }, 90 ResourceTemplate () { 91 DMA (TypeF, NotBusMaster, Transfer8) {2} 92 }, 93 ResourceTemplate () { 94 DMA (TypeF, NotBusMaster, Transfer8_16) {3} 95 }, 96 ResourceTemplate () { 97 DMA (TypeF, NotBusMaster, Transfer16) {4} 98 }, 99 ResourceTemplate () { 100 DMA (TypeF, BusMaster, Transfer8) {5} 101 }, 102 ResourceTemplate () { 103 DMA (TypeF, BusMaster, Transfer8_16) {6} 104 }, 105 ResourceTemplate () { 106 DMA (TypeF, BusMaster, Transfer16) {7} 107 }, 108 109 ResourceTemplate () { 110 DMA (TypeF, BusMaster, Transfer16) {} 111 }, 112 ResourceTemplate () { 113 DMA (TypeF, BusMaster, Transfer16) {0, 1, 2, 3, 4, 5, 6, 7} 114 }, 115 116 // IsBusMaster: if nothing is specifies, then BusMaster is assumed 117 ResourceTemplate () { 118 DMA (TypeF, , Transfer8) {5} 119 }, 120}) 121 122/* 123ACPI Specification, Revision 3.0, September 2, 2004 1246.4.2.2 DMA Descriptor 125 126DMA Descriptor layout: 127 128Byte 0 (Tag Bits): Value = 00101010B (0x2a) (Type = 0, small item name = 0x5, length = 2) 129 130Byte 1 (DMA channel mask bits[7:0]): DMA0 <=> bit[0] 131 132Byte 2 (DMA Information): 133Bits[6:5] DMA channel speed supported, _TYP 134 00 Indicates compatibility mode 135 01 Indicates Type A DMA as described in the EISA 136 10 Indicates Type B DMA 137 11 Indicates Type F 138Bit[2] Logical device bus master status, _BM 139 0 Logical device is not a bus master 140 1 Logical device is a bus master 141Bits[1:0] DMA transfer type preference, _SIZ 142 00 8-bit only 143 01 8- and 16-bit 144 10 16-bit only 145 11 Reserved 146*/ 147 148Name (p405, Package() { 149 Buffer () {0x2a, 0x01, 0x00, 0x79, 0x00}, 150 Buffer () {0x2a, 0x02, 0x01, 0x79, 0x00}, 151 Buffer () {0x2a, 0x04, 0x02, 0x79, 0x00}, 152 Buffer () {0x2a, 0x08, 0x04, 0x79, 0x00}, 153 Buffer () {0x2a, 0x10, 0x05, 0x79, 0x00}, 154 Buffer () {0x2a, 0x20, 0x06, 0x79, 0x00}, 155 Buffer () {0x2a, 0x40, 0x20, 0x79, 0x00}, 156 Buffer () {0x2a, 0x80, 0x21, 0x79, 0x00}, 157 Buffer () {0x2a, 0x01, 0x22, 0x79, 0x00}, 158 Buffer () {0x2a, 0x02, 0x24, 0x79, 0x00}, 159 Buffer () {0x2a, 0x04, 0x25, 0x79, 0x00}, 160 Buffer () {0x2a, 0x08, 0x26, 0x79, 0x00}, 161 Buffer () {0x2a, 0x10, 0x40, 0x79, 0x00}, 162 Buffer () {0x2a, 0x20, 0x41, 0x79, 0x00}, 163 Buffer () {0x2a, 0x40, 0x42, 0x79, 0x00}, 164 Buffer () {0x2a, 0x80, 0x44, 0x79, 0x00}, 165 Buffer () {0x2a, 0x01, 0x45, 0x79, 0x00}, 166 Buffer () {0x2a, 0x02, 0x46, 0x79, 0x00}, 167 Buffer () {0x2a, 0x04, 0x60, 0x79, 0x00}, 168 Buffer () {0x2a, 0x08, 0x61, 0x79, 0x00}, 169 Buffer () {0x2a, 0x10, 0x62, 0x79, 0x00}, 170 Buffer () {0x2a, 0x20, 0x64, 0x79, 0x00}, 171 Buffer () {0x2a, 0x40, 0x65, 0x79, 0x00}, 172 Buffer () {0x2a, 0x80, 0x66, 0x79, 0x00}, 173 174 Buffer () {0x2a, 0x00, 0x66, 0x79, 0x00}, 175 Buffer () {0x2a, 0xff, 0x66, 0x79, 0x00}, 176 177 Buffer () {0x2a, 0x20, 0x64, 0x79, 0x00}, 178}) 179 180Method(RT03,, Serialized) 181{ 182 Name(ts, "RT03") 183 184 // Emit test header, set the filename 185 186 THDR (ts, "DMA Resource Descriptor Macro", __FILE__) 187 188 // Main test case for packages above 189 190 m330(ts, 27, "p404", p404, p405) 191 192 Store ( 193 ResourceTemplate () { 194 DMA (Compatibility, NotBusMaster, Transfer8, DMA0) {} 195 DMA (Compatibility, NotBusMaster, Transfer8, DMA1) {} 196 }, Local0) 197 198 m331(ts, 1, DMA0._TYP, 0x15, DMA1._TYP, 0x2d, "_TYP") 199 m331(ts, 2, DMA0._BM, 0x12, DMA1._BM, 0x2a, "_BM") 200 m331(ts, 3, DMA0._SIZ, 0x10, DMA1._SIZ, 0x28, "_SIZ") 201} 202