xref: /linux/Documentation/ABI/testing/sysfs-firmware-acpi (revision 0fc8f6200d2313278fbf4539bbab74677c685531)
1What:		/sys/firmware/acpi/fpdt/
2Date:		Jan 2021
3Contact:	Zhang Rui <rui.zhang@intel.com>
4Description:
5		ACPI Firmware Performance Data Table (FPDT) provides
6		information for firmware performance data for system boot,
7		S3 suspend and S3 resume. This sysfs entry contains the
8		performance data retrieved from the FPDT.
9
10		boot:
11			firmware_start_ns: Timer value logged at the beginning
12				of firmware image execution. In nanoseconds.
13			bootloader_load_ns: Timer value logged just prior to
14				loading the OS boot loader into memory.
15				In nanoseconds.
16			bootloader_launch_ns: Timer value logged just prior to
17				launching the currently loaded OS boot loader
18				image. In nanoseconds.
19			exitbootservice_start_ns: Timer value logged at the
20				point when the OS loader calls the
21				ExitBootServices function for UEFI compatible
22				firmware. In nanoseconds.
23			exitbootservice_end_ns: Timer value logged at the point
24				just prior to the OS loader gaining control
25				back from the ExitBootServices function for
26				UEFI compatible firmware. In nanoseconds.
27		suspend:
28			suspend_start_ns: Timer value recorded at the previous
29				OS write to SLP_TYP upon entry to S3. In
30				nanoseconds.
31			suspend_end_ns: Timer value recorded at the previous
32				firmware write to SLP_TYP used to trigger
33				hardware entry to S3. In nanoseconds.
34		resume:
35			resume_count: A count of the number of S3 resume cycles
36				since the last full boot sequence.
37			resume_avg_ns: Average timer value of all resume cycles
38				logged since the last full boot sequence,
39				including the most recent resume. In nanoseconds.
40			resume_prev_ns: Timer recorded at the end of the previous
41				platform runtime firmware S3 resume, just prior to
42				handoff to the OS waking vector. In nanoseconds.
43
44		FBPT: The raw binary contents of the Firmware Basic Boot
45			Performance Table (FBPT) subtable.
46
47		S3PT: The raw binary contents of the S3 Performance Table
48			(S3PT) subtable.
49
50What:		/sys/firmware/acpi/bgrt/
51Date:		January 2012
52Contact:	Matthew Garrett <mjg@redhat.com>
53Description:
54		The BGRT is an ACPI 5.0 feature that allows the OS
55		to obtain a copy of the firmware boot splash and
56		some associated metadata. This is intended to be used
57		by boot splash applications in order to interact with
58		the firmware boot splash in order to avoid jarring
59		transitions.
60
61		image: The image bitmap. Currently a 32-bit BMP.
62		status: 1 if the image is valid, 0 if firmware invalidated it.
63		type: 0 indicates image is in BMP format.
64
65		======== ===================================================
66		version: The version of the BGRT. Currently 1.
67		xoffset: The number of pixels between the left of the screen
68			 and the left edge of the image.
69		yoffset: The number of pixels between the top of the screen
70			 and the top edge of the image.
71		======== ===================================================
72
73What:		/sys/firmware/acpi/hotplug/
74Date:		February 2013
75Contact:	Rafael J. Wysocki <rafael.j.wysocki@intel.com>
76Description:
77		There are separate hotplug profiles for different classes of
78		devices supported by ACPI, such as containers, memory modules,
79		processors, PCI root bridges etc.  A hotplug profile for a given
80		class of devices is a collection of settings defining the way
81		that class of devices will be handled by the ACPI core hotplug
82		code.  Those profiles are represented in sysfs as subdirectories
83		of /sys/firmware/acpi/hotplug/.
84
85		The following setting is available to user space for each
86		hotplug profile:
87
88		======== =======================================================
89		enabled: If set, the ACPI core will handle notifications of
90			 hotplug events associated with the given class of
91			 devices and will allow those devices to be ejected with
92			 the help of the _EJ0 control method.  Unsetting it
93			 effectively disables hotplug for the corresponding
94			 class of devices.
95		======== =======================================================
96
97		The value of the above attribute is an integer number: 1 (set)
98		or 0 (unset).  Attempts to write any other values to it will
99		cause -EINVAL to be returned.
100
101What:		/sys/firmware/acpi/interrupts/
102Date:		February 2008
103Contact:	Len Brown <lenb@kernel.org>
104Description:
105		All ACPI interrupts are handled via a single IRQ,
106		the System Control Interrupt (SCI), which appears
107		as "acpi" in /proc/interrupts.
108
109		However, one of the main functions of ACPI is to make
110		the platform understand random hardware without
111		special driver support.  So while the SCI handles a few
112		well known (fixed feature) interrupts sources, such
113		as the power button, it can also handle a variable
114		number of a "General Purpose Events" (GPE).
115
116		A GPE vectors to a specified handler in AML, which
117		can do anything the BIOS writer wants from
118		OS context.  GPE 0x12, for example, would vector
119		to a level or edge handler called _L12 or _E12.
120		The handler may do its business and return.
121		Or the handler may send a Notify event
122		to a Linux device driver registered on an ACPI device,
123		such as a battery, or a processor.
124
125		To figure out where all the SCIs are coming from,
126		/sys/firmware/acpi/interrupts contains a file listing
127		every possible source, and the count of how many
128		times it has triggered::
129
130		  $ cd /sys/firmware/acpi/interrupts
131		  $ grep . *
132		  error:	     0
133		  ff_gbl_lock:	     0   enable
134		  ff_pmtimer:	     0  invalid
135		  ff_pwr_btn:	     0   enable
136		  ff_rt_clk:	     2  disable
137		  ff_slp_btn:	     0  invalid
138		  gpe00:	     0	invalid
139		  gpe01:	     0	 enable
140		  gpe02:	   108	 enable
141		  gpe03:	     0	invalid
142		  gpe04:	     0	invalid
143		  gpe05:	     0	invalid
144		  gpe06:	     0	 enable
145		  gpe07:	     0	 enable
146		  gpe08:	     0	invalid
147		  gpe09:	     0	invalid
148		  gpe0A:	     0	invalid
149		  gpe0B:	     0	invalid
150		  gpe0C:	     0	invalid
151		  gpe0D:	     0	invalid
152		  gpe0E:	     0	invalid
153		  gpe0F:	     0	invalid
154		  gpe10:	     0	invalid
155		  gpe11:	     0	invalid
156		  gpe12:	     0	invalid
157		  gpe13:	     0	invalid
158		  gpe14:	     0	invalid
159		  gpe15:	     0	invalid
160		  gpe16:	     0	invalid
161		  gpe17:	  1084	 enable
162		  gpe18:	     0	 enable
163		  gpe19:	     0	invalid
164		  gpe1A:	     0	invalid
165		  gpe1B:	     0	invalid
166		  gpe1C:	     0	invalid
167		  gpe1D:	     0	invalid
168		  gpe1E:	     0	invalid
169		  gpe1F:	     0	invalid
170		  gpe_all:	  1192
171		  sci:		  1194
172		  sci_not:	     0
173
174		===========  ==================================================
175		sci	     The number of times the ACPI SCI
176			     has been called and claimed an interrupt.
177
178		sci_not	     The number of times the ACPI SCI
179			     has been called and NOT claimed an interrupt.
180
181		gpe_all	     count of SCI caused by GPEs.
182
183		gpeXX	     count for individual GPE source
184
185		ff_gbl_lock  Global Lock
186
187		ff_pmtimer   PM Timer
188
189		ff_pwr_btn   Power Button
190
191		ff_rt_clk    Real Time Clock
192
193		ff_slp_btn   Sleep Button
194
195		error	     an interrupt that can't be accounted for above.
196
197		invalid      it's either a GPE or a Fixed Event that
198			     doesn't have an event handler.
199
200		disable	     the GPE/Fixed Event is valid but disabled.
201
202		enable       the GPE/Fixed Event is valid and enabled.
203		===========  ==================================================
204
205		Root has permission to clear any of these counters.  Eg.::
206
207		  # echo 0 > gpe11
208
209		All counters can be cleared by clearing the total "sci"::
210
211		  # echo 0 > sci
212
213		None of these counters has an effect on the function
214		of the system, they are simply statistics.
215
216		Besides this, user can also write specific strings to these files
217		to enable/disable/clear ACPI interrupts in user space, which can be
218		used to debug some ACPI interrupt storm issues.
219
220		Note that only writing to VALID GPE/Fixed Event is allowed,
221		i.e. user can only change the status of runtime GPE and
222		Fixed Event with event handler installed.
223
224		Let's take power button fixed event for example, please kill acpid
225		and other user space applications so that the machine won't shutdown
226		when pressing the power button::
227
228		  # cat ff_pwr_btn
229		  0	enabled
230		  # press the power button for 3 times;
231		  # cat ff_pwr_btn
232		  3	enabled
233		  # echo disable > ff_pwr_btn
234		  # cat ff_pwr_btn
235		  3	disabled
236		  # press the power button for 3 times;
237		  # cat ff_pwr_btn
238		  3	disabled
239		  # echo enable > ff_pwr_btn
240		  # cat ff_pwr_btn
241		  4	enabled
242		  /*
243		   * this is because the status bit is set even if the enable
244		   * bit is cleared, and it triggers an ACPI fixed event when
245		   * the enable bit is set again
246		   */
247		  # press the power button for 3 times;
248		  # cat ff_pwr_btn
249		  7	enabled
250		  # echo disable > ff_pwr_btn
251		  # press the power button for 3 times;
252		  # echo clear > ff_pwr_btn	/* clear the status bit */
253		  # echo disable > ff_pwr_btn
254		  # cat ff_pwr_btn
255		  7	enabled
256
257What:		/sys/firmware/acpi/memory_ranges/rangeX
258Date:		February 2025
259Contact:	Tony Luck <tony.luck@intel.com>
260Description:
261		On systems with the ACPI MRRM table reports the parameters for
262		each range.
263
264		base: Starting system physical address.
265
266		length: Length of this range in bytes.
267
268		node: NUMA node that this range belongs to. Negative numbers
269		indicate that the node number could not be determined (e.g
270		for an address range that is reserved for future hot add of
271		memory).
272
273		local_region_id: ID associated with access by agents
274		local to this range of addresses.
275
276		remote_region_id: ID associated with access by agents
277		non-local to this range of addresses.
278