Zhang Rui | d1eb86e | 2021-01-29 14:15:48 +0800 | [diff] [blame] | 1 | What: /sys/firmware/acpi/fpdt/ |
| 2 | Date: Jan 2021 |
| 3 | Contact: Zhang Rui <rui.zhang@intel.com> |
| 4 | Description: |
| 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 | |
Matthew Garrett | d1ff4b1 | 2012-01-31 13:19:20 -0500 | [diff] [blame] | 44 | What: /sys/firmware/acpi/bgrt/ |
| 45 | Date: January 2012 |
| 46 | Contact: Matthew Garrett <mjg@redhat.com> |
| 47 | Description: |
| 48 | The BGRT is an ACPI 5.0 feature that allows the OS |
| 49 | to obtain a copy of the firmware boot splash and |
| 50 | some associated metadata. This is intended to be used |
| 51 | by boot splash applications in order to interact with |
| 52 | the firmware boot splash in order to avoid jarring |
| 53 | transitions. |
| 54 | |
| 55 | image: The image bitmap. Currently a 32-bit BMP. |
| 56 | status: 1 if the image is valid, 0 if firmware invalidated it. |
| 57 | type: 0 indicates image is in BMP format. |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 58 | |
| 59 | ======== =================================================== |
Matthew Garrett | d1ff4b1 | 2012-01-31 13:19:20 -0500 | [diff] [blame] | 60 | version: The version of the BGRT. Currently 1. |
| 61 | xoffset: The number of pixels between the left of the screen |
| 62 | and the left edge of the image. |
| 63 | yoffset: The number of pixels between the top of the screen |
| 64 | and the top edge of the image. |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 65 | ======== =================================================== |
Matthew Garrett | d1ff4b1 | 2012-01-31 13:19:20 -0500 | [diff] [blame] | 66 | |
Rafael J. Wysocki | 3f8055c | 2013-03-03 23:08:16 +0100 | [diff] [blame] | 67 | What: /sys/firmware/acpi/hotplug/ |
| 68 | Date: February 2013 |
| 69 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
| 70 | Description: |
| 71 | There are separate hotplug profiles for different classes of |
| 72 | devices supported by ACPI, such as containers, memory modules, |
| 73 | processors, PCI root bridges etc. A hotplug profile for a given |
| 74 | class of devices is a collection of settings defining the way |
| 75 | that class of devices will be handled by the ACPI core hotplug |
| 76 | code. Those profiles are represented in sysfs as subdirectories |
| 77 | of /sys/firmware/acpi/hotplug/. |
| 78 | |
| 79 | The following setting is available to user space for each |
| 80 | hotplug profile: |
| 81 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 82 | ======== ======================================================= |
Rafael J. Wysocki | 3f8055c | 2013-03-03 23:08:16 +0100 | [diff] [blame] | 83 | enabled: If set, the ACPI core will handle notifications of |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 84 | hotplug events associated with the given class of |
| 85 | devices and will allow those devices to be ejected with |
| 86 | the help of the _EJ0 control method. Unsetting it |
| 87 | effectively disables hotplug for the correspoinding |
| 88 | class of devices. |
| 89 | ======== ======================================================= |
Rafael J. Wysocki | 3f8055c | 2013-03-03 23:08:16 +0100 | [diff] [blame] | 90 | |
| 91 | The value of the above attribute is an integer number: 1 (set) |
| 92 | or 0 (unset). Attempts to write any other values to it will |
| 93 | cause -EINVAL to be returned. |
| 94 | |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 95 | What: /sys/firmware/acpi/interrupts/ |
| 96 | Date: February 2008 |
| 97 | Contact: Len Brown <lenb@kernel.org> |
| 98 | Description: |
| 99 | All ACPI interrupts are handled via a single IRQ, |
| 100 | the System Control Interrupt (SCI), which appears |
| 101 | as "acpi" in /proc/interrupts. |
| 102 | |
| 103 | However, one of the main functions of ACPI is to make |
| 104 | the platform understand random hardware without |
| 105 | special driver support. So while the SCI handles a few |
| 106 | well known (fixed feature) interrupts sources, such |
| 107 | as the power button, it can also handle a variable |
| 108 | number of a "General Purpose Events" (GPE). |
| 109 | |
| 110 | A GPE vectors to a specified handler in AML, which |
| 111 | can do a anything the BIOS writer wants from |
| 112 | OS context. GPE 0x12, for example, would vector |
| 113 | to a level or edge handler called _L12 or _E12. |
| 114 | The handler may do its business and return. |
| 115 | Or the handler may send send a Notify event |
| 116 | to a Linux device driver registered on an ACPI device, |
| 117 | such as a battery, or a processor. |
| 118 | |
| 119 | To figure out where all the SCI's are coming from, |
| 120 | /sys/firmware/acpi/interrupts contains a file listing |
| 121 | every possible source, and the count of how many |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 122 | times it has triggered:: |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 123 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 124 | $ cd /sys/firmware/acpi/interrupts |
| 125 | $ grep . * |
| 126 | error: 0 |
Mauro Carvalho Chehab | 54a19b4 | 2020-10-30 08:40:50 +0100 | [diff] [blame] | 127 | ff_gbl_lock: 0 enable |
| 128 | ff_pmtimer: 0 invalid |
| 129 | ff_pwr_btn: 0 enable |
| 130 | ff_rt_clk: 2 disable |
| 131 | ff_slp_btn: 0 invalid |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 132 | gpe00: 0 invalid |
| 133 | gpe01: 0 enable |
| 134 | gpe02: 108 enable |
| 135 | gpe03: 0 invalid |
| 136 | gpe04: 0 invalid |
| 137 | gpe05: 0 invalid |
| 138 | gpe06: 0 enable |
| 139 | gpe07: 0 enable |
| 140 | gpe08: 0 invalid |
| 141 | gpe09: 0 invalid |
| 142 | gpe0A: 0 invalid |
| 143 | gpe0B: 0 invalid |
| 144 | gpe0C: 0 invalid |
| 145 | gpe0D: 0 invalid |
| 146 | gpe0E: 0 invalid |
| 147 | gpe0F: 0 invalid |
| 148 | gpe10: 0 invalid |
| 149 | gpe11: 0 invalid |
| 150 | gpe12: 0 invalid |
| 151 | gpe13: 0 invalid |
| 152 | gpe14: 0 invalid |
| 153 | gpe15: 0 invalid |
| 154 | gpe16: 0 invalid |
| 155 | gpe17: 1084 enable |
| 156 | gpe18: 0 enable |
| 157 | gpe19: 0 invalid |
| 158 | gpe1A: 0 invalid |
| 159 | gpe1B: 0 invalid |
| 160 | gpe1C: 0 invalid |
| 161 | gpe1D: 0 invalid |
| 162 | gpe1E: 0 invalid |
| 163 | gpe1F: 0 invalid |
Mauro Carvalho Chehab | 54a19b4 | 2020-10-30 08:40:50 +0100 | [diff] [blame] | 164 | gpe_all: 1192 |
| 165 | sci: 1194 |
| 166 | sci_not: 0 |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 167 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 168 | =========== ================================================== |
| 169 | sci The number of times the ACPI SCI |
| 170 | has been called and claimed an interrupt. |
Len Brown | 88bea18 | 2009-04-21 00:35:47 -0400 | [diff] [blame] | 171 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 172 | sci_not The number of times the ACPI SCI |
| 173 | has been called and NOT claimed an interrupt. |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 174 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 175 | gpe_all count of SCI caused by GPEs. |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 176 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 177 | gpeXX count for individual GPE source |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 178 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 179 | ff_gbl_lock Global Lock |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 180 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 181 | ff_pmtimer PM Timer |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 182 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 183 | ff_pwr_btn Power Button |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 184 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 185 | ff_rt_clk Real Time Clock |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 186 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 187 | ff_slp_btn Sleep Button |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 188 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 189 | error an interrupt that can't be accounted for above. |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 190 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 191 | invalid it's either a GPE or a Fixed Event that |
| 192 | doesn't have an event handler. |
Zhang Rui | 71b58cb | 2008-06-20 09:42:47 +0800 | [diff] [blame] | 193 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 194 | disable the GPE/Fixed Event is valid but disabled. |
Zhang Rui | 71b58cb | 2008-06-20 09:42:47 +0800 | [diff] [blame] | 195 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 196 | enable the GPE/Fixed Event is valid and enabled. |
| 197 | =========== ================================================== |
Zhang Rui | 71b58cb | 2008-06-20 09:42:47 +0800 | [diff] [blame] | 198 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 199 | Root has permission to clear any of these counters. Eg.:: |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 200 | |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 201 | # echo 0 > gpe11 |
| 202 | |
| 203 | All counters can be cleared by clearing the total "sci":: |
| 204 | |
| 205 | # echo 0 > sci |
Len Brown | 5229e87 | 2008-02-06 01:26:55 -0500 | [diff] [blame] | 206 | |
| 207 | None of these counters has an effect on the function |
| 208 | of the system, they are simply statistics. |
Zhang Rui | 71b58cb | 2008-06-20 09:42:47 +0800 | [diff] [blame] | 209 | |
| 210 | Besides this, user can also write specific strings to these files |
| 211 | to enable/disable/clear ACPI interrupts in user space, which can be |
| 212 | used to debug some ACPI interrupt storm issues. |
| 213 | |
Kees Cook | 0855965 | 2016-04-26 16:41:21 -0700 | [diff] [blame] | 214 | Note that only writing to VALID GPE/Fixed Event is allowed, |
Zhang Rui | 71b58cb | 2008-06-20 09:42:47 +0800 | [diff] [blame] | 215 | i.e. user can only change the status of runtime GPE and |
| 216 | Fixed Event with event handler installed. |
| 217 | |
| 218 | Let's take power button fixed event for example, please kill acpid |
| 219 | and other user space applications so that the machine won't shutdown |
Mauro Carvalho Chehab | 3443333 | 2020-10-30 08:40:39 +0100 | [diff] [blame] | 220 | when pressing the power button:: |
| 221 | |
| 222 | # cat ff_pwr_btn |
| 223 | 0 enabled |
| 224 | # press the power button for 3 times; |
| 225 | # cat ff_pwr_btn |
| 226 | 3 enabled |
| 227 | # echo disable > ff_pwr_btn |
| 228 | # cat ff_pwr_btn |
| 229 | 3 disabled |
| 230 | # press the power button for 3 times; |
| 231 | # cat ff_pwr_btn |
| 232 | 3 disabled |
| 233 | # echo enable > ff_pwr_btn |
| 234 | # cat ff_pwr_btn |
| 235 | 4 enabled |
| 236 | /* |
| 237 | * this is because the status bit is set even if the enable |
| 238 | * bit is cleared, and it triggers an ACPI fixed event when |
| 239 | * the enable bit is set again |
| 240 | */ |
| 241 | # press the power button for 3 times; |
| 242 | # cat ff_pwr_btn |
| 243 | 7 enabled |
| 244 | # echo disable > ff_pwr_btn |
| 245 | # press the power button for 3 times; |
| 246 | # echo clear > ff_pwr_btn /* clear the status bit */ |
| 247 | # echo disable > ff_pwr_btn |
| 248 | # cat ff_pwr_btn |
| 249 | 7 enabled |
Zhang Rui | 71b58cb | 2008-06-20 09:42:47 +0800 | [diff] [blame] | 250 | |