Найти в Дзене

Invisible housekeeper in a laptop

The laptop has a lot of interesting features that the desktop does not have:the convenience of closing the lid on the go, the mysterious Breathing Lights during sleep, the beautiful keyboard lights and much more.Many of these features can still work when the computer is turned off, so who is controlling them?Certainly not the CPU, which also makes Windows and other operating systems lose the execution of the soil, they can also be excluded.This invisible Steward is EC. A crude example. How the EC works EC and BIOS work very closely together.EC through the BIOS ACPI table will report information and methods it needs to report to the operating system, and interact with it. A typical information interaction channel is this: Its performance in the ACPI table is: Seen from this example, the battery alarm, AC power plug, temperature sensor reports and LID (notebook lid) information, first reported to the EC different Q, EC then access ACPI of GPE, GPE trigger will produce SCI, this
Оглавление

The laptop has a lot of interesting features that the desktop does not have:the convenience of closing the lid on the go, the mysterious Breathing Lights during sleep, the beautiful keyboard lights and much more.Many of these features can still work when the computer is turned off, so who is controlling them?Certainly not the CPU, which also makes Windows and other operating systems lose the execution of the soil, they can also be excluded.This invisible Steward is EC.

  1. EC introduction
  2. Almost all of the laptops have a small one on their motherboard: the EC (Embedded Controller), a tiny 16-bit chip that, like the BMC in the server, controls every aspect of the laptop.It originated from the notebook keyboard controller, now many features on the notebook, it has its shadow behind.Why does the charging indicator light up?EC at the right time to let it shine; why fan mad?EC think your CPU is too hot;various function keys and above the small lights is its credit.Even after the shutdown EC is still working tirelessly, its features are also the focus of notebook manufacturers to force.
  3. There are a variety of EC controllers on the market, ENE, ite, Nuvoton and SMSC and other players.It is generally soldered on a laptop motherboard:
  4. The location of the Lenovo Y700 EC is in the lower left corner
  5. It has its own Firmware (firmware), but the motherboard manufacturers generally call this firmware EC BIOS, a bit confusing.This corresponds to the schematic diagram of the notebook motherboard is generally at least one to two pages in the middle of the EC chapter:

A crude example.

  • I put an EC controller chip ENE manual in reference 1[1], interested in the details of the students can refer to read.

How the EC works
EC and BIOS work very closely together.EC through the BIOS ACPI table will report information and methods it needs to report to the operating system, and interact with it.

A typical information interaction channel is this:

Its performance in the ACPI table is:

  1. Device (EC0) {
  2. Name (_HID, EISAID ("PNP0C09”))
  3. Method (_CRS) { … }
  4. Name (_GPE, 0 )
  5. Method (_Q06) { … }
  6. Method (_Q07) { … }
  7. Method (_Q08) { … }
  8. Method (_Q0A) { ... } / / EC uses GPE0
  9. // Adapter event
  10. // Thermal event
  11. / Battery event
  12. // LID event
Seen from this example, the battery alarm, AC power plug, temperature sensor reports and LID (notebook lid) information, first reported to the EC different Q, EC then access ACPI of GPE, GPE trigger will produce SCI, this when the operating system will know.An Event generated, the operating system after receiving SCI, will check the GPE, to see who triggered the event; after the discovery is GP_STS0, you know the time is generated EC, then will go to check the EC's Q0x, to see which is the specific EC pin triggered, what you want, eventually found the Event generating side, and

It seems quite difficult to understand!Well, let's see a case study.

Laptop lid open / close case study

Let's simplify the picture.:

Notebook closed, EC trigger GPE.OS received GPE, view GP_STS, found to be triggered GPE0, know EC lead.Access EC that is Q0A.By _lid keywords and PNP know is the lid information, know is the lid closed.

Then check the user's power management policy to make the appropriate treatment:

Refer to my article for details:

Wolf: what happens when you close the lid of your notebook?What is the mechanism behind?

zhuanlan.zhihu.com

Icon

2.Open the lid, GPEB will trigger wake up related actions.

Conclusion

Not only the LID, various temperature sensors are also the first EC:

AC plug, turn on the switching power supply policy is triggered EC.Even some notebooks, AC plug next to the small LED lights are EC control.

EC is so important in the notebook computer, manufacturers in order to make their own different product strategy, development of fancy features, frequently force on the EC.EC is indeed the invisible housekeeper in the notebook!

Other related articles:

Wolf: what happened after pressing the power button?How does a computer boot gracefully?

zhuanlan.zhihu.com

Icon

Wolf: what happened after pressing the power button?How does the computer shut down?

zhuanlan.zhihu.com

Icon

Wolf: what happened after Reset reboot?What is the difference between it and turn on again after shutdown?

zhuanlan.zhihu.com

Icon

Welcome to pay attention to this column and use the WeChat scan below the two-dimensional code to join the WeChat public number"UEFIBlog", where there are the latest articles.You are welcome to contribute to this column and the public number!