Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

This includes initial support for the recently published ACPI 5.0 spec.
In particular, support for the "hardware-reduced" bit that eliminates
the dependency on legacy hardware.

APEI has patches resulting from testing on real hardware.

Plus other random fixes.

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (52 commits)
acpi/apei/einj: Add extensions to EINJ from rev 5.0 of acpi spec
intel_idle: Split up and provide per CPU initialization func
ACPI processor: Remove unneeded variable passed by acpi_processor_hotadd_init V2
ACPI processor: Remove unneeded cpuidle_unregister_driver call
intel idle: Make idle driver more robust
intel_idle: Fix a cast to pointer from integer of different size warning in intel_idle
ACPI: kernel-parameters.txt : Add intel_idle.max_cstate
intel_idle: remove redundant local_irq_disable() call
ACPI processor: Fix error path, also remove sysdev link
ACPI: processor: fix acpi_get_cpuid for UP processor
intel_idle: fix API misuse
ACPI APEI: Convert atomicio routines
ACPI: Export interfaces for ioremapping/iounmapping ACPI registers
ACPI: Fix possible alignment issues with GAS 'address' references
ACPI, ia64: Use SRAT table rev to use 8bit or 16/32bit PXM fields (ia64)
ACPI, x86: Use SRAT table rev to use 8bit or 32bit PXM fields (x86/x86-64)
ACPI: Store SRAT table revision
ACPI, APEI, Resolve false conflict between ACPI NVS and APEI
ACPI, Record ACPI NVS regions
ACPI, APEI, EINJ, Refine the fix of resource conflict
...

+4828 -799
+44 -11
Documentation/acpi/apei/einj.txt
··· 47 47 48 48 - param1 49 49 This file is used to set the first error parameter value. Effect of 50 - parameter depends on error_type specified. For memory error, this is 51 - physical memory address. Only available if param_extension module 52 - parameter is specified. 50 + parameter depends on error_type specified. 53 51 54 52 - param2 55 53 This file is used to set the second error parameter value. Effect of 56 - parameter depends on error_type specified. For memory error, this is 57 - physical memory address mask. Only available if param_extension 58 - module parameter is specified. 54 + parameter depends on error_type specified. 59 55 60 - Injecting parameter support is a BIOS version specific extension, that 61 - is, it only works on some BIOS version. If you want to use it, please 62 - make sure your BIOS version has the proper support and specify 63 - "param_extension=y" in module parameter. 56 + BIOS versions based in the ACPI 4.0 specification have limited options 57 + to control where the errors are injected. Your BIOS may support an 58 + extension (enabled with the param_extension=1 module parameter, or 59 + boot command line einj.param_extension=1). This allows the address 60 + and mask for memory injections to be specified by the param1 and 61 + param2 files in apei/einj. 62 + 63 + BIOS versions using the ACPI 5.0 specification have more control over 64 + the target of the injection. For processor related errors (type 0x1, 65 + 0x2 and 0x4) the APICID of the target should be provided using the 66 + param1 file in apei/einj. For memory errors (type 0x8, 0x10 and 0x20) 67 + the address is set using param1 with a mask in param2 (0x0 is equivalent 68 + to all ones). For PCI express errors (type 0x40, 0x80 and 0x100) the 69 + segment, bus, device and function are specified using param1: 70 + 71 + 31 24 23 16 15 11 10 8 7 0 72 + +-------------------------------------------------+ 73 + | segment | bus | device | function | reserved | 74 + +-------------------------------------------------+ 75 + 76 + An ACPI 5.0 BIOS may also allow vendor specific errors to be injected. 77 + In this case a file named vendor will contain identifying information 78 + from the BIOS that hopefully will allow an application wishing to use 79 + the vendor specific extension to tell that they are running on a BIOS 80 + that supports it. All vendor extensions have the 0x80000000 bit set in 81 + error_type. A file vendor_flags controls the interpretation of param1 82 + and param2 (1 = PROCESSOR, 2 = MEMORY, 4 = PCI). See your BIOS vendor 83 + documentation for details (and expect changes to this API if vendors 84 + creativity in using this feature expands beyond our expectations). 85 + 86 + Example: 87 + # cd /sys/kernel/debug/apei/einj 88 + # cat available_error_type # See which errors can be injected 89 + 0x00000002 Processor Uncorrectable non-fatal 90 + 0x00000008 Memory Correctable 91 + 0x00000010 Memory Uncorrectable non-fatal 92 + # echo 0x12345000 > param1 # Set memory address for injection 93 + # echo 0xfffffffffffff000 > param2 # Mask - anywhere in this page 94 + # echo 0x8 > error_type # Choose correctable memory error 95 + # echo 1 > error_inject # Inject now 96 + 64 97 65 98 For more information about EINJ, please refer to ACPI specification 66 - version 4.0, section 17.5. 99 + version 4.0, section 17.5 and ACPI 5.0, section 18.6.
+5
Documentation/kernel-parameters.txt
··· 1059 1059 By default, super page will be supported if Intel IOMMU 1060 1060 has the capability. With this option, super page will 1061 1061 not be supported. 1062 + 1063 + intel_idle.max_cstate= [KNL,HW,ACPI,X86] 1064 + 0 disables intel_idle and fall back on acpi_idle. 1065 + 1 to 6 specify maximum depth of C-state. 1066 + 1062 1067 intremap= [X86-64, Intel-IOMMU] 1063 1068 on enable Interrupt Remapping (default) 1064 1069 off disable Interrupt Remapping
+6 -4
arch/ia64/kernel/acpi.c
··· 429 429 static struct acpi_table_slit __initdata *slit_table; 430 430 cpumask_t early_cpu_possible_map = CPU_MASK_NONE; 431 431 432 - static int get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa) 432 + static int __init 433 + get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa) 433 434 { 434 435 int pxm; 435 436 436 437 pxm = pa->proximity_domain_lo; 437 - if (ia64_platform_is("sn2")) 438 + if (ia64_platform_is("sn2") || acpi_srat_revision >= 2) 438 439 pxm += pa->proximity_domain_hi[0] << 8; 439 440 return pxm; 440 441 } 441 442 442 - static int get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma) 443 + static int __init 444 + get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma) 443 445 { 444 446 int pxm; 445 447 446 448 pxm = ma->proximity_domain; 447 - if (!ia64_platform_is("sn2")) 449 + if (!ia64_platform_is("sn2") && acpi_srat_revision <= 1) 448 450 pxm &= 0xff; 449 451 450 452 return pxm;
+2 -2
arch/x86/kernel/e820.c
··· 703 703 } 704 704 #endif 705 705 706 - #ifdef CONFIG_HIBERNATION 706 + #ifdef CONFIG_ACPI 707 707 /** 708 708 * Mark ACPI NVS memory region, so that we can save/restore it during 709 709 * hibernation and the subsequent resume. ··· 716 716 struct e820entry *ei = &e820.map[i]; 717 717 718 718 if (ei->type == E820_NVS) 719 - suspend_nvs_register(ei->addr, ei->size); 719 + acpi_nvs_register(ei->addr, ei->size); 720 720 } 721 721 722 722 return 0;
+4
arch/x86/mm/srat.c
··· 109 109 if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0) 110 110 return; 111 111 pxm = pa->proximity_domain_lo; 112 + if (acpi_srat_revision >= 2) 113 + pxm |= *((unsigned int*)pa->proximity_domain_hi) << 8; 112 114 node = setup_node(pxm); 113 115 if (node < 0) { 114 116 printk(KERN_ERR "SRAT: Too many proximity domains %x\n", pxm); ··· 162 160 start = ma->base_address; 163 161 end = start + ma->length; 164 162 pxm = ma->proximity_domain; 163 + if (acpi_srat_revision <= 1) 164 + pxm &= 0xff; 165 165 node = setup_node(pxm); 166 166 if (node < 0) { 167 167 printk(KERN_ERR "SRAT: Too many proximity domains.\n");
+2 -1
drivers/acpi/Makefile
··· 20 20 # All the builtin files are in the "acpi." module_param namespace. 21 21 acpi-y += osl.o utils.o reboot.o 22 22 acpi-y += atomicio.o 23 + acpi-y += nvs.o 23 24 24 25 # sleep related files 25 26 acpi-y += wakeup.o 26 27 acpi-y += sleep.o 27 - acpi-$(CONFIG_ACPI_SLEEP) += proc.o nvs.o 28 + acpi-$(CONFIG_ACPI_SLEEP) += proc.o 28 29 29 30 30 31 #
+134 -24
drivers/acpi/acpica/Makefile
··· 8 8 # use acpi.o to put all files here into acpi.o modparam namespace 9 9 obj-y += acpi.o 10 10 11 - acpi-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \ 12 - dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \ 13 - dsinit.o dsargs.o dscontrol.o dswload2.o 11 + acpi-y := \ 12 + dsargs.o \ 13 + dscontrol.o \ 14 + dsfield.o \ 15 + dsinit.o \ 16 + dsmethod.o \ 17 + dsmthdat.o \ 18 + dsobject.o \ 19 + dsopcode.o \ 20 + dsutils.o \ 21 + dswexec.o \ 22 + dswload.o \ 23 + dswload2.o \ 24 + dswscope.o \ 25 + dswstate.o 14 26 15 - acpi-y += evevent.o evregion.o evsci.o evxfevnt.o \ 16 - evmisc.o evrgnini.o evxface.o evxfregn.o \ 17 - evgpe.o evgpeblk.o evgpeinit.o evgpeutil.o evxfgpe.o evglock.o 27 + acpi-y += \ 28 + evevent.o \ 29 + evgpe.o \ 30 + evgpeblk.o \ 31 + evgpeinit.o \ 32 + evgpeutil.o \ 33 + evglock.o \ 34 + evmisc.o \ 35 + evregion.o \ 36 + evrgnini.o \ 37 + evsci.o \ 38 + evxface.o \ 39 + evxfevnt.o \ 40 + evxfgpe.o \ 41 + evxfregn.o 18 42 19 - acpi-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\ 20 - exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\ 21 - excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \ 22 - exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o exdebug.o 43 + acpi-y += \ 44 + exconfig.o \ 45 + exconvrt.o \ 46 + excreate.o \ 47 + exdebug.o \ 48 + exdump.o \ 49 + exfield.o \ 50 + exfldio.o \ 51 + exmutex.o \ 52 + exnames.o \ 53 + exoparg1.o \ 54 + exoparg2.o \ 55 + exoparg3.o \ 56 + exoparg6.o \ 57 + exprep.o \ 58 + exmisc.o \ 59 + exregion.o \ 60 + exresnte.o \ 61 + exresolv.o \ 62 + exresop.o \ 63 + exstore.o \ 64 + exstoren.o \ 65 + exstorob.o \ 66 + exsystem.o \ 67 + exutils.o 23 68 24 - acpi-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o hwpci.o 69 + acpi-y += \ 70 + hwacpi.o \ 71 + hwgpe.o \ 72 + hwpci.o \ 73 + hwregs.o \ 74 + hwsleep.o \ 75 + hwvalid.o \ 76 + hwxface.o 25 77 26 78 acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o 27 79 28 - acpi-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \ 29 - nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \ 30 - nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \ 31 - nsparse.o nspredef.o nsrepair.o nsrepair2.o 80 + acpi-y += \ 81 + nsaccess.o \ 82 + nsalloc.o \ 83 + nsdump.o \ 84 + nseval.o \ 85 + nsinit.o \ 86 + nsload.o \ 87 + nsnames.o \ 88 + nsobject.o \ 89 + nsparse.o \ 90 + nspredef.o \ 91 + nsrepair.o \ 92 + nsrepair2.o \ 93 + nssearch.o \ 94 + nsutils.o \ 95 + nswalk.o \ 96 + nsxfeval.o \ 97 + nsxfname.o \ 98 + nsxfobj.o 32 99 33 100 acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o 34 101 35 - acpi-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \ 36 - psopcode.o psscope.o psutils.o psxface.o 102 + acpi-y += \ 103 + psargs.o \ 104 + psloop.o \ 105 + psopcode.o \ 106 + psparse.o \ 107 + psscope.o \ 108 + pstree.o \ 109 + psutils.o \ 110 + pswalk.o \ 111 + psxface.o 37 112 38 - acpi-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \ 39 - rscalc.o rsirq.o rsmemory.o rsutils.o 113 + acpi-y += \ 114 + rsaddr.o \ 115 + rscalc.o \ 116 + rscreate.o \ 117 + rsinfo.o \ 118 + rsio.o \ 119 + rsirq.o \ 120 + rslist.o \ 121 + rsmemory.o \ 122 + rsmisc.o \ 123 + rsserial.o \ 124 + rsutils.o \ 125 + rsxface.o 40 126 41 127 acpi-$(ACPI_FUTURE_USAGE) += rsdump.o 42 128 43 - acpi-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o 129 + acpi-y += \ 130 + tbfadt.o \ 131 + tbfind.o \ 132 + tbinstal.o \ 133 + tbutils.o \ 134 + tbxface.o \ 135 + tbxfroot.o 44 136 45 - acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \ 46 - utcopy.o utdelete.o utglobal.o utmath.o utobject.o \ 47 - utstate.o utmutex.o utobject.o utresrc.o utlock.o utids.o \ 48 - utosi.o utxferror.o utdecode.o 137 + acpi-y += \ 138 + utaddress.o \ 139 + utalloc.o \ 140 + utcopy.o \ 141 + utdebug.o \ 142 + utdecode.o \ 143 + utdelete.o \ 144 + uteval.o \ 145 + utglobal.o \ 146 + utids.o \ 147 + utinit.o \ 148 + utlock.o \ 149 + utmath.o \ 150 + utmisc.o \ 151 + utmutex.o \ 152 + utobject.o \ 153 + utosi.o \ 154 + utresrc.o \ 155 + utstate.o \ 156 + utxface.o \ 157 + utxferror.o \ 158 + utxfmutex.o
+1 -1
drivers/acpi/acpica/accommon.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+7 -2
drivers/acpi/acpica/acconfig.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 123 123 124 124 #define ACPI_MAX_SLEEP 2000 /* Two seconds */ 125 125 126 + /* Address Range lists are per-space_id (Memory and I/O only) */ 127 + 128 + #define ACPI_ADDRESS_RANGE_MAX 2 129 + 126 130 /****************************************************************************** 127 131 * 128 132 * ACPI Specification constants (Do not change unless the specification changes) ··· 206 202 #define ACPI_RSDP_CHECKSUM_LENGTH 20 207 203 #define ACPI_RSDP_XCHECKSUM_LENGTH 36 208 204 209 - /* SMBus and IPMI bidirectional buffer size */ 205 + /* SMBus, GSBus and IPMI bidirectional buffer size */ 210 206 211 207 #define ACPI_SMBUS_BUFFER_SIZE 34 208 + #define ACPI_GSBUS_BUFFER_SIZE 34 212 209 #define ACPI_IPMI_BUFFER_SIZE 66 213 210 214 211 /* _sx_d and _sx_w control methods */
+1 -1
drivers/acpi/acpica/acdebug.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acdispat.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+2 -1
drivers/acpi/acpica/acevents.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 162 162 163 163 acpi_status 164 164 acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 165 + union acpi_operand_object *field_obj, 165 166 u32 function, 166 167 u32 region_offset, u32 bit_width, u64 *value); 167 168
+15 -2
drivers/acpi/acpica/acglobal.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 140 140 acpi_name acpi_gbl_trace_method_name; 141 141 u8 acpi_gbl_system_awake_and_running; 142 142 143 + /* 144 + * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning 145 + * that the ACPI hardware is no longer required. A flag in the FADT indicates 146 + * a reduced HW machine, and that flag is duplicated here for convenience. 147 + */ 148 + u8 acpi_gbl_reduced_hardware; 149 + 143 150 #endif 151 + 152 + /* Do not disassemble buffers to resource descriptors */ 153 + 154 + ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_no_resource_disassembly, FALSE); 144 155 145 156 /***************************************************************************** 146 157 * ··· 218 207 219 208 /***************************************************************************** 220 209 * 221 - * Mutual exlusion within ACPICA subsystem 210 + * Mutual exclusion within ACPICA subsystem 222 211 * 223 212 ****************************************************************************/ 224 213 ··· 306 295 ACPI_EXTERN u8 acpi_gbl_events_initialized; 307 296 ACPI_EXTERN u8 acpi_gbl_osi_data; 308 297 ACPI_EXTERN struct acpi_interface_info *acpi_gbl_supported_interfaces; 298 + ACPI_EXTERN struct acpi_address_range 299 + *acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX]; 309 300 310 301 #ifndef DEFINE_ACPI_GLOBALS 311 302
+1 -1
drivers/acpi/acpica/achware.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+3 -1
drivers/acpi/acpica/acinterp.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 467 467 void acpi_ex_eisa_id_to_string(char *dest, u64 compressed_id); 468 468 469 469 void acpi_ex_integer_to_string(char *dest, u64 value); 470 + 471 + u8 acpi_is_valid_space_id(u8 space_id); 470 472 471 473 /* 472 474 * exregion - default op_region handlers
+21 -5
drivers/acpi/acpica/aclocal.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 53 53 54 54 /* Total number of aml opcodes defined */ 55 55 56 - #define AML_NUM_OPCODES 0x7F 56 + #define AML_NUM_OPCODES 0x81 57 57 58 58 /* Forward declarations */ 59 59 ··· 249 249 struct acpi_namespace_node *field_node; 250 250 struct acpi_namespace_node *register_node; 251 251 struct acpi_namespace_node *data_register_node; 252 + struct acpi_namespace_node *connection_node; 253 + u8 *resource_buffer; 252 254 u32 bank_value; 253 255 u32 field_bit_position; 254 256 u32 field_bit_length; 257 + u16 resource_length; 255 258 u8 field_flags; 256 259 u8 attribute; 257 260 u8 field_type; 261 + u8 access_length; 258 262 }; 259 263 260 264 typedef ··· 319 315 320 316 /* 321 317 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 322 - * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT 318 + * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, 319 + * ACPI_PTYPE2_FIX_VAR 323 320 */ 324 321 struct acpi_package_info { 325 322 u8 type; ··· 629 624 ****************************************************************************/ 630 625 631 626 typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state); 627 + 628 + /* Address Range info block */ 629 + 630 + struct acpi_address_range { 631 + struct acpi_address_range *next; 632 + struct acpi_namespace_node *region_node; 633 + acpi_physical_address start_address; 634 + acpi_physical_address end_address; 635 + }; 632 636 633 637 /***************************************************************************** 634 638 * ··· 965 951 #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 966 952 #define ACPI_RESOURCE_NAME_IO 0x40 967 953 #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 968 - #define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 954 + #define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 969 955 #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 970 956 #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 971 957 #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 ··· 987 973 #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 988 974 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 989 975 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 990 - #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B 976 + #define ACPI_RESOURCE_NAME_GPIO 0x8C 977 + #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 978 + #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E 991 979 992 980 /***************************************************************************** 993 981 *
+1 -1
drivers/acpi/acpica/acmacros.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/acnamesp.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+6 -2
drivers/acpi/acpica/acobject.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 254 254 u32 base_byte_offset; /* Byte offset within containing object */\ 255 255 u32 value; /* Value to store into the Bank or Index register */\ 256 256 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ 257 + u8 access_length; /* For serial regions/fields */ 257 258 258 259 259 260 struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ ··· 262 261 }; 263 262 264 263 struct acpi_object_region_field { 265 - ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ 264 + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length; 265 + union acpi_operand_object *region_obj; /* Containing op_region object */ 266 + u8 *resource_buffer; /* resource_template for serial regions/fields */ 266 267 }; 267 268 268 269 struct acpi_object_bank_field { ··· 361 358 */ 362 359 struct acpi_object_extra { 363 360 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ 361 + struct acpi_namespace_node *scope_node; 364 362 void *region_context; /* Region-specific data */ 365 363 u8 *aml_start; 366 364 u32 aml_length;
+5 -1
drivers/acpi/acpica/acopcode.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 93 93 #define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 94 94 #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 95 95 #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) 96 + #define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) 96 97 #define ARGP_CONTINUE_OP ARG_NONE 97 98 #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) 98 99 #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) ··· 165 164 #define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG) 166 165 #define ARGP_REVISION_OP ARG_NONE 167 166 #define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST) 167 + #define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) 168 168 #define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 169 169 #define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 170 170 #define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME) ··· 225 223 #define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF) 226 224 #define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF) 227 225 #define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF) 226 + #define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE 228 227 #define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE 229 228 #define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET) 230 229 #define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE) ··· 297 294 #define ARGI_RETURN_OP ARGI_INVALID_OPCODE 298 295 #define ARGI_REVISION_OP ARG_NONE 299 296 #define ARGI_SCOPE_OP ARGI_INVALID_OPCODE 297 + #define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE 300 298 #define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) 301 299 #define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) 302 300 #define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
+1 -1
drivers/acpi/acpica/acparser.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+39 -2
drivers/acpi/acpica/acpredef.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 94 94 * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length 95 95 * (Used for _ART, _FPS) 96 96 * 97 + * ACPI_PTYPE2_FIX_VAR: Each subpackage consists of some fixed-length elements 98 + * followed by an optional element 99 + * object type 100 + * count 101 + * object type 102 + * count = 0 (optional) 103 + * (Used for _DLM) 104 + * 97 105 *****************************************************************************/ 98 106 99 107 enum acpi_return_package_types { ··· 113 105 ACPI_PTYPE2_PKG_COUNT = 6, 114 106 ACPI_PTYPE2_FIXED = 7, 115 107 ACPI_PTYPE2_MIN = 8, 116 - ACPI_PTYPE2_REV_FIXED = 9 108 + ACPI_PTYPE2_REV_FIXED = 9, 109 + ACPI_PTYPE2_FIX_VAR = 10 117 110 }; 118 111 119 112 #ifdef ACPI_CREATE_PREDEFINED_TABLE ··· 163 154 {{"_AC8", 0, ACPI_RTYPE_INTEGER}}, 164 155 {{"_AC9", 0, ACPI_RTYPE_INTEGER}}, 165 156 {{"_ADR", 0, ACPI_RTYPE_INTEGER}}, 157 + {{"_AEI", 0, ACPI_RTYPE_BUFFER}}, 166 158 {{"_AL0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 167 159 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, 168 160 ··· 239 229 {{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */ 240 230 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}}, 241 231 232 + {{"_CLS", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */ 233 + {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0}, 0, 0}}, 234 + 235 + {{"_CPC", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Bufs) */ 236 + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0, 0}, 0, 237 + 0}}, 238 + 242 239 {{"_CRS", 0, ACPI_RTYPE_BUFFER}}, 243 240 {{"_CRT", 0, ACPI_RTYPE_INTEGER}}, 244 241 {{"_CSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n-1 Int) */ ··· 254 237 {{"_CST", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */ 255 238 {{{ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER}, 3,0}}, 256 239 240 + {{"_CWS", 1, ACPI_RTYPE_INTEGER}}, 257 241 {{"_DCK", 1, ACPI_RTYPE_INTEGER}}, 258 242 {{"_DCS", 0, ACPI_RTYPE_INTEGER}}, 259 243 {{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}}, 260 244 {{"_DDN", 0, ACPI_RTYPE_STRING}}, 245 + {{"_DEP", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 246 + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}}, 247 + 261 248 {{"_DGS", 0, ACPI_RTYPE_INTEGER}}, 262 249 {{"_DIS", 0, 0}}, 250 + 251 + {{"_DLM", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (1 Ref, 0/1 Optional Buf/Ref) */ 252 + {{{ACPI_PTYPE2_FIX_VAR, ACPI_RTYPE_REFERENCE, 1, 253 + ACPI_RTYPE_REFERENCE | ACPI_RTYPE_BUFFER}, 0, 0}}, 254 + 263 255 {{"_DMA", 0, ACPI_RTYPE_BUFFER}}, 264 256 {{"_DOD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ 265 257 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, ··· 288 262 {{"_EJ3", 1, 0}}, 289 263 {{"_EJ4", 1, 0}}, 290 264 {{"_EJD", 0, ACPI_RTYPE_STRING}}, 265 + {{"_EVT", 1, 0}}, 291 266 {{"_FDE", 0, ACPI_RTYPE_BUFFER}}, 292 267 {{"_FDI", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int) */ 293 268 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}}, ··· 308 281 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0}, 0, 0}}, 309 282 310 283 {{"_GAI", 0, ACPI_RTYPE_INTEGER}}, 284 + {{"_GCP", 0, ACPI_RTYPE_INTEGER}}, 311 285 {{"_GHL", 0, ACPI_RTYPE_INTEGER}}, 312 286 {{"_GLK", 0, ACPI_RTYPE_INTEGER}}, 313 287 {{"_GPD", 0, ACPI_RTYPE_INTEGER}}, 314 288 {{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */ 289 + {{"_GRT", 0, ACPI_RTYPE_BUFFER}}, 315 290 {{"_GSB", 0, ACPI_RTYPE_INTEGER}}, 316 291 {{"_GTF", 0, ACPI_RTYPE_BUFFER}}, 317 292 {{"_GTM", 0, ACPI_RTYPE_BUFFER}}, 318 293 {{"_GTS", 1, 0}}, 294 + {{"_GWS", 1, ACPI_RTYPE_INTEGER}}, 319 295 {{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, 320 296 {{"_HOT", 0, ACPI_RTYPE_INTEGER}}, 321 297 {{"_HPP", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ ··· 333 303 {{"_HPX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (var Ints) */ 334 304 {{{ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, 335 305 306 + {{"_HRV", 0, ACPI_RTYPE_INTEGER}}, 336 307 {{"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ 337 308 {{"_INI", 0, 0}}, 338 309 {{"_IRC", 0, 0}}, ··· 392 361 {{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 393 362 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}}, 394 363 364 + {{"_PRE", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 365 + {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}}, 366 + 395 367 {{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 396 368 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}}, 397 369 ··· 425 391 {{"_PSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (5 Int) with count */ 426 392 {{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0}, 0,0}}, 427 393 394 + {{"_PSE", 1, 0}}, 428 395 {{"_PSL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 429 396 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, 430 397 ··· 492 457 {{"_SLI", 0, ACPI_RTYPE_BUFFER}}, 493 458 {{"_SPD", 1, ACPI_RTYPE_INTEGER}}, 494 459 {{"_SRS", 1, 0}}, 460 + {{"_SRT", 1, ACPI_RTYPE_INTEGER}}, 495 461 {{"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ 496 462 {{"_SST", 1, 0}}, 497 463 {{"_STA", 0, ACPI_RTYPE_INTEGER}}, ··· 500 464 {{"_STP", 2, ACPI_RTYPE_INTEGER}}, 501 465 {{"_STR", 0, ACPI_RTYPE_BUFFER}}, 502 466 {{"_STV", 2, ACPI_RTYPE_INTEGER}}, 467 + {{"_SUB", 0, ACPI_RTYPE_STRING}}, 503 468 {{"_SUN", 0, ACPI_RTYPE_INTEGER}}, 504 469 {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, 505 470 {{"_TC1", 0, ACPI_RTYPE_INTEGER}},
+78 -37
drivers/acpi/acpica/acresrc.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 73 73 74 74 /* Resource conversion opcodes */ 75 75 76 - #define ACPI_RSC_INITGET 0 77 - #define ACPI_RSC_INITSET 1 78 - #define ACPI_RSC_FLAGINIT 2 79 - #define ACPI_RSC_1BITFLAG 3 80 - #define ACPI_RSC_2BITFLAG 4 81 - #define ACPI_RSC_COUNT 5 82 - #define ACPI_RSC_COUNT16 6 83 - #define ACPI_RSC_LENGTH 7 84 - #define ACPI_RSC_MOVE8 8 85 - #define ACPI_RSC_MOVE16 9 86 - #define ACPI_RSC_MOVE32 10 87 - #define ACPI_RSC_MOVE64 11 88 - #define ACPI_RSC_SET8 12 89 - #define ACPI_RSC_DATA8 13 90 - #define ACPI_RSC_ADDRESS 14 91 - #define ACPI_RSC_SOURCE 15 92 - #define ACPI_RSC_SOURCEX 16 93 - #define ACPI_RSC_BITMASK 17 94 - #define ACPI_RSC_BITMASK16 18 95 - #define ACPI_RSC_EXIT_NE 19 96 - #define ACPI_RSC_EXIT_LE 20 97 - #define ACPI_RSC_EXIT_EQ 21 76 + typedef enum { 77 + ACPI_RSC_INITGET = 0, 78 + ACPI_RSC_INITSET, 79 + ACPI_RSC_FLAGINIT, 80 + ACPI_RSC_1BITFLAG, 81 + ACPI_RSC_2BITFLAG, 82 + ACPI_RSC_3BITFLAG, 83 + ACPI_RSC_ADDRESS, 84 + ACPI_RSC_BITMASK, 85 + ACPI_RSC_BITMASK16, 86 + ACPI_RSC_COUNT, 87 + ACPI_RSC_COUNT16, 88 + ACPI_RSC_COUNT_GPIO_PIN, 89 + ACPI_RSC_COUNT_GPIO_RES, 90 + ACPI_RSC_COUNT_GPIO_VEN, 91 + ACPI_RSC_COUNT_SERIAL_RES, 92 + ACPI_RSC_COUNT_SERIAL_VEN, 93 + ACPI_RSC_DATA8, 94 + ACPI_RSC_EXIT_EQ, 95 + ACPI_RSC_EXIT_LE, 96 + ACPI_RSC_EXIT_NE, 97 + ACPI_RSC_LENGTH, 98 + ACPI_RSC_MOVE_GPIO_PIN, 99 + ACPI_RSC_MOVE_GPIO_RES, 100 + ACPI_RSC_MOVE_SERIAL_RES, 101 + ACPI_RSC_MOVE_SERIAL_VEN, 102 + ACPI_RSC_MOVE8, 103 + ACPI_RSC_MOVE16, 104 + ACPI_RSC_MOVE32, 105 + ACPI_RSC_MOVE64, 106 + ACPI_RSC_SET8, 107 + ACPI_RSC_SOURCE, 108 + ACPI_RSC_SOURCEX 109 + } ACPI_RSCONVERT_OPCODES; 98 110 99 111 /* Resource Conversion sub-opcodes */ 100 112 ··· 118 106 #define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f) 119 107 #define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f) 120 108 109 + /* 110 + * Individual entry for the resource dump tables 111 + */ 121 112 typedef const struct acpi_rsdump_info { 122 113 u8 opcode; 123 114 u8 offset; ··· 131 116 132 117 /* Values for the Opcode field above */ 133 118 134 - #define ACPI_RSD_TITLE 0 135 - #define ACPI_RSD_LITERAL 1 136 - #define ACPI_RSD_STRING 2 137 - #define ACPI_RSD_UINT8 3 138 - #define ACPI_RSD_UINT16 4 139 - #define ACPI_RSD_UINT32 5 140 - #define ACPI_RSD_UINT64 6 141 - #define ACPI_RSD_1BITFLAG 7 142 - #define ACPI_RSD_2BITFLAG 8 143 - #define ACPI_RSD_SHORTLIST 9 144 - #define ACPI_RSD_LONGLIST 10 145 - #define ACPI_RSD_DWORDLIST 11 146 - #define ACPI_RSD_ADDRESS 12 147 - #define ACPI_RSD_SOURCE 13 119 + typedef enum { 120 + ACPI_RSD_TITLE = 0, 121 + ACPI_RSD_1BITFLAG, 122 + ACPI_RSD_2BITFLAG, 123 + ACPI_RSD_3BITFLAG, 124 + ACPI_RSD_ADDRESS, 125 + ACPI_RSD_DWORDLIST, 126 + ACPI_RSD_LITERAL, 127 + ACPI_RSD_LONGLIST, 128 + ACPI_RSD_SHORTLIST, 129 + ACPI_RSD_SHORTLISTX, 130 + ACPI_RSD_SOURCE, 131 + ACPI_RSD_STRING, 132 + ACPI_RSD_UINT8, 133 + ACPI_RSD_UINT16, 134 + ACPI_RSD_UINT32, 135 + ACPI_RSD_UINT64, 136 + ACPI_RSD_WORDLIST 137 + } ACPI_RSDUMP_OPCODES; 148 138 149 139 /* restore default alignment */ 150 140 ··· 158 138 /* Resource tables indexed by internal resource type */ 159 139 160 140 extern const u8 acpi_gbl_aml_resource_sizes[]; 141 + extern const u8 acpi_gbl_aml_resource_serial_bus_sizes[]; 161 142 extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; 162 143 163 144 /* Resource tables indexed by raw AML resource descriptor type */ 164 145 165 146 extern const u8 acpi_gbl_resource_struct_sizes[]; 147 + extern const u8 acpi_gbl_resource_struct_serial_bus_sizes[]; 166 148 extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[]; 149 + 150 + extern struct acpi_rsconvert_info 151 + *acpi_gbl_convert_resource_serial_bus_dispatch[]; 167 152 168 153 struct acpi_vendor_walk_info { 169 154 struct acpi_vendor_uuid *uuid; ··· 213 188 214 189 acpi_status 215 190 acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, 191 + struct acpi_buffer *ret_buffer); 192 + 193 + acpi_status 194 + acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, 216 195 struct acpi_buffer *ret_buffer); 217 196 218 197 /* ··· 322 293 extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[]; 323 294 extern struct acpi_rsconvert_info acpi_rs_convert_address64[]; 324 295 extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[]; 296 + extern struct acpi_rsconvert_info acpi_rs_convert_gpio[]; 297 + extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[]; 298 + extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[]; 299 + extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[]; 300 + extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[]; 325 301 326 302 /* These resources require separate get/set tables */ 327 303 ··· 344 310 * rsinfo 345 311 */ 346 312 extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[]; 313 + extern struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[]; 347 314 348 315 /* 349 316 * rsdump ··· 366 331 extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[]; 367 332 extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; 368 333 extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; 334 + extern struct acpi_rsdump_info acpi_rs_dump_gpio[]; 335 + extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[]; 336 + extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[]; 337 + extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[]; 338 + extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[]; 339 + extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[]; 369 340 #endif 370 341 371 342 #endif /* __ACRESRC_H__ */
+1 -1
drivers/acpi/acpica/acstruct.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/actables.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+20 -1
drivers/acpi/acpica/acutils.h
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 45 45 #define _ACUTILS_H 46 46 47 47 extern const u8 acpi_gbl_resource_aml_sizes[]; 48 + extern const u8 acpi_gbl_resource_aml_serial_bus_sizes[]; 48 49 49 50 /* Strings used by the disassembler and debugger resource dump routines */ 50 51 ··· 578 577 u16 object_size, struct acpi_memory_list **return_cache); 579 578 580 579 #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 580 + 581 + /* 582 + * utaddress - address range check 583 + */ 584 + acpi_status 585 + acpi_ut_add_address_range(acpi_adr_space_type space_id, 586 + acpi_physical_address address, 587 + u32 length, struct acpi_namespace_node *region_node); 588 + 589 + void 590 + acpi_ut_remove_address_range(acpi_adr_space_type space_id, 591 + struct acpi_namespace_node *region_node); 592 + 593 + u32 594 + acpi_ut_check_address_range(acpi_adr_space_type space_id, 595 + acpi_physical_address address, u32 length, u8 warn); 596 + 597 + void acpi_ut_delete_address_lists(void); 581 598 582 599 /* 583 600 * utxferror - various error/warning output functions
+21 -8
drivers/acpi/acpica/amlcode.h
··· 7 7 *****************************************************************************/ 8 8 9 9 /* 10 - * Copyright (C) 2000 - 2011, Intel Corp. 10 + * Copyright (C) 2000 - 2012, Intel Corp. 11 11 * All rights reserved. 12 12 * 13 13 * Redistribution and use in source and binary forms, with or without ··· 189 189 #define AML_LNOTEQUAL_OP (u16) 0x9293 190 190 191 191 /* 192 + * Opcodes for "Field" operators 193 + */ 194 + #define AML_FIELD_OFFSET_OP (u8) 0x00 195 + #define AML_FIELD_ACCESS_OP (u8) 0x01 196 + #define AML_FIELD_CONNECTION_OP (u8) 0x02 /* ACPI 5.0 */ 197 + #define AML_FIELD_EXT_ACCESS_OP (u8) 0x03 /* ACPI 5.0 */ 198 + 199 + /* 192 200 * Internal opcodes 193 201 * Use only "Unknown" AML opcodes, don't attempt to use 194 202 * any valid ACPI ASCII values (A-Z, 0-9, '-') ··· 210 202 #define AML_INT_METHODCALL_OP (u16) 0x0035 211 203 #define AML_INT_RETURN_VALUE_OP (u16) 0x0036 212 204 #define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 205 + #define AML_INT_CONNECTION_OP (u16) 0x0038 206 + #define AML_INT_EXTACCESSFIELD_OP (u16) 0x0039 213 207 214 208 #define ARG_NONE 0x0 215 209 ··· 466 456 * access_as keyword 467 457 */ 468 458 typedef enum { 469 - AML_FIELD_ATTRIB_SMB_QUICK = 0x02, 470 - AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, 471 - AML_FIELD_ATTRIB_SMB_BYTE = 0x06, 472 - AML_FIELD_ATTRIB_SMB_WORD = 0x08, 473 - AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, 474 - AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, 475 - AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D 459 + AML_FIELD_ATTRIB_QUICK = 0x02, 460 + AML_FIELD_ATTRIB_SEND_RCV = 0x04, 461 + AML_FIELD_ATTRIB_BYTE = 0x06, 462 + AML_FIELD_ATTRIB_WORD = 0x08, 463 + AML_FIELD_ATTRIB_BLOCK = 0x0A, 464 + AML_FIELD_ATTRIB_MULTIBYTE = 0x0B, 465 + AML_FIELD_ATTRIB_WORD_CALL = 0x0C, 466 + AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D, 467 + AML_FIELD_ATTRIB_RAW_BYTES = 0x0E, 468 + AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F 476 469 } AML_ACCESS_ATTRIBUTE; 477 470 478 471 /* Bit fields in the AML method_flags byte */
+137 -1
drivers/acpi/acpica/amlresrc.h
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 58 58 #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" 59 59 #define ACPI_RESTAG_BASEADDRESS "_BAS" 60 60 #define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ 61 + #define ACPI_RESTAG_DEBOUNCETIME "_DBT" 61 62 #define ACPI_RESTAG_DECODE "_DEC" 63 + #define ACPI_RESTAG_DEVICEPOLARITY "_DPL" 62 64 #define ACPI_RESTAG_DMA "_DMA" 63 65 #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 66 + #define ACPI_RESTAG_DRIVESTRENGTH "_DRS" 67 + #define ACPI_RESTAG_ENDIANNESS "_END" 68 + #define ACPI_RESTAG_FLOWCONTROL "_FLC" 64 69 #define ACPI_RESTAG_GRANULARITY "_GRA" 65 70 #define ACPI_RESTAG_INTERRUPT "_INT" 66 71 #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 67 72 #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 68 73 #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 74 + #define ACPI_RESTAG_IORESTRICTION "_IOR" 69 75 #define ACPI_RESTAG_LENGTH "_LEN" 76 + #define ACPI_RESTAG_LINE "_LIN" 70 77 #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 71 78 #define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 72 79 #define ACPI_RESTAG_MAXADDR "_MAX" 73 80 #define ACPI_RESTAG_MINADDR "_MIN" 74 81 #define ACPI_RESTAG_MAXTYPE "_MAF" 75 82 #define ACPI_RESTAG_MINTYPE "_MIF" 83 + #define ACPI_RESTAG_MODE "_MOD" 84 + #define ACPI_RESTAG_PARITY "_PAR" 85 + #define ACPI_RESTAG_PHASE "_PHA" 86 + #define ACPI_RESTAG_PIN "_PIN" 87 + #define ACPI_RESTAG_PINCONFIG "_PPI" 88 + #define ACPI_RESTAG_POLARITY "_POL" 76 89 #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 77 90 #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" 78 91 #define ACPI_RESTAG_RANGETYPE "_RNG" 79 92 #define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 93 + #define ACPI_RESTAG_LENGTH_RX "_RXL" 94 + #define ACPI_RESTAG_LENGTH_TX "_TXL" 95 + #define ACPI_RESTAG_SLAVEMODE "_SLV" 96 + #define ACPI_RESTAG_SPEED "_SPE" 97 + #define ACPI_RESTAG_STOPBITS "_STB" 80 98 #define ACPI_RESTAG_TRANSLATION "_TRA" 81 99 #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 82 100 #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ 83 101 #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ 102 + #define ACPI_RESTAG_VENDORDATA "_VEN" 84 103 85 104 /* Default sizes for "small" resource descriptors */ 86 105 ··· 109 90 #define ASL_RDESC_END_DEPEND_SIZE 0x00 110 91 #define ASL_RDESC_IO_SIZE 0x07 111 92 #define ASL_RDESC_FIXED_IO_SIZE 0x03 93 + #define ASL_RDESC_FIXED_DMA_SIZE 0x05 112 94 #define ASL_RDESC_END_TAG_SIZE 0x01 113 95 114 96 struct asl_resource_node { ··· 182 162 183 163 struct aml_resource_end_tag { 184 164 AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum; 165 + }; 166 + 167 + struct aml_resource_fixed_dma { 168 + AML_RESOURCE_SMALL_HEADER_COMMON u16 request_lines; 169 + u16 channels; 170 + u8 width; 185 171 }; 186 172 187 173 /* ··· 289 263 u64 address; 290 264 }; 291 265 266 + /* Common descriptor for gpio_int and gpio_io (ACPI 5.0) */ 267 + 268 + struct aml_resource_gpio { 269 + AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id; 270 + u8 connection_type; 271 + u16 flags; 272 + u16 int_flags; 273 + u8 pin_config; 274 + u16 drive_strength; 275 + u16 debounce_timeout; 276 + u16 pin_table_offset; 277 + u8 res_source_index; 278 + u16 res_source_offset; 279 + u16 vendor_offset; 280 + u16 vendor_length; 281 + /* 282 + * Optional fields follow immediately: 283 + * 1) PIN list (Words) 284 + * 2) Resource Source String 285 + * 3) Vendor Data bytes 286 + */ 287 + }; 288 + 289 + #define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */ 290 + 291 + /* Values for connection_type above */ 292 + 293 + #define AML_RESOURCE_GPIO_TYPE_INT 0 294 + #define AML_RESOURCE_GPIO_TYPE_IO 1 295 + #define AML_RESOURCE_MAX_GPIOTYPE 1 296 + 297 + /* Common preamble for all serial descriptors (ACPI 5.0) */ 298 + 299 + #define AML_RESOURCE_SERIAL_COMMON \ 300 + u8 revision_id; \ 301 + u8 res_source_index; \ 302 + u8 type; \ 303 + u8 flags; \ 304 + u16 type_specific_flags; \ 305 + u8 type_revision_id; \ 306 + u16 type_data_length; \ 307 + 308 + /* Values for the type field above */ 309 + 310 + #define AML_RESOURCE_I2C_SERIALBUSTYPE 1 311 + #define AML_RESOURCE_SPI_SERIALBUSTYPE 2 312 + #define AML_RESOURCE_UART_SERIALBUSTYPE 3 313 + #define AML_RESOURCE_MAX_SERIALBUSTYPE 3 314 + #define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */ 315 + 316 + struct aml_resource_common_serialbus { 317 + AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON}; 318 + 319 + struct aml_resource_i2c_serialbus { 320 + AML_RESOURCE_LARGE_HEADER_COMMON 321 + AML_RESOURCE_SERIAL_COMMON u32 connection_speed; 322 + u16 slave_address; 323 + /* 324 + * Optional fields follow immediately: 325 + * 1) Vendor Data bytes 326 + * 2) Resource Source String 327 + */ 328 + }; 329 + 330 + #define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */ 331 + #define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */ 332 + #define AML_RESOURCE_I2C_MIN_DATA_LEN 6 333 + 334 + struct aml_resource_spi_serialbus { 335 + AML_RESOURCE_LARGE_HEADER_COMMON 336 + AML_RESOURCE_SERIAL_COMMON u32 connection_speed; 337 + u8 data_bit_length; 338 + u8 clock_phase; 339 + u8 clock_polarity; 340 + u16 device_selection; 341 + /* 342 + * Optional fields follow immediately: 343 + * 1) Vendor Data bytes 344 + * 2) Resource Source String 345 + */ 346 + }; 347 + 348 + #define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */ 349 + #define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */ 350 + #define AML_RESOURCE_SPI_MIN_DATA_LEN 9 351 + 352 + struct aml_resource_uart_serialbus { 353 + AML_RESOURCE_LARGE_HEADER_COMMON 354 + AML_RESOURCE_SERIAL_COMMON u32 default_baud_rate; 355 + u16 rx_fifo_size; 356 + u16 tx_fifo_size; 357 + u8 parity; 358 + u8 lines_enabled; 359 + /* 360 + * Optional fields follow immediately: 361 + * 1) Vendor Data bytes 362 + * 2) Resource Source String 363 + */ 364 + }; 365 + 366 + #define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */ 367 + #define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ 368 + #define AML_RESOURCE_UART_MIN_DATA_LEN 10 369 + 292 370 /* restore default alignment */ 293 371 294 372 #pragma pack() ··· 414 284 struct aml_resource_end_dependent end_dpf; 415 285 struct aml_resource_io io; 416 286 struct aml_resource_fixed_io fixed_io; 287 + struct aml_resource_fixed_dma fixed_dma; 417 288 struct aml_resource_vendor_small vendor_small; 418 289 struct aml_resource_end_tag end_tag; 419 290 ··· 430 299 struct aml_resource_address64 address64; 431 300 struct aml_resource_extended_address64 ext_address64; 432 301 struct aml_resource_extended_irq extended_irq; 302 + struct aml_resource_gpio gpio; 303 + struct aml_resource_i2c_serialbus i2c_serial_bus; 304 + struct aml_resource_spi_serialbus spi_serial_bus; 305 + struct aml_resource_uart_serialbus uart_serial_bus; 306 + struct aml_resource_common_serialbus common_serial_bus; 433 307 434 308 /* Utility overlays */ 435 309
+16 -2
drivers/acpi/acpica/dsargs.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 250 250 status = acpi_ds_execute_arguments(node, node->parent, 251 251 extra_desc->extra.aml_length, 252 252 extra_desc->extra.aml_start); 253 + if (ACPI_FAILURE(status)) { 254 + return_ACPI_STATUS(status); 255 + } 256 + 257 + status = acpi_ut_add_address_range(obj_desc->region.space_id, 258 + obj_desc->region.address, 259 + obj_desc->region.length, node); 253 260 return_ACPI_STATUS(status); 254 261 } 255 262 ··· 391 384 392 385 /* Execute the argument AML */ 393 386 394 - status = acpi_ds_execute_arguments(node, node->parent, 387 + status = acpi_ds_execute_arguments(node, extra_desc->extra.scope_node, 395 388 extra_desc->extra.aml_length, 396 389 extra_desc->extra.aml_start); 390 + if (ACPI_FAILURE(status)) { 391 + return_ACPI_STATUS(status); 392 + } 393 + 394 + status = acpi_ut_add_address_range(obj_desc->region.space_id, 395 + obj_desc->region.address, 396 + obj_desc->region.length, node); 397 397 return_ACPI_STATUS(status); 398 398 }
+1 -1
drivers/acpi/acpica/dscontrol.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+67 -16
drivers/acpi/acpica/dsfield.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 221 221 { 222 222 acpi_status status; 223 223 u64 position; 224 + union acpi_parse_object *child; 224 225 225 226 ACPI_FUNCTION_TRACE_PTR(ds_get_field_names, info); 226 227 ··· 233 232 234 233 while (arg) { 235 234 /* 236 - * Three types of field elements are handled: 237 - * 1) Offset - specifies a bit offset 238 - * 2) access_as - changes the access mode 239 - * 3) Name - Enters a new named field into the namespace 235 + * Four types of field elements are handled: 236 + * 1) Name - Enters a new named field into the namespace 237 + * 2) Offset - specifies a bit offset 238 + * 3) access_as - changes the access mode/attributes 239 + * 4) Connection - Associate a resource template with the field 240 240 */ 241 241 switch (arg->common.aml_opcode) { 242 242 case AML_INT_RESERVEDFIELD_OP: ··· 255 253 break; 256 254 257 255 case AML_INT_ACCESSFIELD_OP: 258 - 256 + case AML_INT_EXTACCESSFIELD_OP: 259 257 /* 260 - * Get a new access_type and access_attribute -- to be used for all 261 - * field units that follow, until field end or another access_as 262 - * keyword. 258 + * Get new access_type, access_attribute, and access_length fields 259 + * -- to be used for all field units that follow, until the 260 + * end-of-field or another access_as keyword is encountered. 261 + * NOTE. These three bytes are encoded in the integer value 262 + * of the parseop for convenience. 263 263 * 264 264 * In field_flags, preserve the flag bits other than the 265 - * ACCESS_TYPE bits 265 + * ACCESS_TYPE bits. 266 266 */ 267 + 268 + /* access_type (byte_acc, word_acc, etc.) */ 269 + 267 270 info->field_flags = (u8) 268 271 ((info-> 269 272 field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | 270 - ((u8) ((u32) arg->common.value.integer >> 8))); 273 + ((u8)((u32)(arg->common.value.integer & 0x07)))); 271 274 272 - info->attribute = (u8) (arg->common.value.integer); 275 + /* access_attribute (attrib_quick, attrib_byte, etc.) */ 276 + 277 + info->attribute = 278 + (u8)((arg->common.value.integer >> 8) & 0xFF); 279 + 280 + /* access_length (for serial/buffer protocols) */ 281 + 282 + info->access_length = 283 + (u8)((arg->common.value.integer >> 16) & 0xFF); 284 + break; 285 + 286 + case AML_INT_CONNECTION_OP: 287 + /* 288 + * Clear any previous connection. New connection is used for all 289 + * fields that follow, similar to access_as 290 + */ 291 + info->resource_buffer = NULL; 292 + info->connection_node = NULL; 293 + 294 + /* 295 + * A Connection() is either an actual resource descriptor (buffer) 296 + * or a named reference to a resource template 297 + */ 298 + child = arg->common.value.arg; 299 + if (child->common.aml_opcode == AML_INT_BYTELIST_OP) { 300 + info->resource_buffer = child->named.data; 301 + info->resource_length = 302 + (u16)child->named.value.integer; 303 + } else { 304 + /* Lookup the Connection() namepath, it should already exist */ 305 + 306 + status = acpi_ns_lookup(walk_state->scope_info, 307 + child->common.value. 308 + name, ACPI_TYPE_ANY, 309 + ACPI_IMODE_EXECUTE, 310 + ACPI_NS_DONT_OPEN_SCOPE, 311 + walk_state, 312 + &info->connection_node); 313 + if (ACPI_FAILURE(status)) { 314 + ACPI_ERROR_NAMESPACE(child->common. 315 + value.name, 316 + status); 317 + return_ACPI_STATUS(status); 318 + } 319 + } 273 320 break; 274 321 275 322 case AML_INT_NAMEDFIELD_OP: ··· 425 374 } 426 375 } 427 376 377 + ACPI_MEMSET(&info, 0, sizeof(struct acpi_create_field_info)); 378 + 428 379 /* Second arg is the field flags */ 429 380 430 381 arg = arg->common.next; ··· 439 386 info.region_node = region_node; 440 387 441 388 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); 442 - 443 389 return_ACPI_STATUS(status); 444 390 } 445 391 ··· 526 474 */ 527 475 while (arg) { 528 476 /* 529 - * Ignore OFFSET and ACCESSAS terms here; we are only interested in the 530 - * field names in order to enter them into the namespace. 477 + * Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested 478 + * in the field names in order to enter them into the namespace. 531 479 */ 532 480 if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) { 533 481 status = acpi_ns_lookup(walk_state->scope_info, ··· 703 651 info.region_node = region_node; 704 652 705 653 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); 706 - 707 654 return_ACPI_STATUS(status); 708 655 }
+1 -1
drivers/acpi/acpica/dsinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsmethod.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsmthdat.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsobject.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsopcode.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dsutils.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswexec.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswload.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswload2.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswscope.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/dswstate.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+13 -1
drivers/acpi/acpica/evevent.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 71 71 72 72 ACPI_FUNCTION_TRACE(ev_initialize_events); 73 73 74 + /* If Hardware Reduced flag is set, there are no fixed events */ 75 + 76 + if (acpi_gbl_reduced_hardware) { 77 + return_ACPI_STATUS(AE_OK); 78 + } 79 + 74 80 /* 75 81 * Initialize the Fixed and General Purpose Events. This is done prior to 76 82 * enabling SCIs to prevent interrupts from occurring before the handlers ··· 116 110 acpi_status status; 117 111 118 112 ACPI_FUNCTION_TRACE(ev_install_xrupt_handlers); 113 + 114 + /* If Hardware Reduced flag is set, there is no ACPI h/w */ 115 + 116 + if (acpi_gbl_reduced_hardware) { 117 + return_ACPI_STATUS(AE_OK); 118 + } 119 119 120 120 /* Install the SCI handler */ 121 121
+7 -1
drivers/acpi/acpica/evglock.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 69 69 acpi_status status; 70 70 71 71 ACPI_FUNCTION_TRACE(ev_init_global_lock_handler); 72 + 73 + /* If Hardware Reduced flag is set, there is no global lock */ 74 + 75 + if (acpi_gbl_reduced_hardware) { 76 + return_ACPI_STATUS(AE_OK); 77 + } 72 78 73 79 /* Attempt installation of the global lock handler */ 74 80
+1 -1
drivers/acpi/acpica/evgpe.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evgpeblk.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evgpeinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evgpeutil.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evmisc.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+27 -4
drivers/acpi/acpica/evregion.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 329 329 * FUNCTION: acpi_ev_address_space_dispatch 330 330 * 331 331 * PARAMETERS: region_obj - Internal region object 332 + * field_obj - Corresponding field. Can be NULL. 332 333 * Function - Read or Write operation 333 334 * region_offset - Where in the region to read or write 334 335 * bit_width - Field width in bits (8, 16, 32, or 64) ··· 345 344 346 345 acpi_status 347 346 acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 347 + union acpi_operand_object *field_obj, 348 348 u32 function, 349 349 u32 region_offset, u32 bit_width, u64 *value) 350 350 { ··· 355 353 union acpi_operand_object *handler_desc; 356 354 union acpi_operand_object *region_obj2; 357 355 void *region_context = NULL; 356 + struct acpi_connection_info *context; 358 357 359 358 ACPI_FUNCTION_TRACE(ev_address_space_dispatch); 360 359 ··· 377 374 378 375 return_ACPI_STATUS(AE_NOT_EXIST); 379 376 } 377 + 378 + context = handler_desc->address_space.context; 380 379 381 380 /* 382 381 * It may be the case that the region has never been initialized. ··· 409 404 acpi_ex_exit_interpreter(); 410 405 411 406 status = region_setup(region_obj, ACPI_REGION_ACTIVATE, 412 - handler_desc->address_space.context, 413 - &region_context); 407 + context, &region_context); 414 408 415 409 /* Re-enter the interpreter */ 416 410 ··· 459 455 acpi_ut_get_region_name(region_obj->region. 460 456 space_id))); 461 457 458 + /* 459 + * Special handling for generic_serial_bus and general_purpose_io: 460 + * There are three extra parameters that must be passed to the 461 + * handler via the context: 462 + * 1) Connection buffer, a resource template from Connection() op. 463 + * 2) Length of the above buffer. 464 + * 3) Actual access length from the access_as() op. 465 + */ 466 + if (((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) || 467 + (region_obj->region.space_id == ACPI_ADR_SPACE_GPIO)) && 468 + context && field_obj) { 469 + 470 + /* Get the Connection (resource_template) buffer */ 471 + 472 + context->connection = field_obj->field.resource_buffer; 473 + context->length = field_obj->field.resource_length; 474 + context->access_length = field_obj->field.access_length; 475 + } 476 + 462 477 if (!(handler_desc->address_space.handler_flags & 463 478 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { 464 479 /* ··· 492 469 493 470 status = handler(function, 494 471 (region_obj->region.address + region_offset), 495 - bit_width, value, handler_desc->address_space.context, 472 + bit_width, value, context, 496 473 region_obj2->extra.region_context); 497 474 498 475 if (ACPI_FAILURE(status)) {
+1 -1
drivers/acpi/acpica/evrgnini.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evsci.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxface.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxfevnt.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxfgpe.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/evxfregn.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+4 -4
drivers/acpi/acpica/exconfig.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 297 297 /* Bytewise reads */ 298 298 299 299 for (i = 0; i < length; i++) { 300 - status = acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, 301 - region_offset, 8, 302 - &value); 300 + status = 301 + acpi_ev_address_space_dispatch(obj_desc, NULL, ACPI_READ, 302 + region_offset, 8, &value); 303 303 if (ACPI_FAILURE(status)) { 304 304 return status; 305 305 }
+1 -1
drivers/acpi/acpica/exconvrt.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+20 -11
drivers/acpi/acpica/excreate.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 267 267 * 268 268 * PARAMETERS: aml_start - Pointer to the region declaration AML 269 269 * aml_length - Max length of the declaration AML 270 - * region_space - space_iD for the region 270 + * space_id - Address space ID for the region 271 271 * walk_state - Current state 272 272 * 273 273 * RETURN: Status ··· 279 279 acpi_status 280 280 acpi_ex_create_region(u8 * aml_start, 281 281 u32 aml_length, 282 - u8 region_space, struct acpi_walk_state *walk_state) 282 + u8 space_id, struct acpi_walk_state *walk_state) 283 283 { 284 284 acpi_status status; 285 285 union acpi_operand_object *obj_desc; ··· 304 304 * Space ID must be one of the predefined IDs, or in the user-defined 305 305 * range 306 306 */ 307 - if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) && 308 - (region_space < ACPI_USER_REGION_BEGIN) && 309 - (region_space != ACPI_ADR_SPACE_DATA_TABLE)) { 310 - ACPI_ERROR((AE_INFO, "Invalid AddressSpace type 0x%X", 311 - region_space)); 312 - return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID); 307 + if (!acpi_is_valid_space_id(space_id)) { 308 + /* 309 + * Print an error message, but continue. We don't want to abort 310 + * a table load for this exception. Instead, if the region is 311 + * actually used at runtime, abort the executing method. 312 + */ 313 + ACPI_ERROR((AE_INFO, 314 + "Invalid/unknown Address Space ID: 0x%2.2X", 315 + space_id)); 313 316 } 314 317 315 318 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", 316 - acpi_ut_get_region_name(region_space), region_space)); 319 + acpi_ut_get_region_name(space_id), space_id)); 317 320 318 321 /* Create the region descriptor */ 319 322 ··· 333 330 region_obj2 = obj_desc->common.next_object; 334 331 region_obj2->extra.aml_start = aml_start; 335 332 region_obj2->extra.aml_length = aml_length; 333 + if (walk_state->scope_info) { 334 + region_obj2->extra.scope_node = 335 + walk_state->scope_info->scope.node; 336 + } else { 337 + region_obj2->extra.scope_node = node; 338 + } 336 339 337 340 /* Init the region from the operands */ 338 341 339 - obj_desc->region.space_id = region_space; 342 + obj_desc->region.space_id = space_id; 340 343 obj_desc->region.address = 0; 341 344 obj_desc->region.length = 0; 342 345 obj_desc->region.node = node;
+1 -1
drivers/acpi/acpica/exdebug.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+6 -3
drivers/acpi/acpica/exdump.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 192 192 "Buffer Object"} 193 193 }; 194 194 195 - static struct acpi_exdump_info acpi_ex_dump_region_field[3] = { 195 + static struct acpi_exdump_info acpi_ex_dump_region_field[5] = { 196 196 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region_field), NULL}, 197 197 {ACPI_EXD_FIELD, 0, NULL}, 198 - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.region_obj), "Region Object"} 198 + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(field.access_length), "AccessLength"}, 199 + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.region_obj), "Region Object"}, 200 + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(field.resource_buffer), 201 + "ResourceBuffer"} 199 202 }; 200 203 201 204 static struct acpi_exdump_info acpi_ex_dump_bank_field[5] = {
+22 -8
drivers/acpi/acpica/exfield.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 100 100 (obj_desc->field.region_obj->region.space_id == 101 101 ACPI_ADR_SPACE_SMBUS 102 102 || obj_desc->field.region_obj->region.space_id == 103 + ACPI_ADR_SPACE_GSBUS 104 + || obj_desc->field.region_obj->region.space_id == 103 105 ACPI_ADR_SPACE_IPMI)) { 104 106 /* 105 - * This is an SMBus or IPMI read. We must create a buffer to hold 107 + * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold 106 108 * the data and then directly access the region handler. 107 109 * 108 - * Note: Smbus protocol value is passed in upper 16-bits of Function 110 + * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function 109 111 */ 110 112 if (obj_desc->field.region_obj->region.space_id == 111 113 ACPI_ADR_SPACE_SMBUS) { 112 114 length = ACPI_SMBUS_BUFFER_SIZE; 115 + function = 116 + ACPI_READ | (obj_desc->field.attribute << 16); 117 + } else if (obj_desc->field.region_obj->region.space_id == 118 + ACPI_ADR_SPACE_GSBUS) { 119 + length = ACPI_GSBUS_BUFFER_SIZE; 113 120 function = 114 121 ACPI_READ | (obj_desc->field.attribute << 16); 115 122 } else { /* IPMI */ ··· 255 248 (obj_desc->field.region_obj->region.space_id == 256 249 ACPI_ADR_SPACE_SMBUS 257 250 || obj_desc->field.region_obj->region.space_id == 251 + ACPI_ADR_SPACE_GSBUS 252 + || obj_desc->field.region_obj->region.space_id == 258 253 ACPI_ADR_SPACE_IPMI)) { 259 254 /* 260 - * This is an SMBus or IPMI write. We will bypass the entire field 255 + * This is an SMBus, GSBus or IPMI write. We will bypass the entire field 261 256 * mechanism and handoff the buffer directly to the handler. For 262 257 * these address spaces, the buffer is bi-directional; on a write, 263 258 * return data is returned in the same buffer. 264 259 * 265 260 * Source must be a buffer of sufficient size: 266 - * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. 261 + * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. 267 262 * 268 - * Note: SMBus protocol type is passed in upper 16-bits of Function 263 + * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function 269 264 */ 270 265 if (source_desc->common.type != ACPI_TYPE_BUFFER) { 271 266 ACPI_ERROR((AE_INFO, 272 - "SMBus or IPMI write requires Buffer, found type %s", 267 + "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", 273 268 acpi_ut_get_object_type_name(source_desc))); 274 269 275 270 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); ··· 282 273 length = ACPI_SMBUS_BUFFER_SIZE; 283 274 function = 284 275 ACPI_WRITE | (obj_desc->field.attribute << 16); 276 + } else if (obj_desc->field.region_obj->region.space_id == 277 + ACPI_ADR_SPACE_GSBUS) { 278 + length = ACPI_GSBUS_BUFFER_SIZE; 279 + function = 280 + ACPI_WRITE | (obj_desc->field.attribute << 16); 285 281 } else { /* IPMI */ 286 282 287 283 length = ACPI_IPMI_BUFFER_SIZE; ··· 295 281 296 282 if (source_desc->buffer.length < length) { 297 283 ACPI_ERROR((AE_INFO, 298 - "SMBus or IPMI write requires Buffer of length %u, found length %u", 284 + "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", 299 285 length, source_desc->buffer.length)); 300 286 301 287 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
+29 -9
drivers/acpi/acpica/exfldio.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 86 86 { 87 87 acpi_status status = AE_OK; 88 88 union acpi_operand_object *rgn_desc; 89 + u8 space_id; 89 90 90 91 ACPI_FUNCTION_TRACE_U32(ex_setup_region, field_datum_byte_offset); 91 92 ··· 100 99 acpi_ut_get_object_type_name(rgn_desc))); 101 100 102 101 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 102 + } 103 + 104 + space_id = rgn_desc->region.space_id; 105 + 106 + /* Validate the Space ID */ 107 + 108 + if (!acpi_is_valid_space_id(space_id)) { 109 + ACPI_ERROR((AE_INFO, 110 + "Invalid/unknown Address Space ID: 0x%2.2X", 111 + space_id)); 112 + return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID); 103 113 } 104 114 105 115 /* ··· 131 119 } 132 120 133 121 /* 134 - * Exit now for SMBus or IPMI address space, it has a non-linear 122 + * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear 135 123 * address space and the request cannot be directly validated 136 124 */ 137 - if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS || 138 - rgn_desc->region.space_id == ACPI_ADR_SPACE_IPMI) { 125 + if (space_id == ACPI_ADR_SPACE_SMBUS || 126 + space_id == ACPI_ADR_SPACE_GSBUS || 127 + space_id == ACPI_ADR_SPACE_IPMI) { 139 128 140 129 /* SMBus or IPMI has a non-linear address space */ 141 130 ··· 284 271 285 272 /* Invoke the appropriate address_space/op_region handler */ 286 273 287 - status = 288 - acpi_ev_address_space_dispatch(rgn_desc, function, region_offset, 289 - ACPI_MUL_8(obj_desc->common_field. 290 - access_byte_width), 291 - value); 274 + status = acpi_ev_address_space_dispatch(rgn_desc, obj_desc, 275 + function, region_offset, 276 + ACPI_MUL_8(obj_desc-> 277 + common_field. 278 + access_byte_width), 279 + value); 292 280 293 281 if (ACPI_FAILURE(status)) { 294 282 if (status == AE_NOT_IMPLEMENTED) { ··· 330 316 static u8 331 317 acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value) 332 318 { 319 + ACPI_FUNCTION_NAME(ex_register_overflow); 333 320 334 321 if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) { 335 322 /* ··· 345 330 * The Value is larger than the maximum value that can fit into 346 331 * the register. 347 332 */ 333 + ACPI_ERROR((AE_INFO, 334 + "Index value 0x%8.8X%8.8X overflows field width 0x%X", 335 + ACPI_FORMAT_UINT64(value), 336 + obj_desc->common_field.bit_length)); 337 + 348 338 return (TRUE); 349 339 } 350 340
+1 -1
drivers/acpi/acpica/exmisc.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exmutex.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exnames.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg1.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg2.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg3.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exoparg6.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+26 -1
drivers/acpi/acpica/exprep.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 47 47 #include "acinterp.h" 48 48 #include "amlcode.h" 49 49 #include "acnamesp.h" 50 + #include "acdispat.h" 50 51 51 52 #define _COMPONENT ACPI_EXECUTER 52 53 ACPI_MODULE_NAME("exprep") ··· 455 454 456 455 obj_desc->field.region_obj = 457 456 acpi_ns_get_attached_object(info->region_node); 457 + 458 + /* Fields specific to generic_serial_bus fields */ 459 + 460 + obj_desc->field.access_length = info->access_length; 461 + 462 + if (info->connection_node) { 463 + second_desc = info->connection_node->object; 464 + if (!(second_desc->common.flags & AOPOBJ_DATA_VALID)) { 465 + status = 466 + acpi_ds_get_buffer_arguments(second_desc); 467 + if (ACPI_FAILURE(status)) { 468 + acpi_ut_delete_object_desc(obj_desc); 469 + return_ACPI_STATUS(status); 470 + } 471 + } 472 + 473 + obj_desc->field.resource_buffer = 474 + second_desc->buffer.pointer; 475 + obj_desc->field.resource_length = 476 + (u16)second_desc->buffer.length; 477 + } else if (info->resource_buffer) { 478 + obj_desc->field.resource_buffer = info->resource_buffer; 479 + obj_desc->field.resource_length = info->resource_length; 480 + } 458 481 459 482 /* Allow full data read from EC address space */ 460 483
+1 -1
drivers/acpi/acpica/exregion.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exresnte.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exresolv.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exresop.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exstore.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exstoren.c
··· 7 7 *****************************************************************************/ 8 8 9 9 /* 10 - * Copyright (C) 2000 - 2011, Intel Corp. 10 + * Copyright (C) 2000 - 2012, Intel Corp. 11 11 * All rights reserved. 12 12 * 13 13 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exstorob.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/exsystem.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+26 -1
drivers/acpi/acpica/exutils.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 433 433 (void)acpi_ut_short_divide(value, 10, &value, &remainder); 434 434 out_string[count - 1] = (char)('0' + remainder); 435 435 } 436 + } 437 + 438 + /******************************************************************************* 439 + * 440 + * FUNCTION: acpi_is_valid_space_id 441 + * 442 + * PARAMETERS: space_id - ID to be validated 443 + * 444 + * RETURN: TRUE if valid/supported ID. 445 + * 446 + * DESCRIPTION: Validate an operation region space_iD. 447 + * 448 + ******************************************************************************/ 449 + 450 + u8 acpi_is_valid_space_id(u8 space_id) 451 + { 452 + 453 + if ((space_id >= ACPI_NUM_PREDEFINED_REGIONS) && 454 + (space_id < ACPI_USER_REGION_BEGIN) && 455 + (space_id != ACPI_ADR_SPACE_DATA_TABLE) && 456 + (space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) { 457 + return (FALSE); 458 + } 459 + 460 + return (TRUE); 436 461 } 437 462 438 463 #endif
+1 -1
drivers/acpi/acpica/hwacpi.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwgpe.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwpci.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwregs.c
··· 7 7 ******************************************************************************/ 8 8 9 9 /* 10 - * Copyright (C) 2000 - 2011, Intel Corp. 10 + * Copyright (C) 2000 - 2012, Intel Corp. 11 11 * All rights reserved. 12 12 * 13 13 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwsleep.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/hwtimer.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+3 -1
drivers/acpi/acpica/hwvalid.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 134 134 /* Supported widths are 8/16/32 */ 135 135 136 136 if ((bit_width != 8) && (bit_width != 16) && (bit_width != 32)) { 137 + ACPI_ERROR((AE_INFO, 138 + "Bad BitWidth parameter: %8.8X", bit_width)); 137 139 return AE_BAD_PARAMETER; 138 140 } 139 141
+1 -1
drivers/acpi/acpica/hwxface.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsaccess.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsalloc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsdump.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsdumpdv.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nseval.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsload.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsnames.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsobject.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsparse.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+30 -1
drivers/acpi/acpica/nspredef.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 620 620 case ACPI_PTYPE2_FIXED: 621 621 case ACPI_PTYPE2_MIN: 622 622 case ACPI_PTYPE2_COUNT: 623 + case ACPI_PTYPE2_FIX_VAR: 623 624 624 625 /* 625 626 * These types all return a single Package that consists of a ··· 755 754 object_type2, 756 755 package->ret_info. 757 756 count2, 0); 757 + if (ACPI_FAILURE(status)) { 758 + return (status); 759 + } 760 + break; 761 + 762 + case ACPI_PTYPE2_FIX_VAR: 763 + /* 764 + * Each subpackage has a fixed number of elements and an 765 + * optional element 766 + */ 767 + expected_count = 768 + package->ret_info.count1 + package->ret_info.count2; 769 + if (sub_package->package.count < expected_count) { 770 + goto package_too_small; 771 + } 772 + 773 + status = 774 + acpi_ns_check_package_elements(data, sub_elements, 775 + package->ret_info. 776 + object_type1, 777 + package->ret_info. 778 + count1, 779 + package->ret_info. 780 + object_type2, 781 + sub_package->package. 782 + count - 783 + package->ret_info. 784 + count1, 0); 758 785 if (ACPI_FAILURE(status)) { 759 786 return (status); 760 787 }
+2 -1
drivers/acpi/acpica/nsrepair.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 634 634 case ACPI_PTYPE2_FIXED: 635 635 case ACPI_PTYPE2_MIN: 636 636 case ACPI_PTYPE2_REV_FIXED: 637 + case ACPI_PTYPE2_FIX_VAR: 637 638 break; 638 639 639 640 default:
+4 -3
drivers/acpi/acpica/nsrepair2.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without ··· 467 467 } 468 468 469 469 /* 470 - * Copy and uppercase the string. From the ACPI specification: 470 + * Copy and uppercase the string. From the ACPI 5.0 specification: 471 471 * 472 472 * A valid PNP ID must be of the form "AAA####" where A is an uppercase 473 473 * letter and # is a hex digit. A valid ACPI ID must be of the form 474 - * "ACPI####" where # is a hex digit. 474 + * "NNNN####" where N is an uppercase letter or decimal digit, and 475 + * # is a hex digit. 475 476 */ 476 477 for (dest = new_string->string.pointer; *source; dest++, source++) { 477 478 *dest = (char)ACPI_TOUPPER(*source);
+1 -1
drivers/acpi/acpica/nssearch.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsutils.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nswalk.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsxfeval.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsxfname.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/nsxfobj.c
··· 6 6 ******************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+130 -15
drivers/acpi/acpica/psargs.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 484 484 static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state 485 485 *parser_state) 486 486 { 487 - u32 aml_offset = (u32) 488 - ACPI_PTR_DIFF(parser_state->aml, 489 - parser_state->aml_start); 487 + u32 aml_offset; 490 488 union acpi_parse_object *field; 489 + union acpi_parse_object *arg = NULL; 491 490 u16 opcode; 492 491 u32 name; 492 + u8 access_type; 493 + u8 access_attribute; 494 + u8 access_length; 495 + u32 pkg_length; 496 + u8 *pkg_end; 497 + u32 buffer_length; 493 498 494 499 ACPI_FUNCTION_TRACE(ps_get_next_field); 500 + 501 + aml_offset = 502 + (u32)ACPI_PTR_DIFF(parser_state->aml, parser_state->aml_start); 495 503 496 504 /* Determine field type */ 497 505 498 506 switch (ACPI_GET8(parser_state->aml)) { 499 - default: 500 - 501 - opcode = AML_INT_NAMEDFIELD_OP; 502 - break; 503 - 504 - case 0x00: 507 + case AML_FIELD_OFFSET_OP: 505 508 506 509 opcode = AML_INT_RESERVEDFIELD_OP; 507 510 parser_state->aml++; 508 511 break; 509 512 510 - case 0x01: 513 + case AML_FIELD_ACCESS_OP: 511 514 512 515 opcode = AML_INT_ACCESSFIELD_OP; 513 516 parser_state->aml++; 517 + break; 518 + 519 + case AML_FIELD_CONNECTION_OP: 520 + 521 + opcode = AML_INT_CONNECTION_OP; 522 + parser_state->aml++; 523 + break; 524 + 525 + case AML_FIELD_EXT_ACCESS_OP: 526 + 527 + opcode = AML_INT_EXTACCESSFIELD_OP; 528 + parser_state->aml++; 529 + break; 530 + 531 + default: 532 + 533 + opcode = AML_INT_NAMEDFIELD_OP; 514 534 break; 515 535 } 516 536 ··· 569 549 break; 570 550 571 551 case AML_INT_ACCESSFIELD_OP: 552 + case AML_INT_EXTACCESSFIELD_OP: 572 553 573 554 /* 574 555 * Get access_type and access_attrib and merge into the field Op 575 - * access_type is first operand, access_attribute is second 556 + * access_type is first operand, access_attribute is second. stuff 557 + * these bytes into the node integer value for convenience. 576 558 */ 577 - field->common.value.integer = 578 - (((u32) ACPI_GET8(parser_state->aml) << 8)); 559 + 560 + /* Get the two bytes (Type/Attribute) */ 561 + 562 + access_type = ACPI_GET8(parser_state->aml); 579 563 parser_state->aml++; 580 - field->common.value.integer |= ACPI_GET8(parser_state->aml); 564 + access_attribute = ACPI_GET8(parser_state->aml); 581 565 parser_state->aml++; 566 + 567 + field->common.value.integer = (u8)access_type; 568 + field->common.value.integer |= (u16)(access_attribute << 8); 569 + 570 + /* This opcode has a third byte, access_length */ 571 + 572 + if (opcode == AML_INT_EXTACCESSFIELD_OP) { 573 + access_length = ACPI_GET8(parser_state->aml); 574 + parser_state->aml++; 575 + 576 + field->common.value.integer |= 577 + (u32)(access_length << 16); 578 + } 579 + break; 580 + 581 + case AML_INT_CONNECTION_OP: 582 + 583 + /* 584 + * Argument for Connection operator can be either a Buffer 585 + * (resource descriptor), or a name_string. 586 + */ 587 + if (ACPI_GET8(parser_state->aml) == AML_BUFFER_OP) { 588 + parser_state->aml++; 589 + 590 + pkg_end = parser_state->aml; 591 + pkg_length = 592 + acpi_ps_get_next_package_length(parser_state); 593 + pkg_end += pkg_length; 594 + 595 + if (parser_state->aml < pkg_end) { 596 + 597 + /* Non-empty list */ 598 + 599 + arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP); 600 + if (!arg) { 601 + return_PTR(NULL); 602 + } 603 + 604 + /* Get the actual buffer length argument */ 605 + 606 + opcode = ACPI_GET8(parser_state->aml); 607 + parser_state->aml++; 608 + 609 + switch (opcode) { 610 + case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ 611 + buffer_length = 612 + ACPI_GET8(parser_state->aml); 613 + parser_state->aml += 1; 614 + break; 615 + 616 + case AML_WORD_OP: /* AML_WORDDATA_ARG */ 617 + buffer_length = 618 + ACPI_GET16(parser_state->aml); 619 + parser_state->aml += 2; 620 + break; 621 + 622 + case AML_DWORD_OP: /* AML_DWORDATA_ARG */ 623 + buffer_length = 624 + ACPI_GET32(parser_state->aml); 625 + parser_state->aml += 4; 626 + break; 627 + 628 + default: 629 + buffer_length = 0; 630 + break; 631 + } 632 + 633 + /* Fill in bytelist data */ 634 + 635 + arg->named.value.size = buffer_length; 636 + arg->named.data = parser_state->aml; 637 + } 638 + 639 + /* Skip to End of byte data */ 640 + 641 + parser_state->aml = pkg_end; 642 + } else { 643 + arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP); 644 + if (!arg) { 645 + return_PTR(NULL); 646 + } 647 + 648 + /* Get the Namestring argument */ 649 + 650 + arg->common.value.name = 651 + acpi_ps_get_next_namestring(parser_state); 652 + } 653 + 654 + /* Link the buffer/namestring to parent (CONNECTION_OP) */ 655 + 656 + acpi_ps_append_arg(field, arg); 582 657 break; 583 658 584 659 default:
+1 -1
drivers/acpi/acpica/psloop.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+12 -3
drivers/acpi/acpica/psopcode.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 638 638 639 639 /* 7E */ ACPI_OP("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, 640 640 AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, 641 - AML_FLAGS_EXEC_0A_0T_1R) 641 + AML_FLAGS_EXEC_0A_0T_1R), 642 + 643 + /* ACPI 5.0 opcodes */ 644 + 645 + /* 7F */ ACPI_OP("-ConnectField-", ARGP_CONNECTFIELD_OP, 646 + ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, 647 + AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), 648 + /* 80 */ ACPI_OP("-ExtAccessField-", ARGP_CONNECTFIELD_OP, 649 + ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, 650 + AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0) 642 651 643 652 /*! [End] no source code translation !*/ 644 653 }; ··· 666 657 /* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 667 658 /* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, 668 659 /* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D, 669 - /* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 660 + /* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 670 661 /* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, 671 662 /* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, 672 663 /* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
+1 -1
drivers/acpi/acpica/psparse.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/psscope.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+7 -1
drivers/acpi/acpica/pstree.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 74 74 75 75 ACPI_FUNCTION_ENTRY(); 76 76 77 + /* 78 + if (Op->Common.aml_opcode == AML_INT_CONNECTION_OP) 79 + { 80 + return (Op->Common.Value.Arg); 81 + } 82 + */ 77 83 /* Get the info structure for this opcode */ 78 84 79 85 op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
+1 -1
drivers/acpi/acpica/psutils.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/pswalk.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/psxface.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/rsaddr.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+81 -8
drivers/acpi/acpica/rscalc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 313 313 resource_source)); 314 314 break; 315 315 316 + case ACPI_RESOURCE_TYPE_GPIO: 317 + 318 + total_size = 319 + (acpi_rs_length) (total_size + 320 + (resource->data.gpio. 321 + pin_table_length * 2) + 322 + resource->data.gpio. 323 + resource_source.string_length + 324 + resource->data.gpio. 325 + vendor_length); 326 + 327 + break; 328 + 329 + case ACPI_RESOURCE_TYPE_SERIAL_BUS: 330 + 331 + total_size = 332 + acpi_gbl_aml_resource_serial_bus_sizes[resource-> 333 + data. 334 + common_serial_bus. 335 + type]; 336 + 337 + total_size = (acpi_rs_length) (total_size + 338 + resource->data. 339 + i2c_serial_bus. 340 + resource_source. 341 + string_length + 342 + resource->data. 343 + i2c_serial_bus. 344 + vendor_length); 345 + 346 + break; 347 + 316 348 default: 317 349 break; 318 350 } ··· 394 362 u32 extra_struct_bytes; 395 363 u8 resource_index; 396 364 u8 minimum_aml_resource_length; 365 + union aml_resource *aml_resource; 397 366 398 367 ACPI_FUNCTION_TRACE(rs_get_list_length); 399 368 400 - *size_needed = 0; 369 + *size_needed = ACPI_RS_SIZE_MIN; /* Minimum size is one end_tag */ 401 370 end_aml = aml_buffer + aml_buffer_length; 402 371 403 372 /* Walk the list of AML resource descriptors */ ··· 409 376 410 377 status = acpi_ut_validate_resource(aml_buffer, &resource_index); 411 378 if (ACPI_FAILURE(status)) { 379 + /* 380 + * Exit on failure. Cannot continue because the descriptor length 381 + * may be bogus also. 382 + */ 412 383 return_ACPI_STATUS(status); 413 384 } 385 + 386 + aml_resource = (void *)aml_buffer; 414 387 415 388 /* Get the resource length and base (minimum) AML size */ 416 389 ··· 461 422 462 423 case ACPI_RESOURCE_NAME_END_TAG: 463 424 /* 464 - * End Tag: 465 - * This is the normal exit, add size of end_tag 425 + * End Tag: This is the normal exit 466 426 */ 467 - *size_needed += ACPI_RS_SIZE_MIN; 468 427 return_ACPI_STATUS(AE_OK); 469 428 470 429 case ACPI_RESOURCE_NAME_ADDRESS32: ··· 494 457 minimum_aml_resource_length); 495 458 break; 496 459 460 + case ACPI_RESOURCE_NAME_GPIO: 461 + 462 + /* Vendor data is optional */ 463 + 464 + if (aml_resource->gpio.vendor_length) { 465 + extra_struct_bytes += 466 + aml_resource->gpio.vendor_offset - 467 + aml_resource->gpio.pin_table_offset + 468 + aml_resource->gpio.vendor_length; 469 + } else { 470 + extra_struct_bytes += 471 + aml_resource->large_header.resource_length + 472 + sizeof(struct aml_resource_large_header) - 473 + aml_resource->gpio.pin_table_offset; 474 + } 475 + break; 476 + 477 + case ACPI_RESOURCE_NAME_SERIAL_BUS: 478 + 479 + minimum_aml_resource_length = 480 + acpi_gbl_resource_aml_serial_bus_sizes 481 + [aml_resource->common_serial_bus.type]; 482 + extra_struct_bytes += 483 + aml_resource->common_serial_bus.resource_length - 484 + minimum_aml_resource_length; 485 + break; 486 + 497 487 default: 498 488 break; 499 489 } ··· 531 467 * Important: Round the size up for the appropriate alignment. This 532 468 * is a requirement on IA64. 533 469 */ 534 - buffer_size = acpi_gbl_resource_struct_sizes[resource_index] + 535 - extra_struct_bytes; 536 - buffer_size = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size); 470 + if (acpi_ut_get_resource_type(aml_buffer) == 471 + ACPI_RESOURCE_NAME_SERIAL_BUS) { 472 + buffer_size = 473 + acpi_gbl_resource_struct_serial_bus_sizes 474 + [aml_resource->common_serial_bus.type] + 475 + extra_struct_bytes; 476 + } else { 477 + buffer_size = 478 + acpi_gbl_resource_struct_sizes[resource_index] + 479 + extra_struct_bytes; 480 + } 481 + buffer_size = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size); 537 482 538 483 *size_needed += buffer_size; 539 484
+67 -2
drivers/acpi/acpica/rscreate.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 51 51 52 52 /******************************************************************************* 53 53 * 54 + * FUNCTION: acpi_buffer_to_resource 55 + * 56 + * PARAMETERS: aml_buffer - Pointer to the resource byte stream 57 + * aml_buffer_length - Length of the aml_buffer 58 + * resource_ptr - Where the converted resource is returned 59 + * 60 + * RETURN: Status 61 + * 62 + * DESCRIPTION: Convert a raw AML buffer to a resource list 63 + * 64 + ******************************************************************************/ 65 + acpi_status 66 + acpi_buffer_to_resource(u8 *aml_buffer, 67 + u16 aml_buffer_length, 68 + struct acpi_resource **resource_ptr) 69 + { 70 + acpi_status status; 71 + acpi_size list_size_needed; 72 + void *resource; 73 + void *current_resource_ptr; 74 + 75 + /* 76 + * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag 77 + * is not required here. 78 + */ 79 + 80 + /* Get the required length for the converted resource */ 81 + 82 + status = acpi_rs_get_list_length(aml_buffer, aml_buffer_length, 83 + &list_size_needed); 84 + if (status == AE_AML_NO_RESOURCE_END_TAG) { 85 + status = AE_OK; 86 + } 87 + if (ACPI_FAILURE(status)) { 88 + return (status); 89 + } 90 + 91 + /* Allocate a buffer for the converted resource */ 92 + 93 + resource = ACPI_ALLOCATE_ZEROED(list_size_needed); 94 + current_resource_ptr = resource; 95 + if (!resource) { 96 + return (AE_NO_MEMORY); 97 + } 98 + 99 + /* Perform the AML-to-Resource conversion */ 100 + 101 + status = acpi_ut_walk_aml_resources(aml_buffer, aml_buffer_length, 102 + acpi_rs_convert_aml_to_resources, 103 + &current_resource_ptr); 104 + if (status == AE_AML_NO_RESOURCE_END_TAG) { 105 + status = AE_OK; 106 + } 107 + if (ACPI_FAILURE(status)) { 108 + ACPI_FREE(resource); 109 + } else { 110 + *resource_ptr = resource; 111 + } 112 + 113 + return (status); 114 + } 115 + 116 + /******************************************************************************* 117 + * 54 118 * FUNCTION: acpi_rs_create_resource_list 55 119 * 56 120 * PARAMETERS: aml_buffer - Pointer to the resource byte stream ··· 130 66 * of device resources. 131 67 * 132 68 ******************************************************************************/ 69 + 133 70 acpi_status 134 71 acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, 135 - struct acpi_buffer *output_buffer) 72 + struct acpi_buffer * output_buffer) 136 73 { 137 74 138 75 acpi_status status;
+186 -10
drivers/acpi/acpica/rsdump.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 61 61 62 62 static void acpi_rs_out_title(char *title); 63 63 64 - static void acpi_rs_dump_byte_list(u16 length, u8 * data); 64 + static void acpi_rs_dump_byte_list(u16 length, u8 *data); 65 65 66 - static void acpi_rs_dump_dword_list(u8 length, u32 * data); 66 + static void acpi_rs_dump_word_list(u16 length, u16 *data); 67 67 68 - static void acpi_rs_dump_short_byte_list(u8 length, u8 * data); 68 + static void acpi_rs_dump_dword_list(u8 length, u32 *data); 69 + 70 + static void acpi_rs_dump_short_byte_list(u8 length, u8 *data); 69 71 70 72 static void 71 73 acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source); ··· 311 309 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(generic_reg.address), "Address", NULL} 312 310 }; 313 311 312 + struct acpi_rsdump_info acpi_rs_dump_gpio[16] = { 313 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_gpio), "GPIO", NULL}, 314 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.revision_id), "RevisionId", NULL}, 315 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.connection_type), 316 + "ConnectionType", acpi_gbl_ct_decode}, 317 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(gpio.producer_consumer), 318 + "ProducerConsumer", acpi_gbl_consume_decode}, 319 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig", 320 + acpi_gbl_ppc_decode}, 321 + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharable", 322 + acpi_gbl_shr_decode}, 323 + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction), 324 + "IoRestriction", acpi_gbl_ior_decode}, 325 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(gpio.triggering), "Triggering", 326 + acpi_gbl_he_decode}, 327 + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.polarity), "Polarity", 328 + acpi_gbl_ll_decode}, 329 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.drive_strength), "DriveStrength", 330 + NULL}, 331 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.debounce_timeout), 332 + "DebounceTimeout", NULL}, 333 + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(gpio.resource_source), 334 + "ResourceSource", NULL}, 335 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.pin_table_length), 336 + "PinTableLength", NULL}, 337 + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(gpio.pin_table), "PinTable", NULL}, 338 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.vendor_length), "VendorLength", 339 + NULL}, 340 + {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(gpio.vendor_data), "VendorData", 341 + NULL}, 342 + }; 343 + 344 + struct acpi_rsdump_info acpi_rs_dump_fixed_dma[4] = { 345 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_dma), 346 + "FixedDma", NULL}, 347 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_dma.request_lines), 348 + "RequestLines", NULL}, 349 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_dma.channels), "Channels", 350 + NULL}, 351 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(fixed_dma.width), "TransferWidth", 352 + acpi_gbl_dts_decode}, 353 + }; 354 + 355 + #define ACPI_RS_DUMP_COMMON_SERIAL_BUS \ 356 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.revision_id), "RevisionId", NULL}, \ 357 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.type), "Type", acpi_gbl_sbt_decode}, \ 358 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.producer_consumer), "ProducerConsumer", acpi_gbl_consume_decode}, \ 359 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.slave_mode), "SlaveMode", acpi_gbl_sm_decode}, \ 360 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.type_revision_id), "TypeRevisionId", NULL}, \ 361 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (common_serial_bus.type_data_length), "TypeDataLength", NULL}, \ 362 + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (common_serial_bus.resource_source), "ResourceSource", NULL}, \ 363 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (common_serial_bus.vendor_length), "VendorLength", NULL}, \ 364 + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (common_serial_bus.vendor_data), "VendorData", NULL}, 365 + 366 + struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[10] = { 367 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_common_serial_bus), 368 + "Common Serial Bus", NULL}, 369 + ACPI_RS_DUMP_COMMON_SERIAL_BUS 370 + }; 371 + 372 + struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[13] = { 373 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus), 374 + "I2C Serial Bus", NULL}, 375 + ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG, 376 + ACPI_RSD_OFFSET(i2c_serial_bus. 377 + access_mode), 378 + "AccessMode", acpi_gbl_am_decode}, 379 + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(i2c_serial_bus.connection_speed), 380 + "ConnectionSpeed", NULL}, 381 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(i2c_serial_bus.slave_address), 382 + "SlaveAddress", NULL}, 383 + }; 384 + 385 + struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[17] = { 386 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_spi_serial_bus), 387 + "Spi Serial Bus", NULL}, 388 + ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG, 389 + ACPI_RSD_OFFSET(spi_serial_bus. 390 + wire_mode), "WireMode", 391 + acpi_gbl_wm_decode}, 392 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(spi_serial_bus.device_polarity), 393 + "DevicePolarity", acpi_gbl_dp_decode}, 394 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.data_bit_length), 395 + "DataBitLength", NULL}, 396 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.clock_phase), 397 + "ClockPhase", acpi_gbl_cph_decode}, 398 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.clock_polarity), 399 + "ClockPolarity", acpi_gbl_cpo_decode}, 400 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(spi_serial_bus.device_selection), 401 + "DeviceSelection", NULL}, 402 + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(spi_serial_bus.connection_speed), 403 + "ConnectionSpeed", NULL}, 404 + }; 405 + 406 + struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[19] = { 407 + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_uart_serial_bus), 408 + "Uart Serial Bus", NULL}, 409 + ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_2BITFLAG, 410 + ACPI_RSD_OFFSET(uart_serial_bus. 411 + flow_control), 412 + "FlowControl", acpi_gbl_fc_decode}, 413 + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.stop_bits), 414 + "StopBits", acpi_gbl_sb_decode}, 415 + {ACPI_RSD_3BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.data_bits), 416 + "DataBits", acpi_gbl_bpb_decode}, 417 + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.endian), "Endian", 418 + acpi_gbl_ed_decode}, 419 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(uart_serial_bus.parity), "Parity", 420 + acpi_gbl_pt_decode}, 421 + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(uart_serial_bus.lines_enabled), 422 + "LinesEnabled", NULL}, 423 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(uart_serial_bus.rx_fifo_size), 424 + "RxFifoSize", NULL}, 425 + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(uart_serial_bus.tx_fifo_size), 426 + "TxFifoSize", NULL}, 427 + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(uart_serial_bus.default_baud_rate), 428 + "ConnectionSpeed", NULL}, 429 + }; 430 + 314 431 /* 315 432 * Tables used for common address descriptor flag fields 316 433 */ ··· 534 413 /* Data items, 8/16/32/64 bit */ 535 414 536 415 case ACPI_RSD_UINT8: 537 - acpi_rs_out_integer8(name, ACPI_GET8(target)); 416 + if (table->pointer) { 417 + acpi_rs_out_string(name, ACPI_CAST_PTR(char, 418 + table-> 419 + pointer 420 + [*target])); 421 + } else { 422 + acpi_rs_out_integer8(name, ACPI_GET8(target)); 423 + } 538 424 break; 539 425 540 426 case ACPI_RSD_UINT16: ··· 572 444 0x03])); 573 445 break; 574 446 447 + case ACPI_RSD_3BITFLAG: 448 + acpi_rs_out_string(name, ACPI_CAST_PTR(char, 449 + table-> 450 + pointer[*target & 451 + 0x07])); 452 + break; 453 + 575 454 case ACPI_RSD_SHORTLIST: 576 455 /* 577 456 * Short byte list (single line output) for DMA and IRQ resources ··· 588 453 acpi_rs_out_title(name); 589 454 acpi_rs_dump_short_byte_list(*previous_target, 590 455 target); 456 + } 457 + break; 458 + 459 + case ACPI_RSD_SHORTLISTX: 460 + /* 461 + * Short byte list (single line output) for GPIO vendor data 462 + * Note: The list length is obtained from the previous table entry 463 + */ 464 + if (previous_target) { 465 + acpi_rs_out_title(name); 466 + acpi_rs_dump_short_byte_list(*previous_target, 467 + * 468 + (ACPI_CAST_INDIRECT_PTR 469 + (u8, target))); 591 470 } 592 471 break; 593 472 ··· 626 477 acpi_rs_dump_dword_list(*previous_target, 627 478 ACPI_CAST_PTR(u32, 628 479 target)); 480 + } 481 + break; 482 + 483 + case ACPI_RSD_WORDLIST: 484 + /* 485 + * Word list for GPIO Pin Table 486 + * Note: The list length is obtained from the previous table entry 487 + */ 488 + if (previous_target) { 489 + acpi_rs_dump_word_list(*previous_target, 490 + *(ACPI_CAST_INDIRECT_PTR 491 + (u16, target))); 629 492 } 630 493 break; 631 494 ··· 788 627 789 628 /* Dump the resource descriptor */ 790 629 791 - acpi_rs_dump_descriptor(&resource_list->data, 792 - acpi_gbl_dump_resource_dispatch[type]); 630 + if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { 631 + acpi_rs_dump_descriptor(&resource_list->data, 632 + acpi_gbl_dump_serial_bus_dispatch 633 + [resource_list->data. 634 + common_serial_bus.type]); 635 + } else { 636 + acpi_rs_dump_descriptor(&resource_list->data, 637 + acpi_gbl_dump_resource_dispatch 638 + [type]); 639 + } 793 640 794 641 /* Point to the next resource structure */ 795 642 796 - resource_list = 797 - ACPI_ADD_PTR(struct acpi_resource, resource_list, 798 - resource_list->length); 643 + resource_list = ACPI_NEXT_RESOURCE(resource_list); 799 644 800 645 /* Exit when END_TAG descriptor is reached */ 801 646 ··· 932 765 933 766 for (i = 0; i < length; i++) { 934 767 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]); 768 + } 769 + } 770 + 771 + static void acpi_rs_dump_word_list(u16 length, u16 *data) 772 + { 773 + u16 i; 774 + 775 + for (i = 0; i < length; i++) { 776 + acpi_os_printf("%25s%2.2X : %4.4X\n", "Word", i, data[i]); 935 777 } 936 778 } 937 779
+51 -7
drivers/acpi/acpica/rsinfo.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 76 76 acpi_rs_convert_address64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */ 77 77 acpi_rs_convert_ext_address64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 78 78 acpi_rs_convert_ext_irq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 79 - acpi_rs_convert_generic_reg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 79 + acpi_rs_convert_generic_reg, /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 80 + acpi_rs_convert_gpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */ 81 + acpi_rs_convert_fixed_dma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */ 82 + NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */ 80 83 }; 81 84 82 85 /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ ··· 97 94 acpi_rs_convert_end_dpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ 98 95 acpi_rs_convert_io, /* 0x08, ACPI_RESOURCE_NAME_IO */ 99 96 acpi_rs_convert_fixed_io, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */ 100 - NULL, /* 0x0A, Reserved */ 97 + acpi_rs_convert_fixed_dma, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */ 101 98 NULL, /* 0x0B, Reserved */ 102 99 NULL, /* 0x0C, Reserved */ 103 100 NULL, /* 0x0D, Reserved */ ··· 117 114 acpi_rs_convert_address16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */ 118 115 acpi_rs_convert_ext_irq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */ 119 116 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ 120 - acpi_rs_convert_ext_address64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ 117 + acpi_rs_convert_ext_address64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ 118 + acpi_rs_convert_gpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ 119 + NULL, /* 0x0D, Reserved */ 120 + NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */ 121 + }; 122 + 123 + /* Subtype table for serial_bus -- I2C, SPI, and UART */ 124 + 125 + struct acpi_rsconvert_info *acpi_gbl_convert_resource_serial_bus_dispatch[] = { 126 + NULL, 127 + acpi_rs_convert_i2c_serial_bus, 128 + acpi_rs_convert_spi_serial_bus, 129 + acpi_rs_convert_uart_serial_bus, 121 130 }; 122 131 123 132 #ifdef ACPI_FUTURE_USAGE ··· 155 140 acpi_rs_dump_ext_address64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 156 141 acpi_rs_dump_ext_irq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 157 142 acpi_rs_dump_generic_reg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 143 + acpi_rs_dump_gpio, /* ACPI_RESOURCE_TYPE_GPIO */ 144 + acpi_rs_dump_fixed_dma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */ 145 + NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ 146 + }; 147 + 148 + struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = { 149 + NULL, 150 + acpi_rs_dump_i2c_serial_bus, /* AML_RESOURCE_I2C_BUS_TYPE */ 151 + acpi_rs_dump_spi_serial_bus, /* AML_RESOURCE_SPI_BUS_TYPE */ 152 + acpi_rs_dump_uart_serial_bus, /* AML_RESOURCE_UART_BUS_TYPE */ 158 153 }; 159 154 #endif 160 155 ··· 191 166 sizeof(struct aml_resource_address64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */ 192 167 sizeof(struct aml_resource_extended_address64), /*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 193 168 sizeof(struct aml_resource_extended_irq), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 194 - sizeof(struct aml_resource_generic_register) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 169 + sizeof(struct aml_resource_generic_register), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 170 + sizeof(struct aml_resource_gpio), /* ACPI_RESOURCE_TYPE_GPIO */ 171 + sizeof(struct aml_resource_fixed_dma), /* ACPI_RESOURCE_TYPE_FIXED_DMA */ 172 + sizeof(struct aml_resource_common_serialbus), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ 195 173 }; 196 174 197 175 const u8 acpi_gbl_resource_struct_sizes[] = { ··· 210 182 ACPI_RS_SIZE_MIN, 211 183 ACPI_RS_SIZE(struct acpi_resource_io), 212 184 ACPI_RS_SIZE(struct acpi_resource_fixed_io), 213 - 0, 185 + ACPI_RS_SIZE(struct acpi_resource_fixed_dma), 214 186 0, 215 187 0, 216 188 0, ··· 230 202 ACPI_RS_SIZE(struct acpi_resource_address16), 231 203 ACPI_RS_SIZE(struct acpi_resource_extended_irq), 232 204 ACPI_RS_SIZE(struct acpi_resource_address64), 233 - ACPI_RS_SIZE(struct acpi_resource_extended_address64) 205 + ACPI_RS_SIZE(struct acpi_resource_extended_address64), 206 + ACPI_RS_SIZE(struct acpi_resource_gpio), 207 + ACPI_RS_SIZE(struct acpi_resource_common_serialbus) 208 + }; 209 + 210 + const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = { 211 + 0, 212 + sizeof(struct aml_resource_i2c_serialbus), 213 + sizeof(struct aml_resource_spi_serialbus), 214 + sizeof(struct aml_resource_uart_serialbus), 215 + }; 216 + 217 + const u8 acpi_gbl_resource_struct_serial_bus_sizes[] = { 218 + 0, 219 + ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus), 220 + ACPI_RS_SIZE(struct acpi_resource_spi_serialbus), 221 + ACPI_RS_SIZE(struct acpi_resource_uart_serialbus), 234 222 };
+1 -1
drivers/acpi/acpica/rsio.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+32 -1
drivers/acpi/acpica/rsirq.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 263 263 {ACPI_RSC_BITMASK, ACPI_RS_OFFSET(data.dma.channels[0]), 264 264 AML_OFFSET(dma.dma_channel_mask), 265 265 ACPI_RS_OFFSET(data.dma.channel_count)} 266 + }; 267 + 268 + /******************************************************************************* 269 + * 270 + * acpi_rs_convert_fixed_dma 271 + * 272 + ******************************************************************************/ 273 + 274 + struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[4] = { 275 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA, 276 + ACPI_RS_SIZE(struct acpi_resource_fixed_dma), 277 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_dma)}, 278 + 279 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA, 280 + sizeof(struct aml_resource_fixed_dma), 281 + 0}, 282 + 283 + /* 284 + * These fields are contiguous in both the source and destination: 285 + * request_lines 286 + * Channels 287 + */ 288 + 289 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_dma.request_lines), 290 + AML_OFFSET(fixed_dma.request_lines), 291 + 2}, 292 + 293 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_dma.width), 294 + AML_OFFSET(fixed_dma.width), 295 + 1}, 296 + 266 297 };
+62 -15
drivers/acpi/acpica/rslist.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 70 70 struct acpi_resource **resource_ptr = 71 71 ACPI_CAST_INDIRECT_PTR(struct acpi_resource, context); 72 72 struct acpi_resource *resource; 73 + union aml_resource *aml_resource; 74 + struct acpi_rsconvert_info *conversion_table; 73 75 acpi_status status; 74 76 75 77 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resources); ··· 86 84 "Misaligned resource pointer %p", resource)); 87 85 } 88 86 87 + /* Get the appropriate conversion info table */ 88 + 89 + aml_resource = ACPI_CAST_PTR(union aml_resource, aml); 90 + if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) { 91 + if (aml_resource->common_serial_bus.type > 92 + AML_RESOURCE_MAX_SERIALBUSTYPE) { 93 + conversion_table = NULL; 94 + } else { 95 + /* This is an I2C, SPI, or UART serial_bus descriptor */ 96 + 97 + conversion_table = 98 + acpi_gbl_convert_resource_serial_bus_dispatch 99 + [aml_resource->common_serial_bus.type]; 100 + } 101 + } else { 102 + conversion_table = 103 + acpi_gbl_get_resource_dispatch[resource_index]; 104 + } 105 + 106 + if (!conversion_table) { 107 + ACPI_ERROR((AE_INFO, 108 + "Invalid/unsupported resource descriptor: Type 0x%2.2X", 109 + resource_index)); 110 + return (AE_AML_INVALID_RESOURCE_TYPE); 111 + } 112 + 89 113 /* Convert the AML byte stream resource to a local resource struct */ 90 114 91 115 status = 92 - acpi_rs_convert_aml_to_resource(resource, 93 - ACPI_CAST_PTR(union aml_resource, 94 - aml), 95 - acpi_gbl_get_resource_dispatch 96 - [resource_index]); 116 + acpi_rs_convert_aml_to_resource(resource, aml_resource, 117 + conversion_table); 97 118 if (ACPI_FAILURE(status)) { 98 119 ACPI_EXCEPTION((AE_INFO, status, 99 120 "Could not convert AML resource (Type 0x%X)", ··· 131 106 132 107 /* Point to the next structure in the output buffer */ 133 108 134 - *resource_ptr = ACPI_ADD_PTR(void, resource, resource->length); 109 + *resource_ptr = ACPI_NEXT_RESOURCE(resource); 135 110 return_ACPI_STATUS(AE_OK); 136 111 } 137 112 ··· 160 135 { 161 136 u8 *aml = output_buffer; 162 137 u8 *end_aml = output_buffer + aml_size_needed; 138 + struct acpi_rsconvert_info *conversion_table; 163 139 acpi_status status; 164 140 165 141 ACPI_FUNCTION_TRACE(rs_convert_resources_to_aml); ··· 180 154 181 155 /* Perform the conversion */ 182 156 183 - status = acpi_rs_convert_resource_to_aml(resource, ACPI_CAST_PTR(union 184 - aml_resource, 185 - aml), 186 - acpi_gbl_set_resource_dispatch 187 - [resource->type]); 157 + if (resource->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { 158 + if (resource->data.common_serial_bus.type > 159 + AML_RESOURCE_MAX_SERIALBUSTYPE) { 160 + conversion_table = NULL; 161 + } else { 162 + /* This is an I2C, SPI, or UART serial_bus descriptor */ 163 + 164 + conversion_table = 165 + acpi_gbl_convert_resource_serial_bus_dispatch 166 + [resource->data.common_serial_bus.type]; 167 + } 168 + } else { 169 + conversion_table = 170 + acpi_gbl_set_resource_dispatch[resource->type]; 171 + } 172 + 173 + if (!conversion_table) { 174 + ACPI_ERROR((AE_INFO, 175 + "Invalid/unsupported resource descriptor: Type 0x%2.2X", 176 + resource->type)); 177 + return (AE_AML_INVALID_RESOURCE_TYPE); 178 + } 179 + 180 + status = acpi_rs_convert_resource_to_aml(resource, 181 + ACPI_CAST_PTR(union 182 + aml_resource, 183 + aml), 184 + conversion_table); 188 185 if (ACPI_FAILURE(status)) { 189 186 ACPI_EXCEPTION((AE_INFO, status, 190 187 "Could not convert resource (type 0x%X) to AML", ··· 241 192 242 193 /* Point to the next input resource descriptor */ 243 194 244 - resource = 245 - ACPI_ADD_PTR(struct acpi_resource, resource, 246 - resource->length); 195 + resource = ACPI_NEXT_RESOURCE(resource); 247 196 } 248 197 249 198 /* Completed buffer, but did not find an end_tag resource descriptor */
+1 -1
drivers/acpi/acpica/rsmemory.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+263 -6
drivers/acpi/acpica/rsmisc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 83 83 84 84 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resource); 85 85 86 + if (!info) { 87 + return_ACPI_STATUS(AE_BAD_PARAMETER); 88 + } 89 + 86 90 if (((acpi_size) resource) & 0x3) { 87 91 88 92 /* Each internal resource struct is expected to be 32-bit aligned */ ··· 105 101 * table length (# of table entries) 106 102 */ 107 103 count = INIT_TABLE_LENGTH(info); 108 - 109 104 while (count) { 110 105 /* 111 106 * Source is the external AML byte stream buffer, ··· 148 145 ((ACPI_GET8(source) >> info->value) & 0x03); 149 146 break; 150 147 148 + case ACPI_RSC_3BITFLAG: 149 + /* 150 + * Mask and shift the flag bits 151 + */ 152 + ACPI_SET8(destination) = (u8) 153 + ((ACPI_GET8(source) >> info->value) & 0x07); 154 + break; 155 + 151 156 case ACPI_RSC_COUNT: 152 157 153 158 item_count = ACPI_GET8(source); ··· 172 161 173 162 resource->length = resource->length + 174 163 (info->value * (item_count - 1)); 164 + break; 165 + 166 + case ACPI_RSC_COUNT_GPIO_PIN: 167 + 168 + target = ACPI_ADD_PTR(void, aml, info->value); 169 + item_count = ACPI_GET16(target) - ACPI_GET16(source); 170 + 171 + resource->length = resource->length + item_count; 172 + item_count = item_count / 2; 173 + ACPI_SET16(destination) = item_count; 174 + break; 175 + 176 + case ACPI_RSC_COUNT_GPIO_VEN: 177 + 178 + item_count = ACPI_GET8(source); 179 + ACPI_SET8(destination) = (u8)item_count; 180 + 181 + resource->length = resource->length + 182 + (info->value * item_count); 183 + break; 184 + 185 + case ACPI_RSC_COUNT_GPIO_RES: 186 + 187 + /* 188 + * Vendor data is optional (length/offset may both be zero) 189 + * Examine vendor data length field first 190 + */ 191 + target = ACPI_ADD_PTR(void, aml, (info->value + 2)); 192 + if (ACPI_GET16(target)) { 193 + 194 + /* Use vendor offset to get resource source length */ 195 + 196 + target = ACPI_ADD_PTR(void, aml, info->value); 197 + item_count = 198 + ACPI_GET16(target) - ACPI_GET16(source); 199 + } else { 200 + /* No vendor data to worry about */ 201 + 202 + item_count = aml->large_header.resource_length + 203 + sizeof(struct aml_resource_large_header) - 204 + ACPI_GET16(source); 205 + } 206 + 207 + resource->length = resource->length + item_count; 208 + ACPI_SET16(destination) = item_count; 209 + break; 210 + 211 + case ACPI_RSC_COUNT_SERIAL_VEN: 212 + 213 + item_count = ACPI_GET16(source) - info->value; 214 + 215 + resource->length = resource->length + item_count; 216 + ACPI_SET16(destination) = item_count; 217 + break; 218 + 219 + case ACPI_RSC_COUNT_SERIAL_RES: 220 + 221 + item_count = (aml_resource_length + 222 + sizeof(struct aml_resource_large_header)) 223 + - ACPI_GET16(source) - info->value; 224 + 225 + resource->length = resource->length + item_count; 226 + ACPI_SET16(destination) = item_count; 175 227 break; 176 228 177 229 case ACPI_RSC_LENGTH: ··· 254 180 item_count = info->value; 255 181 } 256 182 acpi_rs_move_data(destination, source, item_count, 183 + info->opcode); 184 + break; 185 + 186 + case ACPI_RSC_MOVE_GPIO_PIN: 187 + 188 + /* Generate and set the PIN data pointer */ 189 + 190 + target = (char *)ACPI_ADD_PTR(void, resource, 191 + (resource->length - 192 + item_count * 2)); 193 + *(u16 **)destination = ACPI_CAST_PTR(u16, target); 194 + 195 + /* Copy the PIN data */ 196 + 197 + source = ACPI_ADD_PTR(void, aml, ACPI_GET16(source)); 198 + acpi_rs_move_data(target, source, item_count, 199 + info->opcode); 200 + break; 201 + 202 + case ACPI_RSC_MOVE_GPIO_RES: 203 + 204 + /* Generate and set the resource_source string pointer */ 205 + 206 + target = (char *)ACPI_ADD_PTR(void, resource, 207 + (resource->length - 208 + item_count)); 209 + *(u8 **)destination = ACPI_CAST_PTR(u8, target); 210 + 211 + /* Copy the resource_source string */ 212 + 213 + source = ACPI_ADD_PTR(void, aml, ACPI_GET16(source)); 214 + acpi_rs_move_data(target, source, item_count, 215 + info->opcode); 216 + break; 217 + 218 + case ACPI_RSC_MOVE_SERIAL_VEN: 219 + 220 + /* Generate and set the Vendor Data pointer */ 221 + 222 + target = (char *)ACPI_ADD_PTR(void, resource, 223 + (resource->length - 224 + item_count)); 225 + *(u8 **)destination = ACPI_CAST_PTR(u8, target); 226 + 227 + /* Copy the Vendor Data */ 228 + 229 + source = ACPI_ADD_PTR(void, aml, info->value); 230 + acpi_rs_move_data(target, source, item_count, 231 + info->opcode); 232 + break; 233 + 234 + case ACPI_RSC_MOVE_SERIAL_RES: 235 + 236 + /* Generate and set the resource_source string pointer */ 237 + 238 + target = (char *)ACPI_ADD_PTR(void, resource, 239 + (resource->length - 240 + item_count)); 241 + *(u8 **)destination = ACPI_CAST_PTR(u8, target); 242 + 243 + /* Copy the resource_source string */ 244 + 245 + source = 246 + ACPI_ADD_PTR(void, aml, 247 + (ACPI_GET16(source) + info->value)); 248 + acpi_rs_move_data(target, source, item_count, 257 249 info->opcode); 258 250 break; 259 251 ··· 359 219 * Optional resource_source (Index and String). This is the more 360 220 * complicated case used by the Interrupt() macro 361 221 */ 362 - target = 363 - ACPI_ADD_PTR(char, resource, 364 - info->aml_offset + (item_count * 4)); 222 + target = ACPI_ADD_PTR(char, resource, 223 + info->aml_offset + 224 + (item_count * 4)); 365 225 366 226 resource->length += 367 227 acpi_rs_get_resource_source(aml_resource_length, 368 - (acpi_rs_length) (((item_count - 1) * sizeof(u32)) + info->value), destination, aml, target); 228 + (acpi_rs_length) 229 + (((item_count - 230 + 1) * sizeof(u32)) + 231 + info->value), 232 + destination, aml, 233 + target); 369 234 break; 370 235 371 236 case ACPI_RSC_BITMASK: ··· 472 327 { 473 328 void *source = NULL; 474 329 void *destination; 330 + char *target; 475 331 acpi_rsdesc_size aml_length = 0; 476 332 u8 count; 477 333 u16 temp16 = 0; 478 334 u16 item_count = 0; 479 335 480 336 ACPI_FUNCTION_TRACE(rs_convert_resource_to_aml); 337 + 338 + if (!info) { 339 + return_ACPI_STATUS(AE_BAD_PARAMETER); 340 + } 481 341 482 342 /* 483 343 * First table entry must be ACPI_RSC_INITxxx and must contain the ··· 533 383 ((ACPI_GET8(source) & 0x03) << info->value); 534 384 break; 535 385 386 + case ACPI_RSC_3BITFLAG: 387 + /* 388 + * Mask and shift the flag bits 389 + */ 390 + ACPI_SET8(destination) |= (u8) 391 + ((ACPI_GET8(source) & 0x07) << info->value); 392 + break; 393 + 536 394 case ACPI_RSC_COUNT: 537 395 538 396 item_count = ACPI_GET8(source); ··· 558 400 acpi_rs_set_resource_length(aml_length, aml); 559 401 break; 560 402 403 + case ACPI_RSC_COUNT_GPIO_PIN: 404 + 405 + item_count = ACPI_GET16(source); 406 + ACPI_SET16(destination) = (u16)aml_length; 407 + 408 + aml_length = (u16)(aml_length + item_count * 2); 409 + target = ACPI_ADD_PTR(void, aml, info->value); 410 + ACPI_SET16(target) = (u16)aml_length; 411 + acpi_rs_set_resource_length(aml_length, aml); 412 + break; 413 + 414 + case ACPI_RSC_COUNT_GPIO_VEN: 415 + 416 + item_count = ACPI_GET16(source); 417 + ACPI_SET16(destination) = (u16)item_count; 418 + 419 + aml_length = 420 + (u16)(aml_length + (info->value * item_count)); 421 + acpi_rs_set_resource_length(aml_length, aml); 422 + break; 423 + 424 + case ACPI_RSC_COUNT_GPIO_RES: 425 + 426 + /* Set resource source string length */ 427 + 428 + item_count = ACPI_GET16(source); 429 + ACPI_SET16(destination) = (u16)aml_length; 430 + 431 + /* Compute offset for the Vendor Data */ 432 + 433 + aml_length = (u16)(aml_length + item_count); 434 + target = ACPI_ADD_PTR(void, aml, info->value); 435 + 436 + /* Set vendor offset only if there is vendor data */ 437 + 438 + if (resource->data.gpio.vendor_length) { 439 + ACPI_SET16(target) = (u16)aml_length; 440 + } 441 + 442 + acpi_rs_set_resource_length(aml_length, aml); 443 + break; 444 + 445 + case ACPI_RSC_COUNT_SERIAL_VEN: 446 + 447 + item_count = ACPI_GET16(source); 448 + ACPI_SET16(destination) = item_count + info->value; 449 + aml_length = (u16)(aml_length + item_count); 450 + acpi_rs_set_resource_length(aml_length, aml); 451 + break; 452 + 453 + case ACPI_RSC_COUNT_SERIAL_RES: 454 + 455 + item_count = ACPI_GET16(source); 456 + aml_length = (u16)(aml_length + item_count); 457 + acpi_rs_set_resource_length(aml_length, aml); 458 + break; 459 + 561 460 case ACPI_RSC_LENGTH: 562 461 563 462 acpi_rs_set_resource_length(info->value, aml); ··· 628 413 if (info->value) { 629 414 item_count = info->value; 630 415 } 416 + acpi_rs_move_data(destination, source, item_count, 417 + info->opcode); 418 + break; 419 + 420 + case ACPI_RSC_MOVE_GPIO_PIN: 421 + 422 + destination = (char *)ACPI_ADD_PTR(void, aml, 423 + ACPI_GET16 424 + (destination)); 425 + source = *(u16 **)source; 426 + acpi_rs_move_data(destination, source, item_count, 427 + info->opcode); 428 + break; 429 + 430 + case ACPI_RSC_MOVE_GPIO_RES: 431 + 432 + /* Used for both resource_source string and vendor_data */ 433 + 434 + destination = (char *)ACPI_ADD_PTR(void, aml, 435 + ACPI_GET16 436 + (destination)); 437 + source = *(u8 **)source; 438 + acpi_rs_move_data(destination, source, item_count, 439 + info->opcode); 440 + break; 441 + 442 + case ACPI_RSC_MOVE_SERIAL_VEN: 443 + 444 + destination = (char *)ACPI_ADD_PTR(void, aml, 445 + (aml_length - 446 + item_count)); 447 + source = *(u8 **)source; 448 + acpi_rs_move_data(destination, source, item_count, 449 + info->opcode); 450 + break; 451 + 452 + case ACPI_RSC_MOVE_SERIAL_RES: 453 + 454 + destination = (char *)ACPI_ADD_PTR(void, aml, 455 + (aml_length - 456 + item_count)); 457 + source = *(u8 **)source; 631 458 acpi_rs_move_data(destination, source, item_count, 632 459 info->opcode); 633 460 break;
+441
drivers/acpi/acpica/rsserial.c
··· 1 + /******************************************************************************* 2 + * 3 + * Module Name: rsserial - GPIO/serial_bus resource descriptors 4 + * 5 + ******************************************************************************/ 6 + 7 + /* 8 + * Copyright (C) 2000 - 2012, 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_RESOURCES 49 + ACPI_MODULE_NAME("rsserial") 50 + 51 + /******************************************************************************* 52 + * 53 + * acpi_rs_convert_gpio 54 + * 55 + ******************************************************************************/ 56 + struct acpi_rsconvert_info acpi_rs_convert_gpio[17] = { 57 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO, 58 + ACPI_RS_SIZE(struct acpi_resource_gpio), 59 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_gpio)}, 60 + 61 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO, 62 + sizeof(struct aml_resource_gpio), 63 + 0}, 64 + 65 + /* 66 + * These fields are contiguous in both the source and destination: 67 + * revision_id 68 + * connection_type 69 + */ 70 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.revision_id), 71 + AML_OFFSET(gpio.revision_id), 72 + 2}, 73 + 74 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.producer_consumer), 75 + AML_OFFSET(gpio.flags), 76 + 0}, 77 + 78 + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.sharable), 79 + AML_OFFSET(gpio.int_flags), 80 + 3}, 81 + 82 + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.io_restriction), 83 + AML_OFFSET(gpio.int_flags), 84 + 0}, 85 + 86 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.gpio.triggering), 87 + AML_OFFSET(gpio.int_flags), 88 + 0}, 89 + 90 + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.gpio.polarity), 91 + AML_OFFSET(gpio.int_flags), 92 + 1}, 93 + 94 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.pin_config), 95 + AML_OFFSET(gpio.pin_config), 96 + 1}, 97 + 98 + /* 99 + * These fields are contiguous in both the source and destination: 100 + * drive_strength 101 + * debounce_timeout 102 + */ 103 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.gpio.drive_strength), 104 + AML_OFFSET(gpio.drive_strength), 105 + 2}, 106 + 107 + /* Pin Table */ 108 + 109 + {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET(data.gpio.pin_table_length), 110 + AML_OFFSET(gpio.pin_table_offset), 111 + AML_OFFSET(gpio.res_source_offset)}, 112 + 113 + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET(data.gpio.pin_table), 114 + AML_OFFSET(gpio.pin_table_offset), 115 + 0}, 116 + 117 + /* Resource Source */ 118 + 119 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.gpio.resource_source.index), 120 + AML_OFFSET(gpio.res_source_index), 121 + 1}, 122 + 123 + {ACPI_RSC_COUNT_GPIO_RES, 124 + ACPI_RS_OFFSET(data.gpio.resource_source.string_length), 125 + AML_OFFSET(gpio.res_source_offset), 126 + AML_OFFSET(gpio.vendor_offset)}, 127 + 128 + {ACPI_RSC_MOVE_GPIO_RES, 129 + ACPI_RS_OFFSET(data.gpio.resource_source.string_ptr), 130 + AML_OFFSET(gpio.res_source_offset), 131 + 0}, 132 + 133 + /* Vendor Data */ 134 + 135 + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET(data.gpio.vendor_length), 136 + AML_OFFSET(gpio.vendor_length), 137 + 1}, 138 + 139 + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET(data.gpio.vendor_data), 140 + AML_OFFSET(gpio.vendor_offset), 141 + 0}, 142 + }; 143 + 144 + /******************************************************************************* 145 + * 146 + * acpi_rs_convert_i2c_serial_bus 147 + * 148 + ******************************************************************************/ 149 + 150 + struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[16] = { 151 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 152 + ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus), 153 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_i2c_serial_bus)}, 154 + 155 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, 156 + sizeof(struct aml_resource_i2c_serialbus), 157 + 0}, 158 + 159 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id), 160 + AML_OFFSET(common_serial_bus.revision_id), 161 + 1}, 162 + 163 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type), 164 + AML_OFFSET(common_serial_bus.type), 165 + 1}, 166 + 167 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode), 168 + AML_OFFSET(common_serial_bus.flags), 169 + 0}, 170 + 171 + {ACPI_RSC_1BITFLAG, 172 + ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer), 173 + AML_OFFSET(common_serial_bus.flags), 174 + 1}, 175 + 176 + {ACPI_RSC_MOVE8, 177 + ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id), 178 + AML_OFFSET(common_serial_bus.type_revision_id), 179 + 1}, 180 + 181 + {ACPI_RSC_MOVE16, 182 + ACPI_RS_OFFSET(data.common_serial_bus.type_data_length), 183 + AML_OFFSET(common_serial_bus.type_data_length), 184 + 1}, 185 + 186 + /* Vendor data */ 187 + 188 + {ACPI_RSC_COUNT_SERIAL_VEN, 189 + ACPI_RS_OFFSET(data.common_serial_bus.vendor_length), 190 + AML_OFFSET(common_serial_bus.type_data_length), 191 + AML_RESOURCE_I2C_MIN_DATA_LEN}, 192 + 193 + {ACPI_RSC_MOVE_SERIAL_VEN, 194 + ACPI_RS_OFFSET(data.common_serial_bus.vendor_data), 195 + 0, 196 + sizeof(struct aml_resource_i2c_serialbus)}, 197 + 198 + /* Resource Source */ 199 + 200 + {ACPI_RSC_MOVE8, 201 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index), 202 + AML_OFFSET(common_serial_bus.res_source_index), 203 + 1}, 204 + 205 + {ACPI_RSC_COUNT_SERIAL_RES, 206 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length), 207 + AML_OFFSET(common_serial_bus.type_data_length), 208 + sizeof(struct aml_resource_common_serialbus)}, 209 + 210 + {ACPI_RSC_MOVE_SERIAL_RES, 211 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr), 212 + AML_OFFSET(common_serial_bus.type_data_length), 213 + sizeof(struct aml_resource_common_serialbus)}, 214 + 215 + /* I2C bus type specific */ 216 + 217 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.i2c_serial_bus.access_mode), 218 + AML_OFFSET(i2c_serial_bus.type_specific_flags), 219 + 0}, 220 + 221 + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.i2c_serial_bus.connection_speed), 222 + AML_OFFSET(i2c_serial_bus.connection_speed), 223 + 1}, 224 + 225 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.i2c_serial_bus.slave_address), 226 + AML_OFFSET(i2c_serial_bus.slave_address), 227 + 1}, 228 + }; 229 + 230 + /******************************************************************************* 231 + * 232 + * acpi_rs_convert_spi_serial_bus 233 + * 234 + ******************************************************************************/ 235 + 236 + struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[20] = { 237 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 238 + ACPI_RS_SIZE(struct acpi_resource_spi_serialbus), 239 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_spi_serial_bus)}, 240 + 241 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, 242 + sizeof(struct aml_resource_spi_serialbus), 243 + 0}, 244 + 245 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id), 246 + AML_OFFSET(common_serial_bus.revision_id), 247 + 1}, 248 + 249 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type), 250 + AML_OFFSET(common_serial_bus.type), 251 + 1}, 252 + 253 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode), 254 + AML_OFFSET(common_serial_bus.flags), 255 + 0}, 256 + 257 + {ACPI_RSC_1BITFLAG, 258 + ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer), 259 + AML_OFFSET(common_serial_bus.flags), 260 + 1}, 261 + 262 + {ACPI_RSC_MOVE8, 263 + ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id), 264 + AML_OFFSET(common_serial_bus.type_revision_id), 265 + 1}, 266 + 267 + {ACPI_RSC_MOVE16, 268 + ACPI_RS_OFFSET(data.common_serial_bus.type_data_length), 269 + AML_OFFSET(common_serial_bus.type_data_length), 270 + 1}, 271 + 272 + /* Vendor data */ 273 + 274 + {ACPI_RSC_COUNT_SERIAL_VEN, 275 + ACPI_RS_OFFSET(data.common_serial_bus.vendor_length), 276 + AML_OFFSET(common_serial_bus.type_data_length), 277 + AML_RESOURCE_SPI_MIN_DATA_LEN}, 278 + 279 + {ACPI_RSC_MOVE_SERIAL_VEN, 280 + ACPI_RS_OFFSET(data.common_serial_bus.vendor_data), 281 + 0, 282 + sizeof(struct aml_resource_spi_serialbus)}, 283 + 284 + /* Resource Source */ 285 + 286 + {ACPI_RSC_MOVE8, 287 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index), 288 + AML_OFFSET(common_serial_bus.res_source_index), 289 + 1}, 290 + 291 + {ACPI_RSC_COUNT_SERIAL_RES, 292 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length), 293 + AML_OFFSET(common_serial_bus.type_data_length), 294 + sizeof(struct aml_resource_common_serialbus)}, 295 + 296 + {ACPI_RSC_MOVE_SERIAL_RES, 297 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr), 298 + AML_OFFSET(common_serial_bus.type_data_length), 299 + sizeof(struct aml_resource_common_serialbus)}, 300 + 301 + /* Spi bus type specific */ 302 + 303 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.spi_serial_bus.wire_mode), 304 + AML_OFFSET(spi_serial_bus.type_specific_flags), 305 + 0}, 306 + 307 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.spi_serial_bus.device_polarity), 308 + AML_OFFSET(spi_serial_bus.type_specific_flags), 309 + 1}, 310 + 311 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.data_bit_length), 312 + AML_OFFSET(spi_serial_bus.data_bit_length), 313 + 1}, 314 + 315 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.clock_phase), 316 + AML_OFFSET(spi_serial_bus.clock_phase), 317 + 1}, 318 + 319 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.spi_serial_bus.clock_polarity), 320 + AML_OFFSET(spi_serial_bus.clock_polarity), 321 + 1}, 322 + 323 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.spi_serial_bus.device_selection), 324 + AML_OFFSET(spi_serial_bus.device_selection), 325 + 1}, 326 + 327 + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.spi_serial_bus.connection_speed), 328 + AML_OFFSET(spi_serial_bus.connection_speed), 329 + 1}, 330 + }; 331 + 332 + /******************************************************************************* 333 + * 334 + * acpi_rs_convert_uart_serial_bus 335 + * 336 + ******************************************************************************/ 337 + 338 + struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[22] = { 339 + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, 340 + ACPI_RS_SIZE(struct acpi_resource_uart_serialbus), 341 + ACPI_RSC_TABLE_SIZE(acpi_rs_convert_uart_serial_bus)}, 342 + 343 + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, 344 + sizeof(struct aml_resource_uart_serialbus), 345 + 0}, 346 + 347 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id), 348 + AML_OFFSET(common_serial_bus.revision_id), 349 + 1}, 350 + 351 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.type), 352 + AML_OFFSET(common_serial_bus.type), 353 + 1}, 354 + 355 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.common_serial_bus.slave_mode), 356 + AML_OFFSET(common_serial_bus.flags), 357 + 0}, 358 + 359 + {ACPI_RSC_1BITFLAG, 360 + ACPI_RS_OFFSET(data.common_serial_bus.producer_consumer), 361 + AML_OFFSET(common_serial_bus.flags), 362 + 1}, 363 + 364 + {ACPI_RSC_MOVE8, 365 + ACPI_RS_OFFSET(data.common_serial_bus.type_revision_id), 366 + AML_OFFSET(common_serial_bus.type_revision_id), 367 + 1}, 368 + 369 + {ACPI_RSC_MOVE16, 370 + ACPI_RS_OFFSET(data.common_serial_bus.type_data_length), 371 + AML_OFFSET(common_serial_bus.type_data_length), 372 + 1}, 373 + 374 + /* Vendor data */ 375 + 376 + {ACPI_RSC_COUNT_SERIAL_VEN, 377 + ACPI_RS_OFFSET(data.common_serial_bus.vendor_length), 378 + AML_OFFSET(common_serial_bus.type_data_length), 379 + AML_RESOURCE_UART_MIN_DATA_LEN}, 380 + 381 + {ACPI_RSC_MOVE_SERIAL_VEN, 382 + ACPI_RS_OFFSET(data.common_serial_bus.vendor_data), 383 + 0, 384 + sizeof(struct aml_resource_uart_serialbus)}, 385 + 386 + /* Resource Source */ 387 + 388 + {ACPI_RSC_MOVE8, 389 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.index), 390 + AML_OFFSET(common_serial_bus.res_source_index), 391 + 1}, 392 + 393 + {ACPI_RSC_COUNT_SERIAL_RES, 394 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_length), 395 + AML_OFFSET(common_serial_bus.type_data_length), 396 + sizeof(struct aml_resource_common_serialbus)}, 397 + 398 + {ACPI_RSC_MOVE_SERIAL_RES, 399 + ACPI_RS_OFFSET(data.common_serial_bus.resource_source.string_ptr), 400 + AML_OFFSET(common_serial_bus.type_data_length), 401 + sizeof(struct aml_resource_common_serialbus)}, 402 + 403 + /* Uart bus type specific */ 404 + 405 + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.flow_control), 406 + AML_OFFSET(uart_serial_bus.type_specific_flags), 407 + 0}, 408 + 409 + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.stop_bits), 410 + AML_OFFSET(uart_serial_bus.type_specific_flags), 411 + 2}, 412 + 413 + {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.data_bits), 414 + AML_OFFSET(uart_serial_bus.type_specific_flags), 415 + 4}, 416 + 417 + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.uart_serial_bus.endian), 418 + AML_OFFSET(uart_serial_bus.type_specific_flags), 419 + 7}, 420 + 421 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.uart_serial_bus.parity), 422 + AML_OFFSET(uart_serial_bus.parity), 423 + 1}, 424 + 425 + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.uart_serial_bus.lines_enabled), 426 + AML_OFFSET(uart_serial_bus.lines_enabled), 427 + 1}, 428 + 429 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.uart_serial_bus.rx_fifo_size), 430 + AML_OFFSET(uart_serial_bus.rx_fifo_size), 431 + 1}, 432 + 433 + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.uart_serial_bus.tx_fifo_size), 434 + AML_OFFSET(uart_serial_bus.tx_fifo_size), 435 + 1}, 436 + 437 + {ACPI_RSC_MOVE32, 438 + ACPI_RS_OFFSET(data.uart_serial_bus.default_baud_rate), 439 + AML_OFFSET(uart_serial_bus.default_baud_rate), 440 + 1}, 441 + };
+55 -1
drivers/acpi/acpica/rsutils.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 144 144 * since there are no alignment or endian issues 145 145 */ 146 146 case ACPI_RSC_MOVE8: 147 + case ACPI_RSC_MOVE_GPIO_RES: 148 + case ACPI_RSC_MOVE_SERIAL_VEN: 149 + case ACPI_RSC_MOVE_SERIAL_RES: 147 150 ACPI_MEMCPY(destination, source, item_count); 148 151 return; 149 152 ··· 156 153 * misaligned memory transfers 157 154 */ 158 155 case ACPI_RSC_MOVE16: 156 + case ACPI_RSC_MOVE_GPIO_PIN: 159 157 ACPI_MOVE_16_TO_16(&ACPI_CAST_PTR(u16, destination)[i], 160 158 &ACPI_CAST_PTR(u16, source)[i]); 161 159 break; ··· 591 587 return_ACPI_STATUS(status); 592 588 } 593 589 #endif /* ACPI_FUTURE_USAGE */ 590 + 591 + /******************************************************************************* 592 + * 593 + * FUNCTION: acpi_rs_get_aei_method_data 594 + * 595 + * PARAMETERS: Node - Device node 596 + * ret_buffer - Pointer to a buffer structure for the 597 + * results 598 + * 599 + * RETURN: Status 600 + * 601 + * DESCRIPTION: This function is called to get the _AEI value of an object 602 + * contained in an object specified by the handle passed in 603 + * 604 + * If the function fails an appropriate status will be returned 605 + * and the contents of the callers buffer is undefined. 606 + * 607 + ******************************************************************************/ 608 + 609 + acpi_status 610 + acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, 611 + struct acpi_buffer *ret_buffer) 612 + { 613 + union acpi_operand_object *obj_desc; 614 + acpi_status status; 615 + 616 + ACPI_FUNCTION_TRACE(rs_get_aei_method_data); 617 + 618 + /* Parameters guaranteed valid by caller */ 619 + 620 + /* Execute the method, no parameters */ 621 + 622 + status = acpi_ut_evaluate_object(node, METHOD_NAME__AEI, 623 + ACPI_BTYPE_BUFFER, &obj_desc); 624 + if (ACPI_FAILURE(status)) { 625 + return_ACPI_STATUS(status); 626 + } 627 + 628 + /* 629 + * Make the call to create a resource linked list from the 630 + * byte stream buffer that comes back from the _CRS method 631 + * execution. 632 + */ 633 + status = acpi_rs_create_resource_list(obj_desc, ret_buffer); 634 + 635 + /* On exit, we must delete the object returned by evaluate_object */ 636 + 637 + acpi_ut_remove_reference(obj_desc); 638 + return_ACPI_STATUS(status); 639 + } 594 640 595 641 /******************************************************************************* 596 642 *
+47 -5
drivers/acpi/acpica/rsxface.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 307 307 308 308 ACPI_EXPORT_SYMBOL(acpi_set_current_resources) 309 309 310 + /******************************************************************************* 311 + * 312 + * FUNCTION: acpi_get_event_resources 313 + * 314 + * PARAMETERS: device_handle - Handle to the device object for the 315 + * device we are getting resources 316 + * in_buffer - Pointer to a buffer containing the 317 + * resources to be set for the device 318 + * 319 + * RETURN: Status 320 + * 321 + * DESCRIPTION: This function is called to get the event resources for a 322 + * specific device. The caller must first acquire a handle for 323 + * the desired device. The resource data is passed to the routine 324 + * the buffer pointed to by the in_buffer variable. Uses the 325 + * _AEI method. 326 + * 327 + ******************************************************************************/ 328 + acpi_status 329 + acpi_get_event_resources(acpi_handle device_handle, 330 + struct acpi_buffer *ret_buffer) 331 + { 332 + acpi_status status; 333 + struct acpi_namespace_node *node; 334 + 335 + ACPI_FUNCTION_TRACE(acpi_get_event_resources); 336 + 337 + /* Validate parameters then dispatch to internal routine */ 338 + 339 + status = acpi_rs_validate_parameters(device_handle, ret_buffer, &node); 340 + if (ACPI_FAILURE(status)) { 341 + return_ACPI_STATUS(status); 342 + } 343 + 344 + status = acpi_rs_get_aei_method_data(node, ret_buffer); 345 + return_ACPI_STATUS(status); 346 + } 347 + 348 + ACPI_EXPORT_SYMBOL(acpi_get_event_resources) 349 + 310 350 /****************************************************************************** 311 351 * 312 352 * FUNCTION: acpi_resource_to_address64 ··· 526 486 * 527 487 * PARAMETERS: device_handle - Handle to the device object for the 528 488 * device we are querying 529 - * Name - Method name of the resources we want 530 - * (METHOD_NAME__CRS or METHOD_NAME__PRS) 489 + * Name - Method name of the resources we want. 490 + * (METHOD_NAME__CRS, METHOD_NAME__PRS, or 491 + * METHOD_NAME__AEI) 531 492 * user_function - Called for each resource 532 493 * Context - Passed to user_function 533 494 * ··· 555 514 556 515 if (!device_handle || !user_function || !name || 557 516 (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) && 558 - !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS))) { 517 + !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) && 518 + !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI))) { 559 519 return_ACPI_STATUS(AE_BAD_PARAMETER); 560 520 } 561 521 562 - /* Get the _CRS or _PRS resource list */ 522 + /* Get the _CRS/_PRS/_AEI resource list */ 563 523 564 524 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; 565 525 status = acpi_rs_get_method_data(device_handle, name, &buffer);
+30 -11
drivers/acpi/acpica/tbfadt.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 63 63 64 64 typedef struct acpi_fadt_info { 65 65 char *name; 66 - u8 address64; 67 - u8 address32; 68 - u8 length; 66 + u16 address64; 67 + u16 address32; 68 + u16 length; 69 69 u8 default_length; 70 70 u8 type; 71 71 72 72 } acpi_fadt_info; 73 73 74 + #define ACPI_FADT_OPTIONAL 0 74 75 #define ACPI_FADT_REQUIRED 1 75 76 #define ACPI_FADT_SEPARATE_LENGTH 2 76 77 ··· 88 87 ACPI_FADT_OFFSET(pm1b_event_block), 89 88 ACPI_FADT_OFFSET(pm1_event_length), 90 89 ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */ 91 - 0}, 90 + ACPI_FADT_OPTIONAL}, 92 91 93 92 {"Pm1aControlBlock", 94 93 ACPI_FADT_OFFSET(xpm1a_control_block), ··· 102 101 ACPI_FADT_OFFSET(pm1b_control_block), 103 102 ACPI_FADT_OFFSET(pm1_control_length), 104 103 ACPI_PM1_REGISTER_WIDTH, 105 - 0}, 104 + ACPI_FADT_OPTIONAL}, 106 105 107 106 {"Pm2ControlBlock", 108 107 ACPI_FADT_OFFSET(xpm2_control_block), ··· 140 139 141 140 typedef struct acpi_fadt_pm_info { 142 141 struct acpi_generic_address *target; 143 - u8 source; 142 + u16 source; 144 143 u8 register_num; 145 144 146 145 } acpi_fadt_pm_info; ··· 254 253 acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt, 255 254 ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT); 256 255 257 - acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs, 258 - ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); 256 + /* If Hardware Reduced flag is set, there is no FACS */ 257 + 258 + if (!acpi_gbl_reduced_hardware) { 259 + acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT. 260 + Xfacs, ACPI_SIG_FACS, 261 + ACPI_TABLE_INDEX_FACS); 262 + } 259 263 } 260 264 261 265 /******************************************************************************* ··· 283 277 { 284 278 /* 285 279 * Check if the FADT is larger than the largest table that we expect 286 - * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue 280 + * (the ACPI 5.0 version). If so, truncate the table, and issue 287 281 * a warning. 288 282 */ 289 283 if (length > sizeof(struct acpi_table_fadt)) { 290 284 ACPI_WARNING((AE_INFO, 291 - "FADT (revision %u) is longer than ACPI 2.0 version, " 285 + "FADT (revision %u) is longer than ACPI 5.0 version, " 292 286 "truncating length %u to %u", 293 287 table->revision, length, 294 288 (u32)sizeof(struct acpi_table_fadt))); ··· 302 296 303 297 ACPI_MEMCPY(&acpi_gbl_FADT, table, 304 298 ACPI_MIN(length, sizeof(struct acpi_table_fadt))); 299 + 300 + /* Take a copy of the Hardware Reduced flag */ 301 + 302 + acpi_gbl_reduced_hardware = FALSE; 303 + if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) { 304 + acpi_gbl_reduced_hardware = TRUE; 305 + } 305 306 306 307 /* Convert the local copy of the FADT to the common internal format */ 307 308 ··· 513 500 ACPI_FORMAT_UINT64(acpi_gbl_FADT.Xdsdt))); 514 501 515 502 acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; 503 + } 504 + 505 + /* If Hardware Reduced flag is set, we are all done */ 506 + 507 + if (acpi_gbl_reduced_hardware) { 508 + return; 516 509 } 517 510 518 511 /* Examine all of the 64-bit extended address fields (X fields) */
+1 -1
drivers/acpi/acpica/tbfind.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbinstal.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+8 -1
drivers/acpi/acpica/tbutils.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 134 134 acpi_status acpi_tb_initialize_facs(void) 135 135 { 136 136 acpi_status status; 137 + 138 + /* If Hardware Reduced flag is set, there is no FACS */ 139 + 140 + if (acpi_gbl_reduced_hardware) { 141 + acpi_gbl_FACS = NULL; 142 + return (AE_OK); 143 + } 137 144 138 145 status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, 139 146 ACPI_CAST_INDIRECT_PTR(struct
+1 -1
drivers/acpi/acpica/tbxface.c
··· 6 6 *****************************************************************************/ 7 7 8 8 /* 9 - * Copyright (C) 2000 - 2011, Intel Corp. 9 + * Copyright (C) 2000 - 2012, Intel Corp. 10 10 * All rights reserved. 11 11 * 12 12 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/tbxfroot.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+294
drivers/acpi/acpica/utaddress.c
··· 1 + /****************************************************************************** 2 + * 3 + * Module Name: utaddress - op_region address range check 4 + * 5 + *****************************************************************************/ 6 + 7 + /* 8 + * Copyright (C) 2000 - 2012, 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 "acnamesp.h" 47 + 48 + #define _COMPONENT ACPI_UTILITIES 49 + ACPI_MODULE_NAME("utaddress") 50 + 51 + /******************************************************************************* 52 + * 53 + * FUNCTION: acpi_ut_add_address_range 54 + * 55 + * PARAMETERS: space_id - Address space ID 56 + * Address - op_region start address 57 + * Length - op_region length 58 + * region_node - op_region namespace node 59 + * 60 + * RETURN: Status 61 + * 62 + * DESCRIPTION: Add the Operation Region address range to the global list. 63 + * The only supported Space IDs are Memory and I/O. Called when 64 + * the op_region address/length operands are fully evaluated. 65 + * 66 + * MUTEX: Locks the namespace 67 + * 68 + * NOTE: Because this interface is only called when an op_region argument 69 + * list is evaluated, there cannot be any duplicate region_nodes. 70 + * Duplicate Address/Length values are allowed, however, so that multiple 71 + * address conflicts can be detected. 72 + * 73 + ******************************************************************************/ 74 + acpi_status 75 + acpi_ut_add_address_range(acpi_adr_space_type space_id, 76 + acpi_physical_address address, 77 + u32 length, struct acpi_namespace_node *region_node) 78 + { 79 + struct acpi_address_range *range_info; 80 + acpi_status status; 81 + 82 + ACPI_FUNCTION_TRACE(ut_add_address_range); 83 + 84 + if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && 85 + (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { 86 + return_ACPI_STATUS(AE_OK); 87 + } 88 + 89 + /* Allocate/init a new info block, add it to the appropriate list */ 90 + 91 + range_info = ACPI_ALLOCATE(sizeof(struct acpi_address_range)); 92 + if (!range_info) { 93 + return_ACPI_STATUS(AE_NO_MEMORY); 94 + } 95 + 96 + range_info->start_address = address; 97 + range_info->end_address = (address + length - 1); 98 + range_info->region_node = region_node; 99 + 100 + status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 101 + if (ACPI_FAILURE(status)) { 102 + ACPI_FREE(range_info); 103 + return_ACPI_STATUS(status); 104 + } 105 + 106 + range_info->next = acpi_gbl_address_range_list[space_id]; 107 + acpi_gbl_address_range_list[space_id] = range_info; 108 + 109 + ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 110 + "\nAdded [%4.4s] address range: 0x%p-0x%p\n", 111 + acpi_ut_get_node_name(range_info->region_node), 112 + ACPI_CAST_PTR(void, address), 113 + ACPI_CAST_PTR(void, range_info->end_address))); 114 + 115 + (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 116 + return_ACPI_STATUS(AE_OK); 117 + } 118 + 119 + /******************************************************************************* 120 + * 121 + * FUNCTION: acpi_ut_remove_address_range 122 + * 123 + * PARAMETERS: space_id - Address space ID 124 + * region_node - op_region namespace node 125 + * 126 + * RETURN: None 127 + * 128 + * DESCRIPTION: Remove the Operation Region from the global list. The only 129 + * supported Space IDs are Memory and I/O. Called when an 130 + * op_region is deleted. 131 + * 132 + * MUTEX: Assumes the namespace is locked 133 + * 134 + ******************************************************************************/ 135 + 136 + void 137 + acpi_ut_remove_address_range(acpi_adr_space_type space_id, 138 + struct acpi_namespace_node *region_node) 139 + { 140 + struct acpi_address_range *range_info; 141 + struct acpi_address_range *prev; 142 + 143 + ACPI_FUNCTION_TRACE(ut_remove_address_range); 144 + 145 + if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && 146 + (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { 147 + return_VOID; 148 + } 149 + 150 + /* Get the appropriate list head and check the list */ 151 + 152 + range_info = prev = acpi_gbl_address_range_list[space_id]; 153 + while (range_info) { 154 + if (range_info->region_node == region_node) { 155 + if (range_info == prev) { /* Found at list head */ 156 + acpi_gbl_address_range_list[space_id] = 157 + range_info->next; 158 + } else { 159 + prev->next = range_info->next; 160 + } 161 + 162 + ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 163 + "\nRemoved [%4.4s] address range: 0x%p-0x%p\n", 164 + acpi_ut_get_node_name(range_info-> 165 + region_node), 166 + ACPI_CAST_PTR(void, 167 + range_info-> 168 + start_address), 169 + ACPI_CAST_PTR(void, 170 + range_info-> 171 + end_address))); 172 + 173 + ACPI_FREE(range_info); 174 + return_VOID; 175 + } 176 + 177 + prev = range_info; 178 + range_info = range_info->next; 179 + } 180 + 181 + return_VOID; 182 + } 183 + 184 + /******************************************************************************* 185 + * 186 + * FUNCTION: acpi_ut_check_address_range 187 + * 188 + * PARAMETERS: space_id - Address space ID 189 + * Address - Start address 190 + * Length - Length of address range 191 + * Warn - TRUE if warning on overlap desired 192 + * 193 + * RETURN: Count of the number of conflicts detected. Zero is always 194 + * returned for Space IDs other than Memory or I/O. 195 + * 196 + * DESCRIPTION: Check if the input address range overlaps any of the 197 + * ASL operation region address ranges. The only supported 198 + * Space IDs are Memory and I/O. 199 + * 200 + * MUTEX: Assumes the namespace is locked. 201 + * 202 + ******************************************************************************/ 203 + 204 + u32 205 + acpi_ut_check_address_range(acpi_adr_space_type space_id, 206 + acpi_physical_address address, u32 length, u8 warn) 207 + { 208 + struct acpi_address_range *range_info; 209 + acpi_physical_address end_address; 210 + char *pathname; 211 + u32 overlap_count = 0; 212 + 213 + ACPI_FUNCTION_TRACE(ut_check_address_range); 214 + 215 + if ((space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && 216 + (space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { 217 + return_UINT32(0); 218 + } 219 + 220 + range_info = acpi_gbl_address_range_list[space_id]; 221 + end_address = address + length - 1; 222 + 223 + /* Check entire list for all possible conflicts */ 224 + 225 + while (range_info) { 226 + /* 227 + * Check if the requested Address/Length overlaps this address_range. 228 + * Four cases to consider: 229 + * 230 + * 1) Input address/length is contained completely in the address range 231 + * 2) Input address/length overlaps range at the range start 232 + * 3) Input address/length overlaps range at the range end 233 + * 4) Input address/length completely encompasses the range 234 + */ 235 + if ((address <= range_info->end_address) && 236 + (end_address >= range_info->start_address)) { 237 + 238 + /* Found an address range overlap */ 239 + 240 + overlap_count++; 241 + if (warn) { /* Optional warning message */ 242 + pathname = 243 + acpi_ns_get_external_pathname(range_info-> 244 + region_node); 245 + 246 + ACPI_WARNING((AE_INFO, 247 + "0x%p-0x%p %s conflicts with Region %s %d", 248 + ACPI_CAST_PTR(void, address), 249 + ACPI_CAST_PTR(void, end_address), 250 + acpi_ut_get_region_name(space_id), 251 + pathname, overlap_count)); 252 + ACPI_FREE(pathname); 253 + } 254 + } 255 + 256 + range_info = range_info->next; 257 + } 258 + 259 + return_UINT32(overlap_count); 260 + } 261 + 262 + /******************************************************************************* 263 + * 264 + * FUNCTION: acpi_ut_delete_address_lists 265 + * 266 + * PARAMETERS: None 267 + * 268 + * RETURN: None 269 + * 270 + * DESCRIPTION: Delete all global address range lists (called during 271 + * subsystem shutdown). 272 + * 273 + ******************************************************************************/ 274 + 275 + void acpi_ut_delete_address_lists(void) 276 + { 277 + struct acpi_address_range *next; 278 + struct acpi_address_range *range_info; 279 + int i; 280 + 281 + /* Delete all elements in all address range lists */ 282 + 283 + for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) { 284 + next = acpi_gbl_address_range_list[i]; 285 + 286 + while (next) { 287 + range_info = next; 288 + next = range_info->next; 289 + ACPI_FREE(range_info); 290 + } 291 + 292 + acpi_gbl_address_range_list[i] = NULL; 293 + } 294 + }
+1 -1
drivers/acpi/acpica/utalloc.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utcopy.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utdebug.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+4 -2
drivers/acpi/acpica/utdecode.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 171 171 "SMBus", 172 172 "SystemCMOS", 173 173 "PCIBARTarget", 174 - "IPMI" 174 + "IPMI", 175 + "GeneralPurposeIo", 176 + "GenericSerialBus" 175 177 }; 176 178 177 179 char *acpi_ut_get_region_name(u8 space_id)
+9 -6
drivers/acpi/acpica/utdelete.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 215 215 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, 216 216 "***** Region %p\n", object)); 217 217 218 - /* Invalidate the region address/length via the host OS */ 219 - 220 - acpi_os_invalidate_address(object->region.space_id, 221 - object->region.address, 222 - (acpi_size) object->region.length); 218 + /* 219 + * Update address_range list. However, only permanent regions 220 + * are installed in this list. (Not created within a method) 221 + */ 222 + if (!(object->region.node->flags & ANOBJ_TEMPORARY)) { 223 + acpi_ut_remove_address_range(object->region.space_id, 224 + object->region.node); 225 + } 223 226 224 227 second_desc = acpi_ns_get_secondary_object(object); 225 228 if (second_desc) {
+1 -1
drivers/acpi/acpica/uteval.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+7 -1
drivers/acpi/acpica/utglobal.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 262 262 status = acpi_ut_create_caches(); 263 263 if (ACPI_FAILURE(status)) { 264 264 return_ACPI_STATUS(status); 265 + } 266 + 267 + /* Address Range lists */ 268 + 269 + for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) { 270 + acpi_gbl_address_range_list[i] = NULL; 265 271 } 266 272 267 273 /* Mutex locked flags */
+1 -1
drivers/acpi/acpica/utids.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+2 -1
drivers/acpi/acpica/utinit.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 92 92 gpe_xrupt_info = next_gpe_xrupt_info; 93 93 } 94 94 95 + acpi_ut_delete_address_lists(); 95 96 return_VOID; 96 97 } 97 98
+1 -1
drivers/acpi/acpica/utlock.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utmath.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utmisc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+4 -7
drivers/acpi/acpica/utmutex.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 293 293 294 294 acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) 295 295 { 296 - acpi_thread_id this_thread_id; 297 - 298 296 ACPI_FUNCTION_NAME(ut_release_mutex); 299 297 300 - this_thread_id = acpi_os_get_thread_id(); 301 - 302 298 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", 303 - (u32)this_thread_id, 299 + (u32)acpi_os_get_thread_id(), 304 300 acpi_ut_get_mutex_name(mutex_id))); 305 301 306 302 if (mutex_id > ACPI_MAX_MUTEX) { ··· 325 329 * the ACPI subsystem code. 326 330 */ 327 331 for (i = mutex_id; i < ACPI_NUM_MUTEX; i++) { 328 - if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 332 + if (acpi_gbl_mutex_info[i].thread_id == 333 + acpi_os_get_thread_id()) { 329 334 if (i == mutex_id) { 330 335 continue; 331 336 }
+1 -1
drivers/acpi/acpica/utobject.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+1 -1
drivers/acpi/acpica/utosi.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+243 -35
drivers/acpi/acpica/utresrc.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 43 43 44 44 #include <acpi/acpi.h> 45 45 #include "accommon.h" 46 - #include "amlresrc.h" 46 + #include "acresrc.h" 47 47 48 48 #define _COMPONENT ACPI_UTILITIES 49 49 ACPI_MODULE_NAME("utresrc") ··· 154 154 "TypeF" 155 155 }; 156 156 157 + const char *acpi_gbl_ppc_decode[] = { 158 + "PullDefault", 159 + "PullUp", 160 + "PullDown", 161 + "PullNone" 162 + }; 163 + 164 + const char *acpi_gbl_ior_decode[] = { 165 + "IoRestrictionNone", 166 + "IoRestrictionInputOnly", 167 + "IoRestrictionOutputOnly", 168 + "IoRestrictionNoneAndPreserve" 169 + }; 170 + 171 + const char *acpi_gbl_dts_decode[] = { 172 + "Width8bit", 173 + "Width16bit", 174 + "Width32bit", 175 + "Width64bit", 176 + "Width128bit", 177 + "Width256bit", 178 + }; 179 + 180 + /* GPIO connection type */ 181 + 182 + const char *acpi_gbl_ct_decode[] = { 183 + "Interrupt", 184 + "I/O" 185 + }; 186 + 187 + /* Serial bus type */ 188 + 189 + const char *acpi_gbl_sbt_decode[] = { 190 + "/* UNKNOWN serial bus type */", 191 + "I2C", 192 + "SPI", 193 + "UART" 194 + }; 195 + 196 + /* I2C serial bus access mode */ 197 + 198 + const char *acpi_gbl_am_decode[] = { 199 + "AddressingMode7Bit", 200 + "AddressingMode10Bit" 201 + }; 202 + 203 + /* I2C serial bus slave mode */ 204 + 205 + const char *acpi_gbl_sm_decode[] = { 206 + "ControllerInitiated", 207 + "DeviceInitiated" 208 + }; 209 + 210 + /* SPI serial bus wire mode */ 211 + 212 + const char *acpi_gbl_wm_decode[] = { 213 + "FourWireMode", 214 + "ThreeWireMode" 215 + }; 216 + 217 + /* SPI serial clock phase */ 218 + 219 + const char *acpi_gbl_cph_decode[] = { 220 + "ClockPhaseFirst", 221 + "ClockPhaseSecond" 222 + }; 223 + 224 + /* SPI serial bus clock polarity */ 225 + 226 + const char *acpi_gbl_cpo_decode[] = { 227 + "ClockPolarityLow", 228 + "ClockPolarityHigh" 229 + }; 230 + 231 + /* SPI serial bus device polarity */ 232 + 233 + const char *acpi_gbl_dp_decode[] = { 234 + "PolarityLow", 235 + "PolarityHigh" 236 + }; 237 + 238 + /* UART serial bus endian */ 239 + 240 + const char *acpi_gbl_ed_decode[] = { 241 + "LittleEndian", 242 + "BigEndian" 243 + }; 244 + 245 + /* UART serial bus bits per byte */ 246 + 247 + const char *acpi_gbl_bpb_decode[] = { 248 + "DataBitsFive", 249 + "DataBitsSix", 250 + "DataBitsSeven", 251 + "DataBitsEight", 252 + "DataBitsNine", 253 + "/* UNKNOWN Bits per byte */", 254 + "/* UNKNOWN Bits per byte */", 255 + "/* UNKNOWN Bits per byte */" 256 + }; 257 + 258 + /* UART serial bus stop bits */ 259 + 260 + const char *acpi_gbl_sb_decode[] = { 261 + "StopBitsNone", 262 + "StopBitsOne", 263 + "StopBitsOnePlusHalf", 264 + "StopBitsTwo" 265 + }; 266 + 267 + /* UART serial bus flow control */ 268 + 269 + const char *acpi_gbl_fc_decode[] = { 270 + "FlowControlNone", 271 + "FlowControlHardware", 272 + "FlowControlXON", 273 + "/* UNKNOWN flow control keyword */" 274 + }; 275 + 276 + /* UART serial bus parity type */ 277 + 278 + const char *acpi_gbl_pt_decode[] = { 279 + "ParityTypeNone", 280 + "ParityTypeEven", 281 + "ParityTypeOdd", 282 + "ParityTypeMark", 283 + "ParityTypeSpace", 284 + "/* UNKNOWN parity keyword */", 285 + "/* UNKNOWN parity keyword */", 286 + "/* UNKNOWN parity keyword */" 287 + }; 288 + 157 289 #endif 158 290 159 291 /* ··· 305 173 ACPI_AML_SIZE_SMALL(struct aml_resource_end_dependent), 306 174 ACPI_AML_SIZE_SMALL(struct aml_resource_io), 307 175 ACPI_AML_SIZE_SMALL(struct aml_resource_fixed_io), 308 - 0, 176 + ACPI_AML_SIZE_SMALL(struct aml_resource_fixed_dma), 309 177 0, 310 178 0, 311 179 0, ··· 325 193 ACPI_AML_SIZE_LARGE(struct aml_resource_address16), 326 194 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_irq), 327 195 ACPI_AML_SIZE_LARGE(struct aml_resource_address64), 328 - ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64) 196 + ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64), 197 + ACPI_AML_SIZE_LARGE(struct aml_resource_gpio), 198 + 0, 199 + ACPI_AML_SIZE_LARGE(struct aml_resource_common_serialbus), 200 + }; 201 + 202 + const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = { 203 + 0, 204 + ACPI_AML_SIZE_LARGE(struct aml_resource_i2c_serialbus), 205 + ACPI_AML_SIZE_LARGE(struct aml_resource_spi_serialbus), 206 + ACPI_AML_SIZE_LARGE(struct aml_resource_uart_serialbus), 329 207 }; 330 208 331 209 /* ··· 351 209 0, 352 210 0, 353 211 0, 354 - ACPI_SMALL_VARIABLE_LENGTH, 355 - ACPI_FIXED_LENGTH, 356 - ACPI_SMALL_VARIABLE_LENGTH, 357 - ACPI_FIXED_LENGTH, 358 - ACPI_FIXED_LENGTH, 359 - ACPI_FIXED_LENGTH, 212 + ACPI_SMALL_VARIABLE_LENGTH, /* 04 IRQ */ 213 + ACPI_FIXED_LENGTH, /* 05 DMA */ 214 + ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */ 215 + ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */ 216 + ACPI_FIXED_LENGTH, /* 08 IO */ 217 + ACPI_FIXED_LENGTH, /* 09 fixed_iO */ 218 + ACPI_FIXED_LENGTH, /* 0_a fixed_dMA */ 360 219 0, 361 220 0, 362 221 0, 363 - 0, 364 - ACPI_VARIABLE_LENGTH, 365 - ACPI_FIXED_LENGTH, 222 + ACPI_VARIABLE_LENGTH, /* 0_e vendor_short */ 223 + ACPI_FIXED_LENGTH, /* 0_f end_tag */ 366 224 367 225 /* Large descriptors */ 368 226 369 227 0, 370 - ACPI_FIXED_LENGTH, 371 - ACPI_FIXED_LENGTH, 228 + ACPI_FIXED_LENGTH, /* 01 Memory24 */ 229 + ACPI_FIXED_LENGTH, /* 02 generic_register */ 372 230 0, 373 - ACPI_VARIABLE_LENGTH, 374 - ACPI_FIXED_LENGTH, 375 - ACPI_FIXED_LENGTH, 376 - ACPI_VARIABLE_LENGTH, 377 - ACPI_VARIABLE_LENGTH, 378 - ACPI_VARIABLE_LENGTH, 379 - ACPI_VARIABLE_LENGTH, 380 - ACPI_FIXED_LENGTH 231 + ACPI_VARIABLE_LENGTH, /* 04 vendor_long */ 232 + ACPI_FIXED_LENGTH, /* 05 Memory32 */ 233 + ACPI_FIXED_LENGTH, /* 06 memory32_fixed */ 234 + ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ 235 + ACPI_VARIABLE_LENGTH, /* 08 Word* address */ 236 + ACPI_VARIABLE_LENGTH, /* 09 extended_iRQ */ 237 + ACPI_VARIABLE_LENGTH, /* 0_a Qword* address */ 238 + ACPI_FIXED_LENGTH, /* 0_b Extended* address */ 239 + ACPI_VARIABLE_LENGTH, /* 0_c Gpio* */ 240 + 0, 241 + ACPI_VARIABLE_LENGTH /* 0_e *serial_bus */ 381 242 }; 243 + 244 + /* 245 + * For the i_aSL compiler/disassembler, we don't want any error messages 246 + * because the disassembler uses the resource validation code to determine 247 + * if Buffer objects are actually Resource Templates. 248 + */ 249 + #ifdef ACPI_ASL_COMPILER 250 + #define ACPI_RESOURCE_ERROR(plist) 251 + #else 252 + #define ACPI_RESOURCE_ERROR(plist) ACPI_ERROR(plist) 253 + #endif 382 254 383 255 /******************************************************************************* 384 256 * ··· 421 265 u8 resource_index; 422 266 u32 length; 423 267 u32 offset = 0; 268 + u8 end_tag[2] = { 0x79, 0x00 }; 424 269 425 270 ACPI_FUNCTION_TRACE(ut_walk_aml_resources); 426 271 ··· 443 286 444 287 status = acpi_ut_validate_resource(aml, &resource_index); 445 288 if (ACPI_FAILURE(status)) { 289 + /* 290 + * Exit on failure. Cannot continue because the descriptor length 291 + * may be bogus also. 292 + */ 446 293 return_ACPI_STATUS(status); 447 294 } 448 295 ··· 461 300 user_function(aml, length, offset, resource_index, 462 301 context); 463 302 if (ACPI_FAILURE(status)) { 464 - return (status); 303 + return_ACPI_STATUS(status); 465 304 } 466 305 } 467 306 ··· 494 333 495 334 /* Did not find an end_tag descriptor */ 496 335 497 - return (AE_AML_NO_RESOURCE_END_TAG); 336 + if (user_function) { 337 + 338 + /* Insert an end_tag anyway. acpi_rs_get_list_length always leaves room */ 339 + 340 + (void)acpi_ut_validate_resource(end_tag, &resource_index); 341 + status = 342 + user_function(end_tag, 2, offset, resource_index, context); 343 + if (ACPI_FAILURE(status)) { 344 + return_ACPI_STATUS(status); 345 + } 346 + } 347 + 348 + return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG); 498 349 } 499 350 500 351 /******************************************************************************* ··· 527 354 528 355 acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index) 529 356 { 357 + union aml_resource *aml_resource; 530 358 u8 resource_type; 531 359 u8 resource_index; 532 360 acpi_rs_length resource_length; ··· 549 375 /* Verify the large resource type (name) against the max */ 550 376 551 377 if (resource_type > ACPI_RESOURCE_NAME_LARGE_MAX) { 552 - return (AE_AML_INVALID_RESOURCE_TYPE); 378 + goto invalid_resource; 553 379 } 554 380 555 381 /* ··· 566 392 ((resource_type & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3); 567 393 } 568 394 569 - /* Check validity of the resource type, zero indicates name is invalid */ 570 - 395 + /* 396 + * Check validity of the resource type, via acpi_gbl_resource_types. Zero 397 + * indicates an invalid resource. 398 + */ 571 399 if (!acpi_gbl_resource_types[resource_index]) { 572 - return (AE_AML_INVALID_RESOURCE_TYPE); 400 + goto invalid_resource; 573 401 } 574 402 575 403 /* 576 - * 2) Validate the resource_length field. This ensures that the length 577 - * is at least reasonable, and guarantees that it is non-zero. 404 + * Validate the resource_length field. This ensures that the length 405 + * is at least reasonable, and guarantees that it is non-zero. 578 406 */ 579 407 resource_length = acpi_ut_get_resource_length(aml); 580 408 minimum_resource_length = acpi_gbl_resource_aml_sizes[resource_index]; ··· 589 413 /* Fixed length resource, length must match exactly */ 590 414 591 415 if (resource_length != minimum_resource_length) { 592 - return (AE_AML_BAD_RESOURCE_LENGTH); 416 + goto bad_resource_length; 593 417 } 594 418 break; 595 419 ··· 598 422 /* Variable length resource, length must be at least the minimum */ 599 423 600 424 if (resource_length < minimum_resource_length) { 601 - return (AE_AML_BAD_RESOURCE_LENGTH); 425 + goto bad_resource_length; 602 426 } 603 427 break; 604 428 ··· 608 432 609 433 if ((resource_length > minimum_resource_length) || 610 434 (resource_length < (minimum_resource_length - 1))) { 611 - return (AE_AML_BAD_RESOURCE_LENGTH); 435 + goto bad_resource_length; 612 436 } 613 437 break; 614 438 ··· 616 440 617 441 /* Shouldn't happen (because of validation earlier), but be sure */ 618 442 619 - return (AE_AML_INVALID_RESOURCE_TYPE); 443 + goto invalid_resource; 444 + } 445 + 446 + aml_resource = ACPI_CAST_PTR(union aml_resource, aml); 447 + if (resource_type == ACPI_RESOURCE_NAME_SERIAL_BUS) { 448 + 449 + /* Validate the bus_type field */ 450 + 451 + if ((aml_resource->common_serial_bus.type == 0) || 452 + (aml_resource->common_serial_bus.type > 453 + AML_RESOURCE_MAX_SERIALBUSTYPE)) { 454 + ACPI_RESOURCE_ERROR((AE_INFO, 455 + "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X", 456 + aml_resource->common_serial_bus. 457 + type)); 458 + return (AE_AML_INVALID_RESOURCE_TYPE); 459 + } 620 460 } 621 461 622 462 /* Optionally return the resource table index */ ··· 642 450 } 643 451 644 452 return (AE_OK); 453 + 454 + invalid_resource: 455 + 456 + ACPI_RESOURCE_ERROR((AE_INFO, 457 + "Invalid/unsupported resource descriptor: Type 0x%2.2X", 458 + resource_type)); 459 + return (AE_AML_INVALID_RESOURCE_TYPE); 460 + 461 + bad_resource_length: 462 + 463 + ACPI_RESOURCE_ERROR((AE_INFO, 464 + "Invalid resource descriptor length: Type " 465 + "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X", 466 + resource_type, resource_length, 467 + minimum_resource_length)); 468 + return (AE_AML_BAD_RESOURCE_LENGTH); 645 469 } 646 470 647 471 /*******************************************************************************
+1 -1
drivers/acpi/acpica/utstate.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+39 -1
drivers/acpi/acpica/utxface.c
··· 5 5 *****************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without ··· 48 48 #include "acnamesp.h" 49 49 #include "acdebug.h" 50 50 #include "actables.h" 51 + #include "acinterp.h" 51 52 52 53 #define _COMPONENT ACPI_UTILITIES 53 54 ACPI_MODULE_NAME("utxface") ··· 641 640 } 642 641 643 642 ACPI_EXPORT_SYMBOL(acpi_install_interface_handler) 643 + 644 + /***************************************************************************** 645 + * 646 + * FUNCTION: acpi_check_address_range 647 + * 648 + * PARAMETERS: space_id - Address space ID 649 + * Address - Start address 650 + * Length - Length 651 + * Warn - TRUE if warning on overlap desired 652 + * 653 + * RETURN: Count of the number of conflicts detected. 654 + * 655 + * DESCRIPTION: Check if the input address range overlaps any of the 656 + * ASL operation region address ranges. 657 + * 658 + ****************************************************************************/ 659 + u32 660 + acpi_check_address_range(acpi_adr_space_type space_id, 661 + acpi_physical_address address, 662 + acpi_size length, u8 warn) 663 + { 664 + u32 overlaps; 665 + acpi_status status; 666 + 667 + status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 668 + if (ACPI_FAILURE(status)) { 669 + return (0); 670 + } 671 + 672 + overlaps = acpi_ut_check_address_range(space_id, address, 673 + (u32)length, warn); 674 + 675 + (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 676 + return (overlaps); 677 + } 678 + 679 + ACPI_EXPORT_SYMBOL(acpi_check_address_range) 644 680 #endif /* !ACPI_ASL_COMPILER */
+1 -1
drivers/acpi/acpica/utxferror.c
··· 5 5 ******************************************************************************/ 6 6 7 7 /* 8 - * Copyright (C) 2000 - 2011, Intel Corp. 8 + * Copyright (C) 2000 - 2012, Intel Corp. 9 9 * All rights reserved. 10 10 * 11 11 * Redistribution and use in source and binary forms, with or without
+187
drivers/acpi/acpica/utxfmutex.c
··· 1 + /******************************************************************************* 2 + * 3 + * Module Name: utxfmutex - external AML mutex access functions 4 + * 5 + ******************************************************************************/ 6 + 7 + /* 8 + * Copyright (C) 2000 - 2012, 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 "acnamesp.h" 47 + 48 + #define _COMPONENT ACPI_UTILITIES 49 + ACPI_MODULE_NAME("utxfmutex") 50 + 51 + /* Local prototypes */ 52 + static acpi_status 53 + acpi_ut_get_mutex_object(acpi_handle handle, 54 + acpi_string pathname, 55 + union acpi_operand_object **ret_obj); 56 + 57 + /******************************************************************************* 58 + * 59 + * FUNCTION: acpi_ut_get_mutex_object 60 + * 61 + * PARAMETERS: Handle - Mutex or prefix handle (optional) 62 + * Pathname - Mutex pathname (optional) 63 + * ret_obj - Where the mutex object is returned 64 + * 65 + * RETURN: Status 66 + * 67 + * DESCRIPTION: Get an AML mutex object. The mutex node is pointed to by 68 + * Handle:Pathname. Either Handle or Pathname can be NULL, but 69 + * not both. 70 + * 71 + ******************************************************************************/ 72 + 73 + static acpi_status 74 + acpi_ut_get_mutex_object(acpi_handle handle, 75 + acpi_string pathname, 76 + union acpi_operand_object **ret_obj) 77 + { 78 + struct acpi_namespace_node *mutex_node; 79 + union acpi_operand_object *mutex_obj; 80 + acpi_status status; 81 + 82 + /* Parameter validation */ 83 + 84 + if (!ret_obj || (!handle && !pathname)) { 85 + return (AE_BAD_PARAMETER); 86 + } 87 + 88 + /* Get a the namespace node for the mutex */ 89 + 90 + mutex_node = handle; 91 + if (pathname != NULL) { 92 + status = acpi_get_handle(handle, pathname, 93 + ACPI_CAST_PTR(acpi_handle, 94 + &mutex_node)); 95 + if (ACPI_FAILURE(status)) { 96 + return (status); 97 + } 98 + } 99 + 100 + /* Ensure that we actually have a Mutex object */ 101 + 102 + if (!mutex_node || (mutex_node->type != ACPI_TYPE_MUTEX)) { 103 + return (AE_TYPE); 104 + } 105 + 106 + /* Get the low-level mutex object */ 107 + 108 + mutex_obj = acpi_ns_get_attached_object(mutex_node); 109 + if (!mutex_obj) { 110 + return (AE_NULL_OBJECT); 111 + } 112 + 113 + *ret_obj = mutex_obj; 114 + return (AE_OK); 115 + } 116 + 117 + /******************************************************************************* 118 + * 119 + * FUNCTION: acpi_acquire_mutex 120 + * 121 + * PARAMETERS: Handle - Mutex or prefix handle (optional) 122 + * Pathname - Mutex pathname (optional) 123 + * Timeout - Max time to wait for the lock (millisec) 124 + * 125 + * RETURN: Status 126 + * 127 + * DESCRIPTION: Acquire an AML mutex. This is a device driver interface to 128 + * AML mutex objects, and allows for transaction locking between 129 + * drivers and AML code. The mutex node is pointed to by 130 + * Handle:Pathname. Either Handle or Pathname can be NULL, but 131 + * not both. 132 + * 133 + ******************************************************************************/ 134 + 135 + acpi_status 136 + acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout) 137 + { 138 + acpi_status status; 139 + union acpi_operand_object *mutex_obj; 140 + 141 + /* Get the low-level mutex associated with Handle:Pathname */ 142 + 143 + status = acpi_ut_get_mutex_object(handle, pathname, &mutex_obj); 144 + if (ACPI_FAILURE(status)) { 145 + return (status); 146 + } 147 + 148 + /* Acquire the OS mutex */ 149 + 150 + status = acpi_os_acquire_mutex(mutex_obj->mutex.os_mutex, timeout); 151 + return (status); 152 + } 153 + 154 + /******************************************************************************* 155 + * 156 + * FUNCTION: acpi_release_mutex 157 + * 158 + * PARAMETERS: Handle - Mutex or prefix handle (optional) 159 + * Pathname - Mutex pathname (optional) 160 + * 161 + * RETURN: Status 162 + * 163 + * DESCRIPTION: Release an AML mutex. This is a device driver interface to 164 + * AML mutex objects, and allows for transaction locking between 165 + * drivers and AML code. The mutex node is pointed to by 166 + * Handle:Pathname. Either Handle or Pathname can be NULL, but 167 + * not both. 168 + * 169 + ******************************************************************************/ 170 + 171 + acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname) 172 + { 173 + acpi_status status; 174 + union acpi_operand_object *mutex_obj; 175 + 176 + /* Get the low-level mutex associated with Handle:Pathname */ 177 + 178 + status = acpi_ut_get_mutex_object(handle, pathname, &mutex_obj); 179 + if (ACPI_FAILURE(status)) { 180 + return (status); 181 + } 182 + 183 + /* Release the OS mutex */ 184 + 185 + acpi_os_release_mutex(mutex_obj->mutex.os_mutex); 186 + return (AE_OK); 187 + }
+139 -11
drivers/acpi/apei/apei-base.c
··· 34 34 #include <linux/module.h> 35 35 #include <linux/init.h> 36 36 #include <linux/acpi.h> 37 + #include <linux/acpi_io.h> 37 38 #include <linux/slab.h> 38 39 #include <linux/io.h> 39 40 #include <linux/kref.h> 40 41 #include <linux/rculist.h> 41 42 #include <linux/interrupt.h> 42 43 #include <linux/debugfs.h> 43 - #include <acpi/atomicio.h> 44 44 45 45 #include "apei-internal.h" 46 46 ··· 70 70 { 71 71 int rc; 72 72 73 - rc = acpi_atomic_read(val, &entry->register_region); 73 + rc = apei_read(val, &entry->register_region); 74 74 if (rc) 75 75 return rc; 76 76 *val >>= entry->register_region.bit_offset; ··· 116 116 val <<= entry->register_region.bit_offset; 117 117 if (entry->flags & APEI_EXEC_PRESERVE_REGISTER) { 118 118 u64 valr = 0; 119 - rc = acpi_atomic_read(&valr, &entry->register_region); 119 + rc = apei_read(&valr, &entry->register_region); 120 120 if (rc) 121 121 return rc; 122 122 valr &= ~(entry->mask << entry->register_region.bit_offset); 123 123 val |= valr; 124 124 } 125 - rc = acpi_atomic_write(val, &entry->register_region); 125 + rc = apei_write(val, &entry->register_region); 126 126 127 127 return rc; 128 128 } ··· 243 243 u8 ins = entry->instruction; 244 244 245 245 if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) 246 - return acpi_pre_map_gar(&entry->register_region); 246 + return acpi_os_map_generic_address(&entry->register_region); 247 247 248 248 return 0; 249 249 } ··· 276 276 u8 ins = entry->instruction; 277 277 278 278 if (ctx->ins_table[ins].flags & APEI_EXEC_INS_ACCESS_REGISTER) 279 - acpi_post_unmap_gar(&entry->register_region); 279 + acpi_os_unmap_generic_address(&entry->register_region); 280 280 281 281 return 0; 282 282 } ··· 421 421 return 0; 422 422 } 423 423 424 + int apei_resources_add(struct apei_resources *resources, 425 + unsigned long start, unsigned long size, 426 + bool iomem) 427 + { 428 + if (iomem) 429 + return apei_res_add(&resources->iomem, start, size); 430 + else 431 + return apei_res_add(&resources->ioport, start, size); 432 + } 433 + EXPORT_SYMBOL_GPL(apei_resources_add); 434 + 424 435 /* 425 436 * EINJ has two groups of GARs (EINJ table entry and trigger table 426 437 * entry), so common resources are subtracted from the trigger table ··· 449 438 } 450 439 EXPORT_SYMBOL_GPL(apei_resources_sub); 451 440 441 + static int apei_get_nvs_callback(__u64 start, __u64 size, void *data) 442 + { 443 + struct apei_resources *resources = data; 444 + return apei_res_add(&resources->iomem, start, size); 445 + } 446 + 447 + static int apei_get_nvs_resources(struct apei_resources *resources) 448 + { 449 + return acpi_nvs_for_each_region(apei_get_nvs_callback, resources); 450 + } 451 + 452 452 /* 453 - * IO memory/port rersource management mechanism is used to check 453 + * IO memory/port resource management mechanism is used to check 454 454 * whether memory/port area used by GARs conflicts with normal memory 455 455 * or IO memory/port of devices. 456 456 */ ··· 470 448 { 471 449 struct apei_res *res, *res_bak = NULL; 472 450 struct resource *r; 451 + struct apei_resources nvs_resources; 473 452 int rc; 474 453 475 454 rc = apei_resources_sub(resources, &apei_resources_all); 476 455 if (rc) 477 456 return rc; 457 + 458 + /* 459 + * Some firmware uses ACPI NVS region, that has been marked as 460 + * busy, so exclude it from APEI resources to avoid false 461 + * conflict. 462 + */ 463 + apei_resources_init(&nvs_resources); 464 + rc = apei_get_nvs_resources(&nvs_resources); 465 + if (rc) 466 + goto res_fini; 467 + rc = apei_resources_sub(resources, &nvs_resources); 468 + if (rc) 469 + goto res_fini; 478 470 479 471 rc = -EINVAL; 480 472 list_for_each_entry(res, &resources->iomem, list) { ··· 496 460 desc); 497 461 if (!r) { 498 462 pr_err(APEI_PFX 499 - "Can not request iomem region <%016llx-%016llx> for GARs.\n", 463 + "Can not request [mem %#010llx-%#010llx] for %s registers\n", 500 464 (unsigned long long)res->start, 501 - (unsigned long long)res->end); 465 + (unsigned long long)res->end - 1, desc); 502 466 res_bak = res; 503 467 goto err_unmap_iomem; 504 468 } ··· 508 472 r = request_region(res->start, res->end - res->start, desc); 509 473 if (!r) { 510 474 pr_err(APEI_PFX 511 - "Can not request ioport region <%016llx-%016llx> for GARs.\n", 475 + "Can not request [io %#06llx-%#06llx] for %s registers\n", 512 476 (unsigned long long)res->start, 513 - (unsigned long long)res->end); 477 + (unsigned long long)res->end - 1, desc); 514 478 res_bak = res; 515 479 goto err_unmap_ioport; 516 480 } ··· 536 500 break; 537 501 release_mem_region(res->start, res->end - res->start); 538 502 } 503 + res_fini: 504 + apei_resources_fini(&nvs_resources); 539 505 return rc; 540 506 } 541 507 EXPORT_SYMBOL_GPL(apei_resources_request); ··· 590 552 591 553 return 0; 592 554 } 555 + 556 + /* read GAR in interrupt (including NMI) or process context */ 557 + int apei_read(u64 *val, struct acpi_generic_address *reg) 558 + { 559 + int rc; 560 + u64 address; 561 + u32 tmp, width = reg->bit_width; 562 + acpi_status status; 563 + 564 + rc = apei_check_gar(reg, &address); 565 + if (rc) 566 + return rc; 567 + 568 + if (width == 64) 569 + width = 32; /* Break into two 32-bit transfers */ 570 + 571 + *val = 0; 572 + switch(reg->space_id) { 573 + case ACPI_ADR_SPACE_SYSTEM_MEMORY: 574 + status = acpi_os_read_memory((acpi_physical_address) 575 + address, &tmp, width); 576 + if (ACPI_FAILURE(status)) 577 + return -EIO; 578 + *val = tmp; 579 + 580 + if (reg->bit_width == 64) { 581 + /* Read the top 32 bits */ 582 + status = acpi_os_read_memory((acpi_physical_address) 583 + (address + 4), &tmp, 32); 584 + if (ACPI_FAILURE(status)) 585 + return -EIO; 586 + *val |= ((u64)tmp << 32); 587 + } 588 + break; 589 + case ACPI_ADR_SPACE_SYSTEM_IO: 590 + status = acpi_os_read_port(address, (u32 *)val, reg->bit_width); 591 + if (ACPI_FAILURE(status)) 592 + return -EIO; 593 + break; 594 + default: 595 + return -EINVAL; 596 + } 597 + 598 + return 0; 599 + } 600 + EXPORT_SYMBOL_GPL(apei_read); 601 + 602 + /* write GAR in interrupt (including NMI) or process context */ 603 + int apei_write(u64 val, struct acpi_generic_address *reg) 604 + { 605 + int rc; 606 + u64 address; 607 + u32 width = reg->bit_width; 608 + acpi_status status; 609 + 610 + rc = apei_check_gar(reg, &address); 611 + if (rc) 612 + return rc; 613 + 614 + if (width == 64) 615 + width = 32; /* Break into two 32-bit transfers */ 616 + 617 + switch (reg->space_id) { 618 + case ACPI_ADR_SPACE_SYSTEM_MEMORY: 619 + status = acpi_os_write_memory((acpi_physical_address) 620 + address, ACPI_LODWORD(val), 621 + width); 622 + if (ACPI_FAILURE(status)) 623 + return -EIO; 624 + 625 + if (reg->bit_width == 64) { 626 + status = acpi_os_write_memory((acpi_physical_address) 627 + (address + 4), 628 + ACPI_HIDWORD(val), 32); 629 + if (ACPI_FAILURE(status)) 630 + return -EIO; 631 + } 632 + break; 633 + case ACPI_ADR_SPACE_SYSTEM_IO: 634 + status = acpi_os_write_port(address, val, reg->bit_width); 635 + if (ACPI_FAILURE(status)) 636 + return -EIO; 637 + break; 638 + default: 639 + return -EINVAL; 640 + } 641 + 642 + return 0; 643 + } 644 + EXPORT_SYMBOL_GPL(apei_write); 593 645 594 646 static int collect_res_callback(struct apei_exec_context *ctx, 595 647 struct acpi_whea_header *entry,
+6
drivers/acpi/apei/apei-internal.h
··· 68 68 /* IP has been set in instruction function */ 69 69 #define APEI_EXEC_SET_IP 1 70 70 71 + int apei_read(u64 *val, struct acpi_generic_address *reg); 72 + int apei_write(u64 val, struct acpi_generic_address *reg); 73 + 71 74 int __apei_exec_read_register(struct acpi_whea_header *entry, u64 *val); 72 75 int __apei_exec_write_register(struct acpi_whea_header *entry, u64 val); 73 76 int apei_exec_read_register(struct apei_exec_context *ctx, ··· 98 95 } 99 96 100 97 void apei_resources_fini(struct apei_resources *resources); 98 + int apei_resources_add(struct apei_resources *resources, 99 + unsigned long start, unsigned long size, 100 + bool iomem); 101 101 int apei_resources_sub(struct apei_resources *resources1, 102 102 struct apei_resources *resources2); 103 103 int apei_resources_request(struct apei_resources *resources,
+244 -46
drivers/acpi/apei/einj.c
··· 43 43 #define FIRMWARE_TIMEOUT (1 * NSEC_PER_MSEC) 44 44 45 45 /* 46 + * ACPI version 5 provides a SET_ERROR_TYPE_WITH_ADDRESS action. 47 + */ 48 + static int acpi5; 49 + 50 + struct set_error_type_with_address { 51 + u32 type; 52 + u32 vendor_extension; 53 + u32 flags; 54 + u32 apicid; 55 + u64 memory_address; 56 + u64 memory_address_range; 57 + u32 pcie_sbdf; 58 + }; 59 + enum { 60 + SETWA_FLAGS_APICID = 1, 61 + SETWA_FLAGS_MEM = 2, 62 + SETWA_FLAGS_PCIE_SBDF = 4, 63 + }; 64 + 65 + /* 66 + * Vendor extensions for platform specific operations 67 + */ 68 + struct vendor_error_type_extension { 69 + u32 length; 70 + u32 pcie_sbdf; 71 + u16 vendor_id; 72 + u16 device_id; 73 + u8 rev_id; 74 + u8 reserved[3]; 75 + }; 76 + 77 + static u32 vendor_flags; 78 + static struct debugfs_blob_wrapper vendor_blob; 79 + static char vendor_dev[64]; 80 + 81 + /* 46 82 * Some BIOSes allow parameters to the SET_ERROR_TYPE entries in the 47 83 * EINJ table through an unpublished extension. Use with caution as 48 84 * most will ignore the parameter and make their own choice of address ··· 139 103 */ 140 104 static DEFINE_MUTEX(einj_mutex); 141 105 142 - static struct einj_parameter *einj_param; 106 + static void *einj_param; 107 + 108 + #ifndef readq 109 + static inline __u64 readq(volatile void __iomem *addr) 110 + { 111 + return ((__u64)readl(addr+4) << 32) + readl(addr); 112 + } 113 + #endif 143 114 144 115 #ifndef writeq 145 116 static inline void writeq(__u64 val, volatile void __iomem *addr) ··· 201 158 return 0; 202 159 } 203 160 204 - static u64 einj_get_parameter_address(void) 161 + static void check_vendor_extension(u64 paddr, 162 + struct set_error_type_with_address *v5param) 163 + { 164 + int offset = readl(&v5param->vendor_extension); 165 + struct vendor_error_type_extension *v; 166 + u32 sbdf; 167 + 168 + if (!offset) 169 + return; 170 + v = ioremap(paddr + offset, sizeof(*v)); 171 + if (!v) 172 + return; 173 + sbdf = readl(&v->pcie_sbdf); 174 + sprintf(vendor_dev, "%x:%x:%x.%x vendor_id=%x device_id=%x rev_id=%x\n", 175 + sbdf >> 24, (sbdf >> 16) & 0xff, 176 + (sbdf >> 11) & 0x1f, (sbdf >> 8) & 0x7, 177 + readw(&v->vendor_id), readw(&v->device_id), 178 + readb(&v->rev_id)); 179 + iounmap(v); 180 + } 181 + 182 + static void *einj_get_parameter_address(void) 205 183 { 206 184 int i; 207 - u64 paddr = 0; 185 + u64 paddrv4 = 0, paddrv5 = 0; 208 186 struct acpi_whea_header *entry; 209 187 210 188 entry = EINJ_TAB_ENTRY(einj_tab); ··· 234 170 entry->instruction == ACPI_EINJ_WRITE_REGISTER && 235 171 entry->register_region.space_id == 236 172 ACPI_ADR_SPACE_SYSTEM_MEMORY) 237 - memcpy(&paddr, &entry->register_region.address, 238 - sizeof(paddr)); 173 + memcpy(&paddrv4, &entry->register_region.address, 174 + sizeof(paddrv4)); 175 + if (entry->action == ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS && 176 + entry->instruction == ACPI_EINJ_WRITE_REGISTER && 177 + entry->register_region.space_id == 178 + ACPI_ADR_SPACE_SYSTEM_MEMORY) 179 + memcpy(&paddrv5, &entry->register_region.address, 180 + sizeof(paddrv5)); 239 181 entry++; 240 182 } 183 + if (paddrv5) { 184 + struct set_error_type_with_address *v5param; 241 185 242 - return paddr; 186 + v5param = ioremap(paddrv5, sizeof(*v5param)); 187 + if (v5param) { 188 + acpi5 = 1; 189 + check_vendor_extension(paddrv5, v5param); 190 + return v5param; 191 + } 192 + } 193 + if (paddrv4) { 194 + struct einj_parameter *v4param; 195 + 196 + v4param = ioremap(paddrv4, sizeof(*v4param)); 197 + if (!v4param) 198 + return 0; 199 + if (readq(&v4param->reserved1) || readq(&v4param->reserved2)) { 200 + iounmap(v4param); 201 + return 0; 202 + } 203 + return v4param; 204 + } 205 + 206 + return 0; 243 207 } 244 208 245 209 /* do sanity check to trigger table */ ··· 286 194 return 0; 287 195 } 288 196 197 + static struct acpi_generic_address *einj_get_trigger_parameter_region( 198 + struct acpi_einj_trigger *trigger_tab, u64 param1, u64 param2) 199 + { 200 + int i; 201 + struct acpi_whea_header *entry; 202 + 203 + entry = (struct acpi_whea_header *) 204 + ((char *)trigger_tab + sizeof(struct acpi_einj_trigger)); 205 + for (i = 0; i < trigger_tab->entry_count; i++) { 206 + if (entry->action == ACPI_EINJ_TRIGGER_ERROR && 207 + entry->instruction == ACPI_EINJ_WRITE_REGISTER_VALUE && 208 + entry->register_region.space_id == 209 + ACPI_ADR_SPACE_SYSTEM_MEMORY && 210 + (entry->register_region.address & param2) == (param1 & param2)) 211 + return &entry->register_region; 212 + entry++; 213 + } 214 + 215 + return NULL; 216 + } 289 217 /* Execute instructions in trigger error action table */ 290 - static int __einj_error_trigger(u64 trigger_paddr) 218 + static int __einj_error_trigger(u64 trigger_paddr, u32 type, 219 + u64 param1, u64 param2) 291 220 { 292 221 struct acpi_einj_trigger *trigger_tab = NULL; 293 222 struct apei_exec_context trigger_ctx; ··· 317 204 struct resource *r; 318 205 u32 table_size; 319 206 int rc = -EIO; 207 + struct acpi_generic_address *trigger_param_region = NULL; 320 208 321 209 r = request_mem_region(trigger_paddr, sizeof(*trigger_tab), 322 210 "APEI EINJ Trigger Table"); 323 211 if (!r) { 324 212 pr_err(EINJ_PFX 325 - "Can not request iomem region <%016llx-%016llx> for Trigger table.\n", 213 + "Can not request [mem %#010llx-%#010llx] for Trigger table\n", 326 214 (unsigned long long)trigger_paddr, 327 - (unsigned long long)trigger_paddr+sizeof(*trigger_tab)); 215 + (unsigned long long)trigger_paddr + 216 + sizeof(*trigger_tab) - 1); 328 217 goto out; 329 218 } 330 219 trigger_tab = ioremap_cache(trigger_paddr, sizeof(*trigger_tab)); ··· 347 232 "APEI EINJ Trigger Table"); 348 233 if (!r) { 349 234 pr_err(EINJ_PFX 350 - "Can not request iomem region <%016llx-%016llx> for Trigger Table Entry.\n", 351 - (unsigned long long)trigger_paddr+sizeof(*trigger_tab), 352 - (unsigned long long)trigger_paddr + table_size); 235 + "Can not request [mem %#010llx-%#010llx] for Trigger Table Entry\n", 236 + (unsigned long long)trigger_paddr + sizeof(*trigger_tab), 237 + (unsigned long long)trigger_paddr + table_size - 1); 353 238 goto out_rel_header; 354 239 } 355 240 iounmap(trigger_tab); ··· 370 255 rc = apei_resources_sub(&trigger_resources, &einj_resources); 371 256 if (rc) 372 257 goto out_fini; 258 + /* 259 + * Some firmware will access target address specified in 260 + * param1 to trigger the error when injecting memory error. 261 + * This will cause resource conflict with regular memory. So 262 + * remove it from trigger table resources. 263 + */ 264 + if (param_extension && (type & 0x0038) && param2) { 265 + struct apei_resources addr_resources; 266 + apei_resources_init(&addr_resources); 267 + trigger_param_region = einj_get_trigger_parameter_region( 268 + trigger_tab, param1, param2); 269 + if (trigger_param_region) { 270 + rc = apei_resources_add(&addr_resources, 271 + trigger_param_region->address, 272 + trigger_param_region->bit_width/8, true); 273 + if (rc) 274 + goto out_fini; 275 + rc = apei_resources_sub(&trigger_resources, 276 + &addr_resources); 277 + } 278 + apei_resources_fini(&addr_resources); 279 + if (rc) 280 + goto out_fini; 281 + } 373 282 rc = apei_resources_request(&trigger_resources, "APEI EINJ Trigger"); 374 283 if (rc) 375 284 goto out_fini; ··· 432 293 if (rc) 433 294 return rc; 434 295 apei_exec_ctx_set_input(&ctx, type); 435 - rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE); 436 - if (rc) 437 - return rc; 438 - if (einj_param) { 439 - writeq(param1, &einj_param->param1); 440 - writeq(param2, &einj_param->param2); 296 + if (acpi5) { 297 + struct set_error_type_with_address *v5param = einj_param; 298 + 299 + writel(type, &v5param->type); 300 + if (type & 0x80000000) { 301 + switch (vendor_flags) { 302 + case SETWA_FLAGS_APICID: 303 + writel(param1, &v5param->apicid); 304 + break; 305 + case SETWA_FLAGS_MEM: 306 + writeq(param1, &v5param->memory_address); 307 + writeq(param2, &v5param->memory_address_range); 308 + break; 309 + case SETWA_FLAGS_PCIE_SBDF: 310 + writel(param1, &v5param->pcie_sbdf); 311 + break; 312 + } 313 + writel(vendor_flags, &v5param->flags); 314 + } else { 315 + switch (type) { 316 + case ACPI_EINJ_PROCESSOR_CORRECTABLE: 317 + case ACPI_EINJ_PROCESSOR_UNCORRECTABLE: 318 + case ACPI_EINJ_PROCESSOR_FATAL: 319 + writel(param1, &v5param->apicid); 320 + writel(SETWA_FLAGS_APICID, &v5param->flags); 321 + break; 322 + case ACPI_EINJ_MEMORY_CORRECTABLE: 323 + case ACPI_EINJ_MEMORY_UNCORRECTABLE: 324 + case ACPI_EINJ_MEMORY_FATAL: 325 + writeq(param1, &v5param->memory_address); 326 + writeq(param2, &v5param->memory_address_range); 327 + writel(SETWA_FLAGS_MEM, &v5param->flags); 328 + break; 329 + case ACPI_EINJ_PCIX_CORRECTABLE: 330 + case ACPI_EINJ_PCIX_UNCORRECTABLE: 331 + case ACPI_EINJ_PCIX_FATAL: 332 + writel(param1, &v5param->pcie_sbdf); 333 + writel(SETWA_FLAGS_PCIE_SBDF, &v5param->flags); 334 + break; 335 + } 336 + } 337 + } else { 338 + rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE); 339 + if (rc) 340 + return rc; 341 + if (einj_param) { 342 + struct einj_parameter *v4param = einj_param; 343 + writeq(param1, &v4param->param1); 344 + writeq(param2, &v4param->param2); 345 + } 441 346 } 442 347 rc = apei_exec_run(&ctx, ACPI_EINJ_EXECUTE_OPERATION); 443 348 if (rc) ··· 507 324 if (rc) 508 325 return rc; 509 326 trigger_paddr = apei_exec_ctx_get_output(&ctx); 510 - rc = __einj_error_trigger(trigger_paddr); 327 + rc = __einj_error_trigger(trigger_paddr, type, param1, param2); 511 328 if (rc) 512 329 return rc; 513 330 rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION); ··· 591 408 { 592 409 int rc; 593 410 u32 available_error_type = 0; 411 + u32 tval, vendor; 412 + 413 + /* 414 + * Vendor defined types have 0x80000000 bit set, and 415 + * are not enumerated by ACPI_EINJ_GET_ERROR_TYPE 416 + */ 417 + vendor = val & 0x80000000; 418 + tval = val & 0x7fffffff; 594 419 595 420 /* Only one error type can be specified */ 596 - if (val & (val - 1)) 421 + if (tval & (tval - 1)) 597 422 return -EINVAL; 598 - rc = einj_get_available_error_type(&available_error_type); 599 - if (rc) 600 - return rc; 601 - if (!(val & available_error_type)) 602 - return -EINVAL; 423 + if (!vendor) { 424 + rc = einj_get_available_error_type(&available_error_type); 425 + if (rc) 426 + return rc; 427 + if (!(val & available_error_type)) 428 + return -EINVAL; 429 + } 603 430 error_type = val; 604 431 605 432 return 0; ··· 648 455 static int __init einj_init(void) 649 456 { 650 457 int rc; 651 - u64 param_paddr; 652 458 acpi_status status; 653 459 struct dentry *fentry; 654 460 struct apei_exec_context ctx; ··· 657 465 658 466 status = acpi_get_table(ACPI_SIG_EINJ, 0, 659 467 (struct acpi_table_header **)&einj_tab); 660 - if (status == AE_NOT_FOUND) { 661 - pr_info(EINJ_PFX "Table is not found!\n"); 468 + if (status == AE_NOT_FOUND) 662 469 return -ENODEV; 663 - } else if (ACPI_FAILURE(status)) { 470 + else if (ACPI_FAILURE(status)) { 664 471 const char *msg = acpi_format_exception(status); 665 472 pr_err(EINJ_PFX "Failed to get table, %s\n", msg); 666 473 return -EINVAL; ··· 700 509 rc = apei_exec_pre_map_gars(&ctx); 701 510 if (rc) 702 511 goto err_release; 703 - if (param_extension) { 704 - param_paddr = einj_get_parameter_address(); 705 - if (param_paddr) { 706 - einj_param = ioremap(param_paddr, sizeof(*einj_param)); 707 - rc = -ENOMEM; 708 - if (!einj_param) 709 - goto err_unmap; 710 - fentry = debugfs_create_x64("param1", S_IRUSR | S_IWUSR, 711 - einj_debug_dir, &error_param1); 712 - if (!fentry) 713 - goto err_unmap; 714 - fentry = debugfs_create_x64("param2", S_IRUSR | S_IWUSR, 715 - einj_debug_dir, &error_param2); 716 - if (!fentry) 717 - goto err_unmap; 718 - } else 719 - pr_warn(EINJ_PFX "Parameter extension is not supported.\n"); 512 + 513 + einj_param = einj_get_parameter_address(); 514 + if ((param_extension || acpi5) && einj_param) { 515 + fentry = debugfs_create_x64("param1", S_IRUSR | S_IWUSR, 516 + einj_debug_dir, &error_param1); 517 + if (!fentry) 518 + goto err_unmap; 519 + fentry = debugfs_create_x64("param2", S_IRUSR | S_IWUSR, 520 + einj_debug_dir, &error_param2); 521 + if (!fentry) 522 + goto err_unmap; 523 + } 524 + 525 + if (vendor_dev[0]) { 526 + vendor_blob.data = vendor_dev; 527 + vendor_blob.size = strlen(vendor_dev); 528 + fentry = debugfs_create_blob("vendor", S_IRUSR, 529 + einj_debug_dir, &vendor_blob); 530 + if (!fentry) 531 + goto err_unmap; 532 + fentry = debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR, 533 + einj_debug_dir, &vendor_flags); 534 + if (!fentry) 535 + goto err_unmap; 720 536 } 721 537 722 538 pr_info(EINJ_PFX "Error INJection is initialized.\n");
+2 -3
drivers/acpi/apei/erst.c
··· 1127 1127 1128 1128 status = acpi_get_table(ACPI_SIG_ERST, 0, 1129 1129 (struct acpi_table_header **)&erst_tab); 1130 - if (status == AE_NOT_FOUND) { 1131 - pr_info(ERST_PFX "Table is not found!\n"); 1130 + if (status == AE_NOT_FOUND) 1132 1131 goto err; 1133 - } else if (ACPI_FAILURE(status)) { 1132 + else if (ACPI_FAILURE(status)) { 1134 1133 const char *msg = acpi_format_exception(status); 1135 1134 pr_err(ERST_PFX "Failed to get table, %s\n", msg); 1136 1135 rc = -EINVAL;
+86 -22
drivers/acpi/apei/ghes.c
··· 33 33 #include <linux/module.h> 34 34 #include <linux/init.h> 35 35 #include <linux/acpi.h> 36 + #include <linux/acpi_io.h> 36 37 #include <linux/io.h> 37 38 #include <linux/interrupt.h> 38 39 #include <linux/timer.h> ··· 46 45 #include <linux/irq_work.h> 47 46 #include <linux/llist.h> 48 47 #include <linux/genalloc.h> 48 + #include <linux/pci.h> 49 + #include <linux/aer.h> 49 50 #include <acpi/apei.h> 50 - #include <acpi/atomicio.h> 51 51 #include <acpi/hed.h> 52 52 #include <asm/mce.h> 53 53 #include <asm/tlbflush.h> ··· 301 299 if (!ghes) 302 300 return ERR_PTR(-ENOMEM); 303 301 ghes->generic = generic; 304 - rc = acpi_pre_map_gar(&generic->error_status_address); 302 + rc = acpi_os_map_generic_address(&generic->error_status_address); 305 303 if (rc) 306 304 goto err_free; 307 305 error_block_length = generic->error_block_length; ··· 321 319 return ghes; 322 320 323 321 err_unmap: 324 - acpi_post_unmap_gar(&generic->error_status_address); 322 + acpi_os_unmap_generic_address(&generic->error_status_address); 325 323 err_free: 326 324 kfree(ghes); 327 325 return ERR_PTR(rc); ··· 330 328 static void ghes_fini(struct ghes *ghes) 331 329 { 332 330 kfree(ghes->estatus); 333 - acpi_post_unmap_gar(&ghes->generic->error_status_address); 331 + acpi_os_unmap_generic_address(&ghes->generic->error_status_address); 334 332 } 335 333 336 334 enum { ··· 401 399 u32 len; 402 400 int rc; 403 401 404 - rc = acpi_atomic_read(&buf_paddr, &g->error_status_address); 402 + rc = apei_read(&buf_paddr, &g->error_status_address); 405 403 if (rc) { 406 404 if (!silent && printk_ratelimit()) 407 405 pr_warning(FW_WARN GHES_PFX ··· 478 476 } 479 477 #endif 480 478 } 479 + #ifdef CONFIG_ACPI_APEI_PCIEAER 480 + else if (!uuid_le_cmp(*(uuid_le *)gdata->section_type, 481 + CPER_SEC_PCIE)) { 482 + struct cper_sec_pcie *pcie_err; 483 + pcie_err = (struct cper_sec_pcie *)(gdata+1); 484 + if (sev == GHES_SEV_RECOVERABLE && 485 + sec_sev == GHES_SEV_RECOVERABLE && 486 + pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID && 487 + pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO) { 488 + unsigned int devfn; 489 + int aer_severity; 490 + devfn = PCI_DEVFN(pcie_err->device_id.device, 491 + pcie_err->device_id.function); 492 + aer_severity = cper_severity_to_aer(sev); 493 + aer_recover_queue(pcie_err->device_id.segment, 494 + pcie_err->device_id.bus, 495 + devfn, aer_severity); 496 + } 497 + 498 + } 499 + #endif 481 500 } 482 501 } 483 502 ··· 506 483 const struct acpi_hest_generic *generic, 507 484 const struct acpi_hest_generic_status *estatus) 508 485 { 486 + static atomic_t seqno; 487 + unsigned int curr_seqno; 488 + char pfx_seq[64]; 489 + 509 490 if (pfx == NULL) { 510 491 if (ghes_severity(estatus->error_severity) <= 511 492 GHES_SEV_CORRECTED) 512 - pfx = KERN_WARNING HW_ERR; 493 + pfx = KERN_WARNING; 513 494 else 514 - pfx = KERN_ERR HW_ERR; 495 + pfx = KERN_ERR; 515 496 } 497 + curr_seqno = atomic_inc_return(&seqno); 498 + snprintf(pfx_seq, sizeof(pfx_seq), "%s{%u}" HW_ERR, pfx, curr_seqno); 516 499 printk("%s""Hardware error from APEI Generic Hardware Error Source: %d\n", 517 - pfx, generic->header.source_id); 518 - apei_estatus_print(pfx, estatus); 500 + pfx_seq, generic->header.source_id); 501 + apei_estatus_print(pfx_seq, estatus); 519 502 } 520 503 521 504 static int ghes_print_estatus(const char *pfx, ··· 740 711 return ret; 741 712 } 742 713 743 - static void ghes_proc_in_irq(struct irq_work *irq_work) 714 + static struct llist_node *llist_nodes_reverse(struct llist_node *llnode) 744 715 { 745 - struct llist_node *llnode, *next, *tail = NULL; 746 - struct ghes_estatus_node *estatus_node; 747 - struct acpi_hest_generic *generic; 748 - struct acpi_hest_generic_status *estatus; 749 - u32 len, node_len; 716 + struct llist_node *next, *tail = NULL; 750 717 751 - /* 752 - * Because the time order of estatus in list is reversed, 753 - * revert it back to proper order. 754 - */ 755 - llnode = llist_del_all(&ghes_estatus_llist); 756 718 while (llnode) { 757 719 next = llnode->next; 758 720 llnode->next = tail; 759 721 tail = llnode; 760 722 llnode = next; 761 723 } 762 - llnode = tail; 724 + 725 + return tail; 726 + } 727 + 728 + static void ghes_proc_in_irq(struct irq_work *irq_work) 729 + { 730 + struct llist_node *llnode, *next; 731 + struct ghes_estatus_node *estatus_node; 732 + struct acpi_hest_generic *generic; 733 + struct acpi_hest_generic_status *estatus; 734 + u32 len, node_len; 735 + 736 + llnode = llist_del_all(&ghes_estatus_llist); 737 + /* 738 + * Because the time order of estatus in list is reversed, 739 + * revert it back to proper order. 740 + */ 741 + llnode = llist_nodes_reverse(llnode); 763 742 while (llnode) { 764 743 next = llnode->next; 765 744 estatus_node = llist_entry(llnode, struct ghes_estatus_node, ··· 784 747 gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node, 785 748 node_len); 786 749 llnode = next; 750 + } 751 + } 752 + 753 + static void ghes_print_queued_estatus(void) 754 + { 755 + struct llist_node *llnode; 756 + struct ghes_estatus_node *estatus_node; 757 + struct acpi_hest_generic *generic; 758 + struct acpi_hest_generic_status *estatus; 759 + u32 len, node_len; 760 + 761 + llnode = llist_del_all(&ghes_estatus_llist); 762 + /* 763 + * Because the time order of estatus in list is reversed, 764 + * revert it back to proper order. 765 + */ 766 + llnode = llist_nodes_reverse(llnode); 767 + while (llnode) { 768 + estatus_node = llist_entry(llnode, struct ghes_estatus_node, 769 + llnode); 770 + estatus = GHES_ESTATUS_FROM_NODE(estatus_node); 771 + len = apei_estatus_len(estatus); 772 + node_len = GHES_ESTATUS_NODE_LEN(len); 773 + generic = estatus_node->generic; 774 + ghes_print_estatus(NULL, generic, estatus); 775 + llnode = llnode->next; 787 776 } 788 777 } 789 778 ··· 838 775 839 776 if (sev_global >= GHES_SEV_PANIC) { 840 777 oops_begin(); 841 - __ghes_print_estatus(KERN_EMERG HW_ERR, ghes_global->generic, 778 + ghes_print_queued_estatus(); 779 + __ghes_print_estatus(KERN_EMERG, ghes_global->generic, 842 780 ghes_global->estatus); 843 781 /* reboot to log the error! */ 844 782 if (panic_timeout == 0)
+2 -3
drivers/acpi/apei/hest.c
··· 221 221 222 222 status = acpi_get_table(ACPI_SIG_HEST, 0, 223 223 (struct acpi_table_header **)&hest_tab); 224 - if (status == AE_NOT_FOUND) { 225 - pr_info(HEST_PFX "Table not found.\n"); 224 + if (status == AE_NOT_FOUND) 226 225 goto err; 227 - } else if (ACPI_FAILURE(status)) { 226 + else if (ACPI_FAILURE(status)) { 228 227 const char *msg = acpi_format_exception(status); 229 228 pr_err(HEST_PFX "Failed to get table, %s\n", msg); 230 229 rc = -EINVAL;
+67 -10
drivers/acpi/atomicio.c
··· 32 32 #include <linux/rculist.h> 33 33 #include <linux/interrupt.h> 34 34 #include <linux/slab.h> 35 + #include <linux/mm.h> 36 + #include <linux/highmem.h> 35 37 #include <acpi/atomicio.h> 36 38 37 39 #define ACPI_PFX "ACPI: " ··· 99 97 return NULL; 100 98 } 101 99 100 + #ifndef CONFIG_IA64 101 + #define should_use_kmap(pfn) page_is_ram(pfn) 102 + #else 103 + /* ioremap will take care of cache attributes */ 104 + #define should_use_kmap(pfn) 0 105 + #endif 106 + 107 + static void __iomem *acpi_map(phys_addr_t pg_off, unsigned long pg_sz) 108 + { 109 + unsigned long pfn; 110 + 111 + pfn = pg_off >> PAGE_SHIFT; 112 + if (should_use_kmap(pfn)) { 113 + if (pg_sz > PAGE_SIZE) 114 + return NULL; 115 + return (void __iomem __force *)kmap(pfn_to_page(pfn)); 116 + } else 117 + return ioremap(pg_off, pg_sz); 118 + } 119 + 120 + static void acpi_unmap(phys_addr_t pg_off, void __iomem *vaddr) 121 + { 122 + unsigned long pfn; 123 + 124 + pfn = pg_off >> PAGE_SHIFT; 125 + if (page_is_ram(pfn)) 126 + kunmap(pfn_to_page(pfn)); 127 + else 128 + iounmap(vaddr); 129 + } 130 + 102 131 /* 103 132 * Used to pre-map the specified IO memory area. First try to find 104 133 * whether the area is already pre-mapped, if it is, increase the ··· 152 119 153 120 pg_off = paddr & PAGE_MASK; 154 121 pg_sz = ((paddr + size + PAGE_SIZE - 1) & PAGE_MASK) - pg_off; 155 - vaddr = ioremap(pg_off, pg_sz); 122 + vaddr = acpi_map(pg_off, pg_sz); 156 123 if (!vaddr) 157 124 return NULL; 158 125 map = kmalloc(sizeof(*map), GFP_KERNEL); ··· 168 135 vaddr = __acpi_try_ioremap(paddr, size); 169 136 if (vaddr) { 170 137 spin_unlock_irqrestore(&acpi_iomaps_lock, flags); 171 - iounmap(map->vaddr); 138 + acpi_unmap(pg_off, map->vaddr); 172 139 kfree(map); 173 140 return vaddr; 174 141 } ··· 177 144 178 145 return map->vaddr + (paddr - map->paddr); 179 146 err_unmap: 180 - iounmap(vaddr); 147 + acpi_unmap(pg_off, vaddr); 181 148 return NULL; 182 149 } 183 150 ··· 210 177 return; 211 178 212 179 synchronize_rcu(); 213 - iounmap(map->vaddr); 180 + acpi_unmap(map->paddr, map->vaddr); 214 181 kfree(map); 215 182 } 216 183 ··· 293 260 } 294 261 EXPORT_SYMBOL_GPL(acpi_post_unmap_gar); 295 262 263 + #ifdef readq 264 + static inline u64 read64(const volatile void __iomem *addr) 265 + { 266 + return readq(addr); 267 + } 268 + #else 269 + static inline u64 read64(const volatile void __iomem *addr) 270 + { 271 + u64 l, h; 272 + l = readl(addr); 273 + h = readl(addr+4); 274 + return l | (h << 32); 275 + } 276 + #endif 277 + 296 278 /* 297 279 * Can be used in atomic (including NMI) or process context. RCU read 298 280 * lock can only be released after the IO memory area accessing. ··· 328 280 case 32: 329 281 *val = readl(addr); 330 282 break; 331 - #ifdef readq 332 283 case 64: 333 - *val = readq(addr); 284 + *val = read64(addr); 334 285 break; 335 - #endif 336 286 default: 337 287 return -EINVAL; 338 288 } ··· 338 292 339 293 return 0; 340 294 } 295 + 296 + #ifdef writeq 297 + static inline void write64(u64 val, volatile void __iomem *addr) 298 + { 299 + writeq(val, addr); 300 + } 301 + #else 302 + static inline void write64(u64 val, volatile void __iomem *addr) 303 + { 304 + writel(val, addr); 305 + writel(val>>32, addr+4); 306 + } 307 + #endif 341 308 342 309 static int acpi_atomic_write_mem(u64 paddr, u64 val, u32 width) 343 310 { ··· 368 309 case 32: 369 310 writel(val, addr); 370 311 break; 371 - #ifdef writeq 372 312 case 64: 373 - writeq(val, addr); 313 + write64(val, addr); 374 314 break; 375 - #endif 376 315 default: 377 316 return -EINVAL; 378 317 }
+6
drivers/acpi/numa.c
··· 45 45 static int node_to_pxm_map[MAX_NUMNODES] 46 46 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; 47 47 48 + unsigned char acpi_srat_revision __initdata; 49 + 48 50 int pxm_to_node(int pxm) 49 51 { 50 52 if (pxm < 0) ··· 257 255 258 256 static int __init acpi_parse_srat(struct acpi_table_header *table) 259 257 { 258 + struct acpi_table_srat *srat; 260 259 if (!table) 261 260 return -EINVAL; 261 + 262 + srat = (struct acpi_table_srat *)table; 263 + acpi_srat_revision = srat->header.revision; 262 264 263 265 /* Real work done in acpi_table_parse_srat below. */ 264 266
+52 -1
drivers/acpi/nvs.c
··· 15 15 #include <linux/acpi_io.h> 16 16 #include <acpi/acpiosxf.h> 17 17 18 + /* ACPI NVS regions, APEI may use it */ 19 + 20 + struct nvs_region { 21 + __u64 phys_start; 22 + __u64 size; 23 + struct list_head node; 24 + }; 25 + 26 + static LIST_HEAD(nvs_region_list); 27 + 28 + #ifdef CONFIG_ACPI_SLEEP 29 + static int suspend_nvs_register(unsigned long start, unsigned long size); 30 + #else 31 + static inline int suspend_nvs_register(unsigned long a, unsigned long b) 32 + { 33 + return 0; 34 + } 35 + #endif 36 + 37 + int acpi_nvs_register(__u64 start, __u64 size) 38 + { 39 + struct nvs_region *region; 40 + 41 + region = kmalloc(sizeof(*region), GFP_KERNEL); 42 + if (!region) 43 + return -ENOMEM; 44 + region->phys_start = start; 45 + region->size = size; 46 + list_add_tail(&region->node, &nvs_region_list); 47 + 48 + return suspend_nvs_register(start, size); 49 + } 50 + 51 + int acpi_nvs_for_each_region(int (*func)(__u64 start, __u64 size, void *data), 52 + void *data) 53 + { 54 + int rc; 55 + struct nvs_region *region; 56 + 57 + list_for_each_entry(region, &nvs_region_list, node) { 58 + rc = func(region->phys_start, region->size, data); 59 + if (rc) 60 + return rc; 61 + } 62 + 63 + return 0; 64 + } 65 + 66 + 67 + #ifdef CONFIG_ACPI_SLEEP 18 68 /* 19 69 * Platforms, like ACPI, may want us to save some memory used by them during 20 70 * suspend and to restore the contents of this memory during the subsequent ··· 91 41 * things so that the data from page-aligned addresses in this region will 92 42 * be copied into separate RAM pages. 93 43 */ 94 - int suspend_nvs_register(unsigned long start, unsigned long size) 44 + static int suspend_nvs_register(unsigned long start, unsigned long size) 95 45 { 96 46 struct nvs_page *entry, *next; 97 47 ··· 209 159 if (entry->data) 210 160 memcpy(entry->kaddr, entry->data, entry->size); 211 161 } 162 + #endif
+38 -204
drivers/acpi/osl.c
··· 83 83 struct workqueue_struct *kacpi_hotplug_wq; 84 84 EXPORT_SYMBOL(kacpi_hotplug_wq); 85 85 86 - struct acpi_res_list { 87 - resource_size_t start; 88 - resource_size_t end; 89 - acpi_adr_space_type resource_type; /* IO port, System memory, ...*/ 90 - char name[5]; /* only can have a length of 4 chars, make use of this 91 - one instead of res->name, no need to kalloc then */ 92 - struct list_head resource_list; 93 - int count; 94 - }; 95 - 96 - static LIST_HEAD(resource_list_head); 97 - static DEFINE_SPINLOCK(acpi_res_lock); 98 - 99 86 /* 100 87 * This list of permanent mappings is for memory that may be accessed from 101 88 * interrupt context, where we can't do the ioremap(). ··· 153 166 return supported; 154 167 } 155 168 156 - static void __init acpi_request_region (struct acpi_generic_address *addr, 169 + static void __init acpi_request_region (struct acpi_generic_address *gas, 157 170 unsigned int length, char *desc) 158 171 { 159 - if (!addr->address || !length) 172 + u64 addr; 173 + 174 + /* Handle possible alignment issues */ 175 + memcpy(&addr, &gas->address, sizeof(addr)); 176 + if (!addr || !length) 160 177 return; 161 178 162 179 /* Resources are never freed */ 163 - if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_IO) 164 - request_region(addr->address, length, desc); 165 - else if (addr->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) 166 - request_mem_region(addr->address, length, desc); 180 + if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) 181 + request_region(addr, length, desc); 182 + else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) 183 + request_mem_region(addr, length, desc); 167 184 } 168 185 169 186 static int __init acpi_reserve_resources(void) ··· 418 427 __acpi_unmap_table(virt, size); 419 428 } 420 429 421 - static int acpi_os_map_generic_address(struct acpi_generic_address *addr) 430 + int acpi_os_map_generic_address(struct acpi_generic_address *gas) 422 431 { 432 + u64 addr; 423 433 void __iomem *virt; 424 434 425 - if (addr->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) 435 + if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) 426 436 return 0; 427 437 428 - if (!addr->address || !addr->bit_width) 438 + /* Handle possible alignment issues */ 439 + memcpy(&addr, &gas->address, sizeof(addr)); 440 + if (!addr || !gas->bit_width) 429 441 return -EINVAL; 430 442 431 - virt = acpi_os_map_memory(addr->address, addr->bit_width / 8); 443 + virt = acpi_os_map_memory(addr, gas->bit_width / 8); 432 444 if (!virt) 433 445 return -EIO; 434 446 435 447 return 0; 436 448 } 449 + EXPORT_SYMBOL(acpi_os_map_generic_address); 437 450 438 - static void acpi_os_unmap_generic_address(struct acpi_generic_address *addr) 451 + void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) 439 452 { 453 + u64 addr; 440 454 struct acpi_ioremap *map; 441 455 442 - if (addr->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) 456 + if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) 443 457 return; 444 458 445 - if (!addr->address || !addr->bit_width) 459 + /* Handle possible alignment issues */ 460 + memcpy(&addr, &gas->address, sizeof(addr)); 461 + if (!addr || !gas->bit_width) 446 462 return; 447 463 448 464 mutex_lock(&acpi_ioremap_lock); 449 - map = acpi_map_lookup(addr->address, addr->bit_width / 8); 465 + map = acpi_map_lookup(addr, gas->bit_width / 8); 450 466 if (!map) { 451 467 mutex_unlock(&acpi_ioremap_lock); 452 468 return; ··· 463 465 464 466 acpi_os_map_cleanup(map); 465 467 } 468 + EXPORT_SYMBOL(acpi_os_unmap_generic_address); 466 469 467 470 #ifdef ACPI_FUTURE_USAGE 468 471 acpi_status ··· 1277 1278 * drivers */ 1278 1279 int acpi_check_resource_conflict(const struct resource *res) 1279 1280 { 1280 - struct acpi_res_list *res_list_elem; 1281 - int ioport = 0, clash = 0; 1281 + acpi_adr_space_type space_id; 1282 + acpi_size length; 1283 + u8 warn = 0; 1284 + int clash = 0; 1282 1285 1283 1286 if (acpi_enforce_resources == ENFORCE_RESOURCES_NO) 1284 1287 return 0; 1285 1288 if (!(res->flags & IORESOURCE_IO) && !(res->flags & IORESOURCE_MEM)) 1286 1289 return 0; 1287 1290 1288 - ioport = res->flags & IORESOURCE_IO; 1291 + if (res->flags & IORESOURCE_IO) 1292 + space_id = ACPI_ADR_SPACE_SYSTEM_IO; 1293 + else 1294 + space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY; 1289 1295 1290 - spin_lock(&acpi_res_lock); 1291 - list_for_each_entry(res_list_elem, &resource_list_head, 1292 - resource_list) { 1293 - if (ioport && (res_list_elem->resource_type 1294 - != ACPI_ADR_SPACE_SYSTEM_IO)) 1295 - continue; 1296 - if (!ioport && (res_list_elem->resource_type 1297 - != ACPI_ADR_SPACE_SYSTEM_MEMORY)) 1298 - continue; 1299 - 1300 - if (res->end < res_list_elem->start 1301 - || res_list_elem->end < res->start) 1302 - continue; 1303 - clash = 1; 1304 - break; 1305 - } 1306 - spin_unlock(&acpi_res_lock); 1296 + length = res->end - res->start + 1; 1297 + if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) 1298 + warn = 1; 1299 + clash = acpi_check_address_range(space_id, res->start, length, warn); 1307 1300 1308 1301 if (clash) { 1309 1302 if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) { 1310 - printk(KERN_WARNING "ACPI: resource %s %pR" 1311 - " conflicts with ACPI region %s " 1312 - "[%s 0x%zx-0x%zx]\n", 1313 - res->name, res, res_list_elem->name, 1314 - (res_list_elem->resource_type == 1315 - ACPI_ADR_SPACE_SYSTEM_IO) ? "io" : "mem", 1316 - (size_t) res_list_elem->start, 1317 - (size_t) res_list_elem->end); 1318 1303 if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX) 1319 1304 printk(KERN_NOTICE "ACPI: This conflict may" 1320 1305 " cause random problems and system" ··· 1449 1466 { 1450 1467 kmem_cache_free(cache, object); 1451 1468 return (AE_OK); 1452 - } 1453 - 1454 - static inline int acpi_res_list_add(struct acpi_res_list *res) 1455 - { 1456 - struct acpi_res_list *res_list_elem; 1457 - 1458 - list_for_each_entry(res_list_elem, &resource_list_head, 1459 - resource_list) { 1460 - 1461 - if (res->resource_type == res_list_elem->resource_type && 1462 - res->start == res_list_elem->start && 1463 - res->end == res_list_elem->end) { 1464 - 1465 - /* 1466 - * The Region(addr,len) already exist in the list, 1467 - * just increase the count 1468 - */ 1469 - 1470 - res_list_elem->count++; 1471 - return 0; 1472 - } 1473 - } 1474 - 1475 - res->count = 1; 1476 - list_add(&res->resource_list, &resource_list_head); 1477 - return 1; 1478 - } 1479 - 1480 - static inline void acpi_res_list_del(struct acpi_res_list *res) 1481 - { 1482 - struct acpi_res_list *res_list_elem; 1483 - 1484 - list_for_each_entry(res_list_elem, &resource_list_head, 1485 - resource_list) { 1486 - 1487 - if (res->resource_type == res_list_elem->resource_type && 1488 - res->start == res_list_elem->start && 1489 - res->end == res_list_elem->end) { 1490 - 1491 - /* 1492 - * If the res count is decreased to 0, 1493 - * remove and free it 1494 - */ 1495 - 1496 - if (--res_list_elem->count == 0) { 1497 - list_del(&res_list_elem->resource_list); 1498 - kfree(res_list_elem); 1499 - } 1500 - return; 1501 - } 1502 - } 1503 - } 1504 - 1505 - acpi_status 1506 - acpi_os_invalidate_address( 1507 - u8 space_id, 1508 - acpi_physical_address address, 1509 - acpi_size length) 1510 - { 1511 - struct acpi_res_list res; 1512 - 1513 - switch (space_id) { 1514 - case ACPI_ADR_SPACE_SYSTEM_IO: 1515 - case ACPI_ADR_SPACE_SYSTEM_MEMORY: 1516 - /* Only interference checks against SystemIO and SystemMemory 1517 - are needed */ 1518 - res.start = address; 1519 - res.end = address + length - 1; 1520 - res.resource_type = space_id; 1521 - spin_lock(&acpi_res_lock); 1522 - acpi_res_list_del(&res); 1523 - spin_unlock(&acpi_res_lock); 1524 - break; 1525 - case ACPI_ADR_SPACE_PCI_CONFIG: 1526 - case ACPI_ADR_SPACE_EC: 1527 - case ACPI_ADR_SPACE_SMBUS: 1528 - case ACPI_ADR_SPACE_CMOS: 1529 - case ACPI_ADR_SPACE_PCI_BAR_TARGET: 1530 - case ACPI_ADR_SPACE_DATA_TABLE: 1531 - case ACPI_ADR_SPACE_FIXED_HARDWARE: 1532 - break; 1533 - } 1534 - return AE_OK; 1535 - } 1536 - 1537 - /****************************************************************************** 1538 - * 1539 - * FUNCTION: acpi_os_validate_address 1540 - * 1541 - * PARAMETERS: space_id - ACPI space ID 1542 - * address - Physical address 1543 - * length - Address length 1544 - * 1545 - * RETURN: AE_OK if address/length is valid for the space_id. Otherwise, 1546 - * should return AE_AML_ILLEGAL_ADDRESS. 1547 - * 1548 - * DESCRIPTION: Validate a system address via the host OS. Used to validate 1549 - * the addresses accessed by AML operation regions. 1550 - * 1551 - *****************************************************************************/ 1552 - 1553 - acpi_status 1554 - acpi_os_validate_address ( 1555 - u8 space_id, 1556 - acpi_physical_address address, 1557 - acpi_size length, 1558 - char *name) 1559 - { 1560 - struct acpi_res_list *res; 1561 - int added; 1562 - if (acpi_enforce_resources == ENFORCE_RESOURCES_NO) 1563 - return AE_OK; 1564 - 1565 - switch (space_id) { 1566 - case ACPI_ADR_SPACE_SYSTEM_IO: 1567 - case ACPI_ADR_SPACE_SYSTEM_MEMORY: 1568 - /* Only interference checks against SystemIO and SystemMemory 1569 - are needed */ 1570 - res = kzalloc(sizeof(struct acpi_res_list), GFP_KERNEL); 1571 - if (!res) 1572 - return AE_OK; 1573 - /* ACPI names are fixed to 4 bytes, still better use strlcpy */ 1574 - strlcpy(res->name, name, 5); 1575 - res->start = address; 1576 - res->end = address + length - 1; 1577 - res->resource_type = space_id; 1578 - spin_lock(&acpi_res_lock); 1579 - added = acpi_res_list_add(res); 1580 - spin_unlock(&acpi_res_lock); 1581 - pr_debug("%s %s resource: start: 0x%llx, end: 0x%llx, " 1582 - "name: %s\n", added ? "Added" : "Already exist", 1583 - (space_id == ACPI_ADR_SPACE_SYSTEM_IO) 1584 - ? "SystemIO" : "System Memory", 1585 - (unsigned long long)res->start, 1586 - (unsigned long long)res->end, 1587 - res->name); 1588 - if (!added) 1589 - kfree(res); 1590 - break; 1591 - case ACPI_ADR_SPACE_PCI_CONFIG: 1592 - case ACPI_ADR_SPACE_EC: 1593 - case ACPI_ADR_SPACE_SMBUS: 1594 - case ACPI_ADR_SPACE_CMOS: 1595 - case ACPI_ADR_SPACE_PCI_BAR_TARGET: 1596 - case ACPI_ADR_SPACE_DATA_TABLE: 1597 - case ACPI_ADR_SPACE_FIXED_HARDWARE: 1598 - break; 1599 - } 1600 - return AE_OK; 1601 1469 } 1602 1470 #endif 1603 1471
+24 -2
drivers/acpi/processor_core.c
··· 173 173 apic_id = map_mat_entry(handle, type, acpi_id); 174 174 if (apic_id == -1) 175 175 apic_id = map_madt_entry(type, acpi_id); 176 - if (apic_id == -1) 177 - return apic_id; 176 + if (apic_id == -1) { 177 + /* 178 + * On UP processor, there is no _MAT or MADT table. 179 + * So above apic_id is always set to -1. 180 + * 181 + * BIOS may define multiple CPU handles even for UP processor. 182 + * For example, 183 + * 184 + * Scope (_PR) 185 + * { 186 + * Processor (CPU0, 0x00, 0x00000410, 0x06) {} 187 + * Processor (CPU1, 0x01, 0x00000410, 0x06) {} 188 + * Processor (CPU2, 0x02, 0x00000410, 0x06) {} 189 + * Processor (CPU3, 0x03, 0x00000410, 0x06) {} 190 + * } 191 + * 192 + * Ignores apic_id and always return 0 for CPU0's handle. 193 + * Return -1 for other CPU's handle. 194 + */ 195 + if (acpi_id == 0) 196 + return acpi_id; 197 + else 198 + return apic_id; 199 + } 178 200 179 201 #ifdef CONFIG_SMP 180 202 for_each_possible_cpu(i) {
+9 -11
drivers/acpi/processor_driver.c
··· 82 82 static int acpi_processor_add(struct acpi_device *device); 83 83 static int acpi_processor_remove(struct acpi_device *device, int type); 84 84 static void acpi_processor_notify(struct acpi_device *device, u32 event); 85 - static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); 85 + static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr); 86 86 static int acpi_processor_handle_eject(struct acpi_processor *pr); 87 87 88 88 ··· 324 324 * they are physically not present. 325 325 */ 326 326 if (pr->id == -1) { 327 - if (ACPI_FAILURE 328 - (acpi_processor_hotadd_init(pr->handle, &pr->id))) { 327 + if (ACPI_FAILURE(acpi_processor_hotadd_init(pr))) 329 328 return -ENODEV; 330 - } 331 329 } 332 330 /* 333 331 * On some boxes several processors use the same processor bus id. ··· 537 539 thermal_cooling_device_unregister(pr->cdev); 538 540 err_power_exit: 539 541 acpi_processor_power_exit(pr, device); 542 + sysfs_remove_link(&device->dev.kobj, "sysdev"); 540 543 err_free_cpumask: 541 544 free_cpumask_var(pr->throttling.shared_cpu_map); 542 545 ··· 719 720 return (AE_OK); 720 721 } 721 722 722 - static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu) 723 + static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr) 723 724 { 725 + acpi_handle handle = pr->handle; 724 726 725 727 if (!is_processor_present(handle)) { 726 728 return AE_ERROR; 727 729 } 728 730 729 - if (acpi_map_lsapic(handle, p_cpu)) 731 + if (acpi_map_lsapic(handle, &pr->id)) 730 732 return AE_ERROR; 731 733 732 - if (arch_register_cpu(*p_cpu)) { 733 - acpi_unmap_lsapic(*p_cpu); 734 + if (arch_register_cpu(pr->id)) { 735 + acpi_unmap_lsapic(pr->id); 734 736 return AE_ERROR; 735 737 } 736 738 ··· 748 748 return (0); 749 749 } 750 750 #else 751 - static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu) 751 + static acpi_status acpi_processor_hotadd_init(struct acpi_processor *pr) 752 752 { 753 753 return AE_ERROR; 754 754 } ··· 826 826 acpi_processor_uninstall_hotplug_notify(); 827 827 828 828 acpi_bus_unregister_driver(&acpi_processor_driver); 829 - 830 - cpuidle_unregister_driver(&acpi_idle_driver); 831 829 832 830 return; 833 831 }
+49 -47
drivers/idle/intel_idle.c
··· 197 197 .enter = &intel_idle }, 198 198 }; 199 199 200 - static int get_driver_data(int cstate) 200 + static long get_driver_data(int cstate) 201 201 { 202 202 int driver_data; 203 203 switch (cstate) { ··· 232 232 * @drv: cpuidle driver 233 233 * @index: index of cpuidle state 234 234 * 235 + * Must be called under local_irq_disable(). 235 236 */ 236 237 static int intel_idle(struct cpuidle_device *dev, 237 238 struct cpuidle_driver *drv, int index) ··· 247 246 int cpu = smp_processor_id(); 248 247 249 248 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; 250 - 251 - local_irq_disable(); 252 249 253 250 /* 254 251 * leave_mm() to avoid costly and often unnecessary wakeups ··· 347 348 cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &mwait_substates); 348 349 349 350 if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) || 350 - !(ecx & CPUID5_ECX_INTERRUPT_BREAK)) 351 + !(ecx & CPUID5_ECX_INTERRUPT_BREAK) || 352 + !mwait_substates) 351 353 return -ENODEV; 352 354 353 355 pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates); ··· 394 394 if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */ 395 395 lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE; 396 396 else { 397 - smp_call_function(__setup_broadcast_timer, (void *)true, 1); 397 + on_each_cpu(__setup_broadcast_timer, (void *)true, 1); 398 398 register_cpu_notifier(&setup_broadcast_notifier); 399 399 } 400 400 ··· 471 471 } 472 472 473 473 if (auto_demotion_disable_flags) 474 - smp_call_function(auto_demotion_disable, NULL, 1); 474 + on_each_cpu(auto_demotion_disable, NULL, 1); 475 475 476 476 return 0; 477 477 } 478 478 479 479 480 480 /* 481 - * intel_idle_cpuidle_devices_init() 481 + * intel_idle_cpu_init() 482 482 * allocate, initialize, register cpuidle_devices 483 + * @cpu: cpu/core to initialize 483 484 */ 484 - static int intel_idle_cpuidle_devices_init(void) 485 + int intel_idle_cpu_init(int cpu) 485 486 { 486 - int i, cstate; 487 + int cstate; 487 488 struct cpuidle_device *dev; 488 489 489 - intel_idle_cpuidle_devices = alloc_percpu(struct cpuidle_device); 490 - if (intel_idle_cpuidle_devices == NULL) 491 - return -ENOMEM; 490 + dev = per_cpu_ptr(intel_idle_cpuidle_devices, cpu); 492 491 493 - for_each_online_cpu(i) { 494 - dev = per_cpu_ptr(intel_idle_cpuidle_devices, i); 492 + dev->state_count = 1; 495 493 496 - dev->state_count = 1; 494 + for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) { 495 + int num_substates; 497 496 498 - for (cstate = 1; cstate < MWAIT_MAX_NUM_CSTATES; ++cstate) { 499 - int num_substates; 497 + if (cstate > max_cstate) { 498 + printk(PREFIX "max_cstate %d reached\n", 499 + max_cstate); 500 + break; 501 + } 500 502 501 - if (cstate > max_cstate) { 502 - printk(PREFIX "max_cstate %d reached\n", 503 - max_cstate); 504 - break; 505 - } 503 + /* does the state exist in CPUID.MWAIT? */ 504 + num_substates = (mwait_substates >> ((cstate) * 4)) 505 + & MWAIT_SUBSTATE_MASK; 506 + if (num_substates == 0) 507 + continue; 508 + /* is the state not enabled? */ 509 + if (cpuidle_state_table[cstate].enter == NULL) 510 + continue; 506 511 507 - /* does the state exist in CPUID.MWAIT? */ 508 - num_substates = (mwait_substates >> ((cstate) * 4)) 509 - & MWAIT_SUBSTATE_MASK; 510 - if (num_substates == 0) 511 - continue; 512 - /* is the state not enabled? */ 513 - if (cpuidle_state_table[cstate].enter == NULL) { 514 - continue; 515 - } 516 - 517 - dev->states_usage[dev->state_count].driver_data = 518 - (void *)get_driver_data(cstate); 512 + dev->states_usage[dev->state_count].driver_data = 513 + (void *)get_driver_data(cstate); 519 514 520 515 dev->state_count += 1; 521 516 } 517 + dev->cpu = cpu; 522 518 523 - dev->cpu = i; 524 - if (cpuidle_register_device(dev)) { 525 - pr_debug(PREFIX "cpuidle_register_device %d failed!\n", 526 - i); 527 - intel_idle_cpuidle_devices_uninit(); 528 - return -EIO; 529 - } 519 + if (cpuidle_register_device(dev)) { 520 + pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu); 521 + intel_idle_cpuidle_devices_uninit(); 522 + return -EIO; 530 523 } 524 + 525 + if (auto_demotion_disable_flags) 526 + smp_call_function_single(cpu, auto_demotion_disable, NULL, 1); 531 527 532 528 return 0; 533 529 } ··· 531 535 532 536 static int __init intel_idle_init(void) 533 537 { 534 - int retval; 538 + int retval, i; 535 539 536 540 /* Do not load intel_idle at all for now if idle= is passed */ 537 541 if (boot_option_idle_override != IDLE_NO_OVERRIDE) ··· 549 553 return retval; 550 554 } 551 555 552 - retval = intel_idle_cpuidle_devices_init(); 553 - if (retval) { 554 - cpuidle_unregister_driver(&intel_idle_driver); 555 - return retval; 556 + intel_idle_cpuidle_devices = alloc_percpu(struct cpuidle_device); 557 + if (intel_idle_cpuidle_devices == NULL) 558 + return -ENOMEM; 559 + 560 + for_each_online_cpu(i) { 561 + retval = intel_idle_cpu_init(i); 562 + if (retval) { 563 + cpuidle_unregister_driver(&intel_idle_driver); 564 + return retval; 565 + } 556 566 } 557 567 558 568 return 0; ··· 570 568 cpuidle_unregister_driver(&intel_idle_driver); 571 569 572 570 if (lapic_timer_reliable_states != LAPIC_TIMER_ALWAYS_RELIABLE) { 573 - smp_call_function(__setup_broadcast_timer, (void *)false, 1); 571 + on_each_cpu(__setup_broadcast_timer, (void *)false, 1); 574 572 unregister_cpu_notifier(&setup_broadcast_notifier); 575 573 } 576 574
+1
include/acpi/acnames.h
··· 58 58 #define METHOD_NAME__PRT "_PRT" 59 59 #define METHOD_NAME__CRS "_CRS" 60 60 #define METHOD_NAME__PRS "_PRS" 61 + #define METHOD_NAME__AEI "_AEI" 61 62 #define METHOD_NAME__PRW "_PRW" 62 63 #define METHOD_NAME__SRS "_SRS" 63 64
+1
include/acpi/acpi_numa.h
··· 15 15 extern int node_to_pxm(int); 16 16 extern void __acpi_map_pxm_to_node(int, int); 17 17 extern int acpi_map_pxm_to_node(int); 18 + extern unsigned char acpi_srat_revision; 18 19 19 20 #endif /* CONFIG_ACPI_NUMA */ 20 21 #endif /* __ACP_NUMA_H */
-7
include/acpi/acpiosxf.h
··· 238 238 /* 239 239 * Miscellaneous 240 240 */ 241 - acpi_status 242 - acpi_os_validate_address(u8 space_id, acpi_physical_address address, 243 - acpi_size length, char *name); 244 - acpi_status 245 - acpi_os_invalidate_address(u8 space_id, acpi_physical_address address, 246 - acpi_size length); 247 - 248 241 u64 acpi_os_get_timer(void); 249 242 250 243 acpi_status acpi_os_signal(u32 function, void *info);
+29 -3
include/acpi/acpixf.h
··· 47 47 48 48 /* Current ACPICA subsystem version in YYYYMMDD format */ 49 49 50 - #define ACPI_CA_VERSION 0x20110623 50 + #define ACPI_CA_VERSION 0x20120111 51 51 52 52 #include "actypes.h" 53 53 #include "actbl.h" ··· 74 74 extern u32 acpi_current_gpe_count; 75 75 extern struct acpi_table_fadt acpi_gbl_FADT; 76 76 extern u8 acpi_gbl_system_awake_and_running; 77 + extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ 77 78 78 79 extern u32 acpi_rsdt_forced; 79 80 /* ··· 111 110 acpi_status acpi_install_interface(acpi_string interface_name); 112 111 113 112 acpi_status acpi_remove_interface(acpi_string interface_name); 113 + 114 + u32 115 + acpi_check_address_range(acpi_adr_space_type space_id, 116 + acpi_physical_address address, 117 + acpi_size length, u8 warn); 114 118 115 119 /* 116 120 * ACPI Memory management ··· 282 276 acpi_status acpi_install_interface_handler(acpi_interface_handler handler); 283 277 284 278 /* 285 - * Event interfaces 279 + * Global Lock interfaces 286 280 */ 287 281 acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); 288 282 289 283 acpi_status acpi_release_global_lock(u32 handle); 290 284 285 + /* 286 + * Interfaces to AML mutex objects 287 + */ 288 + acpi_status 289 + acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout); 290 + 291 + acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname); 292 + 293 + /* 294 + * Fixed Event interfaces 295 + */ 291 296 acpi_status acpi_enable_event(u32 event, u32 flags); 292 297 293 298 acpi_status acpi_disable_event(u32 event, u32 flags); ··· 308 291 acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 309 292 310 293 /* 311 - * GPE Interfaces 294 + * General Purpose Event (GPE) Interfaces 312 295 */ 313 296 acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); 314 297 ··· 363 346 #endif 364 347 365 348 acpi_status 349 + acpi_get_event_resources(acpi_handle device_handle, 350 + struct acpi_buffer *ret_buffer); 351 + 352 + acpi_status 366 353 acpi_walk_resources(acpi_handle device, 367 354 char *name, 368 355 acpi_walk_resource_callback user_function, void *context); ··· 380 359 acpi_status 381 360 acpi_resource_to_address64(struct acpi_resource *resource, 382 361 struct acpi_resource_address64 *out); 362 + 363 + acpi_status 364 + acpi_buffer_to_resource(u8 *aml_buffer, 365 + u16 aml_buffer_length, 366 + struct acpi_resource **resource_ptr); 383 367 384 368 /* 385 369 * Hardware (ACPI device) interfaces
+203 -4
include/acpi/acrestyp.h
··· 61 61 #define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 62 62 #define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 63 63 64 + /*! [Begin] no source code translation */ 64 65 /* 65 66 * IO Attributes 66 - * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. 67 - * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. 67 + * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. 68 + * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. 68 69 */ 70 + /*! [End] no source code translation !*/ 71 + 69 72 #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 70 73 #define ACPI_ISA_ONLY_RANGES (u8) 0x02 71 74 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) ··· 84 81 #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ 85 82 86 83 /* 87 - * IRQ Attributes 84 + * Interrupt attributes - used in multiple descriptors 88 85 */ 86 + 87 + /* Triggering */ 88 + 89 89 #define ACPI_LEVEL_SENSITIVE (u8) 0x00 90 90 #define ACPI_EDGE_SENSITIVE (u8) 0x01 91 91 92 + /* Polarity */ 93 + 92 94 #define ACPI_ACTIVE_HIGH (u8) 0x00 93 95 #define ACPI_ACTIVE_LOW (u8) 0x01 96 + #define ACPI_ACTIVE_BOTH (u8) 0x02 97 + 98 + /* Sharing */ 94 99 95 100 #define ACPI_EXCLUSIVE (u8) 0x00 96 101 #define ACPI_SHARED (u8) 0x01 102 + #define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02 103 + #define ACPI_SHARED_AND_WAKE (u8) 0x03 97 104 98 105 /* 99 106 * DMA Attributes ··· 139 126 140 127 #define ACPI_POS_DECODE (u8) 0x00 141 128 #define ACPI_SUB_DECODE (u8) 0x01 129 + 130 + /* Producer/Consumer */ 142 131 143 132 #define ACPI_PRODUCER (u8) 0x00 144 133 #define ACPI_CONSUMER (u8) 0x01 ··· 206 191 u16 address; 207 192 u8 address_length; 208 193 }; 194 + 195 + struct acpi_resource_fixed_dma { 196 + u16 request_lines; 197 + u16 channels; 198 + u8 width; 199 + }; 200 + 201 + /* Values for Width field above */ 202 + 203 + #define ACPI_DMA_WIDTH8 0 204 + #define ACPI_DMA_WIDTH16 1 205 + #define ACPI_DMA_WIDTH32 2 206 + #define ACPI_DMA_WIDTH64 3 207 + #define ACPI_DMA_WIDTH128 4 208 + #define ACPI_DMA_WIDTH256 5 209 209 210 210 struct acpi_resource_vendor { 211 211 u16 byte_length; ··· 359 329 u64 address; 360 330 }; 361 331 332 + struct acpi_resource_gpio { 333 + u8 revision_id; 334 + u8 connection_type; 335 + u8 producer_consumer; /* For values, see Producer/Consumer above */ 336 + u8 pin_config; 337 + u8 sharable; /* For values, see Interrupt Attributes above */ 338 + u8 io_restriction; 339 + u8 triggering; /* For values, see Interrupt Attributes above */ 340 + u8 polarity; /* For values, see Interrupt Attributes above */ 341 + u16 drive_strength; 342 + u16 debounce_timeout; 343 + u16 pin_table_length; 344 + u16 vendor_length; 345 + struct acpi_resource_source resource_source; 346 + u16 *pin_table; 347 + u8 *vendor_data; 348 + }; 349 + 350 + /* Values for GPIO connection_type field above */ 351 + 352 + #define ACPI_RESOURCE_GPIO_TYPE_INT 0 353 + #define ACPI_RESOURCE_GPIO_TYPE_IO 1 354 + 355 + /* Values for pin_config field above */ 356 + 357 + #define ACPI_PIN_CONFIG_DEFAULT 0 358 + #define ACPI_PIN_CONFIG_PULLUP 1 359 + #define ACPI_PIN_CONFIG_PULLDOWN 2 360 + #define ACPI_PIN_CONFIG_NOPULL 3 361 + 362 + /* Values for io_restriction field above */ 363 + 364 + #define ACPI_IO_RESTRICT_NONE 0 365 + #define ACPI_IO_RESTRICT_INPUT 1 366 + #define ACPI_IO_RESTRICT_OUTPUT 2 367 + #define ACPI_IO_RESTRICT_NONE_PRESERVE 3 368 + 369 + /* Common structure for I2C, SPI, and UART serial descriptors */ 370 + 371 + #define ACPI_RESOURCE_SERIAL_COMMON \ 372 + u8 revision_id; \ 373 + u8 type; \ 374 + u8 producer_consumer; /* For values, see Producer/Consumer above */\ 375 + u8 slave_mode; \ 376 + u8 type_revision_id; \ 377 + u16 type_data_length; \ 378 + u16 vendor_length; \ 379 + struct acpi_resource_source resource_source; \ 380 + u8 *vendor_data; 381 + 382 + struct acpi_resource_common_serialbus { 383 + ACPI_RESOURCE_SERIAL_COMMON}; 384 + 385 + /* Values for the Type field above */ 386 + 387 + #define ACPI_RESOURCE_SERIAL_TYPE_I2C 1 388 + #define ACPI_RESOURCE_SERIAL_TYPE_SPI 2 389 + #define ACPI_RESOURCE_SERIAL_TYPE_UART 3 390 + 391 + /* Values for slave_mode field above */ 392 + 393 + #define ACPI_CONTROLLER_INITIATED 0 394 + #define ACPI_DEVICE_INITIATED 1 395 + 396 + struct acpi_resource_i2c_serialbus { 397 + ACPI_RESOURCE_SERIAL_COMMON u8 access_mode; 398 + u16 slave_address; 399 + u32 connection_speed; 400 + }; 401 + 402 + /* Values for access_mode field above */ 403 + 404 + #define ACPI_I2C_7BIT_MODE 0 405 + #define ACPI_I2C_10BIT_MODE 1 406 + 407 + struct acpi_resource_spi_serialbus { 408 + ACPI_RESOURCE_SERIAL_COMMON u8 wire_mode; 409 + u8 device_polarity; 410 + u8 data_bit_length; 411 + u8 clock_phase; 412 + u8 clock_polarity; 413 + u16 device_selection; 414 + u32 connection_speed; 415 + }; 416 + 417 + /* Values for wire_mode field above */ 418 + 419 + #define ACPI_SPI_4WIRE_MODE 0 420 + #define ACPI_SPI_3WIRE_MODE 1 421 + 422 + /* Values for device_polarity field above */ 423 + 424 + #define ACPI_SPI_ACTIVE_LOW 0 425 + #define ACPI_SPI_ACTIVE_HIGH 1 426 + 427 + /* Values for clock_phase field above */ 428 + 429 + #define ACPI_SPI_FIRST_PHASE 0 430 + #define ACPI_SPI_SECOND_PHASE 1 431 + 432 + /* Values for clock_polarity field above */ 433 + 434 + #define ACPI_SPI_START_LOW 0 435 + #define ACPI_SPI_START_HIGH 1 436 + 437 + struct acpi_resource_uart_serialbus { 438 + ACPI_RESOURCE_SERIAL_COMMON u8 endian; 439 + u8 data_bits; 440 + u8 stop_bits; 441 + u8 flow_control; 442 + u8 parity; 443 + u8 lines_enabled; 444 + u16 rx_fifo_size; 445 + u16 tx_fifo_size; 446 + u32 default_baud_rate; 447 + }; 448 + 449 + /* Values for Endian field above */ 450 + 451 + #define ACPI_UART_LITTLE_ENDIAN 0 452 + #define ACPI_UART_BIG_ENDIAN 1 453 + 454 + /* Values for data_bits field above */ 455 + 456 + #define ACPI_UART_5_DATA_BITS 0 457 + #define ACPI_UART_6_DATA_BITS 1 458 + #define ACPI_UART_7_DATA_BITS 2 459 + #define ACPI_UART_8_DATA_BITS 3 460 + #define ACPI_UART_9_DATA_BITS 4 461 + 462 + /* Values for stop_bits field above */ 463 + 464 + #define ACPI_UART_NO_STOP_BITS 0 465 + #define ACPI_UART_1_STOP_BIT 1 466 + #define ACPI_UART_1P5_STOP_BITS 2 467 + #define ACPI_UART_2_STOP_BITS 3 468 + 469 + /* Values for flow_control field above */ 470 + 471 + #define ACPI_UART_FLOW_CONTROL_NONE 0 472 + #define ACPI_UART_FLOW_CONTROL_HW 1 473 + #define ACPI_UART_FLOW_CONTROL_XON_XOFF 2 474 + 475 + /* Values for Parity field above */ 476 + 477 + #define ACPI_UART_PARITY_NONE 0 478 + #define ACPI_UART_PARITY_EVEN 1 479 + #define ACPI_UART_PARITY_ODD 2 480 + #define ACPI_UART_PARITY_MARK 3 481 + #define ACPI_UART_PARITY_SPACE 4 482 + 483 + /* Values for lines_enabled bitfield above */ 484 + 485 + #define ACPI_UART_CARRIER_DETECT (1<<2) 486 + #define ACPI_UART_RING_INDICATOR (1<<3) 487 + #define ACPI_UART_DATA_SET_READY (1<<4) 488 + #define ACPI_UART_DATA_TERMINAL_READY (1<<5) 489 + #define ACPI_UART_CLEAR_TO_SEND (1<<6) 490 + #define ACPI_UART_REQUEST_TO_SEND (1<<7) 491 + 362 492 /* ACPI_RESOURCE_TYPEs */ 363 493 364 494 #define ACPI_RESOURCE_TYPE_IRQ 0 ··· 538 348 #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ 539 349 #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 540 350 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 541 - #define ACPI_RESOURCE_TYPE_MAX 16 351 + #define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ 352 + #define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ 353 + #define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ 354 + #define ACPI_RESOURCE_TYPE_MAX 19 542 355 543 356 /* Master union for resource descriptors */ 544 357 ··· 551 358 struct acpi_resource_start_dependent start_dpf; 552 359 struct acpi_resource_io io; 553 360 struct acpi_resource_fixed_io fixed_io; 361 + struct acpi_resource_fixed_dma fixed_dma; 554 362 struct acpi_resource_vendor vendor; 555 363 struct acpi_resource_vendor_typed vendor_typed; 556 364 struct acpi_resource_end_tag end_tag; ··· 564 370 struct acpi_resource_extended_address64 ext_address64; 565 371 struct acpi_resource_extended_irq extended_irq; 566 372 struct acpi_resource_generic_register generic_reg; 373 + struct acpi_resource_gpio gpio; 374 + struct acpi_resource_i2c_serialbus i2c_serial_bus; 375 + struct acpi_resource_spi_serialbus spi_serial_bus; 376 + struct acpi_resource_uart_serialbus uart_serial_bus; 377 + struct acpi_resource_common_serialbus common_serial_bus; 567 378 568 379 /* Common fields */ 569 380
+17 -6
include/acpi/actbl.h
··· 255 255 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 256 256 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ 257 257 struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ 258 + struct acpi_generic_address sleep_control; /* 64-bit Sleep Control register */ 259 + struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register */ 258 260 }; 259 261 260 262 /* Masks for FADT Boot Architecture Flags (boot_flags) */ ··· 266 264 #define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ 267 265 #define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ 268 266 #define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ 267 + #define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */ 269 268 270 269 #define FADT2_REVISION_ID 3 271 270 ··· 292 289 #define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ 293 290 #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ 294 291 #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */ 292 + #define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */ 293 + #define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */ 295 294 296 295 /* Values for preferred_profile (Preferred Power Management Profiles) */ 297 296 ··· 304 299 PM_WORKSTATION = 3, 305 300 PM_ENTERPRISE_SERVER = 4, 306 301 PM_SOHO_SERVER = 5, 307 - PM_APPLIANCE_PC = 6 302 + PM_APPLIANCE_PC = 6, 303 + PM_PERFORMANCE_SERVER = 7, 304 + PM_TABLET = 8 308 305 }; 309 306 310 307 /* Reset to default packing */ 311 308 312 309 #pragma pack() 313 310 314 - #define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) 311 + #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) 315 312 316 313 /* 317 314 * Internal table-related structures ··· 349 342 350 343 #include <acpi/actbl1.h> 351 344 #include <acpi/actbl2.h> 345 + #include <acpi/actbl3.h> 352 346 353 347 /* 354 348 * Sizes of the various flavors of FADT. We need to look closely ··· 359 351 * FADT is the bottom line as to what the version really is. 360 352 * 361 353 * For reference, the values below are as follows: 362 - * FADT V1 size: 0x74 363 - * FADT V2 size: 0x84 364 - * FADT V3+ size: 0xF4 354 + * FADT V1 size: 0x074 355 + * FADT V2 size: 0x084 356 + * FADT V3 size: 0x0F4 357 + * FADT V4 size: 0x0F4 358 + * FADT V5 size: 0x10C 365 359 */ 366 360 #define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 367 361 #define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) 368 - #define ACPI_FADT_V3_SIZE (u32) (sizeof (struct acpi_table_fadt)) 362 + #define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) 363 + #define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt)) 369 364 370 365 #endif /* __ACTBL_H__ */
+53 -4
include/acpi/actbl1.h
··· 228 228 ACPI_EINJ_EXECUTE_OPERATION = 5, 229 229 ACPI_EINJ_CHECK_BUSY_STATUS = 6, 230 230 ACPI_EINJ_GET_COMMAND_STATUS = 7, 231 - ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */ 231 + ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, 232 + ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */ 232 233 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ 233 234 }; 234 235 ··· 241 240 ACPI_EINJ_WRITE_REGISTER = 2, 242 241 ACPI_EINJ_WRITE_REGISTER_VALUE = 3, 243 242 ACPI_EINJ_NOOP = 4, 244 - ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */ 243 + ACPI_EINJ_FLUSH_CACHELINE = 5, 244 + ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */ 245 + }; 246 + 247 + struct acpi_einj_error_type_with_addr { 248 + u32 error_type; 249 + u32 vendor_struct_offset; 250 + u32 flags; 251 + u32 apic_id; 252 + u64 address; 253 + u64 range; 254 + u32 pcie_id; 255 + }; 256 + 257 + struct acpi_einj_vendor { 258 + u32 length; 259 + u32 pcie_id; 260 + u16 vendor_id; 261 + u16 device_id; 262 + u8 revision_id; 263 + u8 reserved[3]; 245 264 }; 246 265 247 266 /* EINJ Trigger Error Action Table */ ··· 296 275 #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) 297 276 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) 298 277 #define ACPI_EINJ_PLATFORM_FATAL (1<<11) 278 + #define ACPI_EINJ_VENDOR_DEFINED (1<<31) 299 279 300 280 /******************************************************************************* 301 281 * ··· 653 631 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, 654 632 ACPI_MADT_TYPE_LOCAL_X2APIC = 9, 655 633 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 656 - ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */ 634 + ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, 635 + ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, 636 + ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ 657 637 }; 658 638 659 639 /* ··· 776 752 u8 reserved[3]; 777 753 }; 778 754 755 + /* 11: Generic Interrupt (ACPI 5.0) */ 756 + 757 + struct acpi_madt_generic_interrupt { 758 + struct acpi_subtable_header header; 759 + u16 reserved; /* Reserved - must be zero */ 760 + u32 gic_id; 761 + u32 uid; 762 + u32 flags; 763 + u32 parking_version; 764 + u32 performance_interrupt; 765 + u64 parked_address; 766 + u64 base_address; 767 + }; 768 + 769 + /* 12: Generic Distributor (ACPI 5.0) */ 770 + 771 + struct acpi_madt_generic_distributor { 772 + struct acpi_subtable_header header; 773 + u16 reserved; /* Reserved - must be zero */ 774 + u32 gic_id; 775 + u64 base_address; 776 + u32 global_irq_base; 777 + u32 reserved2; /* Reserved - must be zero */ 778 + }; 779 + 779 780 /* 780 781 * Common flags fields for MADT subtables 781 782 */ 782 783 783 - /* MADT Local APIC flags (lapic_flags) */ 784 + /* MADT Local APIC flags (lapic_flags) and GIC flags */ 784 785 785 786 #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 786 787
+552
include/acpi/actbl3.h
··· 1 + /****************************************************************************** 2 + * 3 + * Name: actbl3.h - ACPI Table Definitions 4 + * 5 + *****************************************************************************/ 6 + 7 + /* 8 + * Copyright (C) 2000 - 2011, 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 + #ifndef __ACTBL3_H__ 45 + #define __ACTBL3_H__ 46 + 47 + /******************************************************************************* 48 + * 49 + * Additional ACPI Tables (3) 50 + * 51 + * These tables are not consumed directly by the ACPICA subsystem, but are 52 + * included here to support device drivers and the AML disassembler. 53 + * 54 + * The tables in this file are fully defined within the ACPI specification. 55 + * 56 + ******************************************************************************/ 57 + 58 + /* 59 + * Values for description table header signatures for tables defined in this 60 + * file. Useful because they make it more difficult to inadvertently type in 61 + * the wrong signature. 62 + */ 63 + #define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ 64 + #define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */ 65 + #define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */ 66 + #define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */ 67 + #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ 68 + #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ 69 + #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ 70 + #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ 71 + 72 + #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ 73 + #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ 74 + 75 + /* Reserved table signatures */ 76 + 77 + #define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */ 78 + #define ACPI_SIG_DBG2 "DBG2" /* Debug Port table 2 */ 79 + #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ 80 + #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ 81 + #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ 82 + 83 + /* 84 + * All tables must be byte-packed to match the ACPI specification, since 85 + * the tables are provided by the system BIOS. 86 + */ 87 + #pragma pack(1) 88 + 89 + /* 90 + * Note about bitfields: The u8 type is used for bitfields in ACPI tables. 91 + * This is the only type that is even remotely portable. Anything else is not 92 + * portable, so do not use any other bitfield types. 93 + */ 94 + 95 + /******************************************************************************* 96 + * 97 + * BGRT - Boot Graphics Resource Table (ACPI 5.0) 98 + * Version 1 99 + * 100 + ******************************************************************************/ 101 + 102 + struct acpi_table_bgrt { 103 + struct acpi_table_header header; /* Common ACPI table header */ 104 + u16 version; 105 + u8 status; 106 + u8 image_type; 107 + u64 image_address; 108 + u32 image_offset_x; 109 + u32 image_offset_y; 110 + }; 111 + 112 + /******************************************************************************* 113 + * 114 + * DRTM - Dynamic Root of Trust for Measurement table 115 + * 116 + ******************************************************************************/ 117 + 118 + struct acpi_table_drtm { 119 + struct acpi_table_header header; /* Common ACPI table header */ 120 + u64 entry_base_address; 121 + u64 entry_length; 122 + u32 entry_address32; 123 + u64 entry_address64; 124 + u64 exit_address; 125 + u64 log_area_address; 126 + u32 log_area_length; 127 + u64 arch_dependent_address; 128 + u32 flags; 129 + }; 130 + 131 + /* 1) Validated Tables List */ 132 + 133 + struct acpi_drtm_vtl_list { 134 + u32 validated_table_list_count; 135 + }; 136 + 137 + /* 2) Resources List */ 138 + 139 + struct acpi_drtm_resource_list { 140 + u32 resource_list_count; 141 + }; 142 + 143 + /* 3) Platform-specific Identifiers List */ 144 + 145 + struct acpi_drtm_id_list { 146 + u32 id_list_count; 147 + }; 148 + 149 + /******************************************************************************* 150 + * 151 + * FPDT - Firmware Performance Data Table (ACPI 5.0) 152 + * Version 1 153 + * 154 + ******************************************************************************/ 155 + 156 + struct acpi_table_fpdt { 157 + struct acpi_table_header header; /* Common ACPI table header */ 158 + }; 159 + 160 + /* FPDT subtable header */ 161 + 162 + struct acpi_fpdt_header { 163 + u16 type; 164 + u8 length; 165 + u8 revision; 166 + }; 167 + 168 + /* Values for Type field above */ 169 + 170 + enum acpi_fpdt_type { 171 + ACPI_FPDT_TYPE_BOOT = 0, 172 + ACPI_FPDT_TYPE_S3PERF = 1, 173 + }; 174 + 175 + /* 176 + * FPDT subtables 177 + */ 178 + 179 + /* 0: Firmware Basic Boot Performance Record */ 180 + 181 + struct acpi_fpdt_boot { 182 + struct acpi_fpdt_header header; 183 + u8 reserved[4]; 184 + u64 reset_end; 185 + u64 load_start; 186 + u64 startup_start; 187 + u64 exit_services_entry; 188 + u64 exit_services_exit; 189 + }; 190 + 191 + /* 1: S3 Performance Table Pointer Record */ 192 + 193 + struct acpi_fpdt_s3pt_ptr { 194 + struct acpi_fpdt_header header; 195 + u8 reserved[4]; 196 + u64 address; 197 + }; 198 + 199 + /* 200 + * S3PT - S3 Performance Table. This table is pointed to by the 201 + * FPDT S3 Pointer Record above. 202 + */ 203 + struct acpi_table_s3pt { 204 + u8 signature[4]; /* "S3PT" */ 205 + u32 length; 206 + }; 207 + 208 + /* 209 + * S3PT Subtables 210 + */ 211 + struct acpi_s3pt_header { 212 + u16 type; 213 + u8 length; 214 + u8 revision; 215 + }; 216 + 217 + /* Values for Type field above */ 218 + 219 + enum acpi_s3pt_type { 220 + ACPI_S3PT_TYPE_RESUME = 0, 221 + ACPI_S3PT_TYPE_SUSPEND = 1, 222 + }; 223 + 224 + struct acpi_s3pt_resume { 225 + struct acpi_s3pt_header header; 226 + u32 resume_count; 227 + u64 full_resume; 228 + u64 average_resume; 229 + }; 230 + 231 + struct acpi_s3pt_suspend { 232 + struct acpi_s3pt_header header; 233 + u64 suspend_start; 234 + u64 suspend_end; 235 + }; 236 + 237 + /******************************************************************************* 238 + * 239 + * GTDT - Generic Timer Description Table (ACPI 5.0) 240 + * Version 1 241 + * 242 + ******************************************************************************/ 243 + 244 + struct acpi_table_gtdt { 245 + struct acpi_table_header header; /* Common ACPI table header */ 246 + u64 address; 247 + u32 flags; 248 + u32 secure_pl1_interrupt; 249 + u32 secure_pl1_flags; 250 + u32 non_secure_pl1_interrupt; 251 + u32 non_secure_pl1_flags; 252 + u32 virtual_timer_interrupt; 253 + u32 virtual_timer_flags; 254 + u32 non_secure_pl2_interrupt; 255 + u32 non_secure_pl2_flags; 256 + }; 257 + 258 + /* Values for Flags field above */ 259 + 260 + #define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 261 + 262 + /* Values for all "TimerFlags" fields above */ 263 + 264 + #define ACPI_GTDT_INTERRUPT_MODE 1 265 + #define ACPI_GTDT_INTERRUPT_POLARITY 2 266 + 267 + /******************************************************************************* 268 + * 269 + * MPST - Memory Power State Table (ACPI 5.0) 270 + * Version 1 271 + * 272 + ******************************************************************************/ 273 + 274 + #define ACPI_MPST_CHANNEL_INFO \ 275 + u16 reserved1; \ 276 + u8 channel_id; \ 277 + u8 reserved2; \ 278 + u16 power_node_count; 279 + 280 + /* Main table */ 281 + 282 + struct acpi_table_mpst { 283 + struct acpi_table_header header; /* Common ACPI table header */ 284 + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ 285 + }; 286 + 287 + /* Memory Platform Communication Channel Info */ 288 + 289 + struct acpi_mpst_channel { 290 + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ 291 + }; 292 + 293 + /* Memory Power Node Structure */ 294 + 295 + struct acpi_mpst_power_node { 296 + u8 flags; 297 + u8 reserved1; 298 + u16 node_id; 299 + u32 length; 300 + u64 range_address; 301 + u64 range_length; 302 + u8 num_power_states; 303 + u8 num_physical_components; 304 + u16 reserved2; 305 + }; 306 + 307 + /* Values for Flags field above */ 308 + 309 + #define ACPI_MPST_ENABLED 1 310 + #define ACPI_MPST_POWER_MANAGED 2 311 + #define ACPI_MPST_HOT_PLUG_CAPABLE 4 312 + 313 + /* Memory Power State Structure (follows POWER_NODE above) */ 314 + 315 + struct acpi_mpst_power_state { 316 + u8 power_state; 317 + u8 info_index; 318 + }; 319 + 320 + /* Physical Component ID Structure (follows POWER_STATE above) */ 321 + 322 + struct acpi_mpst_component { 323 + u16 component_id; 324 + }; 325 + 326 + /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */ 327 + 328 + struct acpi_mpst_data_hdr { 329 + u16 characteristics_count; 330 + }; 331 + 332 + struct acpi_mpst_power_data { 333 + u8 revision; 334 + u8 flags; 335 + u16 reserved1; 336 + u32 average_power; 337 + u32 power_saving; 338 + u64 exit_latency; 339 + u64 reserved2; 340 + }; 341 + 342 + /* Values for Flags field above */ 343 + 344 + #define ACPI_MPST_PRESERVE 1 345 + #define ACPI_MPST_AUTOENTRY 2 346 + #define ACPI_MPST_AUTOEXIT 4 347 + 348 + /* Shared Memory Region (not part of an ACPI table) */ 349 + 350 + struct acpi_mpst_shared { 351 + u32 signature; 352 + u16 pcc_command; 353 + u16 pcc_status; 354 + u16 command_register; 355 + u16 status_register; 356 + u16 power_state_id; 357 + u16 power_node_id; 358 + u64 energy_consumed; 359 + u64 average_power; 360 + }; 361 + 362 + /******************************************************************************* 363 + * 364 + * PCCT - Platform Communications Channel Table (ACPI 5.0) 365 + * Version 1 366 + * 367 + ******************************************************************************/ 368 + 369 + struct acpi_table_pcct { 370 + struct acpi_table_header header; /* Common ACPI table header */ 371 + u32 flags; 372 + u32 latency; 373 + u32 reserved; 374 + }; 375 + 376 + /* Values for Flags field above */ 377 + 378 + #define ACPI_PCCT_DOORBELL 1 379 + 380 + /* 381 + * PCCT subtables 382 + */ 383 + 384 + /* 0: Generic Communications Subspace */ 385 + 386 + struct acpi_pcct_subspace { 387 + struct acpi_subtable_header header; 388 + u8 reserved[6]; 389 + u64 base_address; 390 + u64 length; 391 + struct acpi_generic_address doorbell_register; 392 + u64 preserve_mask; 393 + u64 write_mask; 394 + }; 395 + 396 + /* 397 + * PCC memory structures (not part of the ACPI table) 398 + */ 399 + 400 + /* Shared Memory Region */ 401 + 402 + struct acpi_pcct_shared_memory { 403 + u32 signature; 404 + u16 command; 405 + u16 status; 406 + }; 407 + 408 + /******************************************************************************* 409 + * 410 + * PMTT - Platform Memory Topology Table (ACPI 5.0) 411 + * Version 1 412 + * 413 + ******************************************************************************/ 414 + 415 + struct acpi_table_pmtt { 416 + struct acpi_table_header header; /* Common ACPI table header */ 417 + u32 reserved; 418 + }; 419 + 420 + /* Common header for PMTT subtables that follow main table */ 421 + 422 + struct acpi_pmtt_header { 423 + u8 type; 424 + u8 reserved1; 425 + u16 length; 426 + u16 flags; 427 + u16 reserved2; 428 + }; 429 + 430 + /* Values for Type field above */ 431 + 432 + #define ACPI_PMTT_TYPE_SOCKET 0 433 + #define ACPI_PMTT_TYPE_CONTROLLER 1 434 + #define ACPI_PMTT_TYPE_DIMM 2 435 + #define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */ 436 + 437 + /* Values for Flags field above */ 438 + 439 + #define ACPI_PMTT_TOP_LEVEL 0x0001 440 + #define ACPI_PMTT_PHYSICAL 0x0002 441 + #define ACPI_PMTT_MEMORY_TYPE 0x000C 442 + 443 + /* 444 + * PMTT subtables, correspond to Type in struct acpi_pmtt_header 445 + */ 446 + 447 + /* 0: Socket Structure */ 448 + 449 + struct acpi_pmtt_socket { 450 + struct acpi_pmtt_header header; 451 + u16 socket_id; 452 + u16 reserved; 453 + }; 454 + 455 + /* 1: Memory Controller subtable */ 456 + 457 + struct acpi_pmtt_controller { 458 + struct acpi_pmtt_header header; 459 + u32 read_latency; 460 + u32 write_latency; 461 + u32 read_bandwidth; 462 + u32 write_bandwidth; 463 + u16 access_width; 464 + u16 alignment; 465 + u16 reserved; 466 + u16 domain_count; 467 + }; 468 + 469 + /* 1a: Proximity Domain substructure */ 470 + 471 + struct acpi_pmtt_domain { 472 + u32 proximity_domain; 473 + }; 474 + 475 + /* 2: Physical Component Identifier (DIMM) */ 476 + 477 + struct acpi_pmtt_physical_component { 478 + struct acpi_pmtt_header header; 479 + u16 component_id; 480 + u16 reserved; 481 + u32 memory_size; 482 + u32 bios_handle; 483 + }; 484 + 485 + /******************************************************************************* 486 + * 487 + * RASF - RAS Feature Table (ACPI 5.0) 488 + * Version 1 489 + * 490 + ******************************************************************************/ 491 + 492 + struct acpi_table_rasf { 493 + struct acpi_table_header header; /* Common ACPI table header */ 494 + u8 channel_id[12]; 495 + }; 496 + 497 + /* RASF Platform Communication Channel Shared Memory Region */ 498 + 499 + struct acpi_rasf_shared_memory { 500 + u32 signature; 501 + u16 command; 502 + u16 status; 503 + u64 requested_address; 504 + u64 requested_length; 505 + u64 actual_address; 506 + u64 actual_length; 507 + u16 flags; 508 + u8 speed; 509 + }; 510 + 511 + /* Masks for Flags and Speed fields above */ 512 + 513 + #define ACPI_RASF_SCRUBBER_RUNNING 1 514 + #define ACPI_RASF_SPEED (7<<1) 515 + 516 + /* Channel Commands */ 517 + 518 + enum acpi_rasf_commands { 519 + ACPI_RASF_GET_RAS_CAPABILITIES = 1, 520 + ACPI_RASF_GET_PATROL_PARAMETERS = 2, 521 + ACPI_RASF_START_PATROL_SCRUBBER = 3, 522 + ACPI_RASF_STOP_PATROL_SCRUBBER = 4 523 + }; 524 + 525 + /* Channel Command flags */ 526 + 527 + #define ACPI_RASF_GENERATE_SCI (1<<15) 528 + 529 + /* Status values */ 530 + 531 + enum acpi_rasf_status { 532 + ACPI_RASF_SUCCESS = 0, 533 + ACPI_RASF_NOT_VALID = 1, 534 + ACPI_RASF_NOT_SUPPORTED = 2, 535 + ACPI_RASF_BUSY = 3, 536 + ACPI_RASF_FAILED = 4, 537 + ACPI_RASF_ABORTED = 5, 538 + ACPI_RASF_INVALID_DATA = 6 539 + }; 540 + 541 + /* Status flags */ 542 + 543 + #define ACPI_RASF_COMMAND_COMPLETE (1) 544 + #define ACPI_RASF_SCI_DOORBELL (1<<1) 545 + #define ACPI_RASF_ERROR (1<<2) 546 + #define ACPI_RASF_STATUS (0x1F<<3) 547 + 548 + /* Reset to default packing */ 549 + 550 + #pragma pack() 551 + 552 + #endif /* __ACTBL3_H__ */
+11 -1
include/acpi/actypes.h
··· 712 712 #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 713 713 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 714 714 #define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 715 + #define ACPI_ADR_SPACE_GPIO (acpi_adr_space_type) 8 716 + #define ACPI_ADR_SPACE_GSBUS (acpi_adr_space_type) 9 715 717 716 - #define ACPI_NUM_PREDEFINED_REGIONS 8 718 + #define ACPI_NUM_PREDEFINED_REGIONS 10 717 719 718 720 /* 719 721 * Special Address Spaces ··· 958 956 void *region_context); 959 957 960 958 #define ACPI_DEFAULT_HANDLER NULL 959 + 960 + /* Special Context data for generic_serial_bus/general_purpose_io (ACPI 5.0) */ 961 + 962 + struct acpi_connection_info { 963 + u8 *connection; 964 + u16 length; 965 + u8 access_length; 966 + }; 961 967 962 968 typedef 963 969 acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
+14 -6
include/linux/acpi.h
··· 310 310 u32 *mask, u32 req); 311 311 extern void acpi_early_init(void); 312 312 313 + extern int acpi_nvs_register(__u64 start, __u64 size); 314 + 315 + extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), 316 + void *data); 317 + 313 318 #else /* !CONFIG_ACPI */ 314 319 315 320 #define acpi_disabled 1 ··· 357 352 { 358 353 return -1; 359 354 } 360 - #endif /* !CONFIG_ACPI */ 361 355 362 - #ifdef CONFIG_ACPI_SLEEP 363 - int suspend_nvs_register(unsigned long start, unsigned long size); 364 - #else 365 - static inline int suspend_nvs_register(unsigned long a, unsigned long b) 356 + static inline int acpi_nvs_register(__u64 start, __u64 size) 366 357 { 367 358 return 0; 368 359 } 369 - #endif 360 + 361 + static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), 362 + void *data) 363 + { 364 + return 0; 365 + } 366 + 367 + #endif /* !CONFIG_ACPI */ 370 368 371 369 #endif /*_LINUX_ACPI_H*/
+3
include/linux/acpi_io.h
··· 12 12 13 13 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size); 14 14 15 + int acpi_os_map_generic_address(struct acpi_generic_address *addr); 16 + void acpi_os_unmap_generic_address(struct acpi_generic_address *addr); 17 + 15 18 #endif
+7
include/linux/cpuidle.h
··· 186 186 extern int cpuidle_register_governor(struct cpuidle_governor *gov); 187 187 extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); 188 188 189 + #ifdef CONFIG_INTEL_IDLE 190 + extern int intel_idle_cpu_init(int cpu); 189 191 #else 192 + static inline int intel_idle_cpu_init(int cpu) { return -1; } 193 + #endif 194 + 195 + #else 196 + static inline int intel_idle_cpu_init(int cpu) { return -1; } 190 197 191 198 static inline int cpuidle_register_governor(struct cpuidle_governor *gov) 192 199 {return 0;}
+2
tools/power/x86/turbostat/turbostat.c
··· 811 811 case 0x2C: /* Westmere EP - Gulftown */ 812 812 case 0x2A: /* SNB */ 813 813 case 0x2D: /* SNB Xeon */ 814 + case 0x3A: /* IVB */ 815 + case 0x3D: /* IVB Xeon */ 814 816 return 1; 815 817 case 0x2E: /* Nehalem-EX Xeon - Beckton */ 816 818 case 0x2F: /* Westmere-EX Xeon - Eagleton */