162306a36Sopenharmony_ciWhat:		/sys/firmware/acpi/fpdt/
262306a36Sopenharmony_ciDate:		Jan 2021
362306a36Sopenharmony_ciContact:	Zhang Rui <rui.zhang@intel.com>
462306a36Sopenharmony_ciDescription:
562306a36Sopenharmony_ci		ACPI Firmware Performance Data Table (FPDT) provides
662306a36Sopenharmony_ci		information for firmware performance data for system boot,
762306a36Sopenharmony_ci		S3 suspend and S3 resume. This sysfs entry contains the
862306a36Sopenharmony_ci		performance data retrieved from the FPDT.
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci		boot:
1162306a36Sopenharmony_ci			firmware_start_ns: Timer value logged at the beginning
1262306a36Sopenharmony_ci				of firmware image execution. In nanoseconds.
1362306a36Sopenharmony_ci			bootloader_load_ns: Timer value logged just prior to
1462306a36Sopenharmony_ci				loading the OS boot loader into memory.
1562306a36Sopenharmony_ci				In nanoseconds.
1662306a36Sopenharmony_ci			bootloader_launch_ns: Timer value logged just prior to
1762306a36Sopenharmony_ci				launching the currently loaded OS boot loader
1862306a36Sopenharmony_ci				image. In nanoseconds.
1962306a36Sopenharmony_ci			exitbootservice_start_ns: Timer value logged at the
2062306a36Sopenharmony_ci				point when the OS loader calls the
2162306a36Sopenharmony_ci				ExitBootServices function for UEFI compatible
2262306a36Sopenharmony_ci				firmware. In nanoseconds.
2362306a36Sopenharmony_ci			exitbootservice_end_ns: Timer value logged at the point
2462306a36Sopenharmony_ci				just prior to the OS loader gaining control
2562306a36Sopenharmony_ci				back from the ExitBootServices function for
2662306a36Sopenharmony_ci				UEFI compatible firmware. In nanoseconds.
2762306a36Sopenharmony_ci		suspend:
2862306a36Sopenharmony_ci			suspend_start_ns: Timer value recorded at the previous
2962306a36Sopenharmony_ci				OS write to SLP_TYP upon entry to S3. In
3062306a36Sopenharmony_ci				nanoseconds.
3162306a36Sopenharmony_ci			suspend_end_ns: Timer value recorded at the previous
3262306a36Sopenharmony_ci				firmware write to SLP_TYP used to trigger
3362306a36Sopenharmony_ci				hardware entry to S3. In nanoseconds.
3462306a36Sopenharmony_ci		resume:
3562306a36Sopenharmony_ci			resume_count: A count of the number of S3 resume cycles
3662306a36Sopenharmony_ci				since the last full boot sequence.
3762306a36Sopenharmony_ci			resume_avg_ns: Average timer value of all resume cycles
3862306a36Sopenharmony_ci				logged since the last full boot sequence,
3962306a36Sopenharmony_ci				including the most recent resume. In nanoseconds.
4062306a36Sopenharmony_ci			resume_prev_ns: Timer recorded at the end of the previous
4162306a36Sopenharmony_ci				platform runtime firmware S3 resume, just prior to
4262306a36Sopenharmony_ci				handoff to the OS waking vector. In nanoseconds.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciWhat:		/sys/firmware/acpi/bgrt/
4562306a36Sopenharmony_ciDate:		January 2012
4662306a36Sopenharmony_ciContact:	Matthew Garrett <mjg@redhat.com>
4762306a36Sopenharmony_ciDescription:
4862306a36Sopenharmony_ci		The BGRT is an ACPI 5.0 feature that allows the OS
4962306a36Sopenharmony_ci		to obtain a copy of the firmware boot splash and
5062306a36Sopenharmony_ci		some associated metadata. This is intended to be used
5162306a36Sopenharmony_ci		by boot splash applications in order to interact with
5262306a36Sopenharmony_ci		the firmware boot splash in order to avoid jarring
5362306a36Sopenharmony_ci		transitions.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci		image: The image bitmap. Currently a 32-bit BMP.
5662306a36Sopenharmony_ci		status: 1 if the image is valid, 0 if firmware invalidated it.
5762306a36Sopenharmony_ci		type: 0 indicates image is in BMP format.
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci		======== ===================================================
6062306a36Sopenharmony_ci		version: The version of the BGRT. Currently 1.
6162306a36Sopenharmony_ci		xoffset: The number of pixels between the left of the screen
6262306a36Sopenharmony_ci			 and the left edge of the image.
6362306a36Sopenharmony_ci		yoffset: The number of pixels between the top of the screen
6462306a36Sopenharmony_ci			 and the top edge of the image.
6562306a36Sopenharmony_ci		======== ===================================================
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ciWhat:		/sys/firmware/acpi/hotplug/
6862306a36Sopenharmony_ciDate:		February 2013
6962306a36Sopenharmony_ciContact:	Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7062306a36Sopenharmony_ciDescription:
7162306a36Sopenharmony_ci		There are separate hotplug profiles for different classes of
7262306a36Sopenharmony_ci		devices supported by ACPI, such as containers, memory modules,
7362306a36Sopenharmony_ci		processors, PCI root bridges etc.  A hotplug profile for a given
7462306a36Sopenharmony_ci		class of devices is a collection of settings defining the way
7562306a36Sopenharmony_ci		that class of devices will be handled by the ACPI core hotplug
7662306a36Sopenharmony_ci		code.  Those profiles are represented in sysfs as subdirectories
7762306a36Sopenharmony_ci		of /sys/firmware/acpi/hotplug/.
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci		The following setting is available to user space for each
8062306a36Sopenharmony_ci		hotplug profile:
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci		======== =======================================================
8362306a36Sopenharmony_ci		enabled: If set, the ACPI core will handle notifications of
8462306a36Sopenharmony_ci			 hotplug events associated with the given class of
8562306a36Sopenharmony_ci			 devices and will allow those devices to be ejected with
8662306a36Sopenharmony_ci			 the help of the _EJ0 control method.  Unsetting it
8762306a36Sopenharmony_ci			 effectively disables hotplug for the corresponding
8862306a36Sopenharmony_ci			 class of devices.
8962306a36Sopenharmony_ci		======== =======================================================
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci		The value of the above attribute is an integer number: 1 (set)
9262306a36Sopenharmony_ci		or 0 (unset).  Attempts to write any other values to it will
9362306a36Sopenharmony_ci		cause -EINVAL to be returned.
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ciWhat:		/sys/firmware/acpi/interrupts/
9662306a36Sopenharmony_ciDate:		February 2008
9762306a36Sopenharmony_ciContact:	Len Brown <lenb@kernel.org>
9862306a36Sopenharmony_ciDescription:
9962306a36Sopenharmony_ci		All ACPI interrupts are handled via a single IRQ,
10062306a36Sopenharmony_ci		the System Control Interrupt (SCI), which appears
10162306a36Sopenharmony_ci		as "acpi" in /proc/interrupts.
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci		However, one of the main functions of ACPI is to make
10462306a36Sopenharmony_ci		the platform understand random hardware without
10562306a36Sopenharmony_ci		special driver support.  So while the SCI handles a few
10662306a36Sopenharmony_ci		well known (fixed feature) interrupts sources, such
10762306a36Sopenharmony_ci		as the power button, it can also handle a variable
10862306a36Sopenharmony_ci		number of a "General Purpose Events" (GPE).
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci		A GPE vectors to a specified handler in AML, which
11162306a36Sopenharmony_ci		can do a anything the BIOS writer wants from
11262306a36Sopenharmony_ci		OS context.  GPE 0x12, for example, would vector
11362306a36Sopenharmony_ci		to a level or edge handler called _L12 or _E12.
11462306a36Sopenharmony_ci		The handler may do its business and return.
11562306a36Sopenharmony_ci		Or the handler may send send a Notify event
11662306a36Sopenharmony_ci		to a Linux device driver registered on an ACPI device,
11762306a36Sopenharmony_ci		such as a battery, or a processor.
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci		To figure out where all the SCI's are coming from,
12062306a36Sopenharmony_ci		/sys/firmware/acpi/interrupts contains a file listing
12162306a36Sopenharmony_ci		every possible source, and the count of how many
12262306a36Sopenharmony_ci		times it has triggered::
12362306a36Sopenharmony_ci
12462306a36Sopenharmony_ci		  $ cd /sys/firmware/acpi/interrupts
12562306a36Sopenharmony_ci		  $ grep . *
12662306a36Sopenharmony_ci		  error:	     0
12762306a36Sopenharmony_ci		  ff_gbl_lock:	     0   enable
12862306a36Sopenharmony_ci		  ff_pmtimer:	     0  invalid
12962306a36Sopenharmony_ci		  ff_pwr_btn:	     0   enable
13062306a36Sopenharmony_ci		  ff_rt_clk:	     2  disable
13162306a36Sopenharmony_ci		  ff_slp_btn:	     0  invalid
13262306a36Sopenharmony_ci		  gpe00:	     0	invalid
13362306a36Sopenharmony_ci		  gpe01:	     0	 enable
13462306a36Sopenharmony_ci		  gpe02:	   108	 enable
13562306a36Sopenharmony_ci		  gpe03:	     0	invalid
13662306a36Sopenharmony_ci		  gpe04:	     0	invalid
13762306a36Sopenharmony_ci		  gpe05:	     0	invalid
13862306a36Sopenharmony_ci		  gpe06:	     0	 enable
13962306a36Sopenharmony_ci		  gpe07:	     0	 enable
14062306a36Sopenharmony_ci		  gpe08:	     0	invalid
14162306a36Sopenharmony_ci		  gpe09:	     0	invalid
14262306a36Sopenharmony_ci		  gpe0A:	     0	invalid
14362306a36Sopenharmony_ci		  gpe0B:	     0	invalid
14462306a36Sopenharmony_ci		  gpe0C:	     0	invalid
14562306a36Sopenharmony_ci		  gpe0D:	     0	invalid
14662306a36Sopenharmony_ci		  gpe0E:	     0	invalid
14762306a36Sopenharmony_ci		  gpe0F:	     0	invalid
14862306a36Sopenharmony_ci		  gpe10:	     0	invalid
14962306a36Sopenharmony_ci		  gpe11:	     0	invalid
15062306a36Sopenharmony_ci		  gpe12:	     0	invalid
15162306a36Sopenharmony_ci		  gpe13:	     0	invalid
15262306a36Sopenharmony_ci		  gpe14:	     0	invalid
15362306a36Sopenharmony_ci		  gpe15:	     0	invalid
15462306a36Sopenharmony_ci		  gpe16:	     0	invalid
15562306a36Sopenharmony_ci		  gpe17:	  1084	 enable
15662306a36Sopenharmony_ci		  gpe18:	     0	 enable
15762306a36Sopenharmony_ci		  gpe19:	     0	invalid
15862306a36Sopenharmony_ci		  gpe1A:	     0	invalid
15962306a36Sopenharmony_ci		  gpe1B:	     0	invalid
16062306a36Sopenharmony_ci		  gpe1C:	     0	invalid
16162306a36Sopenharmony_ci		  gpe1D:	     0	invalid
16262306a36Sopenharmony_ci		  gpe1E:	     0	invalid
16362306a36Sopenharmony_ci		  gpe1F:	     0	invalid
16462306a36Sopenharmony_ci		  gpe_all:	  1192
16562306a36Sopenharmony_ci		  sci:		  1194
16662306a36Sopenharmony_ci		  sci_not:	     0
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci		===========  ==================================================
16962306a36Sopenharmony_ci		sci	     The number of times the ACPI SCI
17062306a36Sopenharmony_ci			     has been called and claimed an interrupt.
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci		sci_not	     The number of times the ACPI SCI
17362306a36Sopenharmony_ci			     has been called and NOT claimed an interrupt.
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ci		gpe_all	     count of SCI caused by GPEs.
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci		gpeXX	     count for individual GPE source
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci		ff_gbl_lock  Global Lock
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci		ff_pmtimer   PM Timer
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci		ff_pwr_btn   Power Button
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci		ff_rt_clk    Real Time Clock
18662306a36Sopenharmony_ci
18762306a36Sopenharmony_ci		ff_slp_btn   Sleep Button
18862306a36Sopenharmony_ci
18962306a36Sopenharmony_ci		error	     an interrupt that can't be accounted for above.
19062306a36Sopenharmony_ci
19162306a36Sopenharmony_ci		invalid      it's either a GPE or a Fixed Event that
19262306a36Sopenharmony_ci			     doesn't have an event handler.
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ci		disable	     the GPE/Fixed Event is valid but disabled.
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci		enable       the GPE/Fixed Event is valid and enabled.
19762306a36Sopenharmony_ci		===========  ==================================================
19862306a36Sopenharmony_ci
19962306a36Sopenharmony_ci		Root has permission to clear any of these counters.  Eg.::
20062306a36Sopenharmony_ci
20162306a36Sopenharmony_ci		  # echo 0 > gpe11
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci		All counters can be cleared by clearing the total "sci"::
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci		  # echo 0 > sci
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci		None of these counters has an effect on the function
20862306a36Sopenharmony_ci		of the system, they are simply statistics.
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ci		Besides this, user can also write specific strings to these files
21162306a36Sopenharmony_ci		to enable/disable/clear ACPI interrupts in user space, which can be
21262306a36Sopenharmony_ci		used to debug some ACPI interrupt storm issues.
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci		Note that only writing to VALID GPE/Fixed Event is allowed,
21562306a36Sopenharmony_ci		i.e. user can only change the status of runtime GPE and
21662306a36Sopenharmony_ci		Fixed Event with event handler installed.
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_ci		Let's take power button fixed event for example, please kill acpid
21962306a36Sopenharmony_ci		and other user space applications so that the machine won't shutdown
22062306a36Sopenharmony_ci		when pressing the power button::
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ci		  # cat ff_pwr_btn
22362306a36Sopenharmony_ci		  0	enabled
22462306a36Sopenharmony_ci		  # press the power button for 3 times;
22562306a36Sopenharmony_ci		  # cat ff_pwr_btn
22662306a36Sopenharmony_ci		  3	enabled
22762306a36Sopenharmony_ci		  # echo disable > ff_pwr_btn
22862306a36Sopenharmony_ci		  # cat ff_pwr_btn
22962306a36Sopenharmony_ci		  3	disabled
23062306a36Sopenharmony_ci		  # press the power button for 3 times;
23162306a36Sopenharmony_ci		  # cat ff_pwr_btn
23262306a36Sopenharmony_ci		  3	disabled
23362306a36Sopenharmony_ci		  # echo enable > ff_pwr_btn
23462306a36Sopenharmony_ci		  # cat ff_pwr_btn
23562306a36Sopenharmony_ci		  4	enabled
23662306a36Sopenharmony_ci		  /*
23762306a36Sopenharmony_ci		   * this is because the status bit is set even if the enable
23862306a36Sopenharmony_ci		   * bit is cleared, and it triggers an ACPI fixed event when
23962306a36Sopenharmony_ci		   * the enable bit is set again
24062306a36Sopenharmony_ci		   */
24162306a36Sopenharmony_ci		  # press the power button for 3 times;
24262306a36Sopenharmony_ci		  # cat ff_pwr_btn
24362306a36Sopenharmony_ci		  7	enabled
24462306a36Sopenharmony_ci		  # echo disable > ff_pwr_btn
24562306a36Sopenharmony_ci		  # press the power button for 3 times;
24662306a36Sopenharmony_ci		  # echo clear > ff_pwr_btn	/* clear the status bit */
24762306a36Sopenharmony_ci		  # echo disable > ff_pwr_btn
24862306a36Sopenharmony_ci		  # cat ff_pwr_btn
24962306a36Sopenharmony_ci		  7	enabled
25062306a36Sopenharmony_ci
251