aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/Makefile158
-rw-r--r--drivers/acpi/acpica/accommon.h2
-rw-r--r--drivers/acpi/acpica/acconfig.h9
-rw-r--r--drivers/acpi/acpica/acdebug.h2
-rw-r--r--drivers/acpi/acpica/acdispat.h2
-rw-r--r--drivers/acpi/acpica/acevents.h3
-rw-r--r--drivers/acpi/acpica/acglobal.h17
-rw-r--r--drivers/acpi/acpica/achware.h2
-rw-r--r--drivers/acpi/acpica/acinterp.h4
-rw-r--r--drivers/acpi/acpica/aclocal.h26
-rw-r--r--drivers/acpi/acpica/acmacros.h2
-rw-r--r--drivers/acpi/acpica/acnamesp.h2
-rw-r--r--drivers/acpi/acpica/acobject.h8
-rw-r--r--drivers/acpi/acpica/acopcode.h6
-rw-r--r--drivers/acpi/acpica/acparser.h2
-rw-r--r--drivers/acpi/acpica/acpredef.h41
-rw-r--r--drivers/acpi/acpica/acresrc.h115
-rw-r--r--drivers/acpi/acpica/acstruct.h2
-rw-r--r--drivers/acpi/acpica/actables.h2
-rw-r--r--drivers/acpi/acpica/acutils.h21
-rw-r--r--drivers/acpi/acpica/amlcode.h29
-rw-r--r--drivers/acpi/acpica/amlresrc.h138
-rw-r--r--drivers/acpi/acpica/dsargs.c18
-rw-r--r--drivers/acpi/acpica/dscontrol.c2
-rw-r--r--drivers/acpi/acpica/dsfield.c83
-rw-r--r--drivers/acpi/acpica/dsinit.c2
-rw-r--r--drivers/acpi/acpica/dsmethod.c2
-rw-r--r--drivers/acpi/acpica/dsmthdat.c2
-rw-r--r--drivers/acpi/acpica/dsobject.c2
-rw-r--r--drivers/acpi/acpica/dsopcode.c2
-rw-r--r--drivers/acpi/acpica/dsutils.c2
-rw-r--r--drivers/acpi/acpica/dswexec.c2
-rw-r--r--drivers/acpi/acpica/dswload.c2
-rw-r--r--drivers/acpi/acpica/dswload2.c2
-rw-r--r--drivers/acpi/acpica/dswscope.c2
-rw-r--r--drivers/acpi/acpica/dswstate.c2
-rw-r--r--drivers/acpi/acpica/evevent.c14
-rw-r--r--drivers/acpi/acpica/evglock.c8
-rw-r--r--drivers/acpi/acpica/evgpe.c2
-rw-r--r--drivers/acpi/acpica/evgpeblk.c2
-rw-r--r--drivers/acpi/acpica/evgpeinit.c2
-rw-r--r--drivers/acpi/acpica/evgpeutil.c2
-rw-r--r--drivers/acpi/acpica/evmisc.c2
-rw-r--r--drivers/acpi/acpica/evregion.c31
-rw-r--r--drivers/acpi/acpica/evrgnini.c2
-rw-r--r--drivers/acpi/acpica/evsci.c2
-rw-r--r--drivers/acpi/acpica/evxface.c2
-rw-r--r--drivers/acpi/acpica/evxfevnt.c2
-rw-r--r--drivers/acpi/acpica/evxfgpe.c2
-rw-r--r--drivers/acpi/acpica/evxfregn.c2
-rw-r--r--drivers/acpi/acpica/exconfig.c8
-rw-r--r--drivers/acpi/acpica/exconvrt.c2
-rw-r--r--drivers/acpi/acpica/excreate.c31
-rw-r--r--drivers/acpi/acpica/exdebug.c2
-rw-r--r--drivers/acpi/acpica/exdump.c9
-rw-r--r--drivers/acpi/acpica/exfield.c30
-rw-r--r--drivers/acpi/acpica/exfldio.c38
-rw-r--r--drivers/acpi/acpica/exmisc.c2
-rw-r--r--drivers/acpi/acpica/exmutex.c2
-rw-r--r--drivers/acpi/acpica/exnames.c2
-rw-r--r--drivers/acpi/acpica/exoparg1.c2
-rw-r--r--drivers/acpi/acpica/exoparg2.c2
-rw-r--r--drivers/acpi/acpica/exoparg3.c2
-rw-r--r--drivers/acpi/acpica/exoparg6.c2
-rw-r--r--drivers/acpi/acpica/exprep.c27
-rw-r--r--drivers/acpi/acpica/exregion.c2
-rw-r--r--drivers/acpi/acpica/exresnte.c2
-rw-r--r--drivers/acpi/acpica/exresolv.c2
-rw-r--r--drivers/acpi/acpica/exresop.c2
-rw-r--r--drivers/acpi/acpica/exstore.c2
-rw-r--r--drivers/acpi/acpica/exstoren.c2
-rw-r--r--drivers/acpi/acpica/exstorob.c2
-rw-r--r--drivers/acpi/acpica/exsystem.c2
-rw-r--r--drivers/acpi/acpica/exutils.c27
-rw-r--r--drivers/acpi/acpica/hwacpi.c2
-rw-r--r--drivers/acpi/acpica/hwgpe.c2
-rw-r--r--drivers/acpi/acpica/hwpci.c2
-rw-r--r--drivers/acpi/acpica/hwregs.c2
-rw-r--r--drivers/acpi/acpica/hwsleep.c2
-rw-r--r--drivers/acpi/acpica/hwtimer.c2
-rw-r--r--drivers/acpi/acpica/hwvalid.c4
-rw-r--r--drivers/acpi/acpica/hwxface.c2
-rw-r--r--drivers/acpi/acpica/nsaccess.c2
-rw-r--r--drivers/acpi/acpica/nsalloc.c2
-rw-r--r--drivers/acpi/acpica/nsdump.c2
-rw-r--r--drivers/acpi/acpica/nsdumpdv.c2
-rw-r--r--drivers/acpi/acpica/nseval.c2
-rw-r--r--drivers/acpi/acpica/nsinit.c2
-rw-r--r--drivers/acpi/acpica/nsload.c2
-rw-r--r--drivers/acpi/acpica/nsnames.c2
-rw-r--r--drivers/acpi/acpica/nsobject.c2
-rw-r--r--drivers/acpi/acpica/nsparse.c2
-rw-r--r--drivers/acpi/acpica/nspredef.c31
-rw-r--r--drivers/acpi/acpica/nsrepair.c3
-rw-r--r--drivers/acpi/acpica/nsrepair2.c7
-rw-r--r--drivers/acpi/acpica/nssearch.c2
-rw-r--r--drivers/acpi/acpica/nsutils.c2
-rw-r--r--drivers/acpi/acpica/nswalk.c2
-rw-r--r--drivers/acpi/acpica/nsxfeval.c2
-rw-r--r--drivers/acpi/acpica/nsxfname.c2
-rw-r--r--drivers/acpi/acpica/nsxfobj.c2
-rw-r--r--drivers/acpi/acpica/psargs.c143
-rw-r--r--drivers/acpi/acpica/psloop.c2
-rw-r--r--drivers/acpi/acpica/psopcode.c15
-rw-r--r--drivers/acpi/acpica/psparse.c2
-rw-r--r--drivers/acpi/acpica/psscope.c2
-rw-r--r--drivers/acpi/acpica/pstree.c8
-rw-r--r--drivers/acpi/acpica/psutils.c2
-rw-r--r--drivers/acpi/acpica/pswalk.c2
-rw-r--r--drivers/acpi/acpica/psxface.c2
-rw-r--r--drivers/acpi/acpica/rsaddr.c2
-rw-r--r--drivers/acpi/acpica/rscalc.c89
-rw-r--r--drivers/acpi/acpica/rscreate.c69
-rw-r--r--drivers/acpi/acpica/rsdump.c196
-rw-r--r--drivers/acpi/acpica/rsinfo.c58
-rw-r--r--drivers/acpi/acpica/rsio.c2
-rw-r--r--drivers/acpi/acpica/rsirq.c33
-rw-r--r--drivers/acpi/acpica/rslist.c77
-rw-r--r--drivers/acpi/acpica/rsmemory.c2
-rw-r--r--drivers/acpi/acpica/rsmisc.c269
-rw-r--r--drivers/acpi/acpica/rsserial.c441
-rw-r--r--drivers/acpi/acpica/rsutils.c56
-rw-r--r--drivers/acpi/acpica/rsxface.c52
-rw-r--r--drivers/acpi/acpica/tbfadt.c41
-rw-r--r--drivers/acpi/acpica/tbfind.c2
-rw-r--r--drivers/acpi/acpica/tbinstal.c2
-rw-r--r--drivers/acpi/acpica/tbutils.c9
-rw-r--r--drivers/acpi/acpica/tbxface.c2
-rw-r--r--drivers/acpi/acpica/tbxfroot.c2
-rw-r--r--drivers/acpi/acpica/utaddress.c294
-rw-r--r--drivers/acpi/acpica/utalloc.c2
-rw-r--r--drivers/acpi/acpica/utcopy.c2
-rw-r--r--drivers/acpi/acpica/utdebug.c2
-rw-r--r--drivers/acpi/acpica/utdecode.c6
-rw-r--r--drivers/acpi/acpica/utdelete.c15
-rw-r--r--drivers/acpi/acpica/uteval.c2
-rw-r--r--drivers/acpi/acpica/utglobal.c8
-rw-r--r--drivers/acpi/acpica/utids.c2
-rw-r--r--drivers/acpi/acpica/utinit.c3
-rw-r--r--drivers/acpi/acpica/utlock.c2
-rw-r--r--drivers/acpi/acpica/utmath.c2
-rw-r--r--drivers/acpi/acpica/utmisc.c2
-rw-r--r--drivers/acpi/acpica/utmutex.c11
-rw-r--r--drivers/acpi/acpica/utobject.c2
-rw-r--r--drivers/acpi/acpica/utosi.c2
-rw-r--r--drivers/acpi/acpica/utresrc.c278
-rw-r--r--drivers/acpi/acpica/utstate.c2
-rw-r--r--drivers/acpi/acpica/utxface.c40
-rw-r--r--drivers/acpi/acpica/utxferror.c2
-rw-r--r--drivers/acpi/acpica/utxfmutex.c187
-rw-r--r--drivers/acpi/osl.c202
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpiosxf.h7
-rw-r--r--include/acpi/acpixf.h32
-rw-r--r--include/acpi/acrestyp.h207
-rw-r--r--include/acpi/actbl.h23
-rw-r--r--include/acpi/actbl1.h57
-rw-r--r--include/acpi/actbl3.h552
-rw-r--r--include/acpi/actypes.h12
159 files changed, 4025 insertions, 604 deletions
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile
index 301bd2d388ad..0ca208b6dcf0 100644
--- a/drivers/acpi/acpica/Makefile
+++ b/drivers/acpi/acpica/Makefile
@@ -8,41 +8,151 @@ ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
8# use acpi.o to put all files here into acpi.o modparam namespace 8# use acpi.o to put all files here into acpi.o modparam namespace
9obj-y += acpi.o 9obj-y += acpi.o
10 10
11acpi-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \ 11acpi-y := \
12 dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \ 12 dsargs.o \
13 dsinit.o dsargs.o dscontrol.o dswload2.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
15acpi-y += evevent.o evregion.o evsci.o evxfevnt.o \ 27acpi-y += \
16 evmisc.o evrgnini.o evxface.o evxfregn.o \ 28 evevent.o \
17 evgpe.o evgpeblk.o evgpeinit.o evgpeutil.o evxfgpe.o evglock.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
19acpi-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\ 43acpi-y += \
20 exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\ 44 exconfig.o \
21 excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \ 45 exconvrt.o \
22 exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o exdebug.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
24acpi-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o hwpci.o 69acpi-y += \
70 hwacpi.o \
71 hwgpe.o \
72 hwpci.o \
73 hwregs.o \
74 hwsleep.o \
75 hwvalid.o \
76 hwxface.o
25 77
26acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o 78acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o
27 79
28acpi-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \ 80acpi-y += \
29 nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \ 81 nsaccess.o \
30 nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \ 82 nsalloc.o \
31 nsparse.o nspredef.o nsrepair.o nsrepair2.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
33acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o 100acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
34 101
35acpi-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \ 102acpi-y += \
36 psopcode.o psscope.o psutils.o psxface.o 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
38acpi-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \ 113acpi-y += \
39 rscalc.o rsirq.o rsmemory.o rsutils.o 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
41acpi-$(ACPI_FUTURE_USAGE) += rsdump.o 127acpi-$(ACPI_FUTURE_USAGE) += rsdump.o
42 128
43acpi-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o 129acpi-y += \
130 tbfadt.o \
131 tbfind.o \
132 tbinstal.o \
133 tbutils.o \
134 tbxface.o \
135 tbxfroot.o
44 136
45acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \ 137acpi-y += \
46 utcopy.o utdelete.o utglobal.o utmath.o utobject.o \ 138 utaddress.o \
47 utstate.o utmutex.o utobject.o utresrc.o utlock.o utids.o \ 139 utalloc.o \
48 utosi.o utxferror.o utdecode.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
diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
index e0ba17f0a7c8..a44bd424f9f4 100644
--- a/drivers/acpi/acpica/accommon.h
+++ b/drivers/acpi/acpica/accommon.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acconfig.h b/drivers/acpi/acpica/acconfig.h
index f895a244ca7e..1f30af613e87 100644
--- a/drivers/acpi/acpica/acconfig.h
+++ b/drivers/acpi/acpica/acconfig.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -123,6 +123,10 @@
123 123
124#define ACPI_MAX_SLEEP 2000 /* Two seconds */ 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 * ACPI Specification constants (Do not change unless the specification changes) 132 * ACPI Specification constants (Do not change unless the specification changes)
@@ -202,9 +206,10 @@
202#define ACPI_RSDP_CHECKSUM_LENGTH 20 206#define ACPI_RSDP_CHECKSUM_LENGTH 20
203#define ACPI_RSDP_XCHECKSUM_LENGTH 36 207#define ACPI_RSDP_XCHECKSUM_LENGTH 36
204 208
205/* SMBus and IPMI bidirectional buffer size */ 209/* SMBus, GSBus and IPMI bidirectional buffer size */
206 210
207#define ACPI_SMBUS_BUFFER_SIZE 34 211#define ACPI_SMBUS_BUFFER_SIZE 34
212#define ACPI_GSBUS_BUFFER_SIZE 34
208#define ACPI_IPMI_BUFFER_SIZE 66 213#define ACPI_IPMI_BUFFER_SIZE 66
209 214
210/* _sx_d and _sx_w control methods */ 215/* _sx_d and _sx_w control methods */
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index eb0b1f8dee6d..deaa81979561 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acdispat.h b/drivers/acpi/acpica/acdispat.h
index 2d1b7ffa377a..5935ba6707e2 100644
--- a/drivers/acpi/acpica/acdispat.h
+++ b/drivers/acpi/acpica/acdispat.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index bea3b4899183..c53caa521a30 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -162,6 +162,7 @@ acpi_status acpi_ev_initialize_op_regions(void);
162 162
163acpi_status 163acpi_status
164acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 164acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
165 union acpi_operand_object *field_obj,
165 u32 function, 166 u32 function,
166 u32 region_offset, u32 bit_width, u64 *value); 167 u32 region_offset, u32 bit_width, u64 *value);
167 168
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 76dc02f15574..261fd5eb2b68 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -140,8 +140,19 @@ u32 acpi_gbl_trace_flags;
140acpi_name acpi_gbl_trace_method_name; 140acpi_name acpi_gbl_trace_method_name;
141u8 acpi_gbl_system_awake_and_running; 141u8 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 */
148u8 acpi_gbl_reduced_hardware;
149
143#endif 150#endif
144 151
152/* Do not disassemble buffers to resource descriptors */
153
154ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_no_resource_disassembly, FALSE);
155
145/***************************************************************************** 156/*****************************************************************************
146 * 157 *
147 * Debug support 158 * Debug support
@@ -207,7 +218,7 @@ ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
207 218
208/***************************************************************************** 219/*****************************************************************************
209 * 220 *
210 * Mutual exlusion within ACPICA subsystem 221 * Mutual exclusion within ACPICA subsystem
211 * 222 *
212 ****************************************************************************/ 223 ****************************************************************************/
213 224
@@ -295,6 +306,8 @@ ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
295ACPI_EXTERN u8 acpi_gbl_events_initialized; 306ACPI_EXTERN u8 acpi_gbl_events_initialized;
296ACPI_EXTERN u8 acpi_gbl_osi_data; 307ACPI_EXTERN u8 acpi_gbl_osi_data;
297ACPI_EXTERN struct acpi_interface_info *acpi_gbl_supported_interfaces; 308ACPI_EXTERN struct acpi_interface_info *acpi_gbl_supported_interfaces;
309ACPI_EXTERN struct acpi_address_range
310 *acpi_gbl_address_range_list[ACPI_ADDRESS_RANGE_MAX];
298 311
299#ifndef DEFINE_ACPI_GLOBALS 312#ifndef DEFINE_ACPI_GLOBALS
300 313
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
index e7213beaafc7..677793e938f5 100644
--- a/drivers/acpi/acpica/achware.h
+++ b/drivers/acpi/acpica/achware.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acinterp.h b/drivers/acpi/acpica/acinterp.h
index 3731e1c34b83..eb308635da72 100644
--- a/drivers/acpi/acpica/acinterp.h
+++ b/drivers/acpi/acpica/acinterp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -468,6 +468,8 @@ void acpi_ex_eisa_id_to_string(char *dest, u64 compressed_id);
468 468
469void acpi_ex_integer_to_string(char *dest, u64 value); 469void acpi_ex_integer_to_string(char *dest, u64 value);
470 470
471u8 acpi_is_valid_space_id(u8 space_id);
472
471/* 473/*
472 * exregion - default op_region handlers 474 * exregion - default op_region handlers
473 */ 475 */
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 5552125d8340..3f24068837d5 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,7 @@ typedef u32 acpi_mutex_handle;
53 53
54/* Total number of aml opcodes defined */ 54/* Total number of aml opcodes defined */
55 55
56#define AML_NUM_OPCODES 0x7F 56#define AML_NUM_OPCODES 0x81
57 57
58/* Forward declarations */ 58/* Forward declarations */
59 59
@@ -249,12 +249,16 @@ struct acpi_create_field_info {
249 struct acpi_namespace_node *field_node; 249 struct acpi_namespace_node *field_node;
250 struct acpi_namespace_node *register_node; 250 struct acpi_namespace_node *register_node;
251 struct acpi_namespace_node *data_register_node; 251 struct acpi_namespace_node *data_register_node;
252 struct acpi_namespace_node *connection_node;
253 u8 *resource_buffer;
252 u32 bank_value; 254 u32 bank_value;
253 u32 field_bit_position; 255 u32 field_bit_position;
254 u32 field_bit_length; 256 u32 field_bit_length;
257 u16 resource_length;
255 u8 field_flags; 258 u8 field_flags;
256 u8 attribute; 259 u8 attribute;
257 u8 field_type; 260 u8 field_type;
261 u8 access_length;
258}; 262};
259 263
260typedef 264typedef
@@ -315,7 +319,8 @@ struct acpi_name_info {
315 319
316/* 320/*
317 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 321 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
318 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT 322 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
323 * ACPI_PTYPE2_FIX_VAR
319 */ 324 */
320struct acpi_package_info { 325struct acpi_package_info {
321 u8 type; 326 u8 type;
@@ -625,6 +630,15 @@ union acpi_generic_state {
625 630
626typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state); 631typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state);
627 632
633/* Address Range info block */
634
635struct acpi_address_range {
636 struct acpi_address_range *next;
637 struct acpi_namespace_node *region_node;
638 acpi_physical_address start_address;
639 acpi_physical_address end_address;
640};
641
628/***************************************************************************** 642/*****************************************************************************
629 * 643 *
630 * Parser typedefs and structs 644 * Parser typedefs and structs
@@ -951,7 +965,7 @@ struct acpi_port_info {
951#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 965#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
952#define ACPI_RESOURCE_NAME_IO 0x40 966#define ACPI_RESOURCE_NAME_IO 0x40
953#define ACPI_RESOURCE_NAME_FIXED_IO 0x48 967#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
954#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 968#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
955#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 969#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
956#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 970#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
957#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 971#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
@@ -973,7 +987,9 @@ struct acpi_port_info {
973#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 987#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
974#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 988#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
975#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 989#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
976#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B 990#define ACPI_RESOURCE_NAME_GPIO 0x8C
991#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
992#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
977 993
978/***************************************************************************** 994/*****************************************************************************
979 * 995 *
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index b7491ee1fba6..ef338a96f5b2 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index 79a598c67fe3..2c9e0f049523 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index 1055769f2f01..c065078ca83b 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -254,6 +254,7 @@ ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
254 u32 base_byte_offset; /* Byte offset within containing object */\ 254 u32 base_byte_offset; /* Byte offset within containing object */\
255 u32 value; /* Value to store into the Bank or Index register */\ 255 u32 value; /* Value to store into the Bank or Index register */\
256 u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ 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
259struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 260struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
@@ -261,7 +262,9 @@ struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and
261}; 262};
262 263
263struct acpi_object_region_field { 264struct acpi_object_region_field {
264 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ 265 ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length;
266 union acpi_operand_object *region_obj; /* Containing op_region object */
267 u8 *resource_buffer; /* resource_template for serial regions/fields */
265}; 268};
266 269
267struct acpi_object_bank_field { 270struct acpi_object_bank_field {
@@ -358,6 +361,7 @@ typedef enum {
358 */ 361 */
359struct acpi_object_extra { 362struct acpi_object_extra {
360 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ 363 ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */
364 struct acpi_namespace_node *scope_node;
361 void *region_context; /* Region-specific data */ 365 void *region_context; /* Region-specific data */
362 u8 *aml_start; 366 u8 *aml_start;
363 u32 aml_length; 367 u32 aml_length;
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h
index bb2ccfad7376..9440d053fbb3 100644
--- a/drivers/acpi/acpica/acopcode.h
+++ b/drivers/acpi/acpica/acopcode.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -93,6 +93,7 @@
93#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 93#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
94#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 94#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
95#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) 95#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
96#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
96#define ARGP_CONTINUE_OP ARG_NONE 97#define ARGP_CONTINUE_OP ARG_NONE
97#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) 98#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME)
98#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) 99#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
@@ -164,6 +165,7 @@
164#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG) 165#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
165#define ARGP_REVISION_OP ARG_NONE 166#define ARGP_REVISION_OP ARG_NONE
166#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST) 167#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
168#define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
167#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 169#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
168#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) 170#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
169#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME) 171#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
@@ -223,6 +225,7 @@
223#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF) 225#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
224#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF) 226#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
225#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF) 227#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
228#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE
226#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE 229#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
227#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET) 230#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
228#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE) 231#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
@@ -294,6 +297,7 @@
294#define ARGI_RETURN_OP ARGI_INVALID_OPCODE 297#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
295#define ARGI_REVISION_OP ARG_NONE 298#define ARGI_REVISION_OP ARG_NONE
296#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE 299#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
300#define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE
297#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) 301#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
298#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) 302#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
299#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT) 303#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
diff --git a/drivers/acpi/acpica/acparser.h b/drivers/acpi/acpica/acparser.h
index 5ea1e06afa20..b725d780d34d 100644
--- a/drivers/acpi/acpica/acparser.h
+++ b/drivers/acpi/acpica/acparser.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index c445cca490ea..bbb34c9be4e8 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,14 @@
94 * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length 94 * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length
95 * (Used for _ART, _FPS) 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
99enum acpi_return_package_types { 107enum acpi_return_package_types {
@@ -105,7 +113,8 @@ enum acpi_return_package_types {
105 ACPI_PTYPE2_PKG_COUNT = 6, 113 ACPI_PTYPE2_PKG_COUNT = 6,
106 ACPI_PTYPE2_FIXED = 7, 114 ACPI_PTYPE2_FIXED = 7,
107 ACPI_PTYPE2_MIN = 8, 115 ACPI_PTYPE2_MIN = 8,
108 ACPI_PTYPE2_REV_FIXED = 9 116 ACPI_PTYPE2_REV_FIXED = 9,
117 ACPI_PTYPE2_FIX_VAR = 10
109}; 118};
110 119
111#ifdef ACPI_CREATE_PREDEFINED_TABLE 120#ifdef ACPI_CREATE_PREDEFINED_TABLE
@@ -154,6 +163,7 @@ static const union acpi_predefined_info predefined_names[] =
154 {{"_AC8", 0, ACPI_RTYPE_INTEGER}}, 163 {{"_AC8", 0, ACPI_RTYPE_INTEGER}},
155 {{"_AC9", 0, ACPI_RTYPE_INTEGER}}, 164 {{"_AC9", 0, ACPI_RTYPE_INTEGER}},
156 {{"_ADR", 0, ACPI_RTYPE_INTEGER}}, 165 {{"_ADR", 0, ACPI_RTYPE_INTEGER}},
166 {{"_AEI", 0, ACPI_RTYPE_BUFFER}},
157 {{"_AL0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 167 {{"_AL0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
158 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, 168 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
159 169
@@ -229,6 +239,13 @@ static const union acpi_predefined_info predefined_names[] =
229 {{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */ 239 {{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */
230 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}}, 240 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}},
231 241
242 {{"_CLS", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */
243 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0}, 0, 0}},
244
245 {{"_CPC", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Bufs) */
246 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0, 0}, 0,
247 0}},
248
232 {{"_CRS", 0, ACPI_RTYPE_BUFFER}}, 249 {{"_CRS", 0, ACPI_RTYPE_BUFFER}},
233 {{"_CRT", 0, ACPI_RTYPE_INTEGER}}, 250 {{"_CRT", 0, ACPI_RTYPE_INTEGER}},
234 {{"_CSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n-1 Int) */ 251 {{"_CSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n-1 Int) */
@@ -237,12 +254,21 @@ static const union acpi_predefined_info predefined_names[] =
237 {{"_CST", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */ 254 {{"_CST", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */
238 {{{ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER}, 3,0}}, 255 {{{ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER}, 3,0}},
239 256
257 {{"_CWS", 1, ACPI_RTYPE_INTEGER}},
240 {{"_DCK", 1, ACPI_RTYPE_INTEGER}}, 258 {{"_DCK", 1, ACPI_RTYPE_INTEGER}},
241 {{"_DCS", 0, ACPI_RTYPE_INTEGER}}, 259 {{"_DCS", 0, ACPI_RTYPE_INTEGER}},
242 {{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}}, 260 {{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}},
243 {{"_DDN", 0, ACPI_RTYPE_STRING}}, 261 {{"_DDN", 0, ACPI_RTYPE_STRING}},
262 {{"_DEP", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
263 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}},
264
244 {{"_DGS", 0, ACPI_RTYPE_INTEGER}}, 265 {{"_DGS", 0, ACPI_RTYPE_INTEGER}},
245 {{"_DIS", 0, 0}}, 266 {{"_DIS", 0, 0}},
267
268 {{"_DLM", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (1 Ref, 0/1 Optional Buf/Ref) */
269 {{{ACPI_PTYPE2_FIX_VAR, ACPI_RTYPE_REFERENCE, 1,
270 ACPI_RTYPE_REFERENCE | ACPI_RTYPE_BUFFER}, 0, 0}},
271
246 {{"_DMA", 0, ACPI_RTYPE_BUFFER}}, 272 {{"_DMA", 0, ACPI_RTYPE_BUFFER}},
247 {{"_DOD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ 273 {{"_DOD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */
248 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, 274 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}},
@@ -262,6 +288,7 @@ static const union acpi_predefined_info predefined_names[] =
262 {{"_EJ3", 1, 0}}, 288 {{"_EJ3", 1, 0}},
263 {{"_EJ4", 1, 0}}, 289 {{"_EJ4", 1, 0}},
264 {{"_EJD", 0, ACPI_RTYPE_STRING}}, 290 {{"_EJD", 0, ACPI_RTYPE_STRING}},
291 {{"_EVT", 1, 0}},
265 {{"_FDE", 0, ACPI_RTYPE_BUFFER}}, 292 {{"_FDE", 0, ACPI_RTYPE_BUFFER}},
266 {{"_FDI", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int) */ 293 {{"_FDI", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int) */
267 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}}, 294 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}},
@@ -281,14 +308,17 @@ static const union acpi_predefined_info predefined_names[] =
281 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0}, 0, 0}}, 308 {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0}, 0, 0}},
282 309
283 {{"_GAI", 0, ACPI_RTYPE_INTEGER}}, 310 {{"_GAI", 0, ACPI_RTYPE_INTEGER}},
311 {{"_GCP", 0, ACPI_RTYPE_INTEGER}},
284 {{"_GHL", 0, ACPI_RTYPE_INTEGER}}, 312 {{"_GHL", 0, ACPI_RTYPE_INTEGER}},
285 {{"_GLK", 0, ACPI_RTYPE_INTEGER}}, 313 {{"_GLK", 0, ACPI_RTYPE_INTEGER}},
286 {{"_GPD", 0, ACPI_RTYPE_INTEGER}}, 314 {{"_GPD", 0, ACPI_RTYPE_INTEGER}},
287 {{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */ 315 {{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */
316 {{"_GRT", 0, ACPI_RTYPE_BUFFER}},
288 {{"_GSB", 0, ACPI_RTYPE_INTEGER}}, 317 {{"_GSB", 0, ACPI_RTYPE_INTEGER}},
289 {{"_GTF", 0, ACPI_RTYPE_BUFFER}}, 318 {{"_GTF", 0, ACPI_RTYPE_BUFFER}},
290 {{"_GTM", 0, ACPI_RTYPE_BUFFER}}, 319 {{"_GTM", 0, ACPI_RTYPE_BUFFER}},
291 {{"_GTS", 1, 0}}, 320 {{"_GTS", 1, 0}},
321 {{"_GWS", 1, ACPI_RTYPE_INTEGER}},
292 {{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, 322 {{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}},
293 {{"_HOT", 0, ACPI_RTYPE_INTEGER}}, 323 {{"_HOT", 0, ACPI_RTYPE_INTEGER}},
294 {{"_HPP", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ 324 {{"_HPP", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */
@@ -303,6 +333,7 @@ static const union acpi_predefined_info predefined_names[] =
303 {{"_HPX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (var Ints) */ 333 {{"_HPX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (var Ints) */
304 {{{ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, 334 {{{ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0}, 0,0}},
305 335
336 {{"_HRV", 0, ACPI_RTYPE_INTEGER}},
306 {{"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ 337 {{"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */
307 {{"_INI", 0, 0}}, 338 {{"_INI", 0, 0}},
308 {{"_IRC", 0, 0}}, 339 {{"_IRC", 0, 0}},
@@ -361,6 +392,9 @@ static const union acpi_predefined_info predefined_names[] =
361 {{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 392 {{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
362 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}}, 393 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}},
363 394
395 {{"_PRE", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
396 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}},
397
364 {{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 398 {{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
365 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}}, 399 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0, 0}, 0, 0}},
366 400
@@ -391,6 +425,7 @@ static const union acpi_predefined_info predefined_names[] =
391 {{"_PSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (5 Int) with count */ 425 {{"_PSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (5 Int) with count */
392 {{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0}, 0,0}}, 426 {{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0}, 0,0}},
393 427
428 {{"_PSE", 1, 0}},
394 {{"_PSL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ 429 {{"_PSL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */
395 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, 430 {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}},
396 431
@@ -457,6 +492,7 @@ static const union acpi_predefined_info predefined_names[] =
457 {{"_SLI", 0, ACPI_RTYPE_BUFFER}}, 492 {{"_SLI", 0, ACPI_RTYPE_BUFFER}},
458 {{"_SPD", 1, ACPI_RTYPE_INTEGER}}, 493 {{"_SPD", 1, ACPI_RTYPE_INTEGER}},
459 {{"_SRS", 1, 0}}, 494 {{"_SRS", 1, 0}},
495 {{"_SRT", 1, ACPI_RTYPE_INTEGER}},
460 {{"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ 496 {{"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */
461 {{"_SST", 1, 0}}, 497 {{"_SST", 1, 0}},
462 {{"_STA", 0, ACPI_RTYPE_INTEGER}}, 498 {{"_STA", 0, ACPI_RTYPE_INTEGER}},
@@ -464,6 +500,7 @@ static const union acpi_predefined_info predefined_names[] =
464 {{"_STP", 2, ACPI_RTYPE_INTEGER}}, 500 {{"_STP", 2, ACPI_RTYPE_INTEGER}},
465 {{"_STR", 0, ACPI_RTYPE_BUFFER}}, 501 {{"_STR", 0, ACPI_RTYPE_BUFFER}},
466 {{"_STV", 2, ACPI_RTYPE_INTEGER}}, 502 {{"_STV", 2, ACPI_RTYPE_INTEGER}},
503 {{"_SUB", 0, ACPI_RTYPE_STRING}},
467 {{"_SUN", 0, ACPI_RTYPE_INTEGER}}, 504 {{"_SUN", 0, ACPI_RTYPE_INTEGER}},
468 {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, 505 {{"_SWS", 0, ACPI_RTYPE_INTEGER}},
469 {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, 506 {{"_TC1", 0, ACPI_RTYPE_INTEGER}},
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h
index f08b55b7f3a0..0347d0993497 100644
--- a/drivers/acpi/acpica/acresrc.h
+++ b/drivers/acpi/acpica/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -73,28 +73,40 @@ typedef const struct acpi_rsconvert_info {
73 73
74/* Resource conversion opcodes */ 74/* Resource conversion opcodes */
75 75
76#define ACPI_RSC_INITGET 0 76typedef enum {
77#define ACPI_RSC_INITSET 1 77 ACPI_RSC_INITGET = 0,
78#define ACPI_RSC_FLAGINIT 2 78 ACPI_RSC_INITSET,
79#define ACPI_RSC_1BITFLAG 3 79 ACPI_RSC_FLAGINIT,
80#define ACPI_RSC_2BITFLAG 4 80 ACPI_RSC_1BITFLAG,
81#define ACPI_RSC_COUNT 5 81 ACPI_RSC_2BITFLAG,
82#define ACPI_RSC_COUNT16 6 82 ACPI_RSC_3BITFLAG,
83#define ACPI_RSC_LENGTH 7 83 ACPI_RSC_ADDRESS,
84#define ACPI_RSC_MOVE8 8 84 ACPI_RSC_BITMASK,
85#define ACPI_RSC_MOVE16 9 85 ACPI_RSC_BITMASK16,
86#define ACPI_RSC_MOVE32 10 86 ACPI_RSC_COUNT,
87#define ACPI_RSC_MOVE64 11 87 ACPI_RSC_COUNT16,
88#define ACPI_RSC_SET8 12 88 ACPI_RSC_COUNT_GPIO_PIN,
89#define ACPI_RSC_DATA8 13 89 ACPI_RSC_COUNT_GPIO_RES,
90#define ACPI_RSC_ADDRESS 14 90 ACPI_RSC_COUNT_GPIO_VEN,
91#define ACPI_RSC_SOURCE 15 91 ACPI_RSC_COUNT_SERIAL_RES,
92#define ACPI_RSC_SOURCEX 16 92 ACPI_RSC_COUNT_SERIAL_VEN,
93#define ACPI_RSC_BITMASK 17 93 ACPI_RSC_DATA8,
94#define ACPI_RSC_BITMASK16 18 94 ACPI_RSC_EXIT_EQ,
95#define ACPI_RSC_EXIT_NE 19 95 ACPI_RSC_EXIT_LE,
96#define ACPI_RSC_EXIT_LE 20 96 ACPI_RSC_EXIT_NE,
97#define ACPI_RSC_EXIT_EQ 21 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/* Resource Conversion sub-opcodes */ 111/* Resource Conversion sub-opcodes */
100 112
@@ -106,6 +118,9 @@ typedef const struct acpi_rsconvert_info {
106#define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f) 118#define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f)
107#define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f) 119#define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f)
108 120
121/*
122 * Individual entry for the resource dump tables
123 */
109typedef const struct acpi_rsdump_info { 124typedef const struct acpi_rsdump_info {
110 u8 opcode; 125 u8 opcode;
111 u8 offset; 126 u8 offset;
@@ -116,20 +131,25 @@ typedef const struct acpi_rsdump_info {
116 131
117/* Values for the Opcode field above */ 132/* Values for the Opcode field above */
118 133
119#define ACPI_RSD_TITLE 0 134typedef enum {
120#define ACPI_RSD_LITERAL 1 135 ACPI_RSD_TITLE = 0,
121#define ACPI_RSD_STRING 2 136 ACPI_RSD_1BITFLAG,
122#define ACPI_RSD_UINT8 3 137 ACPI_RSD_2BITFLAG,
123#define ACPI_RSD_UINT16 4 138 ACPI_RSD_3BITFLAG,
124#define ACPI_RSD_UINT32 5 139 ACPI_RSD_ADDRESS,
125#define ACPI_RSD_UINT64 6 140 ACPI_RSD_DWORDLIST,
126#define ACPI_RSD_1BITFLAG 7 141 ACPI_RSD_LITERAL,
127#define ACPI_RSD_2BITFLAG 8 142 ACPI_RSD_LONGLIST,
128#define ACPI_RSD_SHORTLIST 9 143 ACPI_RSD_SHORTLIST,
129#define ACPI_RSD_LONGLIST 10 144 ACPI_RSD_SHORTLISTX,
130#define ACPI_RSD_DWORDLIST 11 145 ACPI_RSD_SOURCE,
131#define ACPI_RSD_ADDRESS 12 146 ACPI_RSD_STRING,
132#define ACPI_RSD_SOURCE 13 147 ACPI_RSD_UINT8,
148 ACPI_RSD_UINT16,
149 ACPI_RSD_UINT32,
150 ACPI_RSD_UINT64,
151 ACPI_RSD_WORDLIST
152} ACPI_RSDUMP_OPCODES;
133 153
134/* restore default alignment */ 154/* restore default alignment */
135 155
@@ -138,13 +158,18 @@ typedef const struct acpi_rsdump_info {
138/* Resource tables indexed by internal resource type */ 158/* Resource tables indexed by internal resource type */
139 159
140extern const u8 acpi_gbl_aml_resource_sizes[]; 160extern const u8 acpi_gbl_aml_resource_sizes[];
161extern const u8 acpi_gbl_aml_resource_serial_bus_sizes[];
141extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; 162extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[];
142 163
143/* Resource tables indexed by raw AML resource descriptor type */ 164/* Resource tables indexed by raw AML resource descriptor type */
144 165
145extern const u8 acpi_gbl_resource_struct_sizes[]; 166extern const u8 acpi_gbl_resource_struct_sizes[];
167extern const u8 acpi_gbl_resource_struct_serial_bus_sizes[];
146extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[]; 168extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[];
147 169
170extern struct acpi_rsconvert_info
171 *acpi_gbl_convert_resource_serial_bus_dispatch[];
172
148struct acpi_vendor_walk_info { 173struct acpi_vendor_walk_info {
149 struct acpi_vendor_uuid *uuid; 174 struct acpi_vendor_uuid *uuid;
150 struct acpi_buffer *buffer; 175 struct acpi_buffer *buffer;
@@ -190,6 +215,10 @@ acpi_status
190acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, 215acpi_rs_set_srs_method_data(struct acpi_namespace_node *node,
191 struct acpi_buffer *ret_buffer); 216 struct acpi_buffer *ret_buffer);
192 217
218acpi_status
219acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
220 struct acpi_buffer *ret_buffer);
221
193/* 222/*
194 * rscalc 223 * rscalc
195 */ 224 */
@@ -293,6 +322,11 @@ extern struct acpi_rsconvert_info acpi_rs_convert_address16[];
293extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[]; 322extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[];
294extern struct acpi_rsconvert_info acpi_rs_convert_address64[]; 323extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
295extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[]; 324extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
325extern struct acpi_rsconvert_info acpi_rs_convert_gpio[];
326extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[];
327extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[];
328extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[];
329extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[];
296 330
297/* These resources require separate get/set tables */ 331/* These resources require separate get/set tables */
298 332
@@ -310,6 +344,7 @@ extern struct acpi_rsconvert_info acpi_rs_set_vendor[];
310 * rsinfo 344 * rsinfo
311 */ 345 */
312extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[]; 346extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[];
347extern struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[];
313 348
314/* 349/*
315 * rsdump 350 * rsdump
@@ -331,6 +366,12 @@ extern struct acpi_rsdump_info acpi_rs_dump_address64[];
331extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[]; 366extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[];
332extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; 367extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[];
333extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; 368extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[];
369extern struct acpi_rsdump_info acpi_rs_dump_gpio[];
370extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[];
371extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[];
372extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[];
373extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[];
374extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
334#endif 375#endif
335 376
336#endif /* __ACRESRC_H__ */ 377#endif /* __ACRESRC_H__ */
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h
index 1623b245dde2..0404df605bc1 100644
--- a/drivers/acpi/acpica/acstruct.h
+++ b/drivers/acpi/acpica/acstruct.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 967f08124eba..d5bec304c823 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 99c140d8e348..925ccf22101b 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,7 @@
45#define _ACUTILS_H 45#define _ACUTILS_H
46 46
47extern const u8 acpi_gbl_resource_aml_sizes[]; 47extern const u8 acpi_gbl_resource_aml_sizes[];
48extern const u8 acpi_gbl_resource_aml_serial_bus_sizes[];
48 49
49/* Strings used by the disassembler and debugger resource dump routines */ 50/* Strings used by the disassembler and debugger resource dump routines */
50 51
@@ -579,6 +580,24 @@ acpi_ut_create_list(char *list_name,
579#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ 580#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
580 581
581/* 582/*
583 * utaddress - address range check
584 */
585acpi_status
586acpi_ut_add_address_range(acpi_adr_space_type space_id,
587 acpi_physical_address address,
588 u32 length, struct acpi_namespace_node *region_node);
589
590void
591acpi_ut_remove_address_range(acpi_adr_space_type space_id,
592 struct acpi_namespace_node *region_node);
593
594u32
595acpi_ut_check_address_range(acpi_adr_space_type space_id,
596 acpi_physical_address address, u32 length, u8 warn);
597
598void acpi_ut_delete_address_lists(void);
599
600/*
582 * utxferror - various error/warning output functions 601 * utxferror - various error/warning output functions
583 */ 602 */
584void ACPI_INTERNAL_VAR_XFACE 603void ACPI_INTERNAL_VAR_XFACE
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 1077f17859ed..905280fec0fa 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2011, Intel Corp. 10 * Copyright (C) 2000 - 2012, Intel Corp.
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
@@ -189,6 +189,14 @@
189#define AML_LNOTEQUAL_OP (u16) 0x9293 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 * Internal opcodes 200 * Internal opcodes
193 * Use only "Unknown" AML opcodes, don't attempt to use 201 * Use only "Unknown" AML opcodes, don't attempt to use
194 * any valid ACPI ASCII values (A-Z, 0-9, '-') 202 * any valid ACPI ASCII values (A-Z, 0-9, '-')
@@ -202,6 +210,8 @@
202#define AML_INT_METHODCALL_OP (u16) 0x0035 210#define AML_INT_METHODCALL_OP (u16) 0x0035
203#define AML_INT_RETURN_VALUE_OP (u16) 0x0036 211#define AML_INT_RETURN_VALUE_OP (u16) 0x0036
204#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 212#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037
213#define AML_INT_CONNECTION_OP (u16) 0x0038
214#define AML_INT_EXTACCESSFIELD_OP (u16) 0x0039
205 215
206#define ARG_NONE 0x0 216#define ARG_NONE 0x0
207 217
@@ -456,13 +466,16 @@ typedef enum {
456 * access_as keyword 466 * access_as keyword
457 */ 467 */
458typedef enum { 468typedef enum {
459 AML_FIELD_ATTRIB_SMB_QUICK = 0x02, 469 AML_FIELD_ATTRIB_QUICK = 0x02,
460 AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, 470 AML_FIELD_ATTRIB_SEND_RCV = 0x04,
461 AML_FIELD_ATTRIB_SMB_BYTE = 0x06, 471 AML_FIELD_ATTRIB_BYTE = 0x06,
462 AML_FIELD_ATTRIB_SMB_WORD = 0x08, 472 AML_FIELD_ATTRIB_WORD = 0x08,
463 AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, 473 AML_FIELD_ATTRIB_BLOCK = 0x0A,
464 AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, 474 AML_FIELD_ATTRIB_MULTIBYTE = 0x0B,
465 AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D 475 AML_FIELD_ATTRIB_WORD_CALL = 0x0C,
476 AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D,
477 AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
478 AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F
466} AML_ACCESS_ATTRIBUTE; 479} AML_ACCESS_ATTRIBUTE;
467 480
468/* Bit fields in the AML method_flags byte */ 481/* Bit fields in the AML method_flags byte */
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index 59122cde247c..7b2128f274e7 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -58,29 +58,48 @@
58#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" 58#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT"
59#define ACPI_RESTAG_BASEADDRESS "_BAS" 59#define ACPI_RESTAG_BASEADDRESS "_BAS"
60#define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ 60#define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */
61#define ACPI_RESTAG_DEBOUNCETIME "_DBT"
61#define ACPI_RESTAG_DECODE "_DEC" 62#define ACPI_RESTAG_DECODE "_DEC"
63#define ACPI_RESTAG_DEVICEPOLARITY "_DPL"
62#define ACPI_RESTAG_DMA "_DMA" 64#define ACPI_RESTAG_DMA "_DMA"
63#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 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#define ACPI_RESTAG_GRANULARITY "_GRA" 69#define ACPI_RESTAG_GRANULARITY "_GRA"
65#define ACPI_RESTAG_INTERRUPT "_INT" 70#define ACPI_RESTAG_INTERRUPT "_INT"
66#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ 71#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */
67#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ 72#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */
68#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 73#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
74#define ACPI_RESTAG_IORESTRICTION "_IOR"
69#define ACPI_RESTAG_LENGTH "_LEN" 75#define ACPI_RESTAG_LENGTH "_LEN"
76#define ACPI_RESTAG_LINE "_LIN"
70#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 77#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
71#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 78#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
72#define ACPI_RESTAG_MAXADDR "_MAX" 79#define ACPI_RESTAG_MAXADDR "_MAX"
73#define ACPI_RESTAG_MINADDR "_MIN" 80#define ACPI_RESTAG_MINADDR "_MIN"
74#define ACPI_RESTAG_MAXTYPE "_MAF" 81#define ACPI_RESTAG_MAXTYPE "_MAF"
75#define ACPI_RESTAG_MINTYPE "_MIF" 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#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 89#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
77#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" 90#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
78#define ACPI_RESTAG_RANGETYPE "_RNG" 91#define ACPI_RESTAG_RANGETYPE "_RNG"
79#define ACPI_RESTAG_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ 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#define ACPI_RESTAG_TRANSLATION "_TRA" 98#define ACPI_RESTAG_TRANSLATION "_TRA"
81#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 99#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
82#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ 100#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
83#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */ 101#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8_and16(1), 16(2) */
102#define ACPI_RESTAG_VENDORDATA "_VEN"
84 103
85/* Default sizes for "small" resource descriptors */ 104/* Default sizes for "small" resource descriptors */
86 105
@@ -90,6 +109,7 @@
90#define ASL_RDESC_END_DEPEND_SIZE 0x00 109#define ASL_RDESC_END_DEPEND_SIZE 0x00
91#define ASL_RDESC_IO_SIZE 0x07 110#define ASL_RDESC_IO_SIZE 0x07
92#define ASL_RDESC_FIXED_IO_SIZE 0x03 111#define ASL_RDESC_FIXED_IO_SIZE 0x03
112#define ASL_RDESC_FIXED_DMA_SIZE 0x05
93#define ASL_RDESC_END_TAG_SIZE 0x01 113#define ASL_RDESC_END_TAG_SIZE 0x01
94 114
95struct asl_resource_node { 115struct asl_resource_node {
@@ -164,6 +184,12 @@ struct aml_resource_end_tag {
164 AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum; 184 AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum;
165}; 185};
166 186
187struct aml_resource_fixed_dma {
188 AML_RESOURCE_SMALL_HEADER_COMMON u16 request_lines;
189 u16 channels;
190 u8 width;
191};
192
167/* 193/*
168 * LARGE descriptors 194 * LARGE descriptors
169 */ 195 */
@@ -263,6 +289,110 @@ struct aml_resource_generic_register {
263 u64 address; 289 u64 address;
264}; 290};
265 291
292/* Common descriptor for gpio_int and gpio_io (ACPI 5.0) */
293
294struct aml_resource_gpio {
295 AML_RESOURCE_LARGE_HEADER_COMMON u8 revision_id;
296 u8 connection_type;
297 u16 flags;
298 u16 int_flags;
299 u8 pin_config;
300 u16 drive_strength;
301 u16 debounce_timeout;
302 u16 pin_table_offset;
303 u8 res_source_index;
304 u16 res_source_offset;
305 u16 vendor_offset;
306 u16 vendor_length;
307 /*
308 * Optional fields follow immediately:
309 * 1) PIN list (Words)
310 * 2) Resource Source String
311 * 3) Vendor Data bytes
312 */
313};
314
315#define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */
316
317/* Values for connection_type above */
318
319#define AML_RESOURCE_GPIO_TYPE_INT 0
320#define AML_RESOURCE_GPIO_TYPE_IO 1
321#define AML_RESOURCE_MAX_GPIOTYPE 1
322
323/* Common preamble for all serial descriptors (ACPI 5.0) */
324
325#define AML_RESOURCE_SERIAL_COMMON \
326 u8 revision_id; \
327 u8 res_source_index; \
328 u8 type; \
329 u8 flags; \
330 u16 type_specific_flags; \
331 u8 type_revision_id; \
332 u16 type_data_length; \
333
334/* Values for the type field above */
335
336#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
337#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
338#define AML_RESOURCE_UART_SERIALBUSTYPE 3
339#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
340#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
341
342struct aml_resource_common_serialbus {
343AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON};
344
345struct aml_resource_i2c_serialbus {
346 AML_RESOURCE_LARGE_HEADER_COMMON
347 AML_RESOURCE_SERIAL_COMMON u32 connection_speed;
348 u16 slave_address;
349 /*
350 * Optional fields follow immediately:
351 * 1) Vendor Data bytes
352 * 2) Resource Source String
353 */
354};
355
356#define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */
357#define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */
358#define AML_RESOURCE_I2C_MIN_DATA_LEN 6
359
360struct aml_resource_spi_serialbus {
361 AML_RESOURCE_LARGE_HEADER_COMMON
362 AML_RESOURCE_SERIAL_COMMON u32 connection_speed;
363 u8 data_bit_length;
364 u8 clock_phase;
365 u8 clock_polarity;
366 u16 device_selection;
367 /*
368 * Optional fields follow immediately:
369 * 1) Vendor Data bytes
370 * 2) Resource Source String
371 */
372};
373
374#define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */
375#define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */
376#define AML_RESOURCE_SPI_MIN_DATA_LEN 9
377
378struct aml_resource_uart_serialbus {
379 AML_RESOURCE_LARGE_HEADER_COMMON
380 AML_RESOURCE_SERIAL_COMMON u32 default_baud_rate;
381 u16 rx_fifo_size;
382 u16 tx_fifo_size;
383 u8 parity;
384 u8 lines_enabled;
385 /*
386 * Optional fields follow immediately:
387 * 1) Vendor Data bytes
388 * 2) Resource Source String
389 */
390};
391
392#define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */
393#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */
394#define AML_RESOURCE_UART_MIN_DATA_LEN 10
395
266/* restore default alignment */ 396/* restore default alignment */
267 397
268#pragma pack() 398#pragma pack()
@@ -284,6 +414,7 @@ union aml_resource {
284 struct aml_resource_end_dependent end_dpf; 414 struct aml_resource_end_dependent end_dpf;
285 struct aml_resource_io io; 415 struct aml_resource_io io;
286 struct aml_resource_fixed_io fixed_io; 416 struct aml_resource_fixed_io fixed_io;
417 struct aml_resource_fixed_dma fixed_dma;
287 struct aml_resource_vendor_small vendor_small; 418 struct aml_resource_vendor_small vendor_small;
288 struct aml_resource_end_tag end_tag; 419 struct aml_resource_end_tag end_tag;
289 420
@@ -299,6 +430,11 @@ union aml_resource {
299 struct aml_resource_address64 address64; 430 struct aml_resource_address64 address64;
300 struct aml_resource_extended_address64 ext_address64; 431 struct aml_resource_extended_address64 ext_address64;
301 struct aml_resource_extended_irq extended_irq; 432 struct aml_resource_extended_irq extended_irq;
433 struct aml_resource_gpio gpio;
434 struct aml_resource_i2c_serialbus i2c_serial_bus;
435 struct aml_resource_spi_serialbus spi_serial_bus;
436 struct aml_resource_uart_serialbus uart_serial_bus;
437 struct aml_resource_common_serialbus common_serial_bus;
302 438
303 /* Utility overlays */ 439 /* Utility overlays */
304 440
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index 8c7b99728aa2..80eb1900297f 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -250,6 +250,13 @@ acpi_ds_get_bank_field_arguments(union acpi_operand_object *obj_desc)
250 status = acpi_ds_execute_arguments(node, node->parent, 250 status = acpi_ds_execute_arguments(node, node->parent,
251 extra_desc->extra.aml_length, 251 extra_desc->extra.aml_length,
252 extra_desc->extra.aml_start); 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 return_ACPI_STATUS(status); 260 return_ACPI_STATUS(status);
254} 261}
255 262
@@ -384,8 +391,15 @@ acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc)
384 391
385 /* Execute the argument AML */ 392 /* Execute the argument AML */
386 393
387 status = acpi_ds_execute_arguments(node, node->parent, 394 status = acpi_ds_execute_arguments(node, extra_desc->extra.scope_node,
388 extra_desc->extra.aml_length, 395 extra_desc->extra.aml_length,
389 extra_desc->extra.aml_start); 396 extra_desc->extra.aml_start);
397 if (ACPI_FAILURE(status)) {
398 return_ACPI_STATUS(status);
399 }
400
401 status = acpi_ut_add_address_range(obj_desc->region.space_id,
402 obj_desc->region.address,
403 obj_desc->region.length, node);
390 return_ACPI_STATUS(status); 404 return_ACPI_STATUS(status);
391} 405}
diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c
index 26c49fff58da..effe4ca1133f 100644
--- a/drivers/acpi/acpica/dscontrol.c
+++ b/drivers/acpi/acpica/dscontrol.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 34be60c0e448..cd243cf2cab2 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -221,6 +221,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
221{ 221{
222 acpi_status status; 222 acpi_status status;
223 u64 position; 223 u64 position;
224 union acpi_parse_object *child;
224 225
225 ACPI_FUNCTION_TRACE_PTR(ds_get_field_names, info); 226 ACPI_FUNCTION_TRACE_PTR(ds_get_field_names, info);
226 227
@@ -232,10 +233,11 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
232 233
233 while (arg) { 234 while (arg) {
234 /* 235 /*
235 * Three types of field elements are handled: 236 * Four types of field elements are handled:
236 * 1) Offset - specifies a bit offset 237 * 1) Name - Enters a new named field into the namespace
237 * 2) access_as - changes the access mode 238 * 2) Offset - specifies a bit offset
238 * 3) Name - Enters a new named field into the namespace 239 * 3) access_as - changes the access mode/attributes
240 * 4) Connection - Associate a resource template with the field
239 */ 241 */
240 switch (arg->common.aml_opcode) { 242 switch (arg->common.aml_opcode) {
241 case AML_INT_RESERVEDFIELD_OP: 243 case AML_INT_RESERVEDFIELD_OP:
@@ -253,21 +255,70 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
253 break; 255 break;
254 256
255 case AML_INT_ACCESSFIELD_OP: 257 case AML_INT_ACCESSFIELD_OP:
256 258 case AML_INT_EXTACCESSFIELD_OP:
257 /* 259 /*
258 * Get a new access_type and access_attribute -- to be used for all 260 * Get new access_type, access_attribute, and access_length fields
259 * field units that follow, until field end or another access_as 261 * -- to be used for all field units that follow, until the
260 * keyword. 262 * end-of-field or another access_as keyword is encountered.
263 * NOTE. These three bytes are encoded in the integer value
264 * of the parseop for convenience.
261 * 265 *
262 * In field_flags, preserve the flag bits other than the 266 * In field_flags, preserve the flag bits other than the
263 * ACCESS_TYPE bits 267 * ACCESS_TYPE bits.
264 */ 268 */
269
270 /* access_type (byte_acc, word_acc, etc.) */
271
265 info->field_flags = (u8) 272 info->field_flags = (u8)
266 ((info-> 273 ((info->
267 field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | 274 field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
268 ((u8) ((u32) arg->common.value.integer >> 8))); 275 ((u8)((u32)(arg->common.value.integer & 0x07))));
276
277 /* access_attribute (attrib_quick, attrib_byte, etc.) */
278
279 info->attribute =
280 (u8)((arg->common.value.integer >> 8) & 0xFF);
281
282 /* access_length (for serial/buffer protocols) */
283
284 info->access_length =
285 (u8)((arg->common.value.integer >> 16) & 0xFF);
286 break;
287
288 case AML_INT_CONNECTION_OP:
289 /*
290 * Clear any previous connection. New connection is used for all
291 * fields that follow, similar to access_as
292 */
293 info->resource_buffer = NULL;
294 info->connection_node = NULL;
269 295
270 info->attribute = (u8) (arg->common.value.integer); 296 /*
297 * A Connection() is either an actual resource descriptor (buffer)
298 * or a named reference to a resource template
299 */
300 child = arg->common.value.arg;
301 if (child->common.aml_opcode == AML_INT_BYTELIST_OP) {
302 info->resource_buffer = child->named.data;
303 info->resource_length =
304 (u16)child->named.value.integer;
305 } else {
306 /* Lookup the Connection() namepath, it should already exist */
307
308 status = acpi_ns_lookup(walk_state->scope_info,
309 child->common.value.
310 name, ACPI_TYPE_ANY,
311 ACPI_IMODE_EXECUTE,
312 ACPI_NS_DONT_OPEN_SCOPE,
313 walk_state,
314 &info->connection_node);
315 if (ACPI_FAILURE(status)) {
316 ACPI_ERROR_NAMESPACE(child->common.
317 value.name,
318 status);
319 return_ACPI_STATUS(status);
320 }
321 }
271 break; 322 break;
272 323
273 case AML_INT_NAMEDFIELD_OP: 324 case AML_INT_NAMEDFIELD_OP:
@@ -374,6 +425,8 @@ acpi_ds_create_field(union acpi_parse_object *op,
374 } 425 }
375 } 426 }
376 427
428 ACPI_MEMSET(&info, 0, sizeof(struct acpi_create_field_info));
429
377 /* Second arg is the field flags */ 430 /* Second arg is the field flags */
378 431
379 arg = arg->common.next; 432 arg = arg->common.next;
@@ -386,7 +439,6 @@ acpi_ds_create_field(union acpi_parse_object *op,
386 info.region_node = region_node; 439 info.region_node = region_node;
387 440
388 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); 441 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
389
390 return_ACPI_STATUS(status); 442 return_ACPI_STATUS(status);
391} 443}
392 444
@@ -474,8 +526,8 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
474 */ 526 */
475 while (arg) { 527 while (arg) {
476 /* 528 /*
477 * Ignore OFFSET and ACCESSAS terms here; we are only interested in the 529 * Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested
478 * field names in order to enter them into the namespace. 530 * in the field names in order to enter them into the namespace.
479 */ 531 */
480 if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) { 532 if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
481 status = acpi_ns_lookup(walk_state->scope_info, 533 status = acpi_ns_lookup(walk_state->scope_info,
@@ -651,6 +703,5 @@ acpi_ds_create_index_field(union acpi_parse_object *op,
651 info.region_node = region_node; 703 info.region_node = region_node;
652 704
653 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next); 705 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
654
655 return_ACPI_STATUS(status); 706 return_ACPI_STATUS(status);
656} 707}
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c
index a7718bf2b9a1..9e5ac7f780a7 100644
--- a/drivers/acpi/acpica/dsinit.c
+++ b/drivers/acpi/acpica/dsinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 5d797751e205..00f5dab5bcc0 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsmthdat.c b/drivers/acpi/acpica/dsmthdat.c
index 905ce29a92e1..b40bd507be5d 100644
--- a/drivers/acpi/acpica/dsmthdat.c
+++ b/drivers/acpi/acpica/dsmthdat.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index f42e17e5c252..d7045ca3e32a 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index c627a288e027..e5eff7585102 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index 2c477ce172fa..1abcda31037f 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index fe40e4c6554f..642f3c053e87 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 324acec1179a..552aa3a50c84 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index 976318138c56..ae7147724763 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswscope.c b/drivers/acpi/acpica/dswscope.c
index 76a661fc1e09..9e9490a9cbf0 100644
--- a/drivers/acpi/acpica/dswscope.c
+++ b/drivers/acpi/acpica/dswscope.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c
index a6c374ef9914..c9c2ac13e7cc 100644
--- a/drivers/acpi/acpica/dswstate.c
+++ b/drivers/acpi/acpica/dswstate.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c
index d458b041e651..6729ebe2f1e6 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -71,6 +71,12 @@ acpi_status acpi_ev_initialize_events(void)
71 71
72 ACPI_FUNCTION_TRACE(ev_initialize_events); 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 * Initialize the Fixed and General Purpose Events. This is done prior to 81 * Initialize the Fixed and General Purpose Events. This is done prior to
76 * enabling SCIs to prevent interrupts from occurring before the handlers 82 * enabling SCIs to prevent interrupts from occurring before the handlers
@@ -111,6 +117,12 @@ acpi_status acpi_ev_install_xrupt_handlers(void)
111 117
112 ACPI_FUNCTION_TRACE(ev_install_xrupt_handlers); 118 ACPI_FUNCTION_TRACE(ev_install_xrupt_handlers);
113 119
120 /* If Hardware Reduced flag is set, there is no ACPI h/w */
121
122 if (acpi_gbl_reduced_hardware) {
123 return_ACPI_STATUS(AE_OK);
124 }
125
114 /* Install the SCI handler */ 126 /* Install the SCI handler */
115 127
116 status = acpi_ev_install_sci_handler(); 128 status = acpi_ev_install_sci_handler();
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c
index 56a562a1e5d7..5e5683cb1f0d 100644
--- a/drivers/acpi/acpica/evglock.c
+++ b/drivers/acpi/acpica/evglock.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,12 @@ acpi_status acpi_ev_init_global_lock_handler(void)
70 70
71 ACPI_FUNCTION_TRACE(ev_init_global_lock_handler); 71 ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
72 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 }
78
73 /* Attempt installation of the global lock handler */ 79 /* Attempt installation of the global lock handler */
74 80
75 status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL, 81 status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL,
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index 65c79add3b19..9e88cb6fb25e 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index ca2c41a53311..be75339cd5dd 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index ce9aa9f9a972..adf7494da9db 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index 80a81d0c4a80..25073932aa10 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index d0b331844427..84966f416463 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index f0edf5c43c03..1b0180a1b798 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -329,6 +329,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
329 * FUNCTION: acpi_ev_address_space_dispatch 329 * FUNCTION: acpi_ev_address_space_dispatch
330 * 330 *
331 * PARAMETERS: region_obj - Internal region object 331 * PARAMETERS: region_obj - Internal region object
332 * field_obj - Corresponding field. Can be NULL.
332 * Function - Read or Write operation 333 * Function - Read or Write operation
333 * region_offset - Where in the region to read or write 334 * region_offset - Where in the region to read or write
334 * bit_width - Field width in bits (8, 16, 32, or 64) 335 * bit_width - Field width in bits (8, 16, 32, or 64)
@@ -344,6 +345,7 @@ acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function)
344 345
345acpi_status 346acpi_status
346acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, 347acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
348 union acpi_operand_object *field_obj,
347 u32 function, 349 u32 function,
348 u32 region_offset, u32 bit_width, u64 *value) 350 u32 region_offset, u32 bit_width, u64 *value)
349{ 351{
@@ -353,6 +355,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
353 union acpi_operand_object *handler_desc; 355 union acpi_operand_object *handler_desc;
354 union acpi_operand_object *region_obj2; 356 union acpi_operand_object *region_obj2;
355 void *region_context = NULL; 357 void *region_context = NULL;
358 struct acpi_connection_info *context;
356 359
357 ACPI_FUNCTION_TRACE(ev_address_space_dispatch); 360 ACPI_FUNCTION_TRACE(ev_address_space_dispatch);
358 361
@@ -375,6 +378,8 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
375 return_ACPI_STATUS(AE_NOT_EXIST); 378 return_ACPI_STATUS(AE_NOT_EXIST);
376 } 379 }
377 380
381 context = handler_desc->address_space.context;
382
378 /* 383 /*
379 * It may be the case that the region has never been initialized. 384 * It may be the case that the region has never been initialized.
380 * Some types of regions require special init code 385 * Some types of regions require special init code
@@ -404,8 +409,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
404 acpi_ex_exit_interpreter(); 409 acpi_ex_exit_interpreter();
405 410
406 status = region_setup(region_obj, ACPI_REGION_ACTIVATE, 411 status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
407 handler_desc->address_space.context, 412 context, &region_context);
408 &region_context);
409 413
410 /* Re-enter the interpreter */ 414 /* Re-enter the interpreter */
411 415
@@ -455,6 +459,25 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
455 acpi_ut_get_region_name(region_obj->region. 459 acpi_ut_get_region_name(region_obj->region.
456 space_id))); 460 space_id)));
457 461
462 /*
463 * Special handling for generic_serial_bus and general_purpose_io:
464 * There are three extra parameters that must be passed to the
465 * handler via the context:
466 * 1) Connection buffer, a resource template from Connection() op.
467 * 2) Length of the above buffer.
468 * 3) Actual access length from the access_as() op.
469 */
470 if (((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) ||
471 (region_obj->region.space_id == ACPI_ADR_SPACE_GPIO)) &&
472 context && field_obj) {
473
474 /* Get the Connection (resource_template) buffer */
475
476 context->connection = field_obj->field.resource_buffer;
477 context->length = field_obj->field.resource_length;
478 context->access_length = field_obj->field.access_length;
479 }
480
458 if (!(handler_desc->address_space.handler_flags & 481 if (!(handler_desc->address_space.handler_flags &
459 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { 482 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
460 /* 483 /*
@@ -469,7 +492,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
469 492
470 status = handler(function, 493 status = handler(function,
471 (region_obj->region.address + region_offset), 494 (region_obj->region.address + region_offset),
472 bit_width, value, handler_desc->address_space.context, 495 bit_width, value, context,
473 region_obj2->extra.region_context); 496 region_obj2->extra.region_context);
474 497
475 if (ACPI_FAILURE(status)) { 498 if (ACPI_FAILURE(status)) {
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index 55a5d35ef34a..819c17f5897a 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index 2ebd40e1a3ef..26065c612e76 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index f4f523bf5939..61944e89565a 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index 20516e599476..1768bbec1002 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index f06a3ee356ba..33388fd69df4 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index aee887e3ca5c..6019208cd4b6 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 745a42b401f5..c86d44e41bc8 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -297,9 +297,9 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
297 /* Bytewise reads */ 297 /* Bytewise reads */
298 298
299 for (i = 0; i < length; i++) { 299 for (i = 0; i < length; i++) {
300 status = acpi_ev_address_space_dispatch(obj_desc, ACPI_READ, 300 status =
301 region_offset, 8, 301 acpi_ev_address_space_dispatch(obj_desc, NULL, ACPI_READ,
302 &value); 302 region_offset, 8, &value);
303 if (ACPI_FAILURE(status)) { 303 if (ACPI_FAILURE(status)) {
304 return status; 304 return status;
305 } 305 }
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c
index 74162a11817d..e385436bd424 100644
--- a/drivers/acpi/acpica/exconvrt.c
+++ b/drivers/acpi/acpica/exconvrt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
index 110711afada8..3f5bc998c1cb 100644
--- a/drivers/acpi/acpica/excreate.c
+++ b/drivers/acpi/acpica/excreate.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -267,7 +267,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
267 * 267 *
268 * PARAMETERS: aml_start - Pointer to the region declaration AML 268 * PARAMETERS: aml_start - Pointer to the region declaration AML
269 * aml_length - Max length of the declaration AML 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 * walk_state - Current state 271 * walk_state - Current state
272 * 272 *
273 * RETURN: Status 273 * RETURN: Status
@@ -279,7 +279,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
279acpi_status 279acpi_status
280acpi_ex_create_region(u8 * aml_start, 280acpi_ex_create_region(u8 * aml_start,
281 u32 aml_length, 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 acpi_status status; 284 acpi_status status;
285 union acpi_operand_object *obj_desc; 285 union acpi_operand_object *obj_desc;
@@ -304,16 +304,19 @@ acpi_ex_create_region(u8 * aml_start,
304 * Space ID must be one of the predefined IDs, or in the user-defined 304 * Space ID must be one of the predefined IDs, or in the user-defined
305 * range 305 * range
306 */ 306 */
307 if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) && 307 if (!acpi_is_valid_space_id(space_id)) {
308 (region_space < ACPI_USER_REGION_BEGIN) && 308 /*
309 (region_space != ACPI_ADR_SPACE_DATA_TABLE)) { 309 * Print an error message, but continue. We don't want to abort
310 ACPI_ERROR((AE_INFO, "Invalid AddressSpace type 0x%X", 310 * a table load for this exception. Instead, if the region is
311 region_space)); 311 * actually used at runtime, abort the executing method.
312 return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID); 312 */
313 ACPI_ERROR((AE_INFO,
314 "Invalid/unknown Address Space ID: 0x%2.2X",
315 space_id));
313 } 316 }
314 317
315 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", 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 /* Create the region descriptor */ 321 /* Create the region descriptor */
319 322
@@ -330,10 +333,16 @@ acpi_ex_create_region(u8 * aml_start,
330 region_obj2 = obj_desc->common.next_object; 333 region_obj2 = obj_desc->common.next_object;
331 region_obj2->extra.aml_start = aml_start; 334 region_obj2->extra.aml_start = aml_start;
332 region_obj2->extra.aml_length = aml_length; 335 region_obj2->extra.aml_length = aml_length;
336 if (walk_state->scope_info) {
337 region_obj2->extra.scope_node =
338 walk_state->scope_info->scope.node;
339 } else {
340 region_obj2->extra.scope_node = node;
341 }
333 342
334 /* Init the region from the operands */ 343 /* Init the region from the operands */
335 344
336 obj_desc->region.space_id = region_space; 345 obj_desc->region.space_id = space_id;
337 obj_desc->region.address = 0; 346 obj_desc->region.address = 0;
338 obj_desc->region.length = 0; 347 obj_desc->region.length = 0;
339 obj_desc->region.node = node; 348 obj_desc->region.node = node;
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index c7a2f1edd282..e211e9c19215 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 61b8c0e8b74d..2a6ac0a3bc1e 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -192,10 +192,13 @@ static struct acpi_exdump_info acpi_ex_dump_buffer_field[3] = {
192 "Buffer Object"} 192 "Buffer Object"}
193}; 193};
194 194
195static struct acpi_exdump_info acpi_ex_dump_region_field[3] = { 195static struct acpi_exdump_info acpi_ex_dump_region_field[5] = {
196 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region_field), NULL}, 196 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_region_field), NULL},
197 {ACPI_EXD_FIELD, 0, NULL}, 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
201static struct acpi_exdump_info acpi_ex_dump_bank_field[5] = { 204static struct acpi_exdump_info acpi_ex_dump_bank_field[5] = {
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index 0bde2230c028..dc092f5b35d6 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -100,18 +100,25 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
100 (obj_desc->field.region_obj->region.space_id == 100 (obj_desc->field.region_obj->region.space_id ==
101 ACPI_ADR_SPACE_SMBUS 101 ACPI_ADR_SPACE_SMBUS
102 || obj_desc->field.region_obj->region.space_id == 102 || obj_desc->field.region_obj->region.space_id ==
103 ACPI_ADR_SPACE_GSBUS
104 || obj_desc->field.region_obj->region.space_id ==
103 ACPI_ADR_SPACE_IPMI)) { 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 * the data and then directly access the region handler. 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 if (obj_desc->field.region_obj->region.space_id == 112 if (obj_desc->field.region_obj->region.space_id ==
111 ACPI_ADR_SPACE_SMBUS) { 113 ACPI_ADR_SPACE_SMBUS) {
112 length = ACPI_SMBUS_BUFFER_SIZE; 114 length = ACPI_SMBUS_BUFFER_SIZE;
113 function = 115 function =
114 ACPI_READ | (obj_desc->field.attribute << 16); 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;
120 function =
121 ACPI_READ | (obj_desc->field.attribute << 16);
115 } else { /* IPMI */ 122 } else { /* IPMI */
116 123
117 length = ACPI_IPMI_BUFFER_SIZE; 124 length = ACPI_IPMI_BUFFER_SIZE;
@@ -248,21 +255,23 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
248 (obj_desc->field.region_obj->region.space_id == 255 (obj_desc->field.region_obj->region.space_id ==
249 ACPI_ADR_SPACE_SMBUS 256 ACPI_ADR_SPACE_SMBUS
250 || obj_desc->field.region_obj->region.space_id == 257 || obj_desc->field.region_obj->region.space_id ==
258 ACPI_ADR_SPACE_GSBUS
259 || obj_desc->field.region_obj->region.space_id ==
251 ACPI_ADR_SPACE_IPMI)) { 260 ACPI_ADR_SPACE_IPMI)) {
252 /* 261 /*
253 * This is an SMBus or IPMI write. We will bypass the entire field 262 * This is an SMBus, GSBus or IPMI write. We will bypass the entire field
254 * mechanism and handoff the buffer directly to the handler. For 263 * mechanism and handoff the buffer directly to the handler. For
255 * these address spaces, the buffer is bi-directional; on a write, 264 * these address spaces, the buffer is bi-directional; on a write,
256 * return data is returned in the same buffer. 265 * return data is returned in the same buffer.
257 * 266 *
258 * Source must be a buffer of sufficient size: 267 * Source must be a buffer of sufficient size:
259 * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. 268 * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
260 * 269 *
261 * Note: SMBus protocol type is passed in upper 16-bits of Function 270 * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
262 */ 271 */
263 if (source_desc->common.type != ACPI_TYPE_BUFFER) { 272 if (source_desc->common.type != ACPI_TYPE_BUFFER) {
264 ACPI_ERROR((AE_INFO, 273 ACPI_ERROR((AE_INFO,
265 "SMBus or IPMI write requires Buffer, found type %s", 274 "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
266 acpi_ut_get_object_type_name(source_desc))); 275 acpi_ut_get_object_type_name(source_desc)));
267 276
268 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 277 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
@@ -273,6 +282,11 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
273 length = ACPI_SMBUS_BUFFER_SIZE; 282 length = ACPI_SMBUS_BUFFER_SIZE;
274 function = 283 function =
275 ACPI_WRITE | (obj_desc->field.attribute << 16); 284 ACPI_WRITE | (obj_desc->field.attribute << 16);
285 } else if (obj_desc->field.region_obj->region.space_id ==
286 ACPI_ADR_SPACE_GSBUS) {
287 length = ACPI_GSBUS_BUFFER_SIZE;
288 function =
289 ACPI_WRITE | (obj_desc->field.attribute << 16);
276 } else { /* IPMI */ 290 } else { /* IPMI */
277 291
278 length = ACPI_IPMI_BUFFER_SIZE; 292 length = ACPI_IPMI_BUFFER_SIZE;
@@ -281,7 +295,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
281 295
282 if (source_desc->buffer.length < length) { 296 if (source_desc->buffer.length < length) {
283 ACPI_ERROR((AE_INFO, 297 ACPI_ERROR((AE_INFO,
284 "SMBus or IPMI write requires Buffer of length %u, found length %u", 298 "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
285 length, source_desc->buffer.length)); 299 length, source_desc->buffer.length));
286 300
287 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT); 301 return_ACPI_STATUS(AE_AML_BUFFER_LIMIT);
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index f915a7f3f921..149de45fdadd 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -86,6 +86,7 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
86{ 86{
87 acpi_status status = AE_OK; 87 acpi_status status = AE_OK;
88 union acpi_operand_object *rgn_desc; 88 union acpi_operand_object *rgn_desc;
89 u8 space_id;
89 90
90 ACPI_FUNCTION_TRACE_U32(ex_setup_region, field_datum_byte_offset); 91 ACPI_FUNCTION_TRACE_U32(ex_setup_region, field_datum_byte_offset);
91 92
@@ -101,6 +102,17 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
101 return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 102 return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
102 } 103 }
103 104
105 space_id = rgn_desc->region.space_id;
106
107 /* Validate the Space ID */
108
109 if (!acpi_is_valid_space_id(space_id)) {
110 ACPI_ERROR((AE_INFO,
111 "Invalid/unknown Address Space ID: 0x%2.2X",
112 space_id));
113 return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
114 }
115
104 /* 116 /*
105 * If the Region Address and Length have not been previously evaluated, 117 * If the Region Address and Length have not been previously evaluated,
106 * evaluate them now and save the results. 118 * evaluate them now and save the results.
@@ -119,11 +131,12 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
119 } 131 }
120 132
121 /* 133 /*
122 * Exit now for SMBus or IPMI address space, it has a non-linear 134 * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear
123 * address space and the request cannot be directly validated 135 * address space and the request cannot be directly validated
124 */ 136 */
125 if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS || 137 if (space_id == ACPI_ADR_SPACE_SMBUS ||
126 rgn_desc->region.space_id == ACPI_ADR_SPACE_IPMI) { 138 space_id == ACPI_ADR_SPACE_GSBUS ||
139 space_id == ACPI_ADR_SPACE_IPMI) {
127 140
128 /* SMBus or IPMI has a non-linear address space */ 141 /* SMBus or IPMI has a non-linear address space */
129 142
@@ -271,11 +284,12 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
271 284
272 /* Invoke the appropriate address_space/op_region handler */ 285 /* Invoke the appropriate address_space/op_region handler */
273 286
274 status = 287 status = acpi_ev_address_space_dispatch(rgn_desc, obj_desc,
275 acpi_ev_address_space_dispatch(rgn_desc, function, region_offset, 288 function, region_offset,
276 ACPI_MUL_8(obj_desc->common_field. 289 ACPI_MUL_8(obj_desc->
277 access_byte_width), 290 common_field.
278 value); 291 access_byte_width),
292 value);
279 293
280 if (ACPI_FAILURE(status)) { 294 if (ACPI_FAILURE(status)) {
281 if (status == AE_NOT_IMPLEMENTED) { 295 if (status == AE_NOT_IMPLEMENTED) {
@@ -316,6 +330,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
316static u8 330static u8
317acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value) 331acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value)
318{ 332{
333 ACPI_FUNCTION_NAME(ex_register_overflow);
319 334
320 if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) { 335 if (obj_desc->common_field.bit_length >= ACPI_INTEGER_BIT_SIZE) {
321 /* 336 /*
@@ -330,6 +345,11 @@ acpi_ex_register_overflow(union acpi_operand_object *obj_desc, u64 value)
330 * The Value is larger than the maximum value that can fit into 345 * The Value is larger than the maximum value that can fit into
331 * the register. 346 * the register.
332 */ 347 */
348 ACPI_ERROR((AE_INFO,
349 "Index value 0x%8.8X%8.8X overflows field width 0x%X",
350 ACPI_FORMAT_UINT64(value),
351 obj_desc->common_field.bit_length));
352
333 return (TRUE); 353 return (TRUE);
334 } 354 }
335 355
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c
index 703d88ed0b3d..0a0893310348 100644
--- a/drivers/acpi/acpica/exmisc.c
+++ b/drivers/acpi/acpica/exmisc.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index be1c56ead653..60933e9dc3c0 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exnames.c b/drivers/acpi/acpica/exnames.c
index 49ec049c157e..fcc75fa27d32 100644
--- a/drivers/acpi/acpica/exnames.c
+++ b/drivers/acpi/acpica/exnames.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 236ead14b7f7..9ba8c73cea16 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c
index 2571b4a310f4..879e8a277b94 100644
--- a/drivers/acpi/acpica/exoparg2.c
+++ b/drivers/acpi/acpica/exoparg2.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 1b48d9d28c9a..71fcc65c9ffa 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg6.c b/drivers/acpi/acpica/exoparg6.c
index f4a2787e8e92..0786b8659061 100644
--- a/drivers/acpi/acpica/exoparg6.c
+++ b/drivers/acpi/acpica/exoparg6.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index cc95e2000406..30157f5a12d7 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,7 @@
47#include "acinterp.h" 47#include "acinterp.h"
48#include "amlcode.h" 48#include "amlcode.h"
49#include "acnamesp.h" 49#include "acnamesp.h"
50#include "acdispat.h"
50 51
51#define _COMPONENT ACPI_EXECUTER 52#define _COMPONENT ACPI_EXECUTER
52ACPI_MODULE_NAME("exprep") 53ACPI_MODULE_NAME("exprep")
@@ -455,6 +456,30 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
455 obj_desc->field.region_obj = 456 obj_desc->field.region_obj =
456 acpi_ns_get_attached_object(info->region_node); 457 acpi_ns_get_attached_object(info->region_node);
457 458
459 /* Fields specific to generic_serial_bus fields */
460
461 obj_desc->field.access_length = info->access_length;
462
463 if (info->connection_node) {
464 second_desc = info->connection_node->object;
465 if (!(second_desc->common.flags & AOPOBJ_DATA_VALID)) {
466 status =
467 acpi_ds_get_buffer_arguments(second_desc);
468 if (ACPI_FAILURE(status)) {
469 acpi_ut_delete_object_desc(obj_desc);
470 return_ACPI_STATUS(status);
471 }
472 }
473
474 obj_desc->field.resource_buffer =
475 second_desc->buffer.pointer;
476 obj_desc->field.resource_length =
477 (u16)second_desc->buffer.length;
478 } else if (info->resource_buffer) {
479 obj_desc->field.resource_buffer = info->resource_buffer;
480 obj_desc->field.resource_length = info->resource_length;
481 }
482
458 /* Allow full data read from EC address space */ 483 /* Allow full data read from EC address space */
459 484
460 if ((obj_desc->field.region_obj->region.space_id == 485 if ((obj_desc->field.region_obj->region.space_id ==
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index f0d5e14f1f2c..12d51df6d3bf 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c
index 55997e46948b..fa50e77e64a8 100644
--- a/drivers/acpi/acpica/exresnte.c
+++ b/drivers/acpi/acpica/exresnte.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c
index db502cd7d934..6e335dc34528 100644
--- a/drivers/acpi/acpica/exresolv.c
+++ b/drivers/acpi/acpica/exresolv.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c
index e3bb00ccdff5..a67b1d925ddd 100644
--- a/drivers/acpi/acpica/exresop.c
+++ b/drivers/acpi/acpica/exresop.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c
index c0c8842dd344..c6cf843cc4c9 100644
--- a/drivers/acpi/acpica/exstore.c
+++ b/drivers/acpi/acpica/exstore.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exstoren.c b/drivers/acpi/acpica/exstoren.c
index a979017d56b8..b35bed52e061 100644
--- a/drivers/acpi/acpica/exstoren.c
+++ b/drivers/acpi/acpica/exstoren.c
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2011, Intel Corp. 10 * Copyright (C) 2000 - 2012, Intel Corp.
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c
index dc665cc554de..65a45d8335c8 100644
--- a/drivers/acpi/acpica/exstorob.c
+++ b/drivers/acpi/acpica/exstorob.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c
index df66e7b686be..191a12945226 100644
--- a/drivers/acpi/acpica/exsystem.c
+++ b/drivers/acpi/acpica/exsystem.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index 8ad93146dd32..eb6798ba8b59 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -435,4 +435,29 @@ void acpi_ex_integer_to_string(char *out_string, u64 value)
435 } 435 }
436} 436}
437 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
450u8 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);
461}
462
438#endif 463#endif
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index fc380d3d45ab..d21ec5f0b3a9 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index f610d88a66be..1a6894afef79 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwpci.c b/drivers/acpi/acpica/hwpci.c
index 050fd227951b..1455ddcdc32c 100644
--- a/drivers/acpi/acpica/hwpci.c
+++ b/drivers/acpi/acpica/hwpci.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index cc70f3fdcdd1..4ea4eeb51bfd 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -7,7 +7,7 @@
7 ******************************************************************************/ 7 ******************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2011, Intel Corp. 10 * Copyright (C) 2000 - 2012, Intel Corp.
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index d52da3073650..3c4a922a9fc2 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index 50d21c40b5c1..d4973d9da9f1 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index 5f1605874655..6e5c43a60bb7 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -134,6 +134,8 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
134 /* Supported widths are 8/16/32 */ 134 /* Supported widths are 8/16/32 */
135 135
136 if ((bit_width != 8) && (bit_width != 16) && (bit_width != 32)) { 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 return AE_BAD_PARAMETER; 139 return AE_BAD_PARAMETER;
138 } 140 }
139 141
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index c2793a82f120..7bdbbcf35f85 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index d93172fd15a8..61623f3f6826 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c
index 1d0ef15d158f..7c3d3ceb98b3 100644
--- a/drivers/acpi/acpica/nsalloc.c
+++ b/drivers/acpi/acpica/nsalloc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index b683cc2ff9d3..b7f2b3be79ac 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c
index 2ed294b7a4db..30ea5bc53a78 100644
--- a/drivers/acpi/acpica/nsdumpdv.c
+++ b/drivers/acpi/acpica/nsdumpdv.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c
index c1bd02b1a058..f375cb82e321 100644
--- a/drivers/acpi/acpica/nseval.c
+++ b/drivers/acpi/acpica/nseval.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index fd7c6380e294..9d84ec2f0211 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index 5f7dc691c183..5cbf15ffe7d8 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c
index d5fa520c3de5..b20e7c8c3ffb 100644
--- a/drivers/acpi/acpica/nsnames.c
+++ b/drivers/acpi/acpica/nsnames.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c
index 3bb8bf105ea2..dd77a3ce6e50 100644
--- a/drivers/acpi/acpica/nsobject.c
+++ b/drivers/acpi/acpica/nsobject.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index b3234fa795b8..ec7ba2d3463c 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index c845c8089f39..bbe46a447d34 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -620,6 +620,7 @@ acpi_ns_check_package(struct acpi_predefined_data *data,
620 case ACPI_PTYPE2_FIXED: 620 case ACPI_PTYPE2_FIXED:
621 case ACPI_PTYPE2_MIN: 621 case ACPI_PTYPE2_MIN:
622 case ACPI_PTYPE2_COUNT: 622 case ACPI_PTYPE2_COUNT:
623 case ACPI_PTYPE2_FIX_VAR:
623 624
624 /* 625 /*
625 * These types all return a single Package that consists of a 626 * These types all return a single Package that consists of a
@@ -759,6 +760,34 @@ acpi_ns_check_package_list(struct acpi_predefined_data *data,
759 } 760 }
760 break; 761 break;
761 762
763 case ACPI_PTYPE2_FIX_VAR:
764 /*
765 * Each subpackage has a fixed number of elements and an
766 * optional element
767 */
768 expected_count =
769 package->ret_info.count1 + package->ret_info.count2;
770 if (sub_package->package.count < expected_count) {
771 goto package_too_small;
772 }
773
774 status =
775 acpi_ns_check_package_elements(data, sub_elements,
776 package->ret_info.
777 object_type1,
778 package->ret_info.
779 count1,
780 package->ret_info.
781 object_type2,
782 sub_package->package.
783 count -
784 package->ret_info.
785 count1, 0);
786 if (ACPI_FAILURE(status)) {
787 return (status);
788 }
789 break;
790
762 case ACPI_PTYPE2_FIXED: 791 case ACPI_PTYPE2_FIXED:
763 792
764 /* Each sub-package has a fixed length */ 793 /* Each sub-package has a fixed length */
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index ac7b854b0bd7..9c35d20eb52b 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -634,6 +634,7 @@ acpi_ns_remove_null_elements(struct acpi_predefined_data *data,
634 case ACPI_PTYPE2_FIXED: 634 case ACPI_PTYPE2_FIXED:
635 case ACPI_PTYPE2_MIN: 635 case ACPI_PTYPE2_MIN:
636 case ACPI_PTYPE2_REV_FIXED: 636 case ACPI_PTYPE2_REV_FIXED:
637 case ACPI_PTYPE2_FIX_VAR:
637 break; 638 break;
638 639
639 default: 640 default:
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 024c4f263f87..726bc8e687f7 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -467,11 +467,12 @@ acpi_ns_repair_HID(struct acpi_predefined_data *data,
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 * A valid PNP ID must be of the form "AAA####" where A is an uppercase 472 * A valid PNP ID must be of the form "AAA####" where A is an uppercase
473 * letter and # is a hex digit. A valid ACPI ID must be of the form 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 for (dest = new_string->string.pointer; *source; dest++, source++) { 477 for (dest = new_string->string.pointer; *source; dest++, source++) {
477 *dest = (char)ACPI_TOUPPER(*source); 478 *dest = (char)ACPI_TOUPPER(*source);
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index 28b0d7a62b99..507043d66114 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index cb1b104a69a2..a535b7afda5c 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index 345f0c3c6ad2..f69895a54895 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index e7f016d1b226..71d15f61807b 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 83bf93024303..af401c9c4dfc 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c
index 57e6d825ed84..880a605cee20 100644
--- a/drivers/acpi/acpica/nsxfobj.c
+++ b/drivers/acpi/acpica/nsxfobj.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index e1fad0ee0136..5ac36aba507c 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -484,34 +484,54 @@ acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state,
484static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state 484static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
485 *parser_state) 485 *parser_state)
486{ 486{
487 u32 aml_offset = (u32) 487 u32 aml_offset;
488 ACPI_PTR_DIFF(parser_state->aml,
489 parser_state->aml_start);
490 union acpi_parse_object *field; 488 union acpi_parse_object *field;
489 union acpi_parse_object *arg = NULL;
491 u16 opcode; 490 u16 opcode;
492 u32 name; 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 ACPI_FUNCTION_TRACE(ps_get_next_field); 499 ACPI_FUNCTION_TRACE(ps_get_next_field);
495 500
501 aml_offset =
502 (u32)ACPI_PTR_DIFF(parser_state->aml, parser_state->aml_start);
503
496 /* Determine field type */ 504 /* Determine field type */
497 505
498 switch (ACPI_GET8(parser_state->aml)) { 506 switch (ACPI_GET8(parser_state->aml)) {
499 default: 507 case AML_FIELD_OFFSET_OP:
500 508
501 opcode = AML_INT_NAMEDFIELD_OP; 509 opcode = AML_INT_RESERVEDFIELD_OP;
510 parser_state->aml++;
502 break; 511 break;
503 512
504 case 0x00: 513 case AML_FIELD_ACCESS_OP:
505 514
506 opcode = AML_INT_RESERVEDFIELD_OP; 515 opcode = AML_INT_ACCESSFIELD_OP;
507 parser_state->aml++; 516 parser_state->aml++;
508 break; 517 break;
509 518
510 case 0x01: 519 case AML_FIELD_CONNECTION_OP:
511 520
512 opcode = AML_INT_ACCESSFIELD_OP; 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;
513 parser_state->aml++; 528 parser_state->aml++;
514 break; 529 break;
530
531 default:
532
533 opcode = AML_INT_NAMEDFIELD_OP;
534 break;
515 } 535 }
516 536
517 /* Allocate a new field op */ 537 /* Allocate a new field op */
@@ -549,16 +569,111 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state
549 break; 569 break;
550 570
551 case AML_INT_ACCESSFIELD_OP: 571 case AML_INT_ACCESSFIELD_OP:
572 case AML_INT_EXTACCESSFIELD_OP:
552 573
553 /* 574 /*
554 * Get access_type and access_attrib and merge into the field Op 575 * Get access_type and access_attrib and merge into the field Op
555 * access_type is first operand, access_attribute is second 576 * access_type is first operand, access_attribute is second. stuff
577 * these bytes into the node integer value for convenience.
556 */ 578 */
557 field->common.value.integer = 579
558 (((u32) ACPI_GET8(parser_state->aml) << 8)); 580 /* Get the two bytes (Type/Attribute) */
581
582 access_type = ACPI_GET8(parser_state->aml);
559 parser_state->aml++; 583 parser_state->aml++;
560 field->common.value.integer |= ACPI_GET8(parser_state->aml); 584 access_attribute = ACPI_GET8(parser_state->aml);
561 parser_state->aml++; 585 parser_state->aml++;
586
587 field->common.value.integer = (u8)access_type;
588 field->common.value.integer |= (u16)(access_attribute << 8);
589
590 /* This opcode has a third byte, access_length */
591
592 if (opcode == AML_INT_EXTACCESSFIELD_OP) {
593 access_length = ACPI_GET8(parser_state->aml);
594 parser_state->aml++;
595
596 field->common.value.integer |=
597 (u32)(access_length << 16);
598 }
599 break;
600
601 case AML_INT_CONNECTION_OP:
602
603 /*
604 * Argument for Connection operator can be either a Buffer
605 * (resource descriptor), or a name_string.
606 */
607 if (ACPI_GET8(parser_state->aml) == AML_BUFFER_OP) {
608 parser_state->aml++;
609
610 pkg_end = parser_state->aml;
611 pkg_length =
612 acpi_ps_get_next_package_length(parser_state);
613 pkg_end += pkg_length;
614
615 if (parser_state->aml < pkg_end) {
616
617 /* Non-empty list */
618
619 arg = acpi_ps_alloc_op(AML_INT_BYTELIST_OP);
620 if (!arg) {
621 return_PTR(NULL);
622 }
623
624 /* Get the actual buffer length argument */
625
626 opcode = ACPI_GET8(parser_state->aml);
627 parser_state->aml++;
628
629 switch (opcode) {
630 case AML_BYTE_OP: /* AML_BYTEDATA_ARG */
631 buffer_length =
632 ACPI_GET8(parser_state->aml);
633 parser_state->aml += 1;
634 break;
635
636 case AML_WORD_OP: /* AML_WORDDATA_ARG */
637 buffer_length =
638 ACPI_GET16(parser_state->aml);
639 parser_state->aml += 2;
640 break;
641
642 case AML_DWORD_OP: /* AML_DWORDATA_ARG */
643 buffer_length =
644 ACPI_GET32(parser_state->aml);
645 parser_state->aml += 4;
646 break;
647
648 default:
649 buffer_length = 0;
650 break;
651 }
652
653 /* Fill in bytelist data */
654
655 arg->named.value.size = buffer_length;
656 arg->named.data = parser_state->aml;
657 }
658
659 /* Skip to End of byte data */
660
661 parser_state->aml = pkg_end;
662 } else {
663 arg = acpi_ps_alloc_op(AML_INT_NAMEPATH_OP);
664 if (!arg) {
665 return_PTR(NULL);
666 }
667
668 /* Get the Namestring argument */
669
670 arg->common.value.name =
671 acpi_ps_get_next_namestring(parser_state);
672 }
673
674 /* Link the buffer/namestring to parent (CONNECTION_OP) */
675
676 acpi_ps_append_arg(field, arg);
562 break; 677 break;
563 678
564 default: 679 default:
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index 01dd70d1de51..9547ad8a620b 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index bed08de7528c..a0226fdcf75c 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -638,7 +638,16 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
638 638
639/* 7E */ ACPI_OP("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, 639/* 7E */ ACPI_OP("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY,
640 AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, 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/*! [End] no source code translation !*/ 652/*! [End] no source code translation !*/
644}; 653};
@@ -657,7 +666,7 @@ static const u8 acpi_gbl_short_op_index[256] = {
657/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 666/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
658/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, 667/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
659/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D, 668/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D,
660/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 669/* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
661/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, 670/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
662/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, 671/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
663/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, 672/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index 9bb0cbd37b5e..2ff9c35a1968 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psscope.c b/drivers/acpi/acpica/psscope.c
index a5faa1323a02..c872aa4b926e 100644
--- a/drivers/acpi/acpica/psscope.c
+++ b/drivers/acpi/acpica/psscope.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/pstree.c b/drivers/acpi/acpica/pstree.c
index f1464c03aa42..2b03cdbbe1c0 100644
--- a/drivers/acpi/acpica/pstree.c
+++ b/drivers/acpi/acpica/pstree.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -74,6 +74,12 @@ union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn)
74 74
75 ACPI_FUNCTION_ENTRY(); 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 /* Get the info structure for this opcode */ 83 /* Get the info structure for this opcode */
78 84
79 op_info = acpi_ps_get_opcode_info(op->common.aml_opcode); 85 op_info = acpi_ps_get_opcode_info(op->common.aml_opcode);
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 7eda78503422..13bb131ae125 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/pswalk.c b/drivers/acpi/acpica/pswalk.c
index 3312d6368bf1..ab96cf47896d 100644
--- a/drivers/acpi/acpica/pswalk.c
+++ b/drivers/acpi/acpica/pswalk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index 8086805d4494..9d98c5ff66a5 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c
index 9e66f9078426..a0305652394f 100644
--- a/drivers/acpi/acpica/rsaddr.c
+++ b/drivers/acpi/acpica/rsaddr.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 3a8a89ec2ca4..3c6df4b7eb2d 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -313,6 +313,38 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
313 resource_source)); 313 resource_source));
314 break; 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 default: 348 default:
317 break; 349 break;
318 } 350 }
@@ -362,10 +394,11 @@ acpi_rs_get_list_length(u8 * aml_buffer,
362 u32 extra_struct_bytes; 394 u32 extra_struct_bytes;
363 u8 resource_index; 395 u8 resource_index;
364 u8 minimum_aml_resource_length; 396 u8 minimum_aml_resource_length;
397 union aml_resource *aml_resource;
365 398
366 ACPI_FUNCTION_TRACE(rs_get_list_length); 399 ACPI_FUNCTION_TRACE(rs_get_list_length);
367 400
368 *size_needed = 0; 401 *size_needed = ACPI_RS_SIZE_MIN; /* Minimum size is one end_tag */
369 end_aml = aml_buffer + aml_buffer_length; 402 end_aml = aml_buffer + aml_buffer_length;
370 403
371 /* Walk the list of AML resource descriptors */ 404 /* Walk the list of AML resource descriptors */
@@ -376,9 +409,15 @@ acpi_rs_get_list_length(u8 * aml_buffer,
376 409
377 status = acpi_ut_validate_resource(aml_buffer, &resource_index); 410 status = acpi_ut_validate_resource(aml_buffer, &resource_index);
378 if (ACPI_FAILURE(status)) { 411 if (ACPI_FAILURE(status)) {
412 /*
413 * Exit on failure. Cannot continue because the descriptor length
414 * may be bogus also.
415 */
379 return_ACPI_STATUS(status); 416 return_ACPI_STATUS(status);
380 } 417 }
381 418
419 aml_resource = (void *)aml_buffer;
420
382 /* Get the resource length and base (minimum) AML size */ 421 /* Get the resource length and base (minimum) AML size */
383 422
384 resource_length = acpi_ut_get_resource_length(aml_buffer); 423 resource_length = acpi_ut_get_resource_length(aml_buffer);
@@ -422,10 +461,8 @@ acpi_rs_get_list_length(u8 * aml_buffer,
422 461
423 case ACPI_RESOURCE_NAME_END_TAG: 462 case ACPI_RESOURCE_NAME_END_TAG:
424 /* 463 /*
425 * End Tag: 464 * End Tag: This is the normal exit
426 * This is the normal exit, add size of end_tag
427 */ 465 */
428 *size_needed += ACPI_RS_SIZE_MIN;
429 return_ACPI_STATUS(AE_OK); 466 return_ACPI_STATUS(AE_OK);
430 467
431 case ACPI_RESOURCE_NAME_ADDRESS32: 468 case ACPI_RESOURCE_NAME_ADDRESS32:
@@ -457,6 +494,33 @@ acpi_rs_get_list_length(u8 * aml_buffer,
457 minimum_aml_resource_length); 494 minimum_aml_resource_length);
458 break; 495 break;
459 496
497 case ACPI_RESOURCE_NAME_GPIO:
498
499 /* Vendor data is optional */
500
501 if (aml_resource->gpio.vendor_length) {
502 extra_struct_bytes +=
503 aml_resource->gpio.vendor_offset -
504 aml_resource->gpio.pin_table_offset +
505 aml_resource->gpio.vendor_length;
506 } else {
507 extra_struct_bytes +=
508 aml_resource->large_header.resource_length +
509 sizeof(struct aml_resource_large_header) -
510 aml_resource->gpio.pin_table_offset;
511 }
512 break;
513
514 case ACPI_RESOURCE_NAME_SERIAL_BUS:
515
516 minimum_aml_resource_length =
517 acpi_gbl_resource_aml_serial_bus_sizes
518 [aml_resource->common_serial_bus.type];
519 extra_struct_bytes +=
520 aml_resource->common_serial_bus.resource_length -
521 minimum_aml_resource_length;
522 break;
523
460 default: 524 default:
461 break; 525 break;
462 } 526 }
@@ -467,9 +531,18 @@ acpi_rs_get_list_length(u8 * aml_buffer,
467 * Important: Round the size up for the appropriate alignment. This 531 * Important: Round the size up for the appropriate alignment. This
468 * is a requirement on IA64. 532 * is a requirement on IA64.
469 */ 533 */
470 buffer_size = acpi_gbl_resource_struct_sizes[resource_index] + 534 if (acpi_ut_get_resource_type(aml_buffer) ==
471 extra_struct_bytes; 535 ACPI_RESOURCE_NAME_SERIAL_BUS) {
472 buffer_size = (u32) ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size); 536 buffer_size =
537 acpi_gbl_resource_struct_serial_bus_sizes
538 [aml_resource->common_serial_bus.type] +
539 extra_struct_bytes;
540 } else {
541 buffer_size =
542 acpi_gbl_resource_struct_sizes[resource_index] +
543 extra_struct_bytes;
544 }
545 buffer_size = (u32)ACPI_ROUND_UP_TO_NATIVE_WORD(buffer_size);
473 546
474 *size_needed += buffer_size; 547 *size_needed += buffer_size;
475 548
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 4ce6e1147e80..46d6eb38ae66 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,70 @@ ACPI_MODULE_NAME("rscreate")
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 ******************************************************************************/
65acpi_status
66acpi_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 * FUNCTION: acpi_rs_create_resource_list 118 * FUNCTION: acpi_rs_create_resource_list
55 * 119 *
56 * PARAMETERS: aml_buffer - Pointer to the resource byte stream 120 * PARAMETERS: aml_buffer - Pointer to the resource byte stream
@@ -66,9 +130,10 @@ ACPI_MODULE_NAME("rscreate")
66 * of device resources. 130 * of device resources.
67 * 131 *
68 ******************************************************************************/ 132 ******************************************************************************/
133
69acpi_status 134acpi_status
70acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, 135acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer,
71 struct acpi_buffer *output_buffer) 136 struct acpi_buffer * output_buffer)
72{ 137{
73 138
74 acpi_status status; 139 acpi_status status;
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index 33db7520c74b..b4c581132393 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,11 +61,13 @@ static void acpi_rs_out_integer64(char *title, u64 value);
61 61
62static void acpi_rs_out_title(char *title); 62static void acpi_rs_out_title(char *title);
63 63
64static void acpi_rs_dump_byte_list(u16 length, u8 * data); 64static void acpi_rs_dump_byte_list(u16 length, u8 *data);
65 65
66static void acpi_rs_dump_dword_list(u8 length, u32 * data); 66static void acpi_rs_dump_word_list(u16 length, u16 *data);
67 67
68static void acpi_rs_dump_short_byte_list(u8 length, u8 * data); 68static void acpi_rs_dump_dword_list(u8 length, u32 *data);
69
70static void acpi_rs_dump_short_byte_list(u8 length, u8 *data);
69 71
70static void 72static void
71acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source); 73acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
@@ -309,6 +311,125 @@ struct acpi_rsdump_info acpi_rs_dump_generic_reg[6] = {
309 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(generic_reg.address), "Address", NULL} 311 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET(generic_reg.address), "Address", NULL}
310}; 312};
311 313
314struct acpi_rsdump_info acpi_rs_dump_gpio[16] = {
315 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_gpio), "GPIO", NULL},
316 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.revision_id), "RevisionId", NULL},
317 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.connection_type),
318 "ConnectionType", acpi_gbl_ct_decode},
319 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(gpio.producer_consumer),
320 "ProducerConsumer", acpi_gbl_consume_decode},
321 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(gpio.pin_config), "PinConfig",
322 acpi_gbl_ppc_decode},
323 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.sharable), "Sharable",
324 acpi_gbl_shr_decode},
325 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.io_restriction),
326 "IoRestriction", acpi_gbl_ior_decode},
327 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(gpio.triggering), "Triggering",
328 acpi_gbl_he_decode},
329 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(gpio.polarity), "Polarity",
330 acpi_gbl_ll_decode},
331 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.drive_strength), "DriveStrength",
332 NULL},
333 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.debounce_timeout),
334 "DebounceTimeout", NULL},
335 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(gpio.resource_source),
336 "ResourceSource", NULL},
337 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.pin_table_length),
338 "PinTableLength", NULL},
339 {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET(gpio.pin_table), "PinTable", NULL},
340 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(gpio.vendor_length), "VendorLength",
341 NULL},
342 {ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(gpio.vendor_data), "VendorData",
343 NULL},
344};
345
346struct acpi_rsdump_info acpi_rs_dump_fixed_dma[4] = {
347 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_dma),
348 "FixedDma", NULL},
349 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_dma.request_lines),
350 "RequestLines", NULL},
351 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(fixed_dma.channels), "Channels",
352 NULL},
353 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(fixed_dma.width), "TransferWidth",
354 acpi_gbl_dts_decode},
355};
356
357#define ACPI_RS_DUMP_COMMON_SERIAL_BUS \
358 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.revision_id), "RevisionId", NULL}, \
359 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.type), "Type", acpi_gbl_sbt_decode}, \
360 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.producer_consumer), "ProducerConsumer", acpi_gbl_consume_decode}, \
361 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (common_serial_bus.slave_mode), "SlaveMode", acpi_gbl_sm_decode}, \
362 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (common_serial_bus.type_revision_id), "TypeRevisionId", NULL}, \
363 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (common_serial_bus.type_data_length), "TypeDataLength", NULL}, \
364 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (common_serial_bus.resource_source), "ResourceSource", NULL}, \
365 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (common_serial_bus.vendor_length), "VendorLength", NULL}, \
366 {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (common_serial_bus.vendor_data), "VendorData", NULL},
367
368struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[10] = {
369 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_common_serial_bus),
370 "Common Serial Bus", NULL},
371 ACPI_RS_DUMP_COMMON_SERIAL_BUS
372};
373
374struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[13] = {
375 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus),
376 "I2C Serial Bus", NULL},
377 ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG,
378 ACPI_RSD_OFFSET(i2c_serial_bus.
379 access_mode),
380 "AccessMode", acpi_gbl_am_decode},
381 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(i2c_serial_bus.connection_speed),
382 "ConnectionSpeed", NULL},
383 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(i2c_serial_bus.slave_address),
384 "SlaveAddress", NULL},
385};
386
387struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[17] = {
388 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_spi_serial_bus),
389 "Spi Serial Bus", NULL},
390 ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_1BITFLAG,
391 ACPI_RSD_OFFSET(spi_serial_bus.
392 wire_mode), "WireMode",
393 acpi_gbl_wm_decode},
394 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(spi_serial_bus.device_polarity),
395 "DevicePolarity", acpi_gbl_dp_decode},
396 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.data_bit_length),
397 "DataBitLength", NULL},
398 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.clock_phase),
399 "ClockPhase", acpi_gbl_cph_decode},
400 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(spi_serial_bus.clock_polarity),
401 "ClockPolarity", acpi_gbl_cpo_decode},
402 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(spi_serial_bus.device_selection),
403 "DeviceSelection", NULL},
404 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(spi_serial_bus.connection_speed),
405 "ConnectionSpeed", NULL},
406};
407
408struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[19] = {
409 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_uart_serial_bus),
410 "Uart Serial Bus", NULL},
411 ACPI_RS_DUMP_COMMON_SERIAL_BUS {ACPI_RSD_2BITFLAG,
412 ACPI_RSD_OFFSET(uart_serial_bus.
413 flow_control),
414 "FlowControl", acpi_gbl_fc_decode},
415 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.stop_bits),
416 "StopBits", acpi_gbl_sb_decode},
417 {ACPI_RSD_3BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.data_bits),
418 "DataBits", acpi_gbl_bpb_decode},
419 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(uart_serial_bus.endian), "Endian",
420 acpi_gbl_ed_decode},
421 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(uart_serial_bus.parity), "Parity",
422 acpi_gbl_pt_decode},
423 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET(uart_serial_bus.lines_enabled),
424 "LinesEnabled", NULL},
425 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(uart_serial_bus.rx_fifo_size),
426 "RxFifoSize", NULL},
427 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET(uart_serial_bus.tx_fifo_size),
428 "TxFifoSize", NULL},
429 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET(uart_serial_bus.default_baud_rate),
430 "ConnectionSpeed", NULL},
431};
432
312/* 433/*
313 * Tables used for common address descriptor flag fields 434 * Tables used for common address descriptor flag fields
314 */ 435 */
@@ -413,7 +534,14 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
413 /* Data items, 8/16/32/64 bit */ 534 /* Data items, 8/16/32/64 bit */
414 535
415 case ACPI_RSD_UINT8: 536 case ACPI_RSD_UINT8:
416 acpi_rs_out_integer8(name, ACPI_GET8(target)); 537 if (table->pointer) {
538 acpi_rs_out_string(name, ACPI_CAST_PTR(char,
539 table->
540 pointer
541 [*target]));
542 } else {
543 acpi_rs_out_integer8(name, ACPI_GET8(target));
544 }
417 break; 545 break;
418 546
419 case ACPI_RSD_UINT16: 547 case ACPI_RSD_UINT16:
@@ -444,6 +572,13 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
444 0x03])); 572 0x03]));
445 break; 573 break;
446 574
575 case ACPI_RSD_3BITFLAG:
576 acpi_rs_out_string(name, ACPI_CAST_PTR(char,
577 table->
578 pointer[*target &
579 0x07]));
580 break;
581
447 case ACPI_RSD_SHORTLIST: 582 case ACPI_RSD_SHORTLIST:
448 /* 583 /*
449 * Short byte list (single line output) for DMA and IRQ resources 584 * Short byte list (single line output) for DMA and IRQ resources
@@ -456,6 +591,20 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
456 } 591 }
457 break; 592 break;
458 593
594 case ACPI_RSD_SHORTLISTX:
595 /*
596 * Short byte list (single line output) for GPIO vendor data
597 * Note: The list length is obtained from the previous table entry
598 */
599 if (previous_target) {
600 acpi_rs_out_title(name);
601 acpi_rs_dump_short_byte_list(*previous_target,
602 *
603 (ACPI_CAST_INDIRECT_PTR
604 (u8, target)));
605 }
606 break;
607
459 case ACPI_RSD_LONGLIST: 608 case ACPI_RSD_LONGLIST:
460 /* 609 /*
461 * Long byte list for Vendor resource data 610 * Long byte list for Vendor resource data
@@ -480,6 +629,18 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
480 } 629 }
481 break; 630 break;
482 631
632 case ACPI_RSD_WORDLIST:
633 /*
634 * Word list for GPIO Pin Table
635 * Note: The list length is obtained from the previous table entry
636 */
637 if (previous_target) {
638 acpi_rs_dump_word_list(*previous_target,
639 *(ACPI_CAST_INDIRECT_PTR
640 (u16, target)));
641 }
642 break;
643
483 case ACPI_RSD_ADDRESS: 644 case ACPI_RSD_ADDRESS:
484 /* 645 /*
485 * Common flags for all Address resources 646 * Common flags for all Address resources
@@ -627,14 +788,20 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
627 788
628 /* Dump the resource descriptor */ 789 /* Dump the resource descriptor */
629 790
630 acpi_rs_dump_descriptor(&resource_list->data, 791 if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
631 acpi_gbl_dump_resource_dispatch[type]); 792 acpi_rs_dump_descriptor(&resource_list->data,
793 acpi_gbl_dump_serial_bus_dispatch
794 [resource_list->data.
795 common_serial_bus.type]);
796 } else {
797 acpi_rs_dump_descriptor(&resource_list->data,
798 acpi_gbl_dump_resource_dispatch
799 [type]);
800 }
632 801
633 /* Point to the next resource structure */ 802 /* Point to the next resource structure */
634 803
635 resource_list = 804 resource_list = ACPI_NEXT_RESOURCE(resource_list);
636 ACPI_ADD_PTR(struct acpi_resource, resource_list,
637 resource_list->length);
638 805
639 /* Exit when END_TAG descriptor is reached */ 806 /* Exit when END_TAG descriptor is reached */
640 807
@@ -768,4 +935,13 @@ static void acpi_rs_dump_dword_list(u8 length, u32 * data)
768 } 935 }
769} 936}
770 937
938static void acpi_rs_dump_word_list(u16 length, u16 *data)
939{
940 u16 i;
941
942 for (i = 0; i < length; i++) {
943 acpi_os_printf("%25s%2.2X : %4.4X\n", "Word", i, data[i]);
944 }
945}
946
771#endif 947#endif
diff --git a/drivers/acpi/acpica/rsinfo.c b/drivers/acpi/acpica/rsinfo.c
index f9ea60872aa4..a9fa5158200b 100644
--- a/drivers/acpi/acpica/rsinfo.c
+++ b/drivers/acpi/acpica/rsinfo.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -76,7 +76,10 @@ struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[] = {
76 acpi_rs_convert_address64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */ 76 acpi_rs_convert_address64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */
77 acpi_rs_convert_ext_address64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 77 acpi_rs_convert_ext_address64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
78 acpi_rs_convert_ext_irq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 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/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ 85/* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
@@ -94,7 +97,7 @@ struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
94 acpi_rs_convert_end_dpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ 97 acpi_rs_convert_end_dpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */
95 acpi_rs_convert_io, /* 0x08, ACPI_RESOURCE_NAME_IO */ 98 acpi_rs_convert_io, /* 0x08, ACPI_RESOURCE_NAME_IO */
96 acpi_rs_convert_fixed_io, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */ 99 acpi_rs_convert_fixed_io, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */
97 NULL, /* 0x0A, Reserved */ 100 acpi_rs_convert_fixed_dma, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */
98 NULL, /* 0x0B, Reserved */ 101 NULL, /* 0x0B, Reserved */
99 NULL, /* 0x0C, Reserved */ 102 NULL, /* 0x0C, Reserved */
100 NULL, /* 0x0D, Reserved */ 103 NULL, /* 0x0D, Reserved */
@@ -114,7 +117,19 @@ struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
114 acpi_rs_convert_address16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */ 117 acpi_rs_convert_address16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */
115 acpi_rs_convert_ext_irq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */ 118 acpi_rs_convert_ext_irq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */
116 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ 119 acpi_rs_convert_address64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
117 acpi_rs_convert_ext_address64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ 120 acpi_rs_convert_ext_address64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
121 acpi_rs_convert_gpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
122 NULL, /* 0x0D, Reserved */
123 NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
124};
125
126/* Subtype table for serial_bus -- I2C, SPI, and UART */
127
128struct acpi_rsconvert_info *acpi_gbl_convert_resource_serial_bus_dispatch[] = {
129 NULL,
130 acpi_rs_convert_i2c_serial_bus,
131 acpi_rs_convert_spi_serial_bus,
132 acpi_rs_convert_uart_serial_bus,
118}; 133};
119 134
120#ifdef ACPI_FUTURE_USAGE 135#ifdef ACPI_FUTURE_USAGE
@@ -140,6 +155,16 @@ struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[] = {
140 acpi_rs_dump_ext_address64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 155 acpi_rs_dump_ext_address64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
141 acpi_rs_dump_ext_irq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 156 acpi_rs_dump_ext_irq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
142 acpi_rs_dump_generic_reg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 157 acpi_rs_dump_generic_reg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
158 acpi_rs_dump_gpio, /* ACPI_RESOURCE_TYPE_GPIO */
159 acpi_rs_dump_fixed_dma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */
160 NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
161};
162
163struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = {
164 NULL,
165 acpi_rs_dump_i2c_serial_bus, /* AML_RESOURCE_I2C_BUS_TYPE */
166 acpi_rs_dump_spi_serial_bus, /* AML_RESOURCE_SPI_BUS_TYPE */
167 acpi_rs_dump_uart_serial_bus, /* AML_RESOURCE_UART_BUS_TYPE */
143}; 168};
144#endif 169#endif
145 170
@@ -166,7 +191,10 @@ const u8 acpi_gbl_aml_resource_sizes[] = {
166 sizeof(struct aml_resource_address64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */ 191 sizeof(struct aml_resource_address64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */
167 sizeof(struct aml_resource_extended_address64), /*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ 192 sizeof(struct aml_resource_extended_address64), /*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */
168 sizeof(struct aml_resource_extended_irq), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ 193 sizeof(struct aml_resource_extended_irq), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */
169 sizeof(struct aml_resource_generic_register) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ 194 sizeof(struct aml_resource_generic_register), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */
195 sizeof(struct aml_resource_gpio), /* ACPI_RESOURCE_TYPE_GPIO */
196 sizeof(struct aml_resource_fixed_dma), /* ACPI_RESOURCE_TYPE_FIXED_DMA */
197 sizeof(struct aml_resource_common_serialbus), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
170}; 198};
171 199
172const u8 acpi_gbl_resource_struct_sizes[] = { 200const u8 acpi_gbl_resource_struct_sizes[] = {
@@ -182,7 +210,7 @@ const u8 acpi_gbl_resource_struct_sizes[] = {
182 ACPI_RS_SIZE_MIN, 210 ACPI_RS_SIZE_MIN,
183 ACPI_RS_SIZE(struct acpi_resource_io), 211 ACPI_RS_SIZE(struct acpi_resource_io),
184 ACPI_RS_SIZE(struct acpi_resource_fixed_io), 212 ACPI_RS_SIZE(struct acpi_resource_fixed_io),
185 0, 213 ACPI_RS_SIZE(struct acpi_resource_fixed_dma),
186 0, 214 0,
187 0, 215 0,
188 0, 216 0,
@@ -202,5 +230,21 @@ const u8 acpi_gbl_resource_struct_sizes[] = {
202 ACPI_RS_SIZE(struct acpi_resource_address16), 230 ACPI_RS_SIZE(struct acpi_resource_address16),
203 ACPI_RS_SIZE(struct acpi_resource_extended_irq), 231 ACPI_RS_SIZE(struct acpi_resource_extended_irq),
204 ACPI_RS_SIZE(struct acpi_resource_address64), 232 ACPI_RS_SIZE(struct acpi_resource_address64),
205 ACPI_RS_SIZE(struct acpi_resource_extended_address64) 233 ACPI_RS_SIZE(struct acpi_resource_extended_address64),
234 ACPI_RS_SIZE(struct acpi_resource_gpio),
235 ACPI_RS_SIZE(struct acpi_resource_common_serialbus)
236};
237
238const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = {
239 0,
240 sizeof(struct aml_resource_i2c_serialbus),
241 sizeof(struct aml_resource_spi_serialbus),
242 sizeof(struct aml_resource_uart_serialbus),
243};
244
245const u8 acpi_gbl_resource_struct_serial_bus_sizes[] = {
246 0,
247 ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus),
248 ACPI_RS_SIZE(struct acpi_resource_spi_serialbus),
249 ACPI_RS_SIZE(struct acpi_resource_uart_serialbus),
206}; 250};
diff --git a/drivers/acpi/acpica/rsio.c b/drivers/acpi/acpica/rsio.c
index 0c7efef008be..f6a081057a22 100644
--- a/drivers/acpi/acpica/rsio.c
+++ b/drivers/acpi/acpica/rsio.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index 50b8ad211167..e23a9ec248cb 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -264,3 +264,34 @@ struct acpi_rsconvert_info acpi_rs_convert_dma[6] = {
264 AML_OFFSET(dma.dma_channel_mask), 264 AML_OFFSET(dma.dma_channel_mask),
265 ACPI_RS_OFFSET(data.dma.channel_count)} 265 ACPI_RS_OFFSET(data.dma.channel_count)}
266}; 266};
267
268/*******************************************************************************
269 *
270 * acpi_rs_convert_fixed_dma
271 *
272 ******************************************************************************/
273
274struct 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
297};
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c
index 1bfcef736c50..9be129f5d6f4 100644
--- a/drivers/acpi/acpica/rslist.c
+++ b/drivers/acpi/acpica/rslist.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -70,6 +70,8 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
70 struct acpi_resource **resource_ptr = 70 struct acpi_resource **resource_ptr =
71 ACPI_CAST_INDIRECT_PTR(struct acpi_resource, context); 71 ACPI_CAST_INDIRECT_PTR(struct acpi_resource, context);
72 struct acpi_resource *resource; 72 struct acpi_resource *resource;
73 union aml_resource *aml_resource;
74 struct acpi_rsconvert_info *conversion_table;
73 acpi_status status; 75 acpi_status status;
74 76
75 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resources); 77 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resources);
@@ -84,14 +86,37 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
84 "Misaligned resource pointer %p", resource)); 86 "Misaligned resource pointer %p", resource));
85 } 87 }
86 88
89 /* Get the appropriate conversion info table */
90
91 aml_resource = ACPI_CAST_PTR(union aml_resource, aml);
92 if (acpi_ut_get_resource_type(aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) {
93 if (aml_resource->common_serial_bus.type >
94 AML_RESOURCE_MAX_SERIALBUSTYPE) {
95 conversion_table = NULL;
96 } else {
97 /* This is an I2C, SPI, or UART serial_bus descriptor */
98
99 conversion_table =
100 acpi_gbl_convert_resource_serial_bus_dispatch
101 [aml_resource->common_serial_bus.type];
102 }
103 } else {
104 conversion_table =
105 acpi_gbl_get_resource_dispatch[resource_index];
106 }
107
108 if (!conversion_table) {
109 ACPI_ERROR((AE_INFO,
110 "Invalid/unsupported resource descriptor: Type 0x%2.2X",
111 resource_index));
112 return (AE_AML_INVALID_RESOURCE_TYPE);
113 }
114
87 /* Convert the AML byte stream resource to a local resource struct */ 115 /* Convert the AML byte stream resource to a local resource struct */
88 116
89 status = 117 status =
90 acpi_rs_convert_aml_to_resource(resource, 118 acpi_rs_convert_aml_to_resource(resource, aml_resource,
91 ACPI_CAST_PTR(union aml_resource, 119 conversion_table);
92 aml),
93 acpi_gbl_get_resource_dispatch
94 [resource_index]);
95 if (ACPI_FAILURE(status)) { 120 if (ACPI_FAILURE(status)) {
96 ACPI_EXCEPTION((AE_INFO, status, 121 ACPI_EXCEPTION((AE_INFO, status,
97 "Could not convert AML resource (Type 0x%X)", 122 "Could not convert AML resource (Type 0x%X)",
@@ -106,7 +131,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
106 131
107 /* Point to the next structure in the output buffer */ 132 /* Point to the next structure in the output buffer */
108 133
109 *resource_ptr = ACPI_ADD_PTR(void, resource, resource->length); 134 *resource_ptr = ACPI_NEXT_RESOURCE(resource);
110 return_ACPI_STATUS(AE_OK); 135 return_ACPI_STATUS(AE_OK);
111} 136}
112 137
@@ -135,6 +160,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
135{ 160{
136 u8 *aml = output_buffer; 161 u8 *aml = output_buffer;
137 u8 *end_aml = output_buffer + aml_size_needed; 162 u8 *end_aml = output_buffer + aml_size_needed;
163 struct acpi_rsconvert_info *conversion_table;
138 acpi_status status; 164 acpi_status status;
139 165
140 ACPI_FUNCTION_TRACE(rs_convert_resources_to_aml); 166 ACPI_FUNCTION_TRACE(rs_convert_resources_to_aml);
@@ -154,11 +180,34 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
154 180
155 /* Perform the conversion */ 181 /* Perform the conversion */
156 182
157 status = acpi_rs_convert_resource_to_aml(resource, ACPI_CAST_PTR(union 183 if (resource->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
158 aml_resource, 184 if (resource->data.common_serial_bus.type >
159 aml), 185 AML_RESOURCE_MAX_SERIALBUSTYPE) {
160 acpi_gbl_set_resource_dispatch 186 conversion_table = NULL;
161 [resource->type]); 187 } else {
188 /* This is an I2C, SPI, or UART serial_bus descriptor */
189
190 conversion_table =
191 acpi_gbl_convert_resource_serial_bus_dispatch
192 [resource->data.common_serial_bus.type];
193 }
194 } else {
195 conversion_table =
196 acpi_gbl_set_resource_dispatch[resource->type];
197 }
198
199 if (!conversion_table) {
200 ACPI_ERROR((AE_INFO,
201 "Invalid/unsupported resource descriptor: Type 0x%2.2X",
202 resource->type));
203 return (AE_AML_INVALID_RESOURCE_TYPE);
204 }
205
206 status = acpi_rs_convert_resource_to_aml(resource,
207 ACPI_CAST_PTR(union
208 aml_resource,
209 aml),
210 conversion_table);
162 if (ACPI_FAILURE(status)) { 211 if (ACPI_FAILURE(status)) {
163 ACPI_EXCEPTION((AE_INFO, status, 212 ACPI_EXCEPTION((AE_INFO, status,
164 "Could not convert resource (type 0x%X) to AML", 213 "Could not convert resource (type 0x%X) to AML",
@@ -192,9 +241,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
192 241
193 /* Point to the next input resource descriptor */ 242 /* Point to the next input resource descriptor */
194 243
195 resource = 244 resource = ACPI_NEXT_RESOURCE(resource);
196 ACPI_ADD_PTR(struct acpi_resource, resource,
197 resource->length);
198 } 245 }
199 246
200 /* Completed buffer, but did not find an end_tag resource descriptor */ 247 /* Completed buffer, but did not find an end_tag resource descriptor */
diff --git a/drivers/acpi/acpica/rsmemory.c b/drivers/acpi/acpica/rsmemory.c
index 7cc6d8625f1e..4fd611ad02b4 100644
--- a/drivers/acpi/acpica/rsmemory.c
+++ b/drivers/acpi/acpica/rsmemory.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index 410264b22a29..8073b371cc7c 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -83,6 +83,10 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
83 83
84 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resource); 84 ACPI_FUNCTION_TRACE(rs_convert_aml_to_resource);
85 85
86 if (!info) {
87 return_ACPI_STATUS(AE_BAD_PARAMETER);
88 }
89
86 if (((acpi_size) resource) & 0x3) { 90 if (((acpi_size) resource) & 0x3) {
87 91
88 /* Each internal resource struct is expected to be 32-bit aligned */ 92 /* Each internal resource struct is expected to be 32-bit aligned */
@@ -101,7 +105,6 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
101 * table length (# of table entries) 105 * table length (# of table entries)
102 */ 106 */
103 count = INIT_TABLE_LENGTH(info); 107 count = INIT_TABLE_LENGTH(info);
104
105 while (count) { 108 while (count) {
106 /* 109 /*
107 * Source is the external AML byte stream buffer, 110 * Source is the external AML byte stream buffer,
@@ -145,6 +148,14 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
145 ((ACPI_GET8(source) >> info->value) & 0x03); 148 ((ACPI_GET8(source) >> info->value) & 0x03);
146 break; 149 break;
147 150
151 case ACPI_RSC_3BITFLAG:
152 /*
153 * Mask and shift the flag bits
154 */
155 ACPI_SET8(destination) = (u8)
156 ((ACPI_GET8(source) >> info->value) & 0x07);
157 break;
158
148 case ACPI_RSC_COUNT: 159 case ACPI_RSC_COUNT:
149 160
150 item_count = ACPI_GET8(source); 161 item_count = ACPI_GET8(source);
@@ -163,6 +174,69 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
163 (info->value * (item_count - 1)); 174 (info->value * (item_count - 1));
164 break; 175 break;
165 176
177 case ACPI_RSC_COUNT_GPIO_PIN:
178
179 target = ACPI_ADD_PTR(void, aml, info->value);
180 item_count = ACPI_GET16(target) - ACPI_GET16(source);
181
182 resource->length = resource->length + item_count;
183 item_count = item_count / 2;
184 ACPI_SET16(destination) = item_count;
185 break;
186
187 case ACPI_RSC_COUNT_GPIO_VEN:
188
189 item_count = ACPI_GET8(source);
190 ACPI_SET8(destination) = (u8)item_count;
191
192 resource->length = resource->length +
193 (info->value * item_count);
194 break;
195
196 case ACPI_RSC_COUNT_GPIO_RES:
197
198 /*
199 * Vendor data is optional (length/offset may both be zero)
200 * Examine vendor data length field first
201 */
202 target = ACPI_ADD_PTR(void, aml, (info->value + 2));
203 if (ACPI_GET16(target)) {
204
205 /* Use vendor offset to get resource source length */
206
207 target = ACPI_ADD_PTR(void, aml, info->value);
208 item_count =
209 ACPI_GET16(target) - ACPI_GET16(source);
210 } else {
211 /* No vendor data to worry about */
212
213 item_count = aml->large_header.resource_length +
214 sizeof(struct aml_resource_large_header) -
215 ACPI_GET16(source);
216 }
217
218 resource->length = resource->length + item_count;
219 ACPI_SET16(destination) = item_count;
220 break;
221
222 case ACPI_RSC_COUNT_SERIAL_VEN:
223
224 item_count = ACPI_GET16(source) - info->value;
225
226 resource->length = resource->length + item_count;
227 ACPI_SET16(destination) = item_count;
228 break;
229
230 case ACPI_RSC_COUNT_SERIAL_RES:
231
232 item_count = (aml_resource_length +
233 sizeof(struct aml_resource_large_header))
234 - ACPI_GET16(source) - info->value;
235
236 resource->length = resource->length + item_count;
237 ACPI_SET16(destination) = item_count;
238 break;
239
166 case ACPI_RSC_LENGTH: 240 case ACPI_RSC_LENGTH:
167 241
168 resource->length = resource->length + info->value; 242 resource->length = resource->length + info->value;
@@ -183,6 +257,72 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
183 info->opcode); 257 info->opcode);
184 break; 258 break;
185 259
260 case ACPI_RSC_MOVE_GPIO_PIN:
261
262 /* Generate and set the PIN data pointer */
263
264 target = (char *)ACPI_ADD_PTR(void, resource,
265 (resource->length -
266 item_count * 2));
267 *(u16 **)destination = ACPI_CAST_PTR(u16, target);
268
269 /* Copy the PIN data */
270
271 source = ACPI_ADD_PTR(void, aml, ACPI_GET16(source));
272 acpi_rs_move_data(target, source, item_count,
273 info->opcode);
274 break;
275
276 case ACPI_RSC_MOVE_GPIO_RES:
277
278 /* Generate and set the resource_source string pointer */
279
280 target = (char *)ACPI_ADD_PTR(void, resource,
281 (resource->length -
282 item_count));
283 *(u8 **)destination = ACPI_CAST_PTR(u8, target);
284
285 /* Copy the resource_source string */
286
287 source = ACPI_ADD_PTR(void, aml, ACPI_GET16(source));
288 acpi_rs_move_data(target, source, item_count,
289 info->opcode);
290 break;
291
292 case ACPI_RSC_MOVE_SERIAL_VEN:
293
294 /* Generate and set the Vendor Data pointer */
295
296 target = (char *)ACPI_ADD_PTR(void, resource,
297 (resource->length -
298 item_count));
299 *(u8 **)destination = ACPI_CAST_PTR(u8, target);
300
301 /* Copy the Vendor Data */
302
303 source = ACPI_ADD_PTR(void, aml, info->value);
304 acpi_rs_move_data(target, source, item_count,
305 info->opcode);
306 break;
307
308 case ACPI_RSC_MOVE_SERIAL_RES:
309
310 /* Generate and set the resource_source string pointer */
311
312 target = (char *)ACPI_ADD_PTR(void, resource,
313 (resource->length -
314 item_count));
315 *(u8 **)destination = ACPI_CAST_PTR(u8, target);
316
317 /* Copy the resource_source string */
318
319 source =
320 ACPI_ADD_PTR(void, aml,
321 (ACPI_GET16(source) + info->value));
322 acpi_rs_move_data(target, source, item_count,
323 info->opcode);
324 break;
325
186 case ACPI_RSC_SET8: 326 case ACPI_RSC_SET8:
187 327
188 ACPI_MEMSET(destination, info->aml_offset, info->value); 328 ACPI_MEMSET(destination, info->aml_offset, info->value);
@@ -219,13 +359,18 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
219 * Optional resource_source (Index and String). This is the more 359 * Optional resource_source (Index and String). This is the more
220 * complicated case used by the Interrupt() macro 360 * complicated case used by the Interrupt() macro
221 */ 361 */
222 target = 362 target = ACPI_ADD_PTR(char, resource,
223 ACPI_ADD_PTR(char, resource, 363 info->aml_offset +
224 info->aml_offset + (item_count * 4)); 364 (item_count * 4));
225 365
226 resource->length += 366 resource->length +=
227 acpi_rs_get_resource_source(aml_resource_length, 367 acpi_rs_get_resource_source(aml_resource_length,
228 (acpi_rs_length) (((item_count - 1) * sizeof(u32)) + info->value), destination, aml, target); 368 (acpi_rs_length)
369 (((item_count -
370 1) * sizeof(u32)) +
371 info->value),
372 destination, aml,
373 target);
229 break; 374 break;
230 375
231 case ACPI_RSC_BITMASK: 376 case ACPI_RSC_BITMASK:
@@ -327,6 +472,7 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
327{ 472{
328 void *source = NULL; 473 void *source = NULL;
329 void *destination; 474 void *destination;
475 char *target;
330 acpi_rsdesc_size aml_length = 0; 476 acpi_rsdesc_size aml_length = 0;
331 u8 count; 477 u8 count;
332 u16 temp16 = 0; 478 u16 temp16 = 0;
@@ -334,6 +480,10 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
334 480
335 ACPI_FUNCTION_TRACE(rs_convert_resource_to_aml); 481 ACPI_FUNCTION_TRACE(rs_convert_resource_to_aml);
336 482
483 if (!info) {
484 return_ACPI_STATUS(AE_BAD_PARAMETER);
485 }
486
337 /* 487 /*
338 * First table entry must be ACPI_RSC_INITxxx and must contain the 488 * First table entry must be ACPI_RSC_INITxxx and must contain the
339 * table length (# of table entries) 489 * table length (# of table entries)
@@ -383,6 +533,14 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
383 ((ACPI_GET8(source) & 0x03) << info->value); 533 ((ACPI_GET8(source) & 0x03) << info->value);
384 break; 534 break;
385 535
536 case ACPI_RSC_3BITFLAG:
537 /*
538 * Mask and shift the flag bits
539 */
540 ACPI_SET8(destination) |= (u8)
541 ((ACPI_GET8(source) & 0x07) << info->value);
542 break;
543
386 case ACPI_RSC_COUNT: 544 case ACPI_RSC_COUNT:
387 545
388 item_count = ACPI_GET8(source); 546 item_count = ACPI_GET8(source);
@@ -400,6 +558,63 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
400 acpi_rs_set_resource_length(aml_length, aml); 558 acpi_rs_set_resource_length(aml_length, aml);
401 break; 559 break;
402 560
561 case ACPI_RSC_COUNT_GPIO_PIN:
562
563 item_count = ACPI_GET16(source);
564 ACPI_SET16(destination) = (u16)aml_length;
565
566 aml_length = (u16)(aml_length + item_count * 2);
567 target = ACPI_ADD_PTR(void, aml, info->value);
568 ACPI_SET16(target) = (u16)aml_length;
569 acpi_rs_set_resource_length(aml_length, aml);
570 break;
571
572 case ACPI_RSC_COUNT_GPIO_VEN:
573
574 item_count = ACPI_GET16(source);
575 ACPI_SET16(destination) = (u16)item_count;
576
577 aml_length =
578 (u16)(aml_length + (info->value * item_count));
579 acpi_rs_set_resource_length(aml_length, aml);
580 break;
581
582 case ACPI_RSC_COUNT_GPIO_RES:
583
584 /* Set resource source string length */
585
586 item_count = ACPI_GET16(source);
587 ACPI_SET16(destination) = (u16)aml_length;
588
589 /* Compute offset for the Vendor Data */
590
591 aml_length = (u16)(aml_length + item_count);
592 target = ACPI_ADD_PTR(void, aml, info->value);
593
594 /* Set vendor offset only if there is vendor data */
595
596 if (resource->data.gpio.vendor_length) {
597 ACPI_SET16(target) = (u16)aml_length;
598 }
599
600 acpi_rs_set_resource_length(aml_length, aml);
601 break;
602
603 case ACPI_RSC_COUNT_SERIAL_VEN:
604
605 item_count = ACPI_GET16(source);
606 ACPI_SET16(destination) = item_count + info->value;
607 aml_length = (u16)(aml_length + item_count);
608 acpi_rs_set_resource_length(aml_length, aml);
609 break;
610
611 case ACPI_RSC_COUNT_SERIAL_RES:
612
613 item_count = ACPI_GET16(source);
614 aml_length = (u16)(aml_length + item_count);
615 acpi_rs_set_resource_length(aml_length, aml);
616 break;
617
403 case ACPI_RSC_LENGTH: 618 case ACPI_RSC_LENGTH:
404 619
405 acpi_rs_set_resource_length(info->value, aml); 620 acpi_rs_set_resource_length(info->value, aml);
@@ -417,6 +632,48 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
417 info->opcode); 632 info->opcode);
418 break; 633 break;
419 634
635 case ACPI_RSC_MOVE_GPIO_PIN:
636
637 destination = (char *)ACPI_ADD_PTR(void, aml,
638 ACPI_GET16
639 (destination));
640 source = *(u16 **)source;
641 acpi_rs_move_data(destination, source, item_count,
642 info->opcode);
643 break;
644
645 case ACPI_RSC_MOVE_GPIO_RES:
646
647 /* Used for both resource_source string and vendor_data */
648
649 destination = (char *)ACPI_ADD_PTR(void, aml,
650 ACPI_GET16
651 (destination));
652 source = *(u8 **)source;
653 acpi_rs_move_data(destination, source, item_count,
654 info->opcode);
655 break;
656
657 case ACPI_RSC_MOVE_SERIAL_VEN:
658
659 destination = (char *)ACPI_ADD_PTR(void, aml,
660 (aml_length -
661 item_count));
662 source = *(u8 **)source;
663 acpi_rs_move_data(destination, source, item_count,
664 info->opcode);
665 break;
666
667 case ACPI_RSC_MOVE_SERIAL_RES:
668
669 destination = (char *)ACPI_ADD_PTR(void, aml,
670 (aml_length -
671 item_count));
672 source = *(u8 **)source;
673 acpi_rs_move_data(destination, source, item_count,
674 info->opcode);
675 break;
676
420 case ACPI_RSC_ADDRESS: 677 case ACPI_RSC_ADDRESS:
421 678
422 /* Set the Resource Type, General Flags, and Type-Specific Flags */ 679 /* Set the Resource Type, General Flags, and Type-Specific Flags */
diff --git a/drivers/acpi/acpica/rsserial.c b/drivers/acpi/acpica/rsserial.c
new file mode 100644
index 000000000000..9aa5e689b444
--- /dev/null
+++ b/drivers/acpi/acpica/rsserial.c
@@ -0,0 +1,441 @@
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
49ACPI_MODULE_NAME("rsserial")
50
51/*******************************************************************************
52 *
53 * acpi_rs_convert_gpio
54 *
55 ******************************************************************************/
56struct 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
150struct 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
236struct 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
338struct 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};
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 231811e56939..433a375deb93 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -144,6 +144,9 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
144 * since there are no alignment or endian issues 144 * since there are no alignment or endian issues
145 */ 145 */
146 case ACPI_RSC_MOVE8: 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 ACPI_MEMCPY(destination, source, item_count); 150 ACPI_MEMCPY(destination, source, item_count);
148 return; 151 return;
149 152
@@ -153,6 +156,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
153 * misaligned memory transfers 156 * misaligned memory transfers
154 */ 157 */
155 case ACPI_RSC_MOVE16: 158 case ACPI_RSC_MOVE16:
159 case ACPI_RSC_MOVE_GPIO_PIN:
156 ACPI_MOVE_16_TO_16(&ACPI_CAST_PTR(u16, destination)[i], 160 ACPI_MOVE_16_TO_16(&ACPI_CAST_PTR(u16, destination)[i],
157 &ACPI_CAST_PTR(u16, source)[i]); 161 &ACPI_CAST_PTR(u16, source)[i]);
158 break; 162 break;
@@ -590,6 +594,56 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node,
590 594
591/******************************************************************************* 595/*******************************************************************************
592 * 596 *
597 * FUNCTION: acpi_rs_get_aei_method_data
598 *
599 * PARAMETERS: Node - Device node
600 * ret_buffer - Pointer to a buffer structure for the
601 * results
602 *
603 * RETURN: Status
604 *
605 * DESCRIPTION: This function is called to get the _AEI value of an object
606 * contained in an object specified by the handle passed in
607 *
608 * If the function fails an appropriate status will be returned
609 * and the contents of the callers buffer is undefined.
610 *
611 ******************************************************************************/
612
613acpi_status
614acpi_rs_get_aei_method_data(struct acpi_namespace_node *node,
615 struct acpi_buffer *ret_buffer)
616{
617 union acpi_operand_object *obj_desc;
618 acpi_status status;
619
620 ACPI_FUNCTION_TRACE(rs_get_aei_method_data);
621
622 /* Parameters guaranteed valid by caller */
623
624 /* Execute the method, no parameters */
625
626 status = acpi_ut_evaluate_object(node, METHOD_NAME__AEI,
627 ACPI_BTYPE_BUFFER, &obj_desc);
628 if (ACPI_FAILURE(status)) {
629 return_ACPI_STATUS(status);
630 }
631
632 /*
633 * Make the call to create a resource linked list from the
634 * byte stream buffer that comes back from the _CRS method
635 * execution.
636 */
637 status = acpi_rs_create_resource_list(obj_desc, ret_buffer);
638
639 /* On exit, we must delete the object returned by evaluate_object */
640
641 acpi_ut_remove_reference(obj_desc);
642 return_ACPI_STATUS(status);
643}
644
645/*******************************************************************************
646 *
593 * FUNCTION: acpi_rs_get_method_data 647 * FUNCTION: acpi_rs_get_method_data
594 * 648 *
595 * PARAMETERS: Handle - Handle to the containing object 649 * PARAMETERS: Handle - Handle to the containing object
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index fe86b37b16ce..f58c098c7aeb 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -307,6 +307,46 @@ acpi_set_current_resources(acpi_handle device_handle,
307 307
308ACPI_EXPORT_SYMBOL(acpi_set_current_resources) 308ACPI_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 ******************************************************************************/
328acpi_status
329acpi_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
348ACPI_EXPORT_SYMBOL(acpi_get_event_resources)
349
310/****************************************************************************** 350/******************************************************************************
311 * 351 *
312 * FUNCTION: acpi_resource_to_address64 352 * FUNCTION: acpi_resource_to_address64
@@ -486,8 +526,9 @@ acpi_rs_match_vendor_resource(struct acpi_resource *resource, void *context)
486 * 526 *
487 * PARAMETERS: device_handle - Handle to the device object for the 527 * PARAMETERS: device_handle - Handle to the device object for the
488 * device we are querying 528 * device we are querying
489 * Name - Method name of the resources we want 529 * Name - Method name of the resources we want.
490 * (METHOD_NAME__CRS or METHOD_NAME__PRS) 530 * (METHOD_NAME__CRS, METHOD_NAME__PRS, or
531 * METHOD_NAME__AEI)
491 * user_function - Called for each resource 532 * user_function - Called for each resource
492 * Context - Passed to user_function 533 * Context - Passed to user_function
493 * 534 *
@@ -514,11 +555,12 @@ acpi_walk_resources(acpi_handle device_handle,
514 555
515 if (!device_handle || !user_function || !name || 556 if (!device_handle || !user_function || !name ||
516 (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) && 557 (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) &&
517 !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS))) { 558 !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) &&
559 !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI))) {
518 return_ACPI_STATUS(AE_BAD_PARAMETER); 560 return_ACPI_STATUS(AE_BAD_PARAMETER);
519 } 561 }
520 562
521 /* Get the _CRS or _PRS resource list */ 563 /* Get the _CRS/_PRS/_AEI resource list */
522 564
523 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; 565 buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
524 status = acpi_rs_get_method_data(device_handle, name, &buffer); 566 status = acpi_rs_get_method_data(device_handle, name, &buffer);
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 6f5588e62c0a..c5d870406f41 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -63,14 +63,15 @@ static void acpi_tb_setup_fadt_registers(void);
63 63
64typedef struct acpi_fadt_info { 64typedef struct acpi_fadt_info {
65 char *name; 65 char *name;
66 u8 address64; 66 u16 address64;
67 u8 address32; 67 u16 address32;
68 u8 length; 68 u16 length;
69 u8 default_length; 69 u8 default_length;
70 u8 type; 70 u8 type;
71 71
72} acpi_fadt_info; 72} acpi_fadt_info;
73 73
74#define ACPI_FADT_OPTIONAL 0
74#define ACPI_FADT_REQUIRED 1 75#define ACPI_FADT_REQUIRED 1
75#define ACPI_FADT_SEPARATE_LENGTH 2 76#define ACPI_FADT_SEPARATE_LENGTH 2
76 77
@@ -87,7 +88,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
87 ACPI_FADT_OFFSET(pm1b_event_block), 88 ACPI_FADT_OFFSET(pm1b_event_block),
88 ACPI_FADT_OFFSET(pm1_event_length), 89 ACPI_FADT_OFFSET(pm1_event_length),
89 ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */ 90 ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */
90 0}, 91 ACPI_FADT_OPTIONAL},
91 92
92 {"Pm1aControlBlock", 93 {"Pm1aControlBlock",
93 ACPI_FADT_OFFSET(xpm1a_control_block), 94 ACPI_FADT_OFFSET(xpm1a_control_block),
@@ -101,7 +102,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
101 ACPI_FADT_OFFSET(pm1b_control_block), 102 ACPI_FADT_OFFSET(pm1b_control_block),
102 ACPI_FADT_OFFSET(pm1_control_length), 103 ACPI_FADT_OFFSET(pm1_control_length),
103 ACPI_PM1_REGISTER_WIDTH, 104 ACPI_PM1_REGISTER_WIDTH,
104 0}, 105 ACPI_FADT_OPTIONAL},
105 106
106 {"Pm2ControlBlock", 107 {"Pm2ControlBlock",
107 ACPI_FADT_OFFSET(xpm2_control_block), 108 ACPI_FADT_OFFSET(xpm2_control_block),
@@ -139,7 +140,7 @@ static struct acpi_fadt_info fadt_info_table[] = {
139 140
140typedef struct acpi_fadt_pm_info { 141typedef struct acpi_fadt_pm_info {
141 struct acpi_generic_address *target; 142 struct acpi_generic_address *target;
142 u8 source; 143 u16 source;
143 u8 register_num; 144 u8 register_num;
144 145
145} acpi_fadt_pm_info; 146} acpi_fadt_pm_info;
@@ -253,8 +254,13 @@ void acpi_tb_parse_fadt(u32 table_index)
253 acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt, 254 acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
254 ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT); 255 ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
255 256
256 acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs, 257 /* If Hardware Reduced flag is set, there is no FACS */
257 ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); 258
259 if (!acpi_gbl_reduced_hardware) {
260 acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.
261 Xfacs, ACPI_SIG_FACS,
262 ACPI_TABLE_INDEX_FACS);
263 }
258} 264}
259 265
260/******************************************************************************* 266/*******************************************************************************
@@ -277,12 +283,12 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
277{ 283{
278 /* 284 /*
279 * Check if the FADT is larger than the largest table that we expect 285 * Check if the FADT is larger than the largest table that we expect
280 * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue 286 * (the ACPI 5.0 version). If so, truncate the table, and issue
281 * a warning. 287 * a warning.
282 */ 288 */
283 if (length > sizeof(struct acpi_table_fadt)) { 289 if (length > sizeof(struct acpi_table_fadt)) {
284 ACPI_WARNING((AE_INFO, 290 ACPI_WARNING((AE_INFO,
285 "FADT (revision %u) is longer than ACPI 2.0 version, " 291 "FADT (revision %u) is longer than ACPI 5.0 version, "
286 "truncating length %u to %u", 292 "truncating length %u to %u",
287 table->revision, length, 293 table->revision, length,
288 (u32)sizeof(struct acpi_table_fadt))); 294 (u32)sizeof(struct acpi_table_fadt)));
@@ -297,6 +303,13 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
297 ACPI_MEMCPY(&acpi_gbl_FADT, table, 303 ACPI_MEMCPY(&acpi_gbl_FADT, table,
298 ACPI_MIN(length, sizeof(struct acpi_table_fadt))); 304 ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
299 305
306 /* Take a copy of the Hardware Reduced flag */
307
308 acpi_gbl_reduced_hardware = FALSE;
309 if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) {
310 acpi_gbl_reduced_hardware = TRUE;
311 }
312
300 /* Convert the local copy of the FADT to the common internal format */ 313 /* Convert the local copy of the FADT to the common internal format */
301 314
302 acpi_tb_convert_fadt(); 315 acpi_tb_convert_fadt();
@@ -502,6 +515,12 @@ static void acpi_tb_validate_fadt(void)
502 acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt; 515 acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
503 } 516 }
504 517
518 /* If Hardware Reduced flag is set, we are all done */
519
520 if (acpi_gbl_reduced_hardware) {
521 return;
522 }
523
505 /* Examine all of the 64-bit extended address fields (X fields) */ 524 /* Examine all of the 64-bit extended address fields (X fields) */
506 525
507 for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { 526 for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c
index a55cb2bb5abb..4903e36ea75a 100644
--- a/drivers/acpi/acpica/tbfind.c
+++ b/drivers/acpi/acpica/tbfind.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 62365f6075dd..1aecf7baa4e0 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 0f2d395feaba..09ca39e14337 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -135,6 +135,13 @@ acpi_status acpi_tb_initialize_facs(void)
135{ 135{
136 acpi_status status; 136 acpi_status status;
137 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 }
144
138 status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, 145 status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
139 ACPI_CAST_INDIRECT_PTR(struct 146 ACPI_CAST_INDIRECT_PTR(struct
140 acpi_table_header, 147 acpi_table_header,
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index e7d13f5d3f2d..abcc6412c244 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2011, Intel Corp. 9 * Copyright (C) 2000 - 2012, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 7eb6c6cc1edf..4258f647ca3d 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
new file mode 100644
index 000000000000..67932aebe6dd
--- /dev/null
+++ b/drivers/acpi/acpica/utaddress.c
@@ -0,0 +1,294 @@
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
49ACPI_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 ******************************************************************************/
74acpi_status
75acpi_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
136void
137acpi_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
204u32
205acpi_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
275void 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}
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c
index 0a697351cf69..9982d2ea66fb 100644
--- a/drivers/acpi/acpica/utalloc.c
+++ b/drivers/acpi/acpica/utalloc.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index aded299a2fa8..3317c0a406ee 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index a1f8d7509e66..a0998a886318 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 8b087e2d64f4..d42ede5260c7 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -171,7 +171,9 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
171 "SMBus", 171 "SMBus",
172 "SystemCMOS", 172 "SystemCMOS",
173 "PCIBARTarget", 173 "PCIBARTarget",
174 "IPMI" 174 "IPMI",
175 "GeneralPurposeIo",
176 "GenericSerialBus"
175}; 177};
176 178
177char *acpi_ut_get_region_name(u8 space_id) 179char *acpi_ut_get_region_name(u8 space_id)
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index 31f5a7832ef1..2a6c3e183697 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -215,11 +215,14 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
215 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS, 215 ACPI_DEBUG_PRINT((ACPI_DB_ALLOCATIONS,
216 "***** Region %p\n", object)); 216 "***** Region %p\n", object));
217 217
218 /* Invalidate the region address/length via the host OS */ 218 /*
219 219 * Update address_range list. However, only permanent regions
220 acpi_os_invalidate_address(object->region.space_id, 220 * are installed in this list. (Not created within a method)
221 object->region.address, 221 */
222 (acpi_size) object->region.length); 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 second_desc = acpi_ns_get_secondary_object(object); 227 second_desc = acpi_ns_get_secondary_object(object);
225 if (second_desc) { 228 if (second_desc) {
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index 18f73c9d10bc..479f32b33415 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index ffba0a39c3e8..4153584cf526 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -264,6 +264,12 @@ acpi_status acpi_ut_init_globals(void)
264 return_ACPI_STATUS(status); 264 return_ACPI_STATUS(status);
265 } 265 }
266 266
267 /* Address Range lists */
268
269 for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) {
270 acpi_gbl_address_range_list[i] = NULL;
271 }
272
267 /* Mutex locked flags */ 273 /* Mutex locked flags */
268 274
269 for (i = 0; i < ACPI_NUM_MUTEX; i++) { 275 for (i = 0; i < ACPI_NUM_MUTEX; i++) {
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c
index b679ea693545..c92eb1d93785 100644
--- a/drivers/acpi/acpica/utids.c
+++ b/drivers/acpi/acpica/utids.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utinit.c b/drivers/acpi/acpica/utinit.c
index 191b6828cce9..8359c0c5dc98 100644
--- a/drivers/acpi/acpica/utinit.c
+++ b/drivers/acpi/acpica/utinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -92,6 +92,7 @@ static void acpi_ut_terminate(void)
92 gpe_xrupt_info = next_gpe_xrupt_info; 92 gpe_xrupt_info = next_gpe_xrupt_info;
93 } 93 }
94 94
95 acpi_ut_delete_address_lists();
95 return_VOID; 96 return_VOID;
96} 97}
97 98
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c
index f6bb75c6faf5..155fd786d0f2 100644
--- a/drivers/acpi/acpica/utlock.c
+++ b/drivers/acpi/acpica/utlock.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c
index ce481da9bb45..2491a552b0e6 100644
--- a/drivers/acpi/acpica/utmath.c
+++ b/drivers/acpi/acpica/utmath.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index c33a852d4f42..86f19db74e05 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c
index 7d797e2baecd..43174df33121 100644
--- a/drivers/acpi/acpica/utmutex.c
+++ b/drivers/acpi/acpica/utmutex.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -293,14 +293,10 @@ acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id)
293 293
294acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id) 294acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
295{ 295{
296 acpi_thread_id this_thread_id;
297
298 ACPI_FUNCTION_NAME(ut_release_mutex); 296 ACPI_FUNCTION_NAME(ut_release_mutex);
299 297
300 this_thread_id = acpi_os_get_thread_id();
301
302 ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", 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 acpi_ut_get_mutex_name(mutex_id))); 300 acpi_ut_get_mutex_name(mutex_id)));
305 301
306 if (mutex_id > ACPI_MAX_MUTEX) { 302 if (mutex_id > ACPI_MAX_MUTEX) {
@@ -329,7 +325,8 @@ acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id)
329 * the ACPI subsystem code. 325 * the ACPI subsystem code.
330 */ 326 */
331 for (i = mutex_id; i < ACPI_NUM_MUTEX; i++) { 327 for (i = mutex_id; i < ACPI_NUM_MUTEX; i++) {
332 if (acpi_gbl_mutex_info[i].thread_id == this_thread_id) { 328 if (acpi_gbl_mutex_info[i].thread_id ==
329 acpi_os_get_thread_id()) {
333 if (i == mutex_id) { 330 if (i == mutex_id) {
334 continue; 331 continue;
335 } 332 }
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index 188340a017b4..b112744fc9ae 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 1fb10cb8f11d..2360cf70c18c 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index 6ffd3a8bdaa5..9d441ea70305 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
43 43
44#include <acpi/acpi.h> 44#include <acpi/acpi.h>
45#include "accommon.h" 45#include "accommon.h"
46#include "amlresrc.h" 46#include "acresrc.h"
47 47
48#define _COMPONENT ACPI_UTILITIES 48#define _COMPONENT ACPI_UTILITIES
49ACPI_MODULE_NAME("utresrc") 49ACPI_MODULE_NAME("utresrc")
@@ -154,6 +154,138 @@ const char *acpi_gbl_typ_decode[] = {
154 "TypeF" 154 "TypeF"
155}; 155};
156 156
157const char *acpi_gbl_ppc_decode[] = {
158 "PullDefault",
159 "PullUp",
160 "PullDown",
161 "PullNone"
162};
163
164const char *acpi_gbl_ior_decode[] = {
165 "IoRestrictionNone",
166 "IoRestrictionInputOnly",
167 "IoRestrictionOutputOnly",
168 "IoRestrictionNoneAndPreserve"
169};
170
171const char *acpi_gbl_dts_decode[] = {
172 "Width8bit",
173 "Width16bit",
174 "Width32bit",
175 "Width64bit",
176 "Width128bit",
177 "Width256bit",
178};
179
180/* GPIO connection type */
181
182const char *acpi_gbl_ct_decode[] = {
183 "Interrupt",
184 "I/O"
185};
186
187/* Serial bus type */
188
189const 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
198const char *acpi_gbl_am_decode[] = {
199 "AddressingMode7Bit",
200 "AddressingMode10Bit"
201};
202
203/* I2C serial bus slave mode */
204
205const char *acpi_gbl_sm_decode[] = {
206 "ControllerInitiated",
207 "DeviceInitiated"
208};
209
210/* SPI serial bus wire mode */
211
212const char *acpi_gbl_wm_decode[] = {
213 "FourWireMode",
214 "ThreeWireMode"
215};
216
217/* SPI serial clock phase */
218
219const char *acpi_gbl_cph_decode[] = {
220 "ClockPhaseFirst",
221 "ClockPhaseSecond"
222};
223
224/* SPI serial bus clock polarity */
225
226const char *acpi_gbl_cpo_decode[] = {
227 "ClockPolarityLow",
228 "ClockPolarityHigh"
229};
230
231/* SPI serial bus device polarity */
232
233const char *acpi_gbl_dp_decode[] = {
234 "PolarityLow",
235 "PolarityHigh"
236};
237
238/* UART serial bus endian */
239
240const char *acpi_gbl_ed_decode[] = {
241 "LittleEndian",
242 "BigEndian"
243};
244
245/* UART serial bus bits per byte */
246
247const 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
260const char *acpi_gbl_sb_decode[] = {
261 "StopBitsNone",
262 "StopBitsOne",
263 "StopBitsOnePlusHalf",
264 "StopBitsTwo"
265};
266
267/* UART serial bus flow control */
268
269const 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
278const 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#endif 289#endif
158 290
159/* 291/*
@@ -173,7 +305,7 @@ const u8 acpi_gbl_resource_aml_sizes[] = {
173 ACPI_AML_SIZE_SMALL(struct aml_resource_end_dependent), 305 ACPI_AML_SIZE_SMALL(struct aml_resource_end_dependent),
174 ACPI_AML_SIZE_SMALL(struct aml_resource_io), 306 ACPI_AML_SIZE_SMALL(struct aml_resource_io),
175 ACPI_AML_SIZE_SMALL(struct aml_resource_fixed_io), 307 ACPI_AML_SIZE_SMALL(struct aml_resource_fixed_io),
176 0, 308 ACPI_AML_SIZE_SMALL(struct aml_resource_fixed_dma),
177 0, 309 0,
178 0, 310 0,
179 0, 311 0,
@@ -193,7 +325,17 @@ const u8 acpi_gbl_resource_aml_sizes[] = {
193 ACPI_AML_SIZE_LARGE(struct aml_resource_address16), 325 ACPI_AML_SIZE_LARGE(struct aml_resource_address16),
194 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_irq), 326 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_irq),
195 ACPI_AML_SIZE_LARGE(struct aml_resource_address64), 327 ACPI_AML_SIZE_LARGE(struct aml_resource_address64),
196 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64) 328 ACPI_AML_SIZE_LARGE(struct aml_resource_extended_address64),
329 ACPI_AML_SIZE_LARGE(struct aml_resource_gpio),
330 0,
331 ACPI_AML_SIZE_LARGE(struct aml_resource_common_serialbus),
332};
333
334const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = {
335 0,
336 ACPI_AML_SIZE_LARGE(struct aml_resource_i2c_serialbus),
337 ACPI_AML_SIZE_LARGE(struct aml_resource_spi_serialbus),
338 ACPI_AML_SIZE_LARGE(struct aml_resource_uart_serialbus),
197}; 339};
198 340
199/* 341/*
@@ -209,35 +351,49 @@ static const u8 acpi_gbl_resource_types[] = {
209 0, 351 0,
210 0, 352 0,
211 0, 353 0,
212 ACPI_SMALL_VARIABLE_LENGTH, 354 ACPI_SMALL_VARIABLE_LENGTH, /* 04 IRQ */
213 ACPI_FIXED_LENGTH, 355 ACPI_FIXED_LENGTH, /* 05 DMA */
214 ACPI_SMALL_VARIABLE_LENGTH, 356 ACPI_SMALL_VARIABLE_LENGTH, /* 06 start_dependent_functions */
215 ACPI_FIXED_LENGTH, 357 ACPI_FIXED_LENGTH, /* 07 end_dependent_functions */
216 ACPI_FIXED_LENGTH, 358 ACPI_FIXED_LENGTH, /* 08 IO */
217 ACPI_FIXED_LENGTH, 359 ACPI_FIXED_LENGTH, /* 09 fixed_iO */
218 0, 360 ACPI_FIXED_LENGTH, /* 0_a fixed_dMA */
219 0, 361 0,
220 0, 362 0,
221 0, 363 0,
222 ACPI_VARIABLE_LENGTH, 364 ACPI_VARIABLE_LENGTH, /* 0_e vendor_short */
223 ACPI_FIXED_LENGTH, 365 ACPI_FIXED_LENGTH, /* 0_f end_tag */
224 366
225 /* Large descriptors */ 367 /* Large descriptors */
226 368
227 0, 369 0,
228 ACPI_FIXED_LENGTH, 370 ACPI_FIXED_LENGTH, /* 01 Memory24 */
229 ACPI_FIXED_LENGTH, 371 ACPI_FIXED_LENGTH, /* 02 generic_register */
230 0, 372 0,
231 ACPI_VARIABLE_LENGTH, 373 ACPI_VARIABLE_LENGTH, /* 04 vendor_long */
232 ACPI_FIXED_LENGTH, 374 ACPI_FIXED_LENGTH, /* 05 Memory32 */
233 ACPI_FIXED_LENGTH, 375 ACPI_FIXED_LENGTH, /* 06 memory32_fixed */
234 ACPI_VARIABLE_LENGTH, 376 ACPI_VARIABLE_LENGTH, /* 07 Dword* address */
235 ACPI_VARIABLE_LENGTH, 377 ACPI_VARIABLE_LENGTH, /* 08 Word* address */
236 ACPI_VARIABLE_LENGTH, 378 ACPI_VARIABLE_LENGTH, /* 09 extended_iRQ */
237 ACPI_VARIABLE_LENGTH, 379 ACPI_VARIABLE_LENGTH, /* 0_a Qword* address */
238 ACPI_FIXED_LENGTH 380 ACPI_FIXED_LENGTH, /* 0_b Extended* address */
381 ACPI_VARIABLE_LENGTH, /* 0_c Gpio* */
382 0,
383 ACPI_VARIABLE_LENGTH /* 0_e *serial_bus */
239}; 384};
240 385
386/*
387 * For the i_aSL compiler/disassembler, we don't want any error messages
388 * because the disassembler uses the resource validation code to determine
389 * if Buffer objects are actually Resource Templates.
390 */
391#ifdef ACPI_ASL_COMPILER
392#define ACPI_RESOURCE_ERROR(plist)
393#else
394#define ACPI_RESOURCE_ERROR(plist) ACPI_ERROR(plist)
395#endif
396
241/******************************************************************************* 397/*******************************************************************************
242 * 398 *
243 * FUNCTION: acpi_ut_walk_aml_resources 399 * FUNCTION: acpi_ut_walk_aml_resources
@@ -265,6 +421,7 @@ acpi_ut_walk_aml_resources(u8 * aml,
265 u8 resource_index; 421 u8 resource_index;
266 u32 length; 422 u32 length;
267 u32 offset = 0; 423 u32 offset = 0;
424 u8 end_tag[2] = { 0x79, 0x00 };
268 425
269 ACPI_FUNCTION_TRACE(ut_walk_aml_resources); 426 ACPI_FUNCTION_TRACE(ut_walk_aml_resources);
270 427
@@ -286,6 +443,10 @@ acpi_ut_walk_aml_resources(u8 * aml,
286 443
287 status = acpi_ut_validate_resource(aml, &resource_index); 444 status = acpi_ut_validate_resource(aml, &resource_index);
288 if (ACPI_FAILURE(status)) { 445 if (ACPI_FAILURE(status)) {
446 /*
447 * Exit on failure. Cannot continue because the descriptor length
448 * may be bogus also.
449 */
289 return_ACPI_STATUS(status); 450 return_ACPI_STATUS(status);
290 } 451 }
291 452
@@ -300,7 +461,7 @@ acpi_ut_walk_aml_resources(u8 * aml,
300 user_function(aml, length, offset, resource_index, 461 user_function(aml, length, offset, resource_index,
301 context); 462 context);
302 if (ACPI_FAILURE(status)) { 463 if (ACPI_FAILURE(status)) {
303 return (status); 464 return_ACPI_STATUS(status);
304 } 465 }
305 } 466 }
306 467
@@ -333,7 +494,19 @@ acpi_ut_walk_aml_resources(u8 * aml,
333 494
334 /* Did not find an end_tag descriptor */ 495 /* Did not find an end_tag descriptor */
335 496
336 return (AE_AML_NO_RESOURCE_END_TAG); 497 if (user_function) {
498
499 /* Insert an end_tag anyway. acpi_rs_get_list_length always leaves room */
500
501 (void)acpi_ut_validate_resource(end_tag, &resource_index);
502 status =
503 user_function(end_tag, 2, offset, resource_index, context);
504 if (ACPI_FAILURE(status)) {
505 return_ACPI_STATUS(status);
506 }
507 }
508
509 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
337} 510}
338 511
339/******************************************************************************* 512/*******************************************************************************
@@ -354,6 +527,7 @@ acpi_ut_walk_aml_resources(u8 * aml,
354 527
355acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index) 528acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
356{ 529{
530 union aml_resource *aml_resource;
357 u8 resource_type; 531 u8 resource_type;
358 u8 resource_index; 532 u8 resource_index;
359 acpi_rs_length resource_length; 533 acpi_rs_length resource_length;
@@ -375,7 +549,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
375 /* Verify the large resource type (name) against the max */ 549 /* Verify the large resource type (name) against the max */
376 550
377 if (resource_type > ACPI_RESOURCE_NAME_LARGE_MAX) { 551 if (resource_type > ACPI_RESOURCE_NAME_LARGE_MAX) {
378 return (AE_AML_INVALID_RESOURCE_TYPE); 552 goto invalid_resource;
379 } 553 }
380 554
381 /* 555 /*
@@ -392,15 +566,17 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
392 ((resource_type & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3); 566 ((resource_type & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3);
393 } 567 }
394 568
395 /* Check validity of the resource type, zero indicates name is invalid */ 569 /*
396 570 * Check validity of the resource type, via acpi_gbl_resource_types. Zero
571 * indicates an invalid resource.
572 */
397 if (!acpi_gbl_resource_types[resource_index]) { 573 if (!acpi_gbl_resource_types[resource_index]) {
398 return (AE_AML_INVALID_RESOURCE_TYPE); 574 goto invalid_resource;
399 } 575 }
400 576
401 /* 577 /*
402 * 2) Validate the resource_length field. This ensures that the length 578 * Validate the resource_length field. This ensures that the length
403 * is at least reasonable, and guarantees that it is non-zero. 579 * is at least reasonable, and guarantees that it is non-zero.
404 */ 580 */
405 resource_length = acpi_ut_get_resource_length(aml); 581 resource_length = acpi_ut_get_resource_length(aml);
406 minimum_resource_length = acpi_gbl_resource_aml_sizes[resource_index]; 582 minimum_resource_length = acpi_gbl_resource_aml_sizes[resource_index];
@@ -413,7 +589,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
413 /* Fixed length resource, length must match exactly */ 589 /* Fixed length resource, length must match exactly */
414 590
415 if (resource_length != minimum_resource_length) { 591 if (resource_length != minimum_resource_length) {
416 return (AE_AML_BAD_RESOURCE_LENGTH); 592 goto bad_resource_length;
417 } 593 }
418 break; 594 break;
419 595
@@ -422,7 +598,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
422 /* Variable length resource, length must be at least the minimum */ 598 /* Variable length resource, length must be at least the minimum */
423 599
424 if (resource_length < minimum_resource_length) { 600 if (resource_length < minimum_resource_length) {
425 return (AE_AML_BAD_RESOURCE_LENGTH); 601 goto bad_resource_length;
426 } 602 }
427 break; 603 break;
428 604
@@ -432,7 +608,7 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
432 608
433 if ((resource_length > minimum_resource_length) || 609 if ((resource_length > minimum_resource_length) ||
434 (resource_length < (minimum_resource_length - 1))) { 610 (resource_length < (minimum_resource_length - 1))) {
435 return (AE_AML_BAD_RESOURCE_LENGTH); 611 goto bad_resource_length;
436 } 612 }
437 break; 613 break;
438 614
@@ -440,7 +616,23 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
440 616
441 /* Shouldn't happen (because of validation earlier), but be sure */ 617 /* Shouldn't happen (because of validation earlier), but be sure */
442 618
443 return (AE_AML_INVALID_RESOURCE_TYPE); 619 goto invalid_resource;
620 }
621
622 aml_resource = ACPI_CAST_PTR(union aml_resource, aml);
623 if (resource_type == ACPI_RESOURCE_NAME_SERIAL_BUS) {
624
625 /* Validate the bus_type field */
626
627 if ((aml_resource->common_serial_bus.type == 0) ||
628 (aml_resource->common_serial_bus.type >
629 AML_RESOURCE_MAX_SERIALBUSTYPE)) {
630 ACPI_RESOURCE_ERROR((AE_INFO,
631 "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
632 aml_resource->common_serial_bus.
633 type));
634 return (AE_AML_INVALID_RESOURCE_TYPE);
635 }
444 } 636 }
445 637
446 /* Optionally return the resource table index */ 638 /* Optionally return the resource table index */
@@ -450,6 +642,22 @@ acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index)
450 } 642 }
451 643
452 return (AE_OK); 644 return (AE_OK);
645
646 invalid_resource:
647
648 ACPI_RESOURCE_ERROR((AE_INFO,
649 "Invalid/unsupported resource descriptor: Type 0x%2.2X",
650 resource_type));
651 return (AE_AML_INVALID_RESOURCE_TYPE);
652
653 bad_resource_length:
654
655 ACPI_RESOURCE_ERROR((AE_INFO,
656 "Invalid resource descriptor length: Type "
657 "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
658 resource_type, resource_length,
659 minimum_resource_length));
660 return (AE_AML_BAD_RESOURCE_LENGTH);
453} 661}
454 662
455/******************************************************************************* 663/*******************************************************************************
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index 30c21e1a9360..4267477c2797 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 420ebfe08c72..644e8c8ebc4b 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -48,6 +48,7 @@
48#include "acnamesp.h" 48#include "acnamesp.h"
49#include "acdebug.h" 49#include "acdebug.h"
50#include "actables.h" 50#include "actables.h"
51#include "acinterp.h"
51 52
52#define _COMPONENT ACPI_UTILITIES 53#define _COMPONENT ACPI_UTILITIES
53ACPI_MODULE_NAME("utxface") 54ACPI_MODULE_NAME("utxface")
@@ -640,4 +641,41 @@ acpi_status acpi_install_interface_handler(acpi_interface_handler handler)
640} 641}
641 642
642ACPI_EXPORT_SYMBOL(acpi_install_interface_handler) 643ACPI_EXPORT_SYMBOL(acpi_install_interface_handler)
644
645/*****************************************************************************
646 *
647 * FUNCTION: acpi_check_address_range
648 *
649 * PARAMETERS: space_id - Address space ID
650 * Address - Start address
651 * Length - Length
652 * Warn - TRUE if warning on overlap desired
653 *
654 * RETURN: Count of the number of conflicts detected.
655 *
656 * DESCRIPTION: Check if the input address range overlaps any of the
657 * ASL operation region address ranges.
658 *
659 ****************************************************************************/
660u32
661acpi_check_address_range(acpi_adr_space_type space_id,
662 acpi_physical_address address,
663 acpi_size length, u8 warn)
664{
665 u32 overlaps;
666 acpi_status status;
667
668 status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
669 if (ACPI_FAILURE(status)) {
670 return (0);
671 }
672
673 overlaps = acpi_ut_check_address_range(space_id, address,
674 (u32)length, warn);
675
676 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
677 return (overlaps);
678}
679
680ACPI_EXPORT_SYMBOL(acpi_check_address_range)
643#endif /* !ACPI_ASL_COMPILER */ 681#endif /* !ACPI_ASL_COMPILER */
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 8d0245ec4315..52b568af1819 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2011, Intel Corp. 8 * Copyright (C) 2000 - 2012, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utxfmutex.c b/drivers/acpi/acpica/utxfmutex.c
new file mode 100644
index 000000000000..1427d191d15a
--- /dev/null
+++ b/drivers/acpi/acpica/utxfmutex.c
@@ -0,0 +1,187 @@
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
49ACPI_MODULE_NAME("utxfmutex")
50
51/* Local prototypes */
52static acpi_status
53acpi_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
73static acpi_status
74acpi_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
135acpi_status
136acpi_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
171acpi_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}
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index f31c5c5f1b7e..3e57fbdf50a3 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -83,19 +83,6 @@ static struct workqueue_struct *kacpi_notify_wq;
83struct workqueue_struct *kacpi_hotplug_wq; 83struct workqueue_struct *kacpi_hotplug_wq;
84EXPORT_SYMBOL(kacpi_hotplug_wq); 84EXPORT_SYMBOL(kacpi_hotplug_wq);
85 85
86struct 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
96static LIST_HEAD(resource_list_head);
97static DEFINE_SPINLOCK(acpi_res_lock);
98
99/* 86/*
100 * This list of permanent mappings is for memory that may be accessed from 87 * This list of permanent mappings is for memory that may be accessed from
101 * interrupt context, where we can't do the ioremap(). 88 * interrupt context, where we can't do the ioremap().
@@ -1278,44 +1265,28 @@ __setup("acpi_enforce_resources=", acpi_enforce_resources_setup);
1278 * drivers */ 1265 * drivers */
1279int acpi_check_resource_conflict(const struct resource *res) 1266int acpi_check_resource_conflict(const struct resource *res)
1280{ 1267{
1281 struct acpi_res_list *res_list_elem; 1268 acpi_adr_space_type space_id;
1282 int ioport = 0, clash = 0; 1269 acpi_size length;
1270 u8 warn = 0;
1271 int clash = 0;
1283 1272
1284 if (acpi_enforce_resources == ENFORCE_RESOURCES_NO) 1273 if (acpi_enforce_resources == ENFORCE_RESOURCES_NO)
1285 return 0; 1274 return 0;
1286 if (!(res->flags & IORESOURCE_IO) && !(res->flags & IORESOURCE_MEM)) 1275 if (!(res->flags & IORESOURCE_IO) && !(res->flags & IORESOURCE_MEM))
1287 return 0; 1276 return 0;
1288 1277
1289 ioport = res->flags & IORESOURCE_IO; 1278 if (res->flags & IORESOURCE_IO)
1290 1279 space_id = ACPI_ADR_SPACE_SYSTEM_IO;
1291 spin_lock(&acpi_res_lock); 1280 else
1292 list_for_each_entry(res_list_elem, &resource_list_head, 1281 space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
1293 resource_list) {
1294 if (ioport && (res_list_elem->resource_type
1295 != ACPI_ADR_SPACE_SYSTEM_IO))
1296 continue;
1297 if (!ioport && (res_list_elem->resource_type
1298 != ACPI_ADR_SPACE_SYSTEM_MEMORY))
1299 continue;
1300 1282
1301 if (res->end < res_list_elem->start 1283 length = res->end - res->start + 1;
1302 || res_list_elem->end < res->start) 1284 if (acpi_enforce_resources != ENFORCE_RESOURCES_NO)
1303 continue; 1285 warn = 1;
1304 clash = 1; 1286 clash = acpi_check_address_range(space_id, res->start, length, warn);
1305 break;
1306 }
1307 spin_unlock(&acpi_res_lock);
1308 1287
1309 if (clash) { 1288 if (clash) {
1310 if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) { 1289 if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) {
1311 printk(KERN_WARNING "ACPI: resource %s %pR"
1312 " conflicts with ACPI region %s "
1313 "[%s 0x%zx-0x%zx]\n",
1314 res->name, res, res_list_elem->name,
1315 (res_list_elem->resource_type ==
1316 ACPI_ADR_SPACE_SYSTEM_IO) ? "io" : "mem",
1317 (size_t) res_list_elem->start,
1318 (size_t) res_list_elem->end);
1319 if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX) 1290 if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX)
1320 printk(KERN_NOTICE "ACPI: This conflict may" 1291 printk(KERN_NOTICE "ACPI: This conflict may"
1321 " cause random problems and system" 1292 " cause random problems and system"
@@ -1467,155 +1438,6 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1467 kmem_cache_free(cache, object); 1438 kmem_cache_free(cache, object);
1468 return (AE_OK); 1439 return (AE_OK);
1469} 1440}
1470
1471static inline int acpi_res_list_add(struct acpi_res_list *res)
1472{
1473 struct acpi_res_list *res_list_elem;
1474
1475 list_for_each_entry(res_list_elem, &resource_list_head,
1476 resource_list) {
1477
1478 if (res->resource_type == res_list_elem->resource_type &&
1479 res->start == res_list_elem->start &&
1480 res->end == res_list_elem->end) {
1481
1482 /*
1483 * The Region(addr,len) already exist in the list,
1484 * just increase the count
1485 */
1486
1487 res_list_elem->count++;
1488 return 0;
1489 }
1490 }
1491
1492 res->count = 1;
1493 list_add(&res->resource_list, &resource_list_head);
1494 return 1;
1495}
1496
1497static inline void acpi_res_list_del(struct acpi_res_list *res)
1498{
1499 struct acpi_res_list *res_list_elem;
1500
1501 list_for_each_entry(res_list_elem, &resource_list_head,
1502 resource_list) {
1503
1504 if (res->resource_type == res_list_elem->resource_type &&
1505 res->start == res_list_elem->start &&
1506 res->end == res_list_elem->end) {
1507
1508 /*
1509 * If the res count is decreased to 0,
1510 * remove and free it
1511 */
1512
1513 if (--res_list_elem->count == 0) {
1514 list_del(&res_list_elem->resource_list);
1515 kfree(res_list_elem);
1516 }
1517 return;
1518 }
1519 }
1520}
1521
1522acpi_status
1523acpi_os_invalidate_address(
1524 u8 space_id,
1525 acpi_physical_address address,
1526 acpi_size length)
1527{
1528 struct acpi_res_list res;
1529
1530 switch (space_id) {
1531 case ACPI_ADR_SPACE_SYSTEM_IO:
1532 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
1533 /* Only interference checks against SystemIO and SystemMemory
1534 are needed */
1535 res.start = address;
1536 res.end = address + length - 1;
1537 res.resource_type = space_id;
1538 spin_lock(&acpi_res_lock);
1539 acpi_res_list_del(&res);
1540 spin_unlock(&acpi_res_lock);
1541 break;
1542 case ACPI_ADR_SPACE_PCI_CONFIG:
1543 case ACPI_ADR_SPACE_EC:
1544 case ACPI_ADR_SPACE_SMBUS:
1545 case ACPI_ADR_SPACE_CMOS:
1546 case ACPI_ADR_SPACE_PCI_BAR_TARGET:
1547 case ACPI_ADR_SPACE_DATA_TABLE:
1548 case ACPI_ADR_SPACE_FIXED_HARDWARE:
1549 break;
1550 }
1551 return AE_OK;
1552}
1553
1554/******************************************************************************
1555 *
1556 * FUNCTION: acpi_os_validate_address
1557 *
1558 * PARAMETERS: space_id - ACPI space ID
1559 * address - Physical address
1560 * length - Address length
1561 *
1562 * RETURN: AE_OK if address/length is valid for the space_id. Otherwise,
1563 * should return AE_AML_ILLEGAL_ADDRESS.
1564 *
1565 * DESCRIPTION: Validate a system address via the host OS. Used to validate
1566 * the addresses accessed by AML operation regions.
1567 *
1568 *****************************************************************************/
1569
1570acpi_status
1571acpi_os_validate_address (
1572 u8 space_id,
1573 acpi_physical_address address,
1574 acpi_size length,
1575 char *name)
1576{
1577 struct acpi_res_list *res;
1578 int added;
1579 if (acpi_enforce_resources == ENFORCE_RESOURCES_NO)
1580 return AE_OK;
1581
1582 switch (space_id) {
1583 case ACPI_ADR_SPACE_SYSTEM_IO:
1584 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
1585 /* Only interference checks against SystemIO and SystemMemory
1586 are needed */
1587 res = kzalloc(sizeof(struct acpi_res_list), GFP_KERNEL);
1588 if (!res)
1589 return AE_OK;
1590 /* ACPI names are fixed to 4 bytes, still better use strlcpy */
1591 strlcpy(res->name, name, 5);
1592 res->start = address;
1593 res->end = address + length - 1;
1594 res->resource_type = space_id;
1595 spin_lock(&acpi_res_lock);
1596 added = acpi_res_list_add(res);
1597 spin_unlock(&acpi_res_lock);
1598 pr_debug("%s %s resource: start: 0x%llx, end: 0x%llx, "
1599 "name: %s\n", added ? "Added" : "Already exist",
1600 (space_id == ACPI_ADR_SPACE_SYSTEM_IO)
1601 ? "SystemIO" : "System Memory",
1602 (unsigned long long)res->start,
1603 (unsigned long long)res->end,
1604 res->name);
1605 if (!added)
1606 kfree(res);
1607 break;
1608 case ACPI_ADR_SPACE_PCI_CONFIG:
1609 case ACPI_ADR_SPACE_EC:
1610 case ACPI_ADR_SPACE_SMBUS:
1611 case ACPI_ADR_SPACE_CMOS:
1612 case ACPI_ADR_SPACE_PCI_BAR_TARGET:
1613 case ACPI_ADR_SPACE_DATA_TABLE:
1614 case ACPI_ADR_SPACE_FIXED_HARDWARE:
1615 break;
1616 }
1617 return AE_OK;
1618}
1619#endif 1441#endif
1620 1442
1621acpi_status __init acpi_os_initialize(void) 1443acpi_status __init acpi_os_initialize(void)
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index fc1575fd4596..5b5af0d30a97 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -58,6 +58,7 @@
58#define METHOD_NAME__PRT "_PRT" 58#define METHOD_NAME__PRT "_PRT"
59#define METHOD_NAME__CRS "_CRS" 59#define METHOD_NAME__CRS "_CRS"
60#define METHOD_NAME__PRS "_PRS" 60#define METHOD_NAME__PRS "_PRS"
61#define METHOD_NAME__AEI "_AEI"
61#define METHOD_NAME__PRW "_PRW" 62#define METHOD_NAME__PRW "_PRW"
62#define METHOD_NAME__SRS "_SRS" 63#define METHOD_NAME__SRS "_SRS"
63 64
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 83062ed0ef2f..2fe8639b3ae7 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -238,13 +238,6 @@ acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
238/* 238/*
239 * Miscellaneous 239 * Miscellaneous
240 */ 240 */
241acpi_status
242acpi_os_validate_address(u8 space_id, acpi_physical_address address,
243 acpi_size length, char *name);
244acpi_status
245acpi_os_invalidate_address(u8 space_id, acpi_physical_address address,
246 acpi_size length);
247
248u64 acpi_os_get_timer(void); 241u64 acpi_os_get_timer(void);
249 242
250acpi_status acpi_os_signal(u32 function, void *info); 243acpi_status acpi_os_signal(u32 function, void *info);
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index f554a9313b43..dceeaf51d706 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -47,7 +47,7 @@
47 47
48/* Current ACPICA subsystem version in YYYYMMDD format */ 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#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
@@ -74,6 +74,7 @@ extern u8 acpi_gbl_disable_auto_repair;
74extern u32 acpi_current_gpe_count; 74extern u32 acpi_current_gpe_count;
75extern struct acpi_table_fadt acpi_gbl_FADT; 75extern struct acpi_table_fadt acpi_gbl_FADT;
76extern u8 acpi_gbl_system_awake_and_running; 76extern u8 acpi_gbl_system_awake_and_running;
77extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */
77 78
78extern u32 acpi_rsdt_forced; 79extern u32 acpi_rsdt_forced;
79/* 80/*
@@ -111,6 +112,11 @@ acpi_status acpi_install_interface(acpi_string interface_name);
111 112
112acpi_status acpi_remove_interface(acpi_string interface_name); 113acpi_status acpi_remove_interface(acpi_string interface_name);
113 114
115u32
116acpi_check_address_range(acpi_adr_space_type space_id,
117 acpi_physical_address address,
118 acpi_size length, u8 warn);
119
114/* 120/*
115 * ACPI Memory management 121 * ACPI Memory management
116 */ 122 */
@@ -276,12 +282,23 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
276acpi_status acpi_install_interface_handler(acpi_interface_handler handler); 282acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
277 283
278/* 284/*
279 * Event interfaces 285 * Global Lock interfaces
280 */ 286 */
281acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); 287acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);
282 288
283acpi_status acpi_release_global_lock(u32 handle); 289acpi_status acpi_release_global_lock(u32 handle);
284 290
291/*
292 * Interfaces to AML mutex objects
293 */
294acpi_status
295acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout);
296
297acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname);
298
299/*
300 * Fixed Event interfaces
301 */
285acpi_status acpi_enable_event(u32 event, u32 flags); 302acpi_status acpi_enable_event(u32 event, u32 flags);
286 303
287acpi_status acpi_disable_event(u32 event, u32 flags); 304acpi_status acpi_disable_event(u32 event, u32 flags);
@@ -291,7 +308,7 @@ acpi_status acpi_clear_event(u32 event);
291acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 308acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
292 309
293/* 310/*
294 * GPE Interfaces 311 * General Purpose Event (GPE) Interfaces
295 */ 312 */
296acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); 313acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number);
297 314
@@ -346,6 +363,10 @@ acpi_get_possible_resources(acpi_handle device, struct acpi_buffer *ret_buffer);
346#endif 363#endif
347 364
348acpi_status 365acpi_status
366acpi_get_event_resources(acpi_handle device_handle,
367 struct acpi_buffer *ret_buffer);
368
369acpi_status
349acpi_walk_resources(acpi_handle device, 370acpi_walk_resources(acpi_handle device,
350 char *name, 371 char *name,
351 acpi_walk_resource_callback user_function, void *context); 372 acpi_walk_resource_callback user_function, void *context);
@@ -360,6 +381,11 @@ acpi_status
360acpi_resource_to_address64(struct acpi_resource *resource, 381acpi_resource_to_address64(struct acpi_resource *resource,
361 struct acpi_resource_address64 *out); 382 struct acpi_resource_address64 *out);
362 383
384acpi_status
385acpi_buffer_to_resource(u8 *aml_buffer,
386 u16 aml_buffer_length,
387 struct acpi_resource **resource_ptr);
388
363/* 389/*
364 * Hardware (ACPI device) interfaces 390 * Hardware (ACPI device) interfaces
365 */ 391 */
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
index 0a66cc45dd6b..3506e39a66b1 100644
--- a/include/acpi/acrestyp.h
+++ b/include/acpi/acrestyp.h
@@ -61,11 +61,14 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
61#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 61#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02
62#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 62#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03
63 63
64/*! [Begin] no source code translation */
64/* 65/*
65 * IO Attributes 66 * IO Attributes
66 * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. 67 * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
67 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. 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#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 72#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
70#define ACPI_ISA_ONLY_RANGES (u8) 0x02 73#define ACPI_ISA_ONLY_RANGES (u8) 0x02
71#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 74#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
@@ -81,16 +84,26 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
81#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ 84#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
82 85
83/* 86/*
84 * IRQ Attributes 87 * Interrupt attributes - used in multiple descriptors
85 */ 88 */
89
90/* Triggering */
91
86#define ACPI_LEVEL_SENSITIVE (u8) 0x00 92#define ACPI_LEVEL_SENSITIVE (u8) 0x00
87#define ACPI_EDGE_SENSITIVE (u8) 0x01 93#define ACPI_EDGE_SENSITIVE (u8) 0x01
88 94
95/* Polarity */
96
89#define ACPI_ACTIVE_HIGH (u8) 0x00 97#define ACPI_ACTIVE_HIGH (u8) 0x00
90#define ACPI_ACTIVE_LOW (u8) 0x01 98#define ACPI_ACTIVE_LOW (u8) 0x01
99#define ACPI_ACTIVE_BOTH (u8) 0x02
100
101/* Sharing */
91 102
92#define ACPI_EXCLUSIVE (u8) 0x00 103#define ACPI_EXCLUSIVE (u8) 0x00
93#define ACPI_SHARED (u8) 0x01 104#define ACPI_SHARED (u8) 0x01
105#define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02
106#define ACPI_SHARED_AND_WAKE (u8) 0x03
94 107
95/* 108/*
96 * DMA Attributes 109 * DMA Attributes
@@ -127,6 +140,8 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6
127#define ACPI_POS_DECODE (u8) 0x00 140#define ACPI_POS_DECODE (u8) 0x00
128#define ACPI_SUB_DECODE (u8) 0x01 141#define ACPI_SUB_DECODE (u8) 0x01
129 142
143/* Producer/Consumer */
144
130#define ACPI_PRODUCER (u8) 0x00 145#define ACPI_PRODUCER (u8) 0x00
131#define ACPI_CONSUMER (u8) 0x01 146#define ACPI_CONSUMER (u8) 0x01
132 147
@@ -192,6 +207,21 @@ struct acpi_resource_fixed_io {
192 u8 address_length; 207 u8 address_length;
193}; 208};
194 209
210struct acpi_resource_fixed_dma {
211 u16 request_lines;
212 u16 channels;
213 u8 width;
214};
215
216/* Values for Width field above */
217
218#define ACPI_DMA_WIDTH8 0
219#define ACPI_DMA_WIDTH16 1
220#define ACPI_DMA_WIDTH32 2
221#define ACPI_DMA_WIDTH64 3
222#define ACPI_DMA_WIDTH128 4
223#define ACPI_DMA_WIDTH256 5
224
195struct acpi_resource_vendor { 225struct acpi_resource_vendor {
196 u16 byte_length; 226 u16 byte_length;
197 u8 byte_data[1]; 227 u8 byte_data[1];
@@ -329,6 +359,166 @@ struct acpi_resource_generic_register {
329 u64 address; 359 u64 address;
330}; 360};
331 361
362struct acpi_resource_gpio {
363 u8 revision_id;
364 u8 connection_type;
365 u8 producer_consumer; /* For values, see Producer/Consumer above */
366 u8 pin_config;
367 u8 sharable; /* For values, see Interrupt Attributes above */
368 u8 io_restriction;
369 u8 triggering; /* For values, see Interrupt Attributes above */
370 u8 polarity; /* For values, see Interrupt Attributes above */
371 u16 drive_strength;
372 u16 debounce_timeout;
373 u16 pin_table_length;
374 u16 vendor_length;
375 struct acpi_resource_source resource_source;
376 u16 *pin_table;
377 u8 *vendor_data;
378};
379
380/* Values for GPIO connection_type field above */
381
382#define ACPI_RESOURCE_GPIO_TYPE_INT 0
383#define ACPI_RESOURCE_GPIO_TYPE_IO 1
384
385/* Values for pin_config field above */
386
387#define ACPI_PIN_CONFIG_DEFAULT 0
388#define ACPI_PIN_CONFIG_PULLUP 1
389#define ACPI_PIN_CONFIG_PULLDOWN 2
390#define ACPI_PIN_CONFIG_NOPULL 3
391
392/* Values for io_restriction field above */
393
394#define ACPI_IO_RESTRICT_NONE 0
395#define ACPI_IO_RESTRICT_INPUT 1
396#define ACPI_IO_RESTRICT_OUTPUT 2
397#define ACPI_IO_RESTRICT_NONE_PRESERVE 3
398
399/* Common structure for I2C, SPI, and UART serial descriptors */
400
401#define ACPI_RESOURCE_SERIAL_COMMON \
402 u8 revision_id; \
403 u8 type; \
404 u8 producer_consumer; /* For values, see Producer/Consumer above */\
405 u8 slave_mode; \
406 u8 type_revision_id; \
407 u16 type_data_length; \
408 u16 vendor_length; \
409 struct acpi_resource_source resource_source; \
410 u8 *vendor_data;
411
412struct acpi_resource_common_serialbus {
413ACPI_RESOURCE_SERIAL_COMMON};
414
415/* Values for the Type field above */
416
417#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
418#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
419#define ACPI_RESOURCE_SERIAL_TYPE_UART 3
420
421/* Values for slave_mode field above */
422
423#define ACPI_CONTROLLER_INITIATED 0
424#define ACPI_DEVICE_INITIATED 1
425
426struct acpi_resource_i2c_serialbus {
427 ACPI_RESOURCE_SERIAL_COMMON u8 access_mode;
428 u16 slave_address;
429 u32 connection_speed;
430};
431
432/* Values for access_mode field above */
433
434#define ACPI_I2C_7BIT_MODE 0
435#define ACPI_I2C_10BIT_MODE 1
436
437struct acpi_resource_spi_serialbus {
438 ACPI_RESOURCE_SERIAL_COMMON u8 wire_mode;
439 u8 device_polarity;
440 u8 data_bit_length;
441 u8 clock_phase;
442 u8 clock_polarity;
443 u16 device_selection;
444 u32 connection_speed;
445};
446
447/* Values for wire_mode field above */
448
449#define ACPI_SPI_4WIRE_MODE 0
450#define ACPI_SPI_3WIRE_MODE 1
451
452/* Values for device_polarity field above */
453
454#define ACPI_SPI_ACTIVE_LOW 0
455#define ACPI_SPI_ACTIVE_HIGH 1
456
457/* Values for clock_phase field above */
458
459#define ACPI_SPI_FIRST_PHASE 0
460#define ACPI_SPI_SECOND_PHASE 1
461
462/* Values for clock_polarity field above */
463
464#define ACPI_SPI_START_LOW 0
465#define ACPI_SPI_START_HIGH 1
466
467struct acpi_resource_uart_serialbus {
468 ACPI_RESOURCE_SERIAL_COMMON u8 endian;
469 u8 data_bits;
470 u8 stop_bits;
471 u8 flow_control;
472 u8 parity;
473 u8 lines_enabled;
474 u16 rx_fifo_size;
475 u16 tx_fifo_size;
476 u32 default_baud_rate;
477};
478
479/* Values for Endian field above */
480
481#define ACPI_UART_LITTLE_ENDIAN 0
482#define ACPI_UART_BIG_ENDIAN 1
483
484/* Values for data_bits field above */
485
486#define ACPI_UART_5_DATA_BITS 0
487#define ACPI_UART_6_DATA_BITS 1
488#define ACPI_UART_7_DATA_BITS 2
489#define ACPI_UART_8_DATA_BITS 3
490#define ACPI_UART_9_DATA_BITS 4
491
492/* Values for stop_bits field above */
493
494#define ACPI_UART_NO_STOP_BITS 0
495#define ACPI_UART_1_STOP_BIT 1
496#define ACPI_UART_1P5_STOP_BITS 2
497#define ACPI_UART_2_STOP_BITS 3
498
499/* Values for flow_control field above */
500
501#define ACPI_UART_FLOW_CONTROL_NONE 0
502#define ACPI_UART_FLOW_CONTROL_HW 1
503#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
504
505/* Values for Parity field above */
506
507#define ACPI_UART_PARITY_NONE 0
508#define ACPI_UART_PARITY_EVEN 1
509#define ACPI_UART_PARITY_ODD 2
510#define ACPI_UART_PARITY_MARK 3
511#define ACPI_UART_PARITY_SPACE 4
512
513/* Values for lines_enabled bitfield above */
514
515#define ACPI_UART_CARRIER_DETECT (1<<2)
516#define ACPI_UART_RING_INDICATOR (1<<3)
517#define ACPI_UART_DATA_SET_READY (1<<4)
518#define ACPI_UART_DATA_TERMINAL_READY (1<<5)
519#define ACPI_UART_CLEAR_TO_SEND (1<<6)
520#define ACPI_UART_REQUEST_TO_SEND (1<<7)
521
332/* ACPI_RESOURCE_TYPEs */ 522/* ACPI_RESOURCE_TYPEs */
333 523
334#define ACPI_RESOURCE_TYPE_IRQ 0 524#define ACPI_RESOURCE_TYPE_IRQ 0
@@ -348,7 +538,10 @@ struct acpi_resource_generic_register {
348#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ 538#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
349#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 539#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
350#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 540#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
351#define ACPI_RESOURCE_TYPE_MAX 16 541#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
542#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
543#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
544#define ACPI_RESOURCE_TYPE_MAX 19
352 545
353/* Master union for resource descriptors */ 546/* Master union for resource descriptors */
354 547
@@ -358,6 +551,7 @@ union acpi_resource_data {
358 struct acpi_resource_start_dependent start_dpf; 551 struct acpi_resource_start_dependent start_dpf;
359 struct acpi_resource_io io; 552 struct acpi_resource_io io;
360 struct acpi_resource_fixed_io fixed_io; 553 struct acpi_resource_fixed_io fixed_io;
554 struct acpi_resource_fixed_dma fixed_dma;
361 struct acpi_resource_vendor vendor; 555 struct acpi_resource_vendor vendor;
362 struct acpi_resource_vendor_typed vendor_typed; 556 struct acpi_resource_vendor_typed vendor_typed;
363 struct acpi_resource_end_tag end_tag; 557 struct acpi_resource_end_tag end_tag;
@@ -370,6 +564,11 @@ union acpi_resource_data {
370 struct acpi_resource_extended_address64 ext_address64; 564 struct acpi_resource_extended_address64 ext_address64;
371 struct acpi_resource_extended_irq extended_irq; 565 struct acpi_resource_extended_irq extended_irq;
372 struct acpi_resource_generic_register generic_reg; 566 struct acpi_resource_generic_register generic_reg;
567 struct acpi_resource_gpio gpio;
568 struct acpi_resource_i2c_serialbus i2c_serial_bus;
569 struct acpi_resource_spi_serialbus spi_serial_bus;
570 struct acpi_resource_uart_serialbus uart_serial_bus;
571 struct acpi_resource_common_serialbus common_serial_bus;
373 572
374 /* Common fields */ 573 /* Common fields */
375 574
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index f1380287ed4d..8e1b92f6f650 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -255,6 +255,8 @@ struct acpi_table_fadt {
255 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ 255 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
256 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ 256 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
257 struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ 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/* Masks for FADT Boot Architecture Flags (boot_flags) */ 262/* Masks for FADT Boot Architecture Flags (boot_flags) */
@@ -264,6 +266,7 @@ struct acpi_table_fadt {
264#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ 266#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */
265#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ 267#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
266#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ 268#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
269#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
267 270
268#define FADT2_REVISION_ID 3 271#define FADT2_REVISION_ID 3
269 272
@@ -289,6 +292,8 @@ struct acpi_table_fadt {
289#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ 292#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */
290#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ 293#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
291#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */ 294#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */
295#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */
296#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */
292 297
293/* Values for preferred_profile (Preferred Power Management Profiles) */ 298/* Values for preferred_profile (Preferred Power Management Profiles) */
294 299
@@ -299,14 +304,16 @@ enum acpi_prefered_pm_profiles {
299 PM_WORKSTATION = 3, 304 PM_WORKSTATION = 3,
300 PM_ENTERPRISE_SERVER = 4, 305 PM_ENTERPRISE_SERVER = 4,
301 PM_SOHO_SERVER = 5, 306 PM_SOHO_SERVER = 5,
302 PM_APPLIANCE_PC = 6 307 PM_APPLIANCE_PC = 6,
308 PM_PERFORMANCE_SERVER = 7,
309 PM_TABLET = 8
303}; 310};
304 311
305/* Reset to default packing */ 312/* Reset to default packing */
306 313
307#pragma pack() 314#pragma pack()
308 315
309#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) 316#define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f)
310 317
311/* 318/*
312 * Internal table-related structures 319 * Internal table-related structures
@@ -342,6 +349,7 @@ struct acpi_table_desc {
342 349
343#include <acpi/actbl1.h> 350#include <acpi/actbl1.h>
344#include <acpi/actbl2.h> 351#include <acpi/actbl2.h>
352#include <acpi/actbl3.h>
345 353
346/* 354/*
347 * Sizes of the various flavors of FADT. We need to look closely 355 * Sizes of the various flavors of FADT. We need to look closely
@@ -351,12 +359,15 @@ struct acpi_table_desc {
351 * FADT is the bottom line as to what the version really is. 359 * FADT is the bottom line as to what the version really is.
352 * 360 *
353 * For reference, the values below are as follows: 361 * For reference, the values below are as follows:
354 * FADT V1 size: 0x74 362 * FADT V1 size: 0x074
355 * FADT V2 size: 0x84 363 * FADT V2 size: 0x084
356 * FADT V3+ size: 0xF4 364 * FADT V3 size: 0x0F4
365 * FADT V4 size: 0x0F4
366 * FADT V5 size: 0x10C
357 */ 367 */
358#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 368#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
359#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) 369#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
360#define ACPI_FADT_V3_SIZE (u32) (sizeof (struct acpi_table_fadt)) 370#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control))
371#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt))
361 372
362#endif /* __ACTBL_H__ */ 373#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 7504bc99b29b..71e747beac8f 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -228,7 +228,8 @@ enum acpi_einj_actions {
228 ACPI_EINJ_EXECUTE_OPERATION = 5, 228 ACPI_EINJ_EXECUTE_OPERATION = 5,
229 ACPI_EINJ_CHECK_BUSY_STATUS = 6, 229 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
230 ACPI_EINJ_GET_COMMAND_STATUS = 7, 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 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ 233 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
233}; 234};
234 235
@@ -240,7 +241,27 @@ enum acpi_einj_instructions {
240 ACPI_EINJ_WRITE_REGISTER = 2, 241 ACPI_EINJ_WRITE_REGISTER = 2,
241 ACPI_EINJ_WRITE_REGISTER_VALUE = 3, 242 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
242 ACPI_EINJ_NOOP = 4, 243 ACPI_EINJ_NOOP = 4,
243 ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */ 244 ACPI_EINJ_FLUSH_CACHELINE = 5,
245 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
246};
247
248struct acpi_einj_error_type_with_addr {
249 u32 error_type;
250 u32 vendor_struct_offset;
251 u32 flags;
252 u32 apic_id;
253 u64 address;
254 u64 range;
255 u32 pcie_id;
256};
257
258struct acpi_einj_vendor {
259 u32 length;
260 u32 pcie_id;
261 u16 vendor_id;
262 u16 device_id;
263 u8 revision_id;
264 u8 reserved[3];
244}; 265};
245 266
246/* EINJ Trigger Error Action Table */ 267/* EINJ Trigger Error Action Table */
@@ -275,6 +296,7 @@ enum acpi_einj_command_status {
275#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) 296#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
276#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) 297#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
277#define ACPI_EINJ_PLATFORM_FATAL (1<<11) 298#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
299#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
278 300
279/******************************************************************************* 301/*******************************************************************************
280 * 302 *
@@ -631,7 +653,9 @@ enum acpi_madt_type {
631 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, 653 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
632 ACPI_MADT_TYPE_LOCAL_X2APIC = 9, 654 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
633 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 655 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
634 ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */ 656 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
657 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
658 ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */
635}; 659};
636 660
637/* 661/*
@@ -752,11 +776,36 @@ struct acpi_madt_local_x2apic_nmi {
752 u8 reserved[3]; 776 u8 reserved[3];
753}; 777};
754 778
779/* 11: Generic Interrupt (ACPI 5.0) */
780
781struct acpi_madt_generic_interrupt {
782 struct acpi_subtable_header header;
783 u16 reserved; /* Reserved - must be zero */
784 u32 gic_id;
785 u32 uid;
786 u32 flags;
787 u32 parking_version;
788 u32 performance_interrupt;
789 u64 parked_address;
790 u64 base_address;
791};
792
793/* 12: Generic Distributor (ACPI 5.0) */
794
795struct acpi_madt_generic_distributor {
796 struct acpi_subtable_header header;
797 u16 reserved; /* Reserved - must be zero */
798 u32 gic_id;
799 u64 base_address;
800 u32 global_irq_base;
801 u32 reserved2; /* Reserved - must be zero */
802};
803
755/* 804/*
756 * Common flags fields for MADT subtables 805 * Common flags fields for MADT subtables
757 */ 806 */
758 807
759/* MADT Local APIC flags (lapic_flags) */ 808/* MADT Local APIC flags (lapic_flags) and GIC flags */
760 809
761#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 810#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
762 811
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
new file mode 100644
index 000000000000..c22ce80e9535
--- /dev/null
+++ b/include/acpi/actbl3.h
@@ -0,0 +1,552 @@
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
102struct 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
118struct 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
133struct acpi_drtm_vtl_list {
134 u32 validated_table_list_count;
135};
136
137/* 2) Resources List */
138
139struct acpi_drtm_resource_list {
140 u32 resource_list_count;
141};
142
143/* 3) Platform-specific Identifiers List */
144
145struct 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
156struct acpi_table_fpdt {
157 struct acpi_table_header header; /* Common ACPI table header */
158};
159
160/* FPDT subtable header */
161
162struct acpi_fpdt_header {
163 u16 type;
164 u8 length;
165 u8 revision;
166};
167
168/* Values for Type field above */
169
170enum 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
181struct 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
193struct 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 */
203struct acpi_table_s3pt {
204 u8 signature[4]; /* "S3PT" */
205 u32 length;
206};
207
208/*
209 * S3PT Subtables
210 */
211struct acpi_s3pt_header {
212 u16 type;
213 u8 length;
214 u8 revision;
215};
216
217/* Values for Type field above */
218
219enum acpi_s3pt_type {
220 ACPI_S3PT_TYPE_RESUME = 0,
221 ACPI_S3PT_TYPE_SUSPEND = 1,
222};
223
224struct acpi_s3pt_resume {
225 struct acpi_s3pt_header header;
226 u32 resume_count;
227 u64 full_resume;
228 u64 average_resume;
229};
230
231struct 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
244struct 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
282struct 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
289struct acpi_mpst_channel {
290 ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
291};
292
293/* Memory Power Node Structure */
294
295struct 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
315struct acpi_mpst_power_state {
316 u8 power_state;
317 u8 info_index;
318};
319
320/* Physical Component ID Structure (follows POWER_STATE above) */
321
322struct acpi_mpst_component {
323 u16 component_id;
324};
325
326/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
327
328struct acpi_mpst_data_hdr {
329 u16 characteristics_count;
330};
331
332struct 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
350struct 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
369struct 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
386struct 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
402struct 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
415struct 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
422struct 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
449struct acpi_pmtt_socket {
450 struct acpi_pmtt_header header;
451 u16 socket_id;
452 u16 reserved;
453};
454
455/* 1: Memory Controller subtable */
456
457struct 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
471struct acpi_pmtt_domain {
472 u32 proximity_domain;
473};
474
475/* 2: Physical Component Identifier (DIMM) */
476
477struct 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
492struct 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
499struct 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
518enum 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
531enum 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__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index ed73f6705c86..d5dee7ce9474 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -712,8 +712,10 @@ typedef u8 acpi_adr_space_type;
712#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 712#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5
713#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 713#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6
714#define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7 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 * Special Address Spaces 721 * Special Address Spaces
@@ -957,6 +959,14 @@ acpi_status(*acpi_adr_space_handler) (u32 function,
957 959
958#define ACPI_DEFAULT_HANDLER NULL 960#define ACPI_DEFAULT_HANDLER NULL
959 961
962/* Special Context data for generic_serial_bus/general_purpose_io (ACPI 5.0) */
963
964struct acpi_connection_info {
965 u8 *connection;
966 u16 length;
967 u8 access_length;
968};
969
960typedef 970typedef
961acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, 971acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
962 u32 function, 972 u32 function,