1d1ff4b1cSMatthew GarrettWhat:		/sys/firmware/acpi/bgrt/
2d1ff4b1cSMatthew GarrettDate:		January 2012
3d1ff4b1cSMatthew GarrettContact:	Matthew Garrett <mjg@redhat.com>
4d1ff4b1cSMatthew GarrettDescription:
5d1ff4b1cSMatthew Garrett		The BGRT is an ACPI 5.0 feature that allows the OS
6d1ff4b1cSMatthew Garrett		to obtain a copy of the firmware boot splash and
7d1ff4b1cSMatthew Garrett		some associated metadata. This is intended to be used
8d1ff4b1cSMatthew Garrett		by boot splash applications in order to interact with
9d1ff4b1cSMatthew Garrett		the firmware boot splash in order to avoid jarring
10d1ff4b1cSMatthew Garrett		transitions.
11d1ff4b1cSMatthew Garrett
12d1ff4b1cSMatthew Garrett		image: The image bitmap. Currently a 32-bit BMP.
13d1ff4b1cSMatthew Garrett		status: 1 if the image is valid, 0 if firmware invalidated it.
14d1ff4b1cSMatthew Garrett		type: 0 indicates image is in BMP format.
15d1ff4b1cSMatthew Garrett		version: The version of the BGRT. Currently 1.
16d1ff4b1cSMatthew Garrett		xoffset: The number of pixels between the left of the screen
17d1ff4b1cSMatthew Garrett			 and the left edge of the image.
18d1ff4b1cSMatthew Garrett		yoffset: The number of pixels between the top of the screen
19d1ff4b1cSMatthew Garrett			 and the top edge of the image.
20d1ff4b1cSMatthew Garrett
213f8055c3SRafael J. WysockiWhat:		/sys/firmware/acpi/hotplug/
223f8055c3SRafael J. WysockiDate:		February 2013
233f8055c3SRafael J. WysockiContact:	Rafael J. Wysocki <rafael.j.wysocki@intel.com>
243f8055c3SRafael J. WysockiDescription:
253f8055c3SRafael J. Wysocki		There are separate hotplug profiles for different classes of
263f8055c3SRafael J. Wysocki		devices supported by ACPI, such as containers, memory modules,
273f8055c3SRafael J. Wysocki		processors, PCI root bridges etc.  A hotplug profile for a given
283f8055c3SRafael J. Wysocki		class of devices is a collection of settings defining the way
293f8055c3SRafael J. Wysocki		that class of devices will be handled by the ACPI core hotplug
303f8055c3SRafael J. Wysocki		code.  Those profiles are represented in sysfs as subdirectories
313f8055c3SRafael J. Wysocki		of /sys/firmware/acpi/hotplug/.
323f8055c3SRafael J. Wysocki
333f8055c3SRafael J. Wysocki		The following setting is available to user space for each
343f8055c3SRafael J. Wysocki		hotplug profile:
353f8055c3SRafael J. Wysocki
363f8055c3SRafael J. Wysocki		enabled: If set, the ACPI core will handle notifications of
373f8055c3SRafael J. Wysocki			hotplug events associated with the given class of
383f8055c3SRafael J. Wysocki			devices and will allow those devices to be ejected with
393f8055c3SRafael J. Wysocki			the help of the _EJ0 control method.  Unsetting it
403f8055c3SRafael J. Wysocki			effectively disables hotplug for the correspoinding
413f8055c3SRafael J. Wysocki			class of devices.
423f8055c3SRafael J. Wysocki
433f8055c3SRafael J. Wysocki		The value of the above attribute is an integer number: 1 (set)
443f8055c3SRafael J. Wysocki		or 0 (unset).  Attempts to write any other values to it will
453f8055c3SRafael J. Wysocki		cause -EINVAL to be returned.
463f8055c3SRafael J. Wysocki
475229e87dSLen BrownWhat:		/sys/firmware/acpi/interrupts/
485229e87dSLen BrownDate:		February 2008
495229e87dSLen BrownContact:	Len Brown <lenb@kernel.org>
505229e87dSLen BrownDescription:
515229e87dSLen Brown		All ACPI interrupts are handled via a single IRQ,
525229e87dSLen Brown		the System Control Interrupt (SCI), which appears
535229e87dSLen Brown		as "acpi" in /proc/interrupts.
545229e87dSLen Brown
555229e87dSLen Brown		However, one of the main functions of ACPI is to make
565229e87dSLen Brown		the platform understand random hardware without
575229e87dSLen Brown		special driver support.  So while the SCI handles a few
585229e87dSLen Brown		well known (fixed feature) interrupts sources, such
595229e87dSLen Brown		as the power button, it can also handle a variable
605229e87dSLen Brown		number of a "General Purpose Events" (GPE).
615229e87dSLen Brown
625229e87dSLen Brown		A GPE vectors to a specified handler in AML, which
635229e87dSLen Brown		can do a anything the BIOS writer wants from
645229e87dSLen Brown		OS context.  GPE 0x12, for example, would vector
655229e87dSLen Brown		to a level or edge handler called _L12 or _E12.
665229e87dSLen Brown		The handler may do its business and return.
675229e87dSLen Brown		Or the handler may send send a Notify event
685229e87dSLen Brown		to a Linux device driver registered on an ACPI device,
695229e87dSLen Brown		such as a battery, or a processor.
705229e87dSLen Brown
715229e87dSLen Brown		To figure out where all the SCI's are coming from,
725229e87dSLen Brown		/sys/firmware/acpi/interrupts contains a file listing
735229e87dSLen Brown		every possible source, and the count of how many
745229e87dSLen Brown		times it has triggered.
755229e87dSLen Brown
765229e87dSLen Brown		$ cd /sys/firmware/acpi/interrupts
775229e87dSLen Brown		$ grep . *
785229e87dSLen Brown		error:	     0
7971b58cbbSZhang Rui		ff_gbl_lock:	   0   enable
8071b58cbbSZhang Rui		ff_pmtimer:	  0  invalid
8171b58cbbSZhang Rui		ff_pwr_btn:	  0   enable
8271b58cbbSZhang Rui		ff_rt_clk:	 2  disable
8371b58cbbSZhang Rui		ff_slp_btn:	  0  invalid
8471b58cbbSZhang Rui		gpe00:	     0	invalid
8571b58cbbSZhang Rui		gpe01:	     0	 enable
8671b58cbbSZhang Rui		gpe02:	   108	 enable
8771b58cbbSZhang Rui		gpe03:	     0	invalid
8871b58cbbSZhang Rui		gpe04:	     0	invalid
8971b58cbbSZhang Rui		gpe05:	     0	invalid
9071b58cbbSZhang Rui		gpe06:	     0	 enable
9171b58cbbSZhang Rui		gpe07:	     0	 enable
9271b58cbbSZhang Rui		gpe08:	     0	invalid
9371b58cbbSZhang Rui		gpe09:	     0	invalid
9471b58cbbSZhang Rui		gpe0A:	     0	invalid
9571b58cbbSZhang Rui		gpe0B:	     0	invalid
9671b58cbbSZhang Rui		gpe0C:	     0	invalid
9771b58cbbSZhang Rui		gpe0D:	     0	invalid
9871b58cbbSZhang Rui		gpe0E:	     0	invalid
9971b58cbbSZhang Rui		gpe0F:	     0	invalid
10071b58cbbSZhang Rui		gpe10:	     0	invalid
10171b58cbbSZhang Rui		gpe11:	     0	invalid
10271b58cbbSZhang Rui		gpe12:	     0	invalid
10371b58cbbSZhang Rui		gpe13:	     0	invalid
10471b58cbbSZhang Rui		gpe14:	     0	invalid
10571b58cbbSZhang Rui		gpe15:	     0	invalid
10671b58cbbSZhang Rui		gpe16:	     0	invalid
10771b58cbbSZhang Rui		gpe17:	  1084	 enable
10871b58cbbSZhang Rui		gpe18:	     0	 enable
10971b58cbbSZhang Rui		gpe19:	     0	invalid
11071b58cbbSZhang Rui		gpe1A:	     0	invalid
11171b58cbbSZhang Rui		gpe1B:	     0	invalid
11271b58cbbSZhang Rui		gpe1C:	     0	invalid
11371b58cbbSZhang Rui		gpe1D:	     0	invalid
11471b58cbbSZhang Rui		gpe1E:	     0	invalid
11571b58cbbSZhang Rui		gpe1F:	     0	invalid
11671b58cbbSZhang Rui		gpe_all:    1192
11771b58cbbSZhang Rui		sci:	1194
11888bea188SLen Brown		sci_not:     0
1195229e87dSLen Brown
12088bea188SLen Brown		sci - The number of times the ACPI SCI
12188bea188SLen Brown		has been called and claimed an interrupt.
12288bea188SLen Brown
12388bea188SLen Brown		sci_not - The number of times the ACPI SCI
12488bea188SLen Brown		has been called and NOT claimed an interrupt.
1255229e87dSLen Brown
1265229e87dSLen Brown		gpe_all - count of SCI caused by GPEs.
1275229e87dSLen Brown
1285229e87dSLen Brown		gpeXX - count for individual GPE source
1295229e87dSLen Brown
1305229e87dSLen Brown		ff_gbl_lock - Global Lock
1315229e87dSLen Brown
1325229e87dSLen Brown		ff_pmtimer - PM Timer
1335229e87dSLen Brown
1345229e87dSLen Brown		ff_pwr_btn - Power Button
1355229e87dSLen Brown
1365229e87dSLen Brown		ff_rt_clk - Real Time Clock
1375229e87dSLen Brown
1385229e87dSLen Brown		ff_slp_btn - Sleep Button
1395229e87dSLen Brown
1405229e87dSLen Brown		error - an interrupt that can't be accounted for above.
1415229e87dSLen Brown
142ed206facSZhang Rui		invalid: it's either a GPE or a Fixed Event that
14371b58cbbSZhang Rui			doesn't have an event handler.
14471b58cbbSZhang Rui
14571b58cbbSZhang Rui		disable: the GPE/Fixed Event is valid but disabled.
14671b58cbbSZhang Rui
14771b58cbbSZhang Rui		enable: the GPE/Fixed Event is valid and enabled.
14871b58cbbSZhang Rui
1495229e87dSLen Brown		Root has permission to clear any of these counters.  Eg.
1505229e87dSLen Brown		# echo 0 > gpe11
1515229e87dSLen Brown
1525229e87dSLen Brown		All counters can be cleared by clearing the total "sci":
1535229e87dSLen Brown		# echo 0 > sci
1545229e87dSLen Brown
1555229e87dSLen Brown		None of these counters has an effect on the function
1565229e87dSLen Brown		of the system, they are simply statistics.
15771b58cbbSZhang Rui
15871b58cbbSZhang Rui		Besides this, user can also write specific strings to these files
15971b58cbbSZhang Rui		to enable/disable/clear ACPI interrupts in user space, which can be
16071b58cbbSZhang Rui		used to debug some ACPI interrupt storm issues.
16171b58cbbSZhang Rui
16271b58cbbSZhang Rui		Note that only writting to VALID GPE/Fixed Event is allowed,
16371b58cbbSZhang Rui		i.e. user can only change the status of runtime GPE and
16471b58cbbSZhang Rui		Fixed Event with event handler installed.
16571b58cbbSZhang Rui
16671b58cbbSZhang Rui		Let's take power button fixed event for example, please kill acpid
16771b58cbbSZhang Rui		and other user space applications so that the machine won't shutdown
16871b58cbbSZhang Rui		when pressing the power button.
16971b58cbbSZhang Rui		# cat ff_pwr_btn
170ed206facSZhang Rui		0	enabled
17171b58cbbSZhang Rui		# press the power button for 3 times;
17271b58cbbSZhang Rui		# cat ff_pwr_btn
173ed206facSZhang Rui		3	enabled
17471b58cbbSZhang Rui		# echo disable > ff_pwr_btn
17571b58cbbSZhang Rui		# cat ff_pwr_btn
176ed206facSZhang Rui		3	disabled
17771b58cbbSZhang Rui		# press the power button for 3 times;
17871b58cbbSZhang Rui		# cat ff_pwr_btn
179ed206facSZhang Rui		3	disabled
18071b58cbbSZhang Rui		# echo enable > ff_pwr_btn
18171b58cbbSZhang Rui		# cat ff_pwr_btn
182ed206facSZhang Rui		4	enabled
18371b58cbbSZhang Rui		/*
18471b58cbbSZhang Rui		 * this is because the status bit is set even if the enable bit is cleared,
18571b58cbbSZhang Rui		 * and it triggers an ACPI fixed event when the enable bit is set again
18671b58cbbSZhang Rui		 */
18771b58cbbSZhang Rui		# press the power button for 3 times;
18871b58cbbSZhang Rui		# cat ff_pwr_btn
189ed206facSZhang Rui		7	enabled
19071b58cbbSZhang Rui		# echo disable > ff_pwr_btn
19171b58cbbSZhang Rui		# press the power button for 3 times;
19271b58cbbSZhang Rui		# echo clear > ff_pwr_btn	/* clear the status bit */
19371b58cbbSZhang Rui		# echo disable > ff_pwr_btn
19471b58cbbSZhang Rui		# cat ff_pwr_btn
195ed206facSZhang Rui		7	enabled
19671b58cbbSZhang Rui
197