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. 1534433332SMauro Carvalho Chehab 1634433332SMauro Carvalho Chehab ======== =================================================== 17d1ff4b1cSMatthew Garrett version: The version of the BGRT. Currently 1. 18d1ff4b1cSMatthew Garrett xoffset: The number of pixels between the left of the screen 19d1ff4b1cSMatthew Garrett and the left edge of the image. 20d1ff4b1cSMatthew Garrett yoffset: The number of pixels between the top of the screen 21d1ff4b1cSMatthew Garrett and the top edge of the image. 2234433332SMauro Carvalho Chehab ======== =================================================== 23d1ff4b1cSMatthew Garrett 243f8055c3SRafael J. WysockiWhat: /sys/firmware/acpi/hotplug/ 253f8055c3SRafael J. WysockiDate: February 2013 263f8055c3SRafael J. WysockiContact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> 273f8055c3SRafael J. WysockiDescription: 283f8055c3SRafael J. Wysocki There are separate hotplug profiles for different classes of 293f8055c3SRafael J. Wysocki devices supported by ACPI, such as containers, memory modules, 303f8055c3SRafael J. Wysocki processors, PCI root bridges etc. A hotplug profile for a given 313f8055c3SRafael J. Wysocki class of devices is a collection of settings defining the way 323f8055c3SRafael J. Wysocki that class of devices will be handled by the ACPI core hotplug 333f8055c3SRafael J. Wysocki code. Those profiles are represented in sysfs as subdirectories 343f8055c3SRafael J. Wysocki of /sys/firmware/acpi/hotplug/. 353f8055c3SRafael J. Wysocki 363f8055c3SRafael J. Wysocki The following setting is available to user space for each 373f8055c3SRafael J. Wysocki hotplug profile: 383f8055c3SRafael J. Wysocki 3934433332SMauro Carvalho Chehab ======== ======================================================= 403f8055c3SRafael J. Wysocki enabled: If set, the ACPI core will handle notifications of 413f8055c3SRafael J. Wysocki hotplug events associated with the given class of 423f8055c3SRafael J. Wysocki devices and will allow those devices to be ejected with 433f8055c3SRafael J. Wysocki the help of the _EJ0 control method. Unsetting it 443f8055c3SRafael J. Wysocki effectively disables hotplug for the correspoinding 453f8055c3SRafael J. Wysocki class of devices. 4634433332SMauro Carvalho Chehab ======== ======================================================= 473f8055c3SRafael J. Wysocki 483f8055c3SRafael J. Wysocki The value of the above attribute is an integer number: 1 (set) 493f8055c3SRafael J. Wysocki or 0 (unset). Attempts to write any other values to it will 503f8055c3SRafael J. Wysocki cause -EINVAL to be returned. 513f8055c3SRafael J. Wysocki 525229e87dSLen BrownWhat: /sys/firmware/acpi/interrupts/ 535229e87dSLen BrownDate: February 2008 545229e87dSLen BrownContact: Len Brown <lenb@kernel.org> 555229e87dSLen BrownDescription: 565229e87dSLen Brown All ACPI interrupts are handled via a single IRQ, 575229e87dSLen Brown the System Control Interrupt (SCI), which appears 585229e87dSLen Brown as "acpi" in /proc/interrupts. 595229e87dSLen Brown 605229e87dSLen Brown However, one of the main functions of ACPI is to make 615229e87dSLen Brown the platform understand random hardware without 625229e87dSLen Brown special driver support. So while the SCI handles a few 635229e87dSLen Brown well known (fixed feature) interrupts sources, such 645229e87dSLen Brown as the power button, it can also handle a variable 655229e87dSLen Brown number of a "General Purpose Events" (GPE). 665229e87dSLen Brown 675229e87dSLen Brown A GPE vectors to a specified handler in AML, which 685229e87dSLen Brown can do a anything the BIOS writer wants from 695229e87dSLen Brown OS context. GPE 0x12, for example, would vector 705229e87dSLen Brown to a level or edge handler called _L12 or _E12. 715229e87dSLen Brown The handler may do its business and return. 725229e87dSLen Brown Or the handler may send send a Notify event 735229e87dSLen Brown to a Linux device driver registered on an ACPI device, 745229e87dSLen Brown such as a battery, or a processor. 755229e87dSLen Brown 765229e87dSLen Brown To figure out where all the SCI's are coming from, 775229e87dSLen Brown /sys/firmware/acpi/interrupts contains a file listing 785229e87dSLen Brown every possible source, and the count of how many 7934433332SMauro Carvalho Chehab times it has triggered:: 805229e87dSLen Brown 815229e87dSLen Brown $ cd /sys/firmware/acpi/interrupts 825229e87dSLen Brown $ grep . * 835229e87dSLen Brown error: 0 8471b58cbbSZhang Rui ff_gbl_lock: 0 enable 8571b58cbbSZhang Rui ff_pmtimer: 0 invalid 8671b58cbbSZhang Rui ff_pwr_btn: 0 enable 8771b58cbbSZhang Rui ff_rt_clk: 2 disable 8871b58cbbSZhang Rui ff_slp_btn: 0 invalid 8971b58cbbSZhang Rui gpe00: 0 invalid 9071b58cbbSZhang Rui gpe01: 0 enable 9171b58cbbSZhang Rui gpe02: 108 enable 9271b58cbbSZhang Rui gpe03: 0 invalid 9371b58cbbSZhang Rui gpe04: 0 invalid 9471b58cbbSZhang Rui gpe05: 0 invalid 9571b58cbbSZhang Rui gpe06: 0 enable 9671b58cbbSZhang Rui gpe07: 0 enable 9771b58cbbSZhang Rui gpe08: 0 invalid 9871b58cbbSZhang Rui gpe09: 0 invalid 9971b58cbbSZhang Rui gpe0A: 0 invalid 10071b58cbbSZhang Rui gpe0B: 0 invalid 10171b58cbbSZhang Rui gpe0C: 0 invalid 10271b58cbbSZhang Rui gpe0D: 0 invalid 10371b58cbbSZhang Rui gpe0E: 0 invalid 10471b58cbbSZhang Rui gpe0F: 0 invalid 10571b58cbbSZhang Rui gpe10: 0 invalid 10671b58cbbSZhang Rui gpe11: 0 invalid 10771b58cbbSZhang Rui gpe12: 0 invalid 10871b58cbbSZhang Rui gpe13: 0 invalid 10971b58cbbSZhang Rui gpe14: 0 invalid 11071b58cbbSZhang Rui gpe15: 0 invalid 11171b58cbbSZhang Rui gpe16: 0 invalid 11271b58cbbSZhang Rui gpe17: 1084 enable 11371b58cbbSZhang Rui gpe18: 0 enable 11471b58cbbSZhang Rui gpe19: 0 invalid 11571b58cbbSZhang Rui gpe1A: 0 invalid 11671b58cbbSZhang Rui gpe1B: 0 invalid 11771b58cbbSZhang Rui gpe1C: 0 invalid 11871b58cbbSZhang Rui gpe1D: 0 invalid 11971b58cbbSZhang Rui gpe1E: 0 invalid 12071b58cbbSZhang Rui gpe1F: 0 invalid 12171b58cbbSZhang Rui gpe_all: 1192 12271b58cbbSZhang Rui sci: 1194 12388bea188SLen Brown sci_not: 0 1245229e87dSLen Brown 12534433332SMauro Carvalho Chehab =========== ================================================== 12634433332SMauro Carvalho Chehab sci The number of times the ACPI SCI 12788bea188SLen Brown has been called and claimed an interrupt. 12888bea188SLen Brown 12934433332SMauro Carvalho Chehab sci_not The number of times the ACPI SCI 13088bea188SLen Brown has been called and NOT claimed an interrupt. 1315229e87dSLen Brown 13234433332SMauro Carvalho Chehab gpe_all count of SCI caused by GPEs. 1335229e87dSLen Brown 13434433332SMauro Carvalho Chehab gpeXX count for individual GPE source 1355229e87dSLen Brown 13634433332SMauro Carvalho Chehab ff_gbl_lock Global Lock 1375229e87dSLen Brown 13834433332SMauro Carvalho Chehab ff_pmtimer PM Timer 1395229e87dSLen Brown 14034433332SMauro Carvalho Chehab ff_pwr_btn Power Button 1415229e87dSLen Brown 14234433332SMauro Carvalho Chehab ff_rt_clk Real Time Clock 1435229e87dSLen Brown 14434433332SMauro Carvalho Chehab ff_slp_btn Sleep Button 1455229e87dSLen Brown 14634433332SMauro Carvalho Chehab error an interrupt that can't be accounted for above. 1475229e87dSLen Brown 14834433332SMauro Carvalho Chehab invalid it's either a GPE or a Fixed Event that 14971b58cbbSZhang Rui doesn't have an event handler. 15071b58cbbSZhang Rui 15134433332SMauro Carvalho Chehab disable the GPE/Fixed Event is valid but disabled. 15271b58cbbSZhang Rui 15334433332SMauro Carvalho Chehab enable the GPE/Fixed Event is valid and enabled. 15434433332SMauro Carvalho Chehab =========== ================================================== 15571b58cbbSZhang Rui 15634433332SMauro Carvalho Chehab Root has permission to clear any of these counters. Eg.:: 15734433332SMauro Carvalho Chehab 1585229e87dSLen Brown # echo 0 > gpe11 1595229e87dSLen Brown 16034433332SMauro Carvalho Chehab All counters can be cleared by clearing the total "sci":: 16134433332SMauro Carvalho Chehab 1625229e87dSLen Brown # echo 0 > sci 1635229e87dSLen Brown 1645229e87dSLen Brown None of these counters has an effect on the function 1655229e87dSLen Brown of the system, they are simply statistics. 16671b58cbbSZhang Rui 16771b58cbbSZhang Rui Besides this, user can also write specific strings to these files 16871b58cbbSZhang Rui to enable/disable/clear ACPI interrupts in user space, which can be 16971b58cbbSZhang Rui used to debug some ACPI interrupt storm issues. 17071b58cbbSZhang Rui 17108559657SKees Cook Note that only writing to VALID GPE/Fixed Event is allowed, 17271b58cbbSZhang Rui i.e. user can only change the status of runtime GPE and 17371b58cbbSZhang Rui Fixed Event with event handler installed. 17471b58cbbSZhang Rui 17571b58cbbSZhang Rui Let's take power button fixed event for example, please kill acpid 17671b58cbbSZhang Rui and other user space applications so that the machine won't shutdown 17734433332SMauro Carvalho Chehab when pressing the power button:: 17834433332SMauro Carvalho Chehab 17971b58cbbSZhang Rui # cat ff_pwr_btn 180ed206facSZhang Rui 0 enabled 18171b58cbbSZhang Rui # press the power button for 3 times; 18271b58cbbSZhang Rui # cat ff_pwr_btn 183ed206facSZhang Rui 3 enabled 18471b58cbbSZhang Rui # echo disable > ff_pwr_btn 18571b58cbbSZhang Rui # cat ff_pwr_btn 186ed206facSZhang Rui 3 disabled 18771b58cbbSZhang Rui # press the power button for 3 times; 18871b58cbbSZhang Rui # cat ff_pwr_btn 189ed206facSZhang Rui 3 disabled 19071b58cbbSZhang Rui # echo enable > ff_pwr_btn 19171b58cbbSZhang Rui # cat ff_pwr_btn 192ed206facSZhang Rui 4 enabled 19371b58cbbSZhang Rui /* 19434433332SMauro Carvalho Chehab * this is because the status bit is set even if the enable 19534433332SMauro Carvalho Chehab * bit is cleared, and it triggers an ACPI fixed event when 19634433332SMauro Carvalho Chehab * the enable bit is set again 19771b58cbbSZhang Rui */ 19871b58cbbSZhang Rui # press the power button for 3 times; 19971b58cbbSZhang Rui # cat ff_pwr_btn 200ed206facSZhang Rui 7 enabled 20171b58cbbSZhang Rui # echo disable > ff_pwr_btn 20271b58cbbSZhang Rui # press the power button for 3 times; 20371b58cbbSZhang Rui # echo clear > ff_pwr_btn /* clear the status bit */ 20471b58cbbSZhang Rui # echo disable > ff_pwr_btn 20571b58cbbSZhang Rui # cat ff_pwr_btn 206ed206facSZhang Rui 7 enabled 20771b58cbbSZhang Rui 208