0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __ACRESTYP_H__
0011 #define __ACRESTYP_H__
0012
0013
0014
0015
0016 typedef u16 acpi_rs_length;
0017 typedef u32 acpi_rsdesc_size;
0018
0019
0020
0021
0022 #define ACPI_READ_ONLY_MEMORY (u8) 0x00
0023 #define ACPI_READ_WRITE_MEMORY (u8) 0x01
0024
0025 #define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00
0026 #define ACPI_CACHABLE_MEMORY (u8) 0x01
0027 #define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02
0028 #define ACPI_PREFETCHABLE_MEMORY (u8) 0x03
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
0039 #define ACPI_ISA_ONLY_RANGES (u8) 0x02
0040 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
0041
0042
0043
0044 #define ACPI_SPARSE_TRANSLATION (u8) 0x01
0045
0046
0047
0048
0049 #define ACPI_DECODE_10 (u8) 0x00
0050 #define ACPI_DECODE_16 (u8) 0x01
0051
0052
0053
0054
0055
0056
0057
0058 #define ACPI_LEVEL_SENSITIVE (u8) 0x00
0059 #define ACPI_EDGE_SENSITIVE (u8) 0x01
0060
0061
0062
0063 #define ACPI_ACTIVE_HIGH (u8) 0x00
0064 #define ACPI_ACTIVE_LOW (u8) 0x01
0065 #define ACPI_ACTIVE_BOTH (u8) 0x02
0066
0067
0068
0069 #define ACPI_EXCLUSIVE (u8) 0x00
0070 #define ACPI_SHARED (u8) 0x01
0071
0072
0073
0074 #define ACPI_NOT_WAKE_CAPABLE (u8) 0x00
0075 #define ACPI_WAKE_CAPABLE (u8) 0x01
0076
0077
0078
0079
0080 #define ACPI_COMPATIBILITY (u8) 0x00
0081 #define ACPI_TYPE_A (u8) 0x01
0082 #define ACPI_TYPE_B (u8) 0x02
0083 #define ACPI_TYPE_F (u8) 0x03
0084
0085 #define ACPI_NOT_BUS_MASTER (u8) 0x00
0086 #define ACPI_BUS_MASTER (u8) 0x01
0087
0088 #define ACPI_TRANSFER_8 (u8) 0x00
0089 #define ACPI_TRANSFER_8_16 (u8) 0x01
0090 #define ACPI_TRANSFER_16 (u8) 0x02
0091
0092
0093
0094
0095 #define ACPI_GOOD_CONFIGURATION (u8) 0x00
0096 #define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01
0097 #define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02
0098
0099
0100
0101
0102 #define ACPI_MEMORY_RANGE (u8) 0x00
0103 #define ACPI_IO_RANGE (u8) 0x01
0104 #define ACPI_BUS_NUMBER_RANGE (u8) 0x02
0105
0106 #define ACPI_ADDRESS_NOT_FIXED (u8) 0x00
0107 #define ACPI_ADDRESS_FIXED (u8) 0x01
0108
0109 #define ACPI_POS_DECODE (u8) 0x00
0110 #define ACPI_SUB_DECODE (u8) 0x01
0111
0112
0113
0114 #define ACPI_PRODUCER (u8) 0x00
0115 #define ACPI_CONSUMER (u8) 0x01
0116
0117
0118
0119
0120 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
0121 #pragma pack(1)
0122 #endif
0123
0124
0125
0126 struct acpi_uuid {
0127 u8 data[ACPI_UUID_LENGTH];
0128 };
0129
0130 struct acpi_vendor_uuid {
0131 u8 subtype;
0132 u8 data[ACPI_UUID_LENGTH];
0133 };
0134
0135
0136
0137
0138 struct acpi_resource_irq {
0139 u8 descriptor_length;
0140 u8 triggering;
0141 u8 polarity;
0142 u8 shareable;
0143 u8 wake_capable;
0144 u8 interrupt_count;
0145 u8 interrupts[1];
0146 };
0147
0148 struct acpi_resource_dma {
0149 u8 type;
0150 u8 bus_master;
0151 u8 transfer;
0152 u8 channel_count;
0153 u8 channels[1];
0154 };
0155
0156 struct acpi_resource_start_dependent {
0157 u8 descriptor_length;
0158 u8 compatibility_priority;
0159 u8 performance_robustness;
0160 };
0161
0162
0163
0164
0165
0166
0167 struct acpi_resource_io {
0168 u8 io_decode;
0169 u8 alignment;
0170 u8 address_length;
0171 u16 minimum;
0172 u16 maximum;
0173 };
0174
0175 struct acpi_resource_fixed_io {
0176 u16 address;
0177 u8 address_length;
0178 };
0179
0180 struct acpi_resource_fixed_dma {
0181 u16 request_lines;
0182 u16 channels;
0183 u8 width;
0184 };
0185
0186
0187
0188 #define ACPI_DMA_WIDTH8 0
0189 #define ACPI_DMA_WIDTH16 1
0190 #define ACPI_DMA_WIDTH32 2
0191 #define ACPI_DMA_WIDTH64 3
0192 #define ACPI_DMA_WIDTH128 4
0193 #define ACPI_DMA_WIDTH256 5
0194
0195 struct acpi_resource_vendor {
0196 u16 byte_length;
0197 u8 byte_data[1];
0198 };
0199
0200
0201
0202 struct acpi_resource_vendor_typed {
0203 u16 byte_length;
0204 u8 uuid_subtype;
0205 u8 uuid[ACPI_UUID_LENGTH];
0206 u8 byte_data[1];
0207 };
0208
0209 struct acpi_resource_end_tag {
0210 u8 checksum;
0211 };
0212
0213 struct acpi_resource_memory24 {
0214 u8 write_protect;
0215 u16 minimum;
0216 u16 maximum;
0217 u16 alignment;
0218 u16 address_length;
0219 };
0220
0221 struct acpi_resource_memory32 {
0222 u8 write_protect;
0223 u32 minimum;
0224 u32 maximum;
0225 u32 alignment;
0226 u32 address_length;
0227 };
0228
0229 struct acpi_resource_fixed_memory32 {
0230 u8 write_protect;
0231 u32 address;
0232 u32 address_length;
0233 };
0234
0235 struct acpi_memory_attribute {
0236 u8 write_protect;
0237 u8 caching;
0238 u8 range_type;
0239 u8 translation;
0240 };
0241
0242 struct acpi_io_attribute {
0243 u8 range_type;
0244 u8 translation;
0245 u8 translation_type;
0246 u8 reserved1;
0247 };
0248
0249 union acpi_resource_attribute {
0250 struct acpi_memory_attribute mem;
0251 struct acpi_io_attribute io;
0252
0253
0254
0255 u8 type_specific;
0256 };
0257
0258 struct acpi_resource_label {
0259 u16 string_length;
0260 char *string_ptr;
0261 };
0262
0263 struct acpi_resource_source {
0264 u8 index;
0265 u16 string_length;
0266 char *string_ptr;
0267 };
0268
0269
0270
0271 #define ACPI_RESOURCE_ADDRESS_COMMON \
0272 u8 resource_type; \
0273 u8 producer_consumer; \
0274 u8 decode; \
0275 u8 min_address_fixed; \
0276 u8 max_address_fixed; \
0277 union acpi_resource_attribute info;
0278
0279 struct acpi_address16_attribute {
0280 u16 granularity;
0281 u16 minimum;
0282 u16 maximum;
0283 u16 translation_offset;
0284 u16 address_length;
0285 };
0286
0287 struct acpi_address32_attribute {
0288 u32 granularity;
0289 u32 minimum;
0290 u32 maximum;
0291 u32 translation_offset;
0292 u32 address_length;
0293 };
0294
0295 struct acpi_address64_attribute {
0296 u64 granularity;
0297 u64 minimum;
0298 u64 maximum;
0299 u64 translation_offset;
0300 u64 address_length;
0301 };
0302
0303 struct acpi_resource_address {
0304 ACPI_RESOURCE_ADDRESS_COMMON};
0305
0306 struct acpi_resource_address16 {
0307 ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address16_attribute address;
0308 struct acpi_resource_source resource_source;
0309 };
0310
0311 struct acpi_resource_address32 {
0312 ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address32_attribute address;
0313 struct acpi_resource_source resource_source;
0314 };
0315
0316 struct acpi_resource_address64 {
0317 ACPI_RESOURCE_ADDRESS_COMMON struct acpi_address64_attribute address;
0318 struct acpi_resource_source resource_source;
0319 };
0320
0321 struct acpi_resource_extended_address64 {
0322 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_ID;
0323 struct acpi_address64_attribute address;
0324 u64 type_specific;
0325 };
0326
0327 struct acpi_resource_extended_irq {
0328 u8 producer_consumer;
0329 u8 triggering;
0330 u8 polarity;
0331 u8 shareable;
0332 u8 wake_capable;
0333 u8 interrupt_count;
0334 struct acpi_resource_source resource_source;
0335 u32 interrupts[1];
0336 };
0337
0338 struct acpi_resource_generic_register {
0339 u8 space_id;
0340 u8 bit_width;
0341 u8 bit_offset;
0342 u8 access_size;
0343 u64 address;
0344 };
0345
0346 struct acpi_resource_gpio {
0347 u8 revision_id;
0348 u8 connection_type;
0349 u8 producer_consumer;
0350 u8 pin_config;
0351 u8 shareable;
0352 u8 wake_capable;
0353 u8 io_restriction;
0354 u8 triggering;
0355 u8 polarity;
0356 u16 drive_strength;
0357 u16 debounce_timeout;
0358 u16 pin_table_length;
0359 u16 vendor_length;
0360 struct acpi_resource_source resource_source;
0361 u16 *pin_table;
0362 u8 *vendor_data;
0363 };
0364
0365
0366
0367 #define ACPI_RESOURCE_GPIO_TYPE_INT 0
0368 #define ACPI_RESOURCE_GPIO_TYPE_IO 1
0369
0370
0371
0372 #define ACPI_PIN_CONFIG_DEFAULT 0
0373 #define ACPI_PIN_CONFIG_PULLUP 1
0374 #define ACPI_PIN_CONFIG_PULLDOWN 2
0375 #define ACPI_PIN_CONFIG_NOPULL 3
0376
0377
0378
0379 #define ACPI_IO_RESTRICT_NONE 0
0380 #define ACPI_IO_RESTRICT_INPUT 1
0381 #define ACPI_IO_RESTRICT_OUTPUT 2
0382 #define ACPI_IO_RESTRICT_NONE_PRESERVE 3
0383
0384
0385
0386 #define ACPI_RESOURCE_SERIAL_COMMON \
0387 u8 revision_id; \
0388 u8 type; \
0389 u8 producer_consumer; \
0390 u8 slave_mode; \
0391 u8 connection_sharing; \
0392 u8 type_revision_id; \
0393 u16 type_data_length; \
0394 u16 vendor_length; \
0395 struct acpi_resource_source resource_source; \
0396 u8 *vendor_data;
0397
0398 struct acpi_resource_common_serialbus {
0399 ACPI_RESOURCE_SERIAL_COMMON};
0400
0401
0402
0403 #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
0404 #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
0405 #define ACPI_RESOURCE_SERIAL_TYPE_UART 3
0406 #define ACPI_RESOURCE_SERIAL_TYPE_CSI2 4
0407
0408
0409
0410 #define ACPI_CONTROLLER_INITIATED 0
0411 #define ACPI_DEVICE_INITIATED 1
0412
0413 struct acpi_resource_i2c_serialbus {
0414 ACPI_RESOURCE_SERIAL_COMMON u8 access_mode;
0415 u16 slave_address;
0416 u32 connection_speed;
0417 };
0418
0419
0420
0421 #define ACPI_I2C_7BIT_MODE 0
0422 #define ACPI_I2C_10BIT_MODE 1
0423
0424 struct acpi_resource_spi_serialbus {
0425 ACPI_RESOURCE_SERIAL_COMMON u8 wire_mode;
0426 u8 device_polarity;
0427 u8 data_bit_length;
0428 u8 clock_phase;
0429 u8 clock_polarity;
0430 u16 device_selection;
0431 u32 connection_speed;
0432 };
0433
0434
0435
0436 #define ACPI_SPI_4WIRE_MODE 0
0437 #define ACPI_SPI_3WIRE_MODE 1
0438
0439
0440
0441 #define ACPI_SPI_ACTIVE_LOW 0
0442 #define ACPI_SPI_ACTIVE_HIGH 1
0443
0444
0445
0446 #define ACPI_SPI_FIRST_PHASE 0
0447 #define ACPI_SPI_SECOND_PHASE 1
0448
0449
0450
0451 #define ACPI_SPI_START_LOW 0
0452 #define ACPI_SPI_START_HIGH 1
0453
0454 struct acpi_resource_uart_serialbus {
0455 ACPI_RESOURCE_SERIAL_COMMON u8 endian;
0456 u8 data_bits;
0457 u8 stop_bits;
0458 u8 flow_control;
0459 u8 parity;
0460 u8 lines_enabled;
0461 u16 rx_fifo_size;
0462 u16 tx_fifo_size;
0463 u32 default_baud_rate;
0464 };
0465
0466
0467
0468 #define ACPI_UART_LITTLE_ENDIAN 0
0469 #define ACPI_UART_BIG_ENDIAN 1
0470
0471
0472
0473 #define ACPI_UART_5_DATA_BITS 0
0474 #define ACPI_UART_6_DATA_BITS 1
0475 #define ACPI_UART_7_DATA_BITS 2
0476 #define ACPI_UART_8_DATA_BITS 3
0477 #define ACPI_UART_9_DATA_BITS 4
0478
0479
0480
0481 #define ACPI_UART_NO_STOP_BITS 0
0482 #define ACPI_UART_1_STOP_BIT 1
0483 #define ACPI_UART_1P5_STOP_BITS 2
0484 #define ACPI_UART_2_STOP_BITS 3
0485
0486
0487
0488 #define ACPI_UART_FLOW_CONTROL_NONE 0
0489 #define ACPI_UART_FLOW_CONTROL_HW 1
0490 #define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
0491
0492
0493
0494 #define ACPI_UART_PARITY_NONE 0
0495 #define ACPI_UART_PARITY_EVEN 1
0496 #define ACPI_UART_PARITY_ODD 2
0497 #define ACPI_UART_PARITY_MARK 3
0498 #define ACPI_UART_PARITY_SPACE 4
0499
0500
0501
0502 #define ACPI_UART_CARRIER_DETECT (1<<2)
0503 #define ACPI_UART_RING_INDICATOR (1<<3)
0504 #define ACPI_UART_DATA_SET_READY (1<<4)
0505 #define ACPI_UART_DATA_TERMINAL_READY (1<<5)
0506 #define ACPI_UART_CLEAR_TO_SEND (1<<6)
0507 #define ACPI_UART_REQUEST_TO_SEND (1<<7)
0508
0509 struct acpi_resource_csi2_serialbus {
0510 ACPI_RESOURCE_SERIAL_COMMON u8 local_port_instance;
0511 u8 phy_type;
0512 };
0513
0514 struct acpi_resource_pin_function {
0515 u8 revision_id;
0516 u8 pin_config;
0517 u8 shareable;
0518 u16 function_number;
0519 u16 pin_table_length;
0520 u16 vendor_length;
0521 struct acpi_resource_source resource_source;
0522 u16 *pin_table;
0523 u8 *vendor_data;
0524 };
0525
0526 struct acpi_resource_pin_config {
0527 u8 revision_id;
0528 u8 producer_consumer;
0529 u8 shareable;
0530 u8 pin_config_type;
0531 u32 pin_config_value;
0532 u16 pin_table_length;
0533 u16 vendor_length;
0534 struct acpi_resource_source resource_source;
0535 u16 *pin_table;
0536 u8 *vendor_data;
0537 };
0538
0539
0540
0541 #define ACPI_PIN_CONFIG_DEFAULT 0
0542 #define ACPI_PIN_CONFIG_BIAS_PULL_UP 1
0543 #define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2
0544 #define ACPI_PIN_CONFIG_BIAS_DEFAULT 3
0545 #define ACPI_PIN_CONFIG_BIAS_DISABLE 4
0546 #define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5
0547 #define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6
0548 #define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7
0549 #define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8
0550 #define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9
0551 #define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10
0552 #define ACPI_PIN_CONFIG_SLEW_RATE 11
0553 #define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12
0554 #define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13
0555
0556 struct acpi_resource_pin_group {
0557 u8 revision_id;
0558 u8 producer_consumer;
0559 u16 pin_table_length;
0560 u16 vendor_length;
0561 u16 *pin_table;
0562 struct acpi_resource_label resource_label;
0563 u8 *vendor_data;
0564 };
0565
0566 struct acpi_resource_pin_group_function {
0567 u8 revision_id;
0568 u8 producer_consumer;
0569 u8 shareable;
0570 u16 function_number;
0571 u16 vendor_length;
0572 struct acpi_resource_source resource_source;
0573 struct acpi_resource_label resource_source_label;
0574 u8 *vendor_data;
0575 };
0576
0577 struct acpi_resource_pin_group_config {
0578 u8 revision_id;
0579 u8 producer_consumer;
0580 u8 shareable;
0581 u8 pin_config_type;
0582 u32 pin_config_value;
0583 u16 vendor_length;
0584 struct acpi_resource_source resource_source;
0585 struct acpi_resource_label resource_source_label;
0586 u8 *vendor_data;
0587 };
0588
0589
0590
0591 #define ACPI_RESOURCE_TYPE_IRQ 0
0592 #define ACPI_RESOURCE_TYPE_DMA 1
0593 #define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
0594 #define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
0595 #define ACPI_RESOURCE_TYPE_IO 4
0596 #define ACPI_RESOURCE_TYPE_FIXED_IO 5
0597 #define ACPI_RESOURCE_TYPE_VENDOR 6
0598 #define ACPI_RESOURCE_TYPE_END_TAG 7
0599 #define ACPI_RESOURCE_TYPE_MEMORY24 8
0600 #define ACPI_RESOURCE_TYPE_MEMORY32 9
0601 #define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
0602 #define ACPI_RESOURCE_TYPE_ADDRESS16 11
0603 #define ACPI_RESOURCE_TYPE_ADDRESS32 12
0604 #define ACPI_RESOURCE_TYPE_ADDRESS64 13
0605 #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14
0606 #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
0607 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
0608 #define ACPI_RESOURCE_TYPE_GPIO 17
0609 #define ACPI_RESOURCE_TYPE_FIXED_DMA 18
0610 #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19
0611 #define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20
0612 #define ACPI_RESOURCE_TYPE_PIN_CONFIG 21
0613 #define ACPI_RESOURCE_TYPE_PIN_GROUP 22
0614 #define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23
0615 #define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24
0616 #define ACPI_RESOURCE_TYPE_MAX 24
0617
0618
0619
0620 union acpi_resource_data {
0621 struct acpi_resource_irq irq;
0622 struct acpi_resource_dma dma;
0623 struct acpi_resource_start_dependent start_dpf;
0624 struct acpi_resource_io io;
0625 struct acpi_resource_fixed_io fixed_io;
0626 struct acpi_resource_fixed_dma fixed_dma;
0627 struct acpi_resource_vendor vendor;
0628 struct acpi_resource_vendor_typed vendor_typed;
0629 struct acpi_resource_end_tag end_tag;
0630 struct acpi_resource_memory24 memory24;
0631 struct acpi_resource_memory32 memory32;
0632 struct acpi_resource_fixed_memory32 fixed_memory32;
0633 struct acpi_resource_address16 address16;
0634 struct acpi_resource_address32 address32;
0635 struct acpi_resource_address64 address64;
0636 struct acpi_resource_extended_address64 ext_address64;
0637 struct acpi_resource_extended_irq extended_irq;
0638 struct acpi_resource_generic_register generic_reg;
0639 struct acpi_resource_gpio gpio;
0640 struct acpi_resource_i2c_serialbus i2c_serial_bus;
0641 struct acpi_resource_spi_serialbus spi_serial_bus;
0642 struct acpi_resource_uart_serialbus uart_serial_bus;
0643 struct acpi_resource_csi2_serialbus csi2_serial_bus;
0644 struct acpi_resource_common_serialbus common_serial_bus;
0645 struct acpi_resource_pin_function pin_function;
0646 struct acpi_resource_pin_config pin_config;
0647 struct acpi_resource_pin_group pin_group;
0648 struct acpi_resource_pin_group_function pin_group_function;
0649 struct acpi_resource_pin_group_config pin_group_config;
0650
0651
0652
0653 struct acpi_resource_address address;
0654 };
0655
0656
0657
0658 struct acpi_resource {
0659 u32 type;
0660 u32 length;
0661 union acpi_resource_data data;
0662 };
0663
0664
0665
0666 #pragma pack()
0667
0668 #define ACPI_RS_SIZE_NO_DATA 8
0669 #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
0670 #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
0671
0672
0673
0674 #define ACPI_NEXT_RESOURCE(res) \
0675 ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length)
0676
0677 struct acpi_pci_routing_table {
0678 u32 length;
0679 u32 pin;
0680 u64 address;
0681 u32 source_index;
0682 char source[4];
0683 };
0684
0685 #endif