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
215229e87dSLen BrownWhat:		/sys/firmware/acpi/interrupts/
225229e87dSLen BrownDate:		February 2008
235229e87dSLen BrownContact:	Len Brown <lenb@kernel.org>
245229e87dSLen BrownDescription:
255229e87dSLen Brown		All ACPI interrupts are handled via a single IRQ,
265229e87dSLen Brown		the System Control Interrupt (SCI), which appears
275229e87dSLen Brown		as "acpi" in /proc/interrupts.
285229e87dSLen Brown
295229e87dSLen Brown		However, one of the main functions of ACPI is to make
305229e87dSLen Brown		the platform understand random hardware without
315229e87dSLen Brown		special driver support.  So while the SCI handles a few
325229e87dSLen Brown		well known (fixed feature) interrupts sources, such
335229e87dSLen Brown		as the power button, it can also handle a variable
345229e87dSLen Brown		number of a "General Purpose Events" (GPE).
355229e87dSLen Brown
365229e87dSLen Brown		A GPE vectors to a specified handler in AML, which
375229e87dSLen Brown		can do a anything the BIOS writer wants from
385229e87dSLen Brown		OS context.  GPE 0x12, for example, would vector
395229e87dSLen Brown		to a level or edge handler called _L12 or _E12.
405229e87dSLen Brown		The handler may do its business and return.
415229e87dSLen Brown		Or the handler may send send a Notify event
425229e87dSLen Brown		to a Linux device driver registered on an ACPI device,
435229e87dSLen Brown		such as a battery, or a processor.
445229e87dSLen Brown
455229e87dSLen Brown		To figure out where all the SCI's are coming from,
465229e87dSLen Brown		/sys/firmware/acpi/interrupts contains a file listing
475229e87dSLen Brown		every possible source, and the count of how many
485229e87dSLen Brown		times it has triggered.
495229e87dSLen Brown
505229e87dSLen Brown		$ cd /sys/firmware/acpi/interrupts
515229e87dSLen Brown		$ grep . *
525229e87dSLen Brown		error:	     0
5371b58cbbSZhang Rui		ff_gbl_lock:	   0   enable
5471b58cbbSZhang Rui		ff_pmtimer:	  0  invalid
5571b58cbbSZhang Rui		ff_pwr_btn:	  0   enable
5671b58cbbSZhang Rui		ff_rt_clk:	 2  disable
5771b58cbbSZhang Rui		ff_slp_btn:	  0  invalid
5871b58cbbSZhang Rui		gpe00:	     0	invalid
5971b58cbbSZhang Rui		gpe01:	     0	 enable
6071b58cbbSZhang Rui		gpe02:	   108	 enable
6171b58cbbSZhang Rui		gpe03:	     0	invalid
6271b58cbbSZhang Rui		gpe04:	     0	invalid
6371b58cbbSZhang Rui		gpe05:	     0	invalid
6471b58cbbSZhang Rui		gpe06:	     0	 enable
6571b58cbbSZhang Rui		gpe07:	     0	 enable
6671b58cbbSZhang Rui		gpe08:	     0	invalid
6771b58cbbSZhang Rui		gpe09:	     0	invalid
6871b58cbbSZhang Rui		gpe0A:	     0	invalid
6971b58cbbSZhang Rui		gpe0B:	     0	invalid
7071b58cbbSZhang Rui		gpe0C:	     0	invalid
7171b58cbbSZhang Rui		gpe0D:	     0	invalid
7271b58cbbSZhang Rui		gpe0E:	     0	invalid
7371b58cbbSZhang Rui		gpe0F:	     0	invalid
7471b58cbbSZhang Rui		gpe10:	     0	invalid
7571b58cbbSZhang Rui		gpe11:	     0	invalid
7671b58cbbSZhang Rui		gpe12:	     0	invalid
7771b58cbbSZhang Rui		gpe13:	     0	invalid
7871b58cbbSZhang Rui		gpe14:	     0	invalid
7971b58cbbSZhang Rui		gpe15:	     0	invalid
8071b58cbbSZhang Rui		gpe16:	     0	invalid
8171b58cbbSZhang Rui		gpe17:	  1084	 enable
8271b58cbbSZhang Rui		gpe18:	     0	 enable
8371b58cbbSZhang Rui		gpe19:	     0	invalid
8471b58cbbSZhang Rui		gpe1A:	     0	invalid
8571b58cbbSZhang Rui		gpe1B:	     0	invalid
8671b58cbbSZhang Rui		gpe1C:	     0	invalid
8771b58cbbSZhang Rui		gpe1D:	     0	invalid
8871b58cbbSZhang Rui		gpe1E:	     0	invalid
8971b58cbbSZhang Rui		gpe1F:	     0	invalid
9071b58cbbSZhang Rui		gpe_all:    1192
9171b58cbbSZhang Rui		sci:	1194
9288bea188SLen Brown		sci_not:     0
935229e87dSLen Brown
9488bea188SLen Brown		sci - The number of times the ACPI SCI
9588bea188SLen Brown		has been called and claimed an interrupt.
9688bea188SLen Brown
9788bea188SLen Brown		sci_not - The number of times the ACPI SCI
9888bea188SLen Brown		has been called and NOT claimed an interrupt.
995229e87dSLen Brown
1005229e87dSLen Brown		gpe_all - count of SCI caused by GPEs.
1015229e87dSLen Brown
1025229e87dSLen Brown		gpeXX - count for individual GPE source
1035229e87dSLen Brown
1045229e87dSLen Brown		ff_gbl_lock - Global Lock
1055229e87dSLen Brown
1065229e87dSLen Brown		ff_pmtimer - PM Timer
1075229e87dSLen Brown
1085229e87dSLen Brown		ff_pwr_btn - Power Button
1095229e87dSLen Brown
1105229e87dSLen Brown		ff_rt_clk - Real Time Clock
1115229e87dSLen Brown
1125229e87dSLen Brown		ff_slp_btn - Sleep Button
1135229e87dSLen Brown
1145229e87dSLen Brown		error - an interrupt that can't be accounted for above.
1155229e87dSLen Brown
116ed206facSZhang Rui		invalid: it's either a GPE or a Fixed Event that
11771b58cbbSZhang Rui			doesn't have an event handler.
11871b58cbbSZhang Rui
11971b58cbbSZhang Rui		disable: the GPE/Fixed Event is valid but disabled.
12071b58cbbSZhang Rui
12171b58cbbSZhang Rui		enable: the GPE/Fixed Event is valid and enabled.
12271b58cbbSZhang Rui
1235229e87dSLen Brown		Root has permission to clear any of these counters.  Eg.
1245229e87dSLen Brown		# echo 0 > gpe11
1255229e87dSLen Brown
1265229e87dSLen Brown		All counters can be cleared by clearing the total "sci":
1275229e87dSLen Brown		# echo 0 > sci
1285229e87dSLen Brown
1295229e87dSLen Brown		None of these counters has an effect on the function
1305229e87dSLen Brown		of the system, they are simply statistics.
13171b58cbbSZhang Rui
13271b58cbbSZhang Rui		Besides this, user can also write specific strings to these files
13371b58cbbSZhang Rui		to enable/disable/clear ACPI interrupts in user space, which can be
13471b58cbbSZhang Rui		used to debug some ACPI interrupt storm issues.
13571b58cbbSZhang Rui
13671b58cbbSZhang Rui		Note that only writting to VALID GPE/Fixed Event is allowed,
13771b58cbbSZhang Rui		i.e. user can only change the status of runtime GPE and
13871b58cbbSZhang Rui		Fixed Event with event handler installed.
13971b58cbbSZhang Rui
14071b58cbbSZhang Rui		Let's take power button fixed event for example, please kill acpid
14171b58cbbSZhang Rui		and other user space applications so that the machine won't shutdown
14271b58cbbSZhang Rui		when pressing the power button.
14371b58cbbSZhang Rui		# cat ff_pwr_btn
144ed206facSZhang Rui		0	enabled
14571b58cbbSZhang Rui		# press the power button for 3 times;
14671b58cbbSZhang Rui		# cat ff_pwr_btn
147ed206facSZhang Rui		3	enabled
14871b58cbbSZhang Rui		# echo disable > ff_pwr_btn
14971b58cbbSZhang Rui		# cat ff_pwr_btn
150ed206facSZhang Rui		3	disabled
15171b58cbbSZhang Rui		# press the power button for 3 times;
15271b58cbbSZhang Rui		# cat ff_pwr_btn
153ed206facSZhang Rui		3	disabled
15471b58cbbSZhang Rui		# echo enable > ff_pwr_btn
15571b58cbbSZhang Rui		# cat ff_pwr_btn
156ed206facSZhang Rui		4	enabled
15771b58cbbSZhang Rui		/*
15871b58cbbSZhang Rui		 * this is because the status bit is set even if the enable bit is cleared,
15971b58cbbSZhang Rui		 * and it triggers an ACPI fixed event when the enable bit is set again
16071b58cbbSZhang Rui		 */
16171b58cbbSZhang Rui		# press the power button for 3 times;
16271b58cbbSZhang Rui		# cat ff_pwr_btn
163ed206facSZhang Rui		7	enabled
16471b58cbbSZhang Rui		# echo disable > ff_pwr_btn
16571b58cbbSZhang Rui		# press the power button for 3 times;
16671b58cbbSZhang Rui		# echo clear > ff_pwr_btn	/* clear the status bit */
16771b58cbbSZhang Rui		# echo disable > ff_pwr_btn
16871b58cbbSZhang Rui		# cat ff_pwr_btn
169ed206facSZhang Rui		7	enabled
17071b58cbbSZhang Rui
171