xref: /OK3568_Linux_fs/kernel/Documentation/ABI/testing/sysfs-firmware-acpi (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunWhat:		/sys/firmware/acpi/bgrt/
2*4882a593SmuzhiyunDate:		January 2012
3*4882a593SmuzhiyunContact:	Matthew Garrett <mjg@redhat.com>
4*4882a593SmuzhiyunDescription:
5*4882a593Smuzhiyun		The BGRT is an ACPI 5.0 feature that allows the OS
6*4882a593Smuzhiyun		to obtain a copy of the firmware boot splash and
7*4882a593Smuzhiyun		some associated metadata. This is intended to be used
8*4882a593Smuzhiyun		by boot splash applications in order to interact with
9*4882a593Smuzhiyun		the firmware boot splash in order to avoid jarring
10*4882a593Smuzhiyun		transitions.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun		image: The image bitmap. Currently a 32-bit BMP.
13*4882a593Smuzhiyun		status: 1 if the image is valid, 0 if firmware invalidated it.
14*4882a593Smuzhiyun		type: 0 indicates image is in BMP format.
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun		======== ===================================================
17*4882a593Smuzhiyun		version: The version of the BGRT. Currently 1.
18*4882a593Smuzhiyun		xoffset: The number of pixels between the left of the screen
19*4882a593Smuzhiyun			 and the left edge of the image.
20*4882a593Smuzhiyun		yoffset: The number of pixels between the top of the screen
21*4882a593Smuzhiyun			 and the top edge of the image.
22*4882a593Smuzhiyun		======== ===================================================
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunWhat:		/sys/firmware/acpi/hotplug/
25*4882a593SmuzhiyunDate:		February 2013
26*4882a593SmuzhiyunContact:	Rafael J. Wysocki <rafael.j.wysocki@intel.com>
27*4882a593SmuzhiyunDescription:
28*4882a593Smuzhiyun		There are separate hotplug profiles for different classes of
29*4882a593Smuzhiyun		devices supported by ACPI, such as containers, memory modules,
30*4882a593Smuzhiyun		processors, PCI root bridges etc.  A hotplug profile for a given
31*4882a593Smuzhiyun		class of devices is a collection of settings defining the way
32*4882a593Smuzhiyun		that class of devices will be handled by the ACPI core hotplug
33*4882a593Smuzhiyun		code.  Those profiles are represented in sysfs as subdirectories
34*4882a593Smuzhiyun		of /sys/firmware/acpi/hotplug/.
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun		The following setting is available to user space for each
37*4882a593Smuzhiyun		hotplug profile:
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun		======== =======================================================
40*4882a593Smuzhiyun		enabled: If set, the ACPI core will handle notifications of
41*4882a593Smuzhiyun			 hotplug events associated with the given class of
42*4882a593Smuzhiyun			 devices and will allow those devices to be ejected with
43*4882a593Smuzhiyun			 the help of the _EJ0 control method.  Unsetting it
44*4882a593Smuzhiyun			 effectively disables hotplug for the correspoinding
45*4882a593Smuzhiyun			 class of devices.
46*4882a593Smuzhiyun		======== =======================================================
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun		The value of the above attribute is an integer number: 1 (set)
49*4882a593Smuzhiyun		or 0 (unset).  Attempts to write any other values to it will
50*4882a593Smuzhiyun		cause -EINVAL to be returned.
51*4882a593Smuzhiyun
52*4882a593SmuzhiyunWhat:		/sys/firmware/acpi/interrupts/
53*4882a593SmuzhiyunDate:		February 2008
54*4882a593SmuzhiyunContact:	Len Brown <lenb@kernel.org>
55*4882a593SmuzhiyunDescription:
56*4882a593Smuzhiyun		All ACPI interrupts are handled via a single IRQ,
57*4882a593Smuzhiyun		the System Control Interrupt (SCI), which appears
58*4882a593Smuzhiyun		as "acpi" in /proc/interrupts.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun		However, one of the main functions of ACPI is to make
61*4882a593Smuzhiyun		the platform understand random hardware without
62*4882a593Smuzhiyun		special driver support.  So while the SCI handles a few
63*4882a593Smuzhiyun		well known (fixed feature) interrupts sources, such
64*4882a593Smuzhiyun		as the power button, it can also handle a variable
65*4882a593Smuzhiyun		number of a "General Purpose Events" (GPE).
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun		A GPE vectors to a specified handler in AML, which
68*4882a593Smuzhiyun		can do a anything the BIOS writer wants from
69*4882a593Smuzhiyun		OS context.  GPE 0x12, for example, would vector
70*4882a593Smuzhiyun		to a level or edge handler called _L12 or _E12.
71*4882a593Smuzhiyun		The handler may do its business and return.
72*4882a593Smuzhiyun		Or the handler may send send a Notify event
73*4882a593Smuzhiyun		to a Linux device driver registered on an ACPI device,
74*4882a593Smuzhiyun		such as a battery, or a processor.
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun		To figure out where all the SCI's are coming from,
77*4882a593Smuzhiyun		/sys/firmware/acpi/interrupts contains a file listing
78*4882a593Smuzhiyun		every possible source, and the count of how many
79*4882a593Smuzhiyun		times it has triggered::
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun		  $ cd /sys/firmware/acpi/interrupts
82*4882a593Smuzhiyun		  $ grep . *
83*4882a593Smuzhiyun		  error:	     0
84*4882a593Smuzhiyun		  ff_gbl_lock:	     0   enable
85*4882a593Smuzhiyun		  ff_pmtimer:	     0  invalid
86*4882a593Smuzhiyun		  ff_pwr_btn:	     0   enable
87*4882a593Smuzhiyun		  ff_rt_clk:	     2  disable
88*4882a593Smuzhiyun		  ff_slp_btn:	     0  invalid
89*4882a593Smuzhiyun		  gpe00:	     0	invalid
90*4882a593Smuzhiyun		  gpe01:	     0	 enable
91*4882a593Smuzhiyun		  gpe02:	   108	 enable
92*4882a593Smuzhiyun		  gpe03:	     0	invalid
93*4882a593Smuzhiyun		  gpe04:	     0	invalid
94*4882a593Smuzhiyun		  gpe05:	     0	invalid
95*4882a593Smuzhiyun		  gpe06:	     0	 enable
96*4882a593Smuzhiyun		  gpe07:	     0	 enable
97*4882a593Smuzhiyun		  gpe08:	     0	invalid
98*4882a593Smuzhiyun		  gpe09:	     0	invalid
99*4882a593Smuzhiyun		  gpe0A:	     0	invalid
100*4882a593Smuzhiyun		  gpe0B:	     0	invalid
101*4882a593Smuzhiyun		  gpe0C:	     0	invalid
102*4882a593Smuzhiyun		  gpe0D:	     0	invalid
103*4882a593Smuzhiyun		  gpe0E:	     0	invalid
104*4882a593Smuzhiyun		  gpe0F:	     0	invalid
105*4882a593Smuzhiyun		  gpe10:	     0	invalid
106*4882a593Smuzhiyun		  gpe11:	     0	invalid
107*4882a593Smuzhiyun		  gpe12:	     0	invalid
108*4882a593Smuzhiyun		  gpe13:	     0	invalid
109*4882a593Smuzhiyun		  gpe14:	     0	invalid
110*4882a593Smuzhiyun		  gpe15:	     0	invalid
111*4882a593Smuzhiyun		  gpe16:	     0	invalid
112*4882a593Smuzhiyun		  gpe17:	  1084	 enable
113*4882a593Smuzhiyun		  gpe18:	     0	 enable
114*4882a593Smuzhiyun		  gpe19:	     0	invalid
115*4882a593Smuzhiyun		  gpe1A:	     0	invalid
116*4882a593Smuzhiyun		  gpe1B:	     0	invalid
117*4882a593Smuzhiyun		  gpe1C:	     0	invalid
118*4882a593Smuzhiyun		  gpe1D:	     0	invalid
119*4882a593Smuzhiyun		  gpe1E:	     0	invalid
120*4882a593Smuzhiyun		  gpe1F:	     0	invalid
121*4882a593Smuzhiyun		  gpe_all:	  1192
122*4882a593Smuzhiyun		  sci:		  1194
123*4882a593Smuzhiyun		  sci_not:	     0
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun		===========  ==================================================
126*4882a593Smuzhiyun		sci	     The number of times the ACPI SCI
127*4882a593Smuzhiyun			     has been called and claimed an interrupt.
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun		sci_not	     The number of times the ACPI SCI
130*4882a593Smuzhiyun			     has been called and NOT claimed an interrupt.
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun		gpe_all	     count of SCI caused by GPEs.
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun		gpeXX	     count for individual GPE source
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun		ff_gbl_lock  Global Lock
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun		ff_pmtimer   PM Timer
139*4882a593Smuzhiyun
140*4882a593Smuzhiyun		ff_pwr_btn   Power Button
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun		ff_rt_clk    Real Time Clock
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun		ff_slp_btn   Sleep Button
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun		error	     an interrupt that can't be accounted for above.
147*4882a593Smuzhiyun
148*4882a593Smuzhiyun		invalid      it's either a GPE or a Fixed Event that
149*4882a593Smuzhiyun			     doesn't have an event handler.
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun		disable	     the GPE/Fixed Event is valid but disabled.
152*4882a593Smuzhiyun
153*4882a593Smuzhiyun		enable       the GPE/Fixed Event is valid and enabled.
154*4882a593Smuzhiyun		===========  ==================================================
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun		Root has permission to clear any of these counters.  Eg.::
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun		  # echo 0 > gpe11
159*4882a593Smuzhiyun
160*4882a593Smuzhiyun		All counters can be cleared by clearing the total "sci"::
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun		  # echo 0 > sci
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun		None of these counters has an effect on the function
165*4882a593Smuzhiyun		of the system, they are simply statistics.
166*4882a593Smuzhiyun
167*4882a593Smuzhiyun		Besides this, user can also write specific strings to these files
168*4882a593Smuzhiyun		to enable/disable/clear ACPI interrupts in user space, which can be
169*4882a593Smuzhiyun		used to debug some ACPI interrupt storm issues.
170*4882a593Smuzhiyun
171*4882a593Smuzhiyun		Note that only writing to VALID GPE/Fixed Event is allowed,
172*4882a593Smuzhiyun		i.e. user can only change the status of runtime GPE and
173*4882a593Smuzhiyun		Fixed Event with event handler installed.
174*4882a593Smuzhiyun
175*4882a593Smuzhiyun		Let's take power button fixed event for example, please kill acpid
176*4882a593Smuzhiyun		and other user space applications so that the machine won't shutdown
177*4882a593Smuzhiyun		when pressing the power button::
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun		  # cat ff_pwr_btn
180*4882a593Smuzhiyun		  0	enabled
181*4882a593Smuzhiyun		  # press the power button for 3 times;
182*4882a593Smuzhiyun		  # cat ff_pwr_btn
183*4882a593Smuzhiyun		  3	enabled
184*4882a593Smuzhiyun		  # echo disable > ff_pwr_btn
185*4882a593Smuzhiyun		  # cat ff_pwr_btn
186*4882a593Smuzhiyun		  3	disabled
187*4882a593Smuzhiyun		  # press the power button for 3 times;
188*4882a593Smuzhiyun		  # cat ff_pwr_btn
189*4882a593Smuzhiyun		  3	disabled
190*4882a593Smuzhiyun		  # echo enable > ff_pwr_btn
191*4882a593Smuzhiyun		  # cat ff_pwr_btn
192*4882a593Smuzhiyun		  4	enabled
193*4882a593Smuzhiyun		  /*
194*4882a593Smuzhiyun		   * this is because the status bit is set even if the enable
195*4882a593Smuzhiyun		   * bit is cleared, and it triggers an ACPI fixed event when
196*4882a593Smuzhiyun		   * the enable bit is set again
197*4882a593Smuzhiyun		   */
198*4882a593Smuzhiyun		  # press the power button for 3 times;
199*4882a593Smuzhiyun		  # cat ff_pwr_btn
200*4882a593Smuzhiyun		  7	enabled
201*4882a593Smuzhiyun		  # echo disable > ff_pwr_btn
202*4882a593Smuzhiyun		  # press the power button for 3 times;
203*4882a593Smuzhiyun		  # echo clear > ff_pwr_btn	/* clear the status bit */
204*4882a593Smuzhiyun		  # echo disable > ff_pwr_btn
205*4882a593Smuzhiyun		  # cat ff_pwr_btn
206*4882a593Smuzhiyun		  7	enabled
207*4882a593Smuzhiyun
208