1*d1eb86e5SZhang RuiWhat: /sys/firmware/acpi/fpdt/ 2*d1eb86e5SZhang RuiDate: Jan 2021 3*d1eb86e5SZhang RuiContact: Zhang Rui <rui.zhang@intel.com> 4*d1eb86e5SZhang RuiDescription: 5*d1eb86e5SZhang Rui ACPI Firmware Performance Data Table (FPDT) provides 6*d1eb86e5SZhang Rui information for firmware performance data for system boot, 7*d1eb86e5SZhang Rui S3 suspend and S3 resume. This sysfs entry contains the 8*d1eb86e5SZhang Rui performance data retrieved from the FPDT. 9*d1eb86e5SZhang Rui 10*d1eb86e5SZhang Rui boot: 11*d1eb86e5SZhang Rui firmware_start_ns: Timer value logged at the beginning 12*d1eb86e5SZhang Rui of firmware image execution. In nanoseconds. 13*d1eb86e5SZhang Rui bootloader_load_ns: Timer value logged just prior to 14*d1eb86e5SZhang Rui loading the OS boot loader into memory. 15*d1eb86e5SZhang Rui In nanoseconds. 16*d1eb86e5SZhang Rui bootloader_launch_ns: Timer value logged just prior to 17*d1eb86e5SZhang Rui launching the currently loaded OS boot loader 18*d1eb86e5SZhang Rui image. In nanoseconds. 19*d1eb86e5SZhang Rui exitbootservice_start_ns: Timer value logged at the 20*d1eb86e5SZhang Rui point when the OS loader calls the 21*d1eb86e5SZhang Rui ExitBootServices function for UEFI compatible 22*d1eb86e5SZhang Rui firmware. In nanoseconds. 23*d1eb86e5SZhang Rui exitbootservice_end_ns: Timer value logged at the point 24*d1eb86e5SZhang Rui just prior to the OS loader gaining control 25*d1eb86e5SZhang Rui back from the ExitBootServices function for 26*d1eb86e5SZhang Rui UEFI compatible firmware. In nanoseconds. 27*d1eb86e5SZhang Rui suspend: 28*d1eb86e5SZhang Rui suspend_start_ns: Timer value recorded at the previous 29*d1eb86e5SZhang Rui OS write to SLP_TYP upon entry to S3. In 30*d1eb86e5SZhang Rui nanoseconds. 31*d1eb86e5SZhang Rui suspend_end_ns: Timer value recorded at the previous 32*d1eb86e5SZhang Rui firmware write to SLP_TYP used to trigger 33*d1eb86e5SZhang Rui hardware entry to S3. In nanoseconds. 34*d1eb86e5SZhang Rui resume: 35*d1eb86e5SZhang Rui resume_count: A count of the number of S3 resume cycles 36*d1eb86e5SZhang Rui since the last full boot sequence. 37*d1eb86e5SZhang Rui resume_avg_ns: Average timer value of all resume cycles 38*d1eb86e5SZhang Rui logged since the last full boot sequence, 39*d1eb86e5SZhang Rui including the most recent resume. In nanoseconds. 40*d1eb86e5SZhang Rui resume_prev_ns: Timer recorded at the end of the previous 41*d1eb86e5SZhang Rui platform runtime firmware S3 resume, just prior to 42*d1eb86e5SZhang Rui handoff to the OS waking vector. In nanoseconds. 43*d1eb86e5SZhang Rui 44d1ff4b1cSMatthew GarrettWhat: /sys/firmware/acpi/bgrt/ 45d1ff4b1cSMatthew GarrettDate: January 2012 46d1ff4b1cSMatthew GarrettContact: Matthew Garrett <mjg@redhat.com> 47d1ff4b1cSMatthew GarrettDescription: 48d1ff4b1cSMatthew Garrett The BGRT is an ACPI 5.0 feature that allows the OS 49d1ff4b1cSMatthew Garrett to obtain a copy of the firmware boot splash and 50d1ff4b1cSMatthew Garrett some associated metadata. This is intended to be used 51d1ff4b1cSMatthew Garrett by boot splash applications in order to interact with 52d1ff4b1cSMatthew Garrett the firmware boot splash in order to avoid jarring 53d1ff4b1cSMatthew Garrett transitions. 54d1ff4b1cSMatthew Garrett 55d1ff4b1cSMatthew Garrett image: The image bitmap. Currently a 32-bit BMP. 56d1ff4b1cSMatthew Garrett status: 1 if the image is valid, 0 if firmware invalidated it. 57d1ff4b1cSMatthew Garrett type: 0 indicates image is in BMP format. 5834433332SMauro Carvalho Chehab 5934433332SMauro Carvalho Chehab ======== =================================================== 60d1ff4b1cSMatthew Garrett version: The version of the BGRT. Currently 1. 61d1ff4b1cSMatthew Garrett xoffset: The number of pixels between the left of the screen 62d1ff4b1cSMatthew Garrett and the left edge of the image. 63d1ff4b1cSMatthew Garrett yoffset: The number of pixels between the top of the screen 64d1ff4b1cSMatthew Garrett and the top edge of the image. 6534433332SMauro Carvalho Chehab ======== =================================================== 66d1ff4b1cSMatthew Garrett 673f8055c3SRafael J. WysockiWhat: /sys/firmware/acpi/hotplug/ 683f8055c3SRafael J. WysockiDate: February 2013 693f8055c3SRafael J. WysockiContact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> 703f8055c3SRafael J. WysockiDescription: 713f8055c3SRafael J. Wysocki There are separate hotplug profiles for different classes of 723f8055c3SRafael J. Wysocki devices supported by ACPI, such as containers, memory modules, 733f8055c3SRafael J. Wysocki processors, PCI root bridges etc. A hotplug profile for a given 743f8055c3SRafael J. Wysocki class of devices is a collection of settings defining the way 753f8055c3SRafael J. Wysocki that class of devices will be handled by the ACPI core hotplug 763f8055c3SRafael J. Wysocki code. Those profiles are represented in sysfs as subdirectories 773f8055c3SRafael J. Wysocki of /sys/firmware/acpi/hotplug/. 783f8055c3SRafael J. Wysocki 793f8055c3SRafael J. Wysocki The following setting is available to user space for each 803f8055c3SRafael J. Wysocki hotplug profile: 813f8055c3SRafael J. Wysocki 8234433332SMauro Carvalho Chehab ======== ======================================================= 833f8055c3SRafael J. Wysocki enabled: If set, the ACPI core will handle notifications of 843f8055c3SRafael J. Wysocki hotplug events associated with the given class of 853f8055c3SRafael J. Wysocki devices and will allow those devices to be ejected with 863f8055c3SRafael J. Wysocki the help of the _EJ0 control method. Unsetting it 873f8055c3SRafael J. Wysocki effectively disables hotplug for the correspoinding 883f8055c3SRafael J. Wysocki class of devices. 8934433332SMauro Carvalho Chehab ======== ======================================================= 903f8055c3SRafael J. Wysocki 913f8055c3SRafael J. Wysocki The value of the above attribute is an integer number: 1 (set) 923f8055c3SRafael J. Wysocki or 0 (unset). Attempts to write any other values to it will 933f8055c3SRafael J. Wysocki cause -EINVAL to be returned. 943f8055c3SRafael J. Wysocki 955229e87dSLen BrownWhat: /sys/firmware/acpi/interrupts/ 965229e87dSLen BrownDate: February 2008 975229e87dSLen BrownContact: Len Brown <lenb@kernel.org> 985229e87dSLen BrownDescription: 995229e87dSLen Brown All ACPI interrupts are handled via a single IRQ, 1005229e87dSLen Brown the System Control Interrupt (SCI), which appears 1015229e87dSLen Brown as "acpi" in /proc/interrupts. 1025229e87dSLen Brown 1035229e87dSLen Brown However, one of the main functions of ACPI is to make 1045229e87dSLen Brown the platform understand random hardware without 1055229e87dSLen Brown special driver support. So while the SCI handles a few 1065229e87dSLen Brown well known (fixed feature) interrupts sources, such 1075229e87dSLen Brown as the power button, it can also handle a variable 1085229e87dSLen Brown number of a "General Purpose Events" (GPE). 1095229e87dSLen Brown 1105229e87dSLen Brown A GPE vectors to a specified handler in AML, which 1115229e87dSLen Brown can do a anything the BIOS writer wants from 1125229e87dSLen Brown OS context. GPE 0x12, for example, would vector 1135229e87dSLen Brown to a level or edge handler called _L12 or _E12. 1145229e87dSLen Brown The handler may do its business and return. 1155229e87dSLen Brown Or the handler may send send a Notify event 1165229e87dSLen Brown to a Linux device driver registered on an ACPI device, 1175229e87dSLen Brown such as a battery, or a processor. 1185229e87dSLen Brown 1195229e87dSLen Brown To figure out where all the SCI's are coming from, 1205229e87dSLen Brown /sys/firmware/acpi/interrupts contains a file listing 1215229e87dSLen Brown every possible source, and the count of how many 12234433332SMauro Carvalho Chehab times it has triggered:: 1235229e87dSLen Brown 1245229e87dSLen Brown $ cd /sys/firmware/acpi/interrupts 1255229e87dSLen Brown $ grep . * 1265229e87dSLen Brown error: 0 12771b58cbbSZhang Rui ff_gbl_lock: 0 enable 12871b58cbbSZhang Rui ff_pmtimer: 0 invalid 12971b58cbbSZhang Rui ff_pwr_btn: 0 enable 13071b58cbbSZhang Rui ff_rt_clk: 2 disable 13171b58cbbSZhang Rui ff_slp_btn: 0 invalid 13271b58cbbSZhang Rui gpe00: 0 invalid 13371b58cbbSZhang Rui gpe01: 0 enable 13471b58cbbSZhang Rui gpe02: 108 enable 13571b58cbbSZhang Rui gpe03: 0 invalid 13671b58cbbSZhang Rui gpe04: 0 invalid 13771b58cbbSZhang Rui gpe05: 0 invalid 13871b58cbbSZhang Rui gpe06: 0 enable 13971b58cbbSZhang Rui gpe07: 0 enable 14071b58cbbSZhang Rui gpe08: 0 invalid 14171b58cbbSZhang Rui gpe09: 0 invalid 14271b58cbbSZhang Rui gpe0A: 0 invalid 14371b58cbbSZhang Rui gpe0B: 0 invalid 14471b58cbbSZhang Rui gpe0C: 0 invalid 14571b58cbbSZhang Rui gpe0D: 0 invalid 14671b58cbbSZhang Rui gpe0E: 0 invalid 14771b58cbbSZhang Rui gpe0F: 0 invalid 14871b58cbbSZhang Rui gpe10: 0 invalid 14971b58cbbSZhang Rui gpe11: 0 invalid 15071b58cbbSZhang Rui gpe12: 0 invalid 15171b58cbbSZhang Rui gpe13: 0 invalid 15271b58cbbSZhang Rui gpe14: 0 invalid 15371b58cbbSZhang Rui gpe15: 0 invalid 15471b58cbbSZhang Rui gpe16: 0 invalid 15571b58cbbSZhang Rui gpe17: 1084 enable 15671b58cbbSZhang Rui gpe18: 0 enable 15771b58cbbSZhang Rui gpe19: 0 invalid 15871b58cbbSZhang Rui gpe1A: 0 invalid 15971b58cbbSZhang Rui gpe1B: 0 invalid 16071b58cbbSZhang Rui gpe1C: 0 invalid 16171b58cbbSZhang Rui gpe1D: 0 invalid 16271b58cbbSZhang Rui gpe1E: 0 invalid 16371b58cbbSZhang Rui gpe1F: 0 invalid 16471b58cbbSZhang Rui gpe_all: 1192 16571b58cbbSZhang Rui sci: 1194 16688bea188SLen Brown sci_not: 0 1675229e87dSLen Brown 16834433332SMauro Carvalho Chehab =========== ================================================== 16934433332SMauro Carvalho Chehab sci The number of times the ACPI SCI 17088bea188SLen Brown has been called and claimed an interrupt. 17188bea188SLen Brown 17234433332SMauro Carvalho Chehab sci_not The number of times the ACPI SCI 17388bea188SLen Brown has been called and NOT claimed an interrupt. 1745229e87dSLen Brown 17534433332SMauro Carvalho Chehab gpe_all count of SCI caused by GPEs. 1765229e87dSLen Brown 17734433332SMauro Carvalho Chehab gpeXX count for individual GPE source 1785229e87dSLen Brown 17934433332SMauro Carvalho Chehab ff_gbl_lock Global Lock 1805229e87dSLen Brown 18134433332SMauro Carvalho Chehab ff_pmtimer PM Timer 1825229e87dSLen Brown 18334433332SMauro Carvalho Chehab ff_pwr_btn Power Button 1845229e87dSLen Brown 18534433332SMauro Carvalho Chehab ff_rt_clk Real Time Clock 1865229e87dSLen Brown 18734433332SMauro Carvalho Chehab ff_slp_btn Sleep Button 1885229e87dSLen Brown 18934433332SMauro Carvalho Chehab error an interrupt that can't be accounted for above. 1905229e87dSLen Brown 19134433332SMauro Carvalho Chehab invalid it's either a GPE or a Fixed Event that 19271b58cbbSZhang Rui doesn't have an event handler. 19371b58cbbSZhang Rui 19434433332SMauro Carvalho Chehab disable the GPE/Fixed Event is valid but disabled. 19571b58cbbSZhang Rui 19634433332SMauro Carvalho Chehab enable the GPE/Fixed Event is valid and enabled. 19734433332SMauro Carvalho Chehab =========== ================================================== 19871b58cbbSZhang Rui 19934433332SMauro Carvalho Chehab Root has permission to clear any of these counters. Eg.:: 20034433332SMauro Carvalho Chehab 2015229e87dSLen Brown # echo 0 > gpe11 2025229e87dSLen Brown 20334433332SMauro Carvalho Chehab All counters can be cleared by clearing the total "sci":: 20434433332SMauro Carvalho Chehab 2055229e87dSLen Brown # echo 0 > sci 2065229e87dSLen Brown 2075229e87dSLen Brown None of these counters has an effect on the function 2085229e87dSLen Brown of the system, they are simply statistics. 20971b58cbbSZhang Rui 21071b58cbbSZhang Rui Besides this, user can also write specific strings to these files 21171b58cbbSZhang Rui to enable/disable/clear ACPI interrupts in user space, which can be 21271b58cbbSZhang Rui used to debug some ACPI interrupt storm issues. 21371b58cbbSZhang Rui 21408559657SKees Cook Note that only writing to VALID GPE/Fixed Event is allowed, 21571b58cbbSZhang Rui i.e. user can only change the status of runtime GPE and 21671b58cbbSZhang Rui Fixed Event with event handler installed. 21771b58cbbSZhang Rui 21871b58cbbSZhang Rui Let's take power button fixed event for example, please kill acpid 21971b58cbbSZhang Rui and other user space applications so that the machine won't shutdown 22034433332SMauro Carvalho Chehab when pressing the power button:: 22134433332SMauro Carvalho Chehab 22271b58cbbSZhang Rui # cat ff_pwr_btn 223ed206facSZhang Rui 0 enabled 22471b58cbbSZhang Rui # press the power button for 3 times; 22571b58cbbSZhang Rui # cat ff_pwr_btn 226ed206facSZhang Rui 3 enabled 22771b58cbbSZhang Rui # echo disable > ff_pwr_btn 22871b58cbbSZhang Rui # cat ff_pwr_btn 229ed206facSZhang Rui 3 disabled 23071b58cbbSZhang Rui # press the power button for 3 times; 23171b58cbbSZhang Rui # cat ff_pwr_btn 232ed206facSZhang Rui 3 disabled 23371b58cbbSZhang Rui # echo enable > ff_pwr_btn 23471b58cbbSZhang Rui # cat ff_pwr_btn 235ed206facSZhang Rui 4 enabled 23671b58cbbSZhang Rui /* 23734433332SMauro Carvalho Chehab * this is because the status bit is set even if the enable 23834433332SMauro Carvalho Chehab * bit is cleared, and it triggers an ACPI fixed event when 23934433332SMauro Carvalho Chehab * the enable bit is set again 24071b58cbbSZhang Rui */ 24171b58cbbSZhang Rui # press the power button for 3 times; 24271b58cbbSZhang Rui # cat ff_pwr_btn 243ed206facSZhang Rui 7 enabled 24471b58cbbSZhang Rui # echo disable > ff_pwr_btn 24571b58cbbSZhang Rui # press the power button for 3 times; 24671b58cbbSZhang Rui # echo clear > ff_pwr_btn /* clear the status bit */ 24771b58cbbSZhang Rui # echo disable > ff_pwr_btn 24871b58cbbSZhang Rui # cat ff_pwr_btn 249ed206facSZhang Rui 7 enabled 25071b58cbbSZhang Rui 251