rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | /******************************************************************************* |
| 2 | * |
| 3 | * Module Name: utresdecode - Resource descriptor keyword strings |
| 4 | * |
| 5 | ******************************************************************************/ |
| 6 | |
| 7 | /* |
| 8 | * Copyright (C) 2000 - 2017, Intel Corp. |
| 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 | |
| 44 | #include <acpi/acpi.h> |
| 45 | #include "accommon.h" |
| 46 | #include "acresrc.h" |
| 47 | |
| 48 | #define _COMPONENT ACPI_UTILITIES |
| 49 | ACPI_MODULE_NAME("utresdecode") |
| 50 | |
| 51 | #if defined (ACPI_DEBUG_OUTPUT) || \ |
| 52 | defined (ACPI_DISASSEMBLER) || \ |
| 53 | defined (ACPI_DEBUGGER) |
| 54 | /* |
| 55 | * Strings used to decode resource descriptors. |
| 56 | * Used by both the disassembler and the debugger resource dump routines |
| 57 | */ |
| 58 | const char *acpi_gbl_bm_decode[] = { |
| 59 | "NotBusMaster", |
| 60 | "BusMaster" |
| 61 | }; |
| 62 | |
| 63 | const char *acpi_gbl_config_decode[] = { |
| 64 | "0 - Good Configuration", |
| 65 | "1 - Acceptable Configuration", |
| 66 | "2 - Suboptimal Configuration", |
| 67 | "3 - ***Invalid Configuration***", |
| 68 | }; |
| 69 | |
| 70 | const char *acpi_gbl_consume_decode[] = { |
| 71 | "ResourceProducer", |
| 72 | "ResourceConsumer" |
| 73 | }; |
| 74 | |
| 75 | const char *acpi_gbl_dec_decode[] = { |
| 76 | "PosDecode", |
| 77 | "SubDecode" |
| 78 | }; |
| 79 | |
| 80 | const char *acpi_gbl_he_decode[] = { |
| 81 | "Level", |
| 82 | "Edge" |
| 83 | }; |
| 84 | |
| 85 | const char *acpi_gbl_io_decode[] = { |
| 86 | "Decode10", |
| 87 | "Decode16" |
| 88 | }; |
| 89 | |
| 90 | const char *acpi_gbl_ll_decode[] = { |
| 91 | "ActiveHigh", |
| 92 | "ActiveLow", |
| 93 | "ActiveBoth", |
| 94 | "Reserved" |
| 95 | }; |
| 96 | |
| 97 | const char *acpi_gbl_max_decode[] = { |
| 98 | "MaxNotFixed", |
| 99 | "MaxFixed" |
| 100 | }; |
| 101 | |
| 102 | const char *acpi_gbl_mem_decode[] = { |
| 103 | "NonCacheable", |
| 104 | "Cacheable", |
| 105 | "WriteCombining", |
| 106 | "Prefetchable" |
| 107 | }; |
| 108 | |
| 109 | const char *acpi_gbl_min_decode[] = { |
| 110 | "MinNotFixed", |
| 111 | "MinFixed" |
| 112 | }; |
| 113 | |
| 114 | const char *acpi_gbl_mtp_decode[] = { |
| 115 | "AddressRangeMemory", |
| 116 | "AddressRangeReserved", |
| 117 | "AddressRangeACPI", |
| 118 | "AddressRangeNVS" |
| 119 | }; |
| 120 | |
| 121 | const char *acpi_gbl_rng_decode[] = { |
| 122 | "InvalidRanges", |
| 123 | "NonISAOnlyRanges", |
| 124 | "ISAOnlyRanges", |
| 125 | "EntireRange" |
| 126 | }; |
| 127 | |
| 128 | const char *acpi_gbl_rw_decode[] = { |
| 129 | "ReadOnly", |
| 130 | "ReadWrite" |
| 131 | }; |
| 132 | |
| 133 | const char *acpi_gbl_shr_decode[] = { |
| 134 | "Exclusive", |
| 135 | "Shared", |
| 136 | "ExclusiveAndWake", /* ACPI 5.0 */ |
| 137 | "SharedAndWake" /* ACPI 5.0 */ |
| 138 | }; |
| 139 | |
| 140 | const char *acpi_gbl_siz_decode[] = { |
| 141 | "Transfer8", |
| 142 | "Transfer8_16", |
| 143 | "Transfer16", |
| 144 | "InvalidSize" |
| 145 | }; |
| 146 | |
| 147 | const char *acpi_gbl_trs_decode[] = { |
| 148 | "DenseTranslation", |
| 149 | "SparseTranslation" |
| 150 | }; |
| 151 | |
| 152 | const char *acpi_gbl_ttp_decode[] = { |
| 153 | "TypeStatic", |
| 154 | "TypeTranslation" |
| 155 | }; |
| 156 | |
| 157 | const char *acpi_gbl_typ_decode[] = { |
| 158 | "Compatibility", |
| 159 | "TypeA", |
| 160 | "TypeB", |
| 161 | "TypeF" |
| 162 | }; |
| 163 | |
| 164 | const char *acpi_gbl_ppc_decode[] = { |
| 165 | "PullDefault", |
| 166 | "PullUp", |
| 167 | "PullDown", |
| 168 | "PullNone" |
| 169 | }; |
| 170 | |
| 171 | const char *acpi_gbl_ior_decode[] = { |
| 172 | "IoRestrictionNone", |
| 173 | "IoRestrictionInputOnly", |
| 174 | "IoRestrictionOutputOnly", |
| 175 | "IoRestrictionNoneAndPreserve" |
| 176 | }; |
| 177 | |
| 178 | const char *acpi_gbl_dts_decode[] = { |
| 179 | "Width8bit", |
| 180 | "Width16bit", |
| 181 | "Width32bit", |
| 182 | "Width64bit", |
| 183 | "Width128bit", |
| 184 | "Width256bit", |
| 185 | }; |
| 186 | |
| 187 | /* GPIO connection type */ |
| 188 | |
| 189 | const char *acpi_gbl_ct_decode[] = { |
| 190 | "Interrupt", |
| 191 | "I/O" |
| 192 | }; |
| 193 | |
| 194 | /* Serial bus type */ |
| 195 | |
| 196 | const char *acpi_gbl_sbt_decode[] = { |
| 197 | "/* UNKNOWN serial bus type */", |
| 198 | "I2C", |
| 199 | "SPI", |
| 200 | "UART" |
| 201 | }; |
| 202 | |
| 203 | /* I2C serial bus access mode */ |
| 204 | |
| 205 | const char *acpi_gbl_am_decode[] = { |
| 206 | "AddressingMode7Bit", |
| 207 | "AddressingMode10Bit" |
| 208 | }; |
| 209 | |
| 210 | /* I2C serial bus slave mode */ |
| 211 | |
| 212 | const char *acpi_gbl_sm_decode[] = { |
| 213 | "ControllerInitiated", |
| 214 | "DeviceInitiated" |
| 215 | }; |
| 216 | |
| 217 | /* SPI serial bus wire mode */ |
| 218 | |
| 219 | const char *acpi_gbl_wm_decode[] = { |
| 220 | "FourWireMode", |
| 221 | "ThreeWireMode" |
| 222 | }; |
| 223 | |
| 224 | /* SPI serial clock phase */ |
| 225 | |
| 226 | const char *acpi_gbl_cph_decode[] = { |
| 227 | "ClockPhaseFirst", |
| 228 | "ClockPhaseSecond" |
| 229 | }; |
| 230 | |
| 231 | /* SPI serial bus clock polarity */ |
| 232 | |
| 233 | const char *acpi_gbl_cpo_decode[] = { |
| 234 | "ClockPolarityLow", |
| 235 | "ClockPolarityHigh" |
| 236 | }; |
| 237 | |
| 238 | /* SPI serial bus device polarity */ |
| 239 | |
| 240 | const char *acpi_gbl_dp_decode[] = { |
| 241 | "PolarityLow", |
| 242 | "PolarityHigh" |
| 243 | }; |
| 244 | |
| 245 | /* UART serial bus endian */ |
| 246 | |
| 247 | const char *acpi_gbl_ed_decode[] = { |
| 248 | "LittleEndian", |
| 249 | "BigEndian" |
| 250 | }; |
| 251 | |
| 252 | /* UART serial bus bits per byte */ |
| 253 | |
| 254 | const char *acpi_gbl_bpb_decode[] = { |
| 255 | "DataBitsFive", |
| 256 | "DataBitsSix", |
| 257 | "DataBitsSeven", |
| 258 | "DataBitsEight", |
| 259 | "DataBitsNine", |
| 260 | "/* UNKNOWN Bits per byte */", |
| 261 | "/* UNKNOWN Bits per byte */", |
| 262 | "/* UNKNOWN Bits per byte */" |
| 263 | }; |
| 264 | |
| 265 | /* UART serial bus stop bits */ |
| 266 | |
| 267 | const char *acpi_gbl_sb_decode[] = { |
| 268 | "StopBitsZero", |
| 269 | "StopBitsOne", |
| 270 | "StopBitsOnePlusHalf", |
| 271 | "StopBitsTwo" |
| 272 | }; |
| 273 | |
| 274 | /* UART serial bus flow control */ |
| 275 | |
| 276 | const char *acpi_gbl_fc_decode[] = { |
| 277 | "FlowControlNone", |
| 278 | "FlowControlHardware", |
| 279 | "FlowControlXON", |
| 280 | "/* UNKNOWN flow control keyword */" |
| 281 | }; |
| 282 | |
| 283 | /* UART serial bus parity type */ |
| 284 | |
| 285 | const char *acpi_gbl_pt_decode[] = { |
| 286 | "ParityTypeNone", |
| 287 | "ParityTypeEven", |
| 288 | "ParityTypeOdd", |
| 289 | "ParityTypeMark", |
| 290 | "ParityTypeSpace", |
| 291 | "/* UNKNOWN parity keyword */", |
| 292 | "/* UNKNOWN parity keyword */", |
| 293 | "/* UNKNOWN parity keyword */" |
| 294 | }; |
| 295 | |
| 296 | /* pin_config type */ |
| 297 | |
| 298 | const char *acpi_gbl_ptyp_decode[] = { |
| 299 | "Default", |
| 300 | "Bias Pull-up", |
| 301 | "Bias Pull-down", |
| 302 | "Bias Default", |
| 303 | "Bias Disable", |
| 304 | "Bias High Impedance", |
| 305 | "Bias Bus Hold", |
| 306 | "Drive Open Drain", |
| 307 | "Drive Open Source", |
| 308 | "Drive Push Pull", |
| 309 | "Drive Strength", |
| 310 | "Slew Rate", |
| 311 | "Input Debounce", |
| 312 | "Input Schmitt Trigger", |
| 313 | }; |
| 314 | |
| 315 | #endif |