#111 Add documentation for GM45 ThinkPad EC

Open
opened 2 years ago by wael · 10 comments
wael commented 2 years ago

There currently isn't any documentation for how to use the EC to set various functions, especially since usually these are things covered by the tp-smapi kernel modules which doesn't work under Coreboot/Libreboot.

For example, to fix the mute button and allow control from the OS one may run:

ectool -w 0x03 -z 0x40

More useful might be the ability to set charge thresholds, where one has to set byte 0x03 to 0x44 for the max value (or 0x40 for the min value) and follow that by setting 0x24 to the desired value in the range 0x8a (10%) to 0xe4 (100%) as integer values.
The same can be done for Ultrabay batteries too by using 0x25 instead of 0x24.

Note: This has been confirmed to be working on my T400 running 20160907, both with a regular/main battery and an Ultrabay one.

There currently isn't any documentation for how to use the EC to set various functions, especially since usually these are things covered by the tp-smapi kernel modules which doesn't work under Coreboot/Libreboot. For example, to fix the mute button and allow control from the OS one may run: # ectool -w 0x03 -z 0x40 More useful might be the ability to set charge thresholds, where one has to set byte 0x03 to 0x44 for the max value (or 0x40 for the min value) and follow that by setting 0x24 to the desired value in the range 0x8a (10%) to 0xe4 (100%) as integer values. The same can be done for Ultrabay batteries too by using 0x25 instead of 0x24. Note: This has been confirmed to be working on my T400 running 20160907, both with a regular/main battery and an Ultrabay one.

But does this work on newer versions of libreboot?

'Testing' versions, that is.

But does this work on newer versions of libreboot? 'Testing' versions, that is.
wael commented 2 years ago
Poster

This isn't strictly related to Libreboot or a version thereof. The EC on these thinkpads is proprietary (AFAIK, the only device with a FOSS EC to ever have a stable Libreboot release was the asus C201). ectool merely provides a way to interact with the EC, especially since that is usually handled by the SMAPI, which Coreboot (rightly) refuses to implement on grounds of it being a huge security hole.

This isn't strictly related to Libreboot or a version thereof. The EC on these thinkpads is proprietary (AFAIK, the only device with a FOSS EC to ever have a stable Libreboot release was the asus C201). ectool merely provides a way to interact with the EC, especially since that is usually handled by the SMAPI, which Coreboot (rightly) refuses to implement on grounds of it being a huge security hole.

Ok. Might still want to test in newer versions.

Ok. Might still want to test in newer versions.

In case something changed inside coreboot

In case something changed inside coreboot
Ghost commented 1 year ago

It would be nice, to be able to use libre EC firmware, especially since, it may very well greatly increase the battery life for those devices.

Not sure, myself, but its possible that the EC firmware even when its updated enough, when its proprietary, even if not a huge threat, is still too bloated.

Just a thought.

It would be nice, to be able to use libre EC firmware, especially since, it may very well greatly increase the battery life for those devices. Not sure, myself, but its possible that the EC firmware even when its updated enough, when its proprietary, even if not a huge threat, is still too bloated. Just a thought.

Yep. The problem is that it's not possible at the moment. What's so unfortunate is that many people think that Librebooted computers are 100% free, which is of course, not the case at all. The ASUS C201 is really close to 100% free though, but still isn't 100% free.

Cheers.

Yep. The problem is that it's not possible at the moment. What's so unfortunate is that many people think that Librebooted computers are 100% free, which is of course, not the case at all. The ASUS C201 is really close to 100% free though, but still isn't 100% free. Cheers.

Also, @wael, you can open a PR on that if you want.

Also, @wael, you *can* open a PR on that if you want.
Ghost commented 1 year ago

There are two problems tho, about current librebootable chromebooks though and very likely, future ones as well.

Wifi is one of them, but the other, is that they are supposedly not built well.

Aka, crappy durability... which is a very google thing to do, if the device is cheap...

;)

Unless a subscription is involved, then its hit or miss.

If I had to guess, the x86 ones, probably have more irritating issues.

Regarding @wael, I don't know if he still works on this, but I haven't checked his activity on here, so...

who knows...

But yeah, libreboot devices are not 100% free.

I would be stunned if ANY devices were ever created fully free.*

Btw, the asterisk here is for a very specific reason:

The goal of DRM-Free hardware alone is hard enough, especially for newer tech.

I would be shocked if this is, is even 95% possible even for newer tech, even on the DRM level.

Aka, anything with newer tech than 2017 not having any remote DRM enabled that is of any threat level.

It might be possible for the future given something I heard about regarding Nitrokey conference I heard about, aka, they are trying to change the wifi situation for the future.

Supposedly? Its in a massively alpha state.

There are two problems tho, about current librebootable chromebooks though and very likely, future ones as well. Wifi is one of them, but the other, is that they are supposedly not built well. Aka, crappy durability... which is a very google thing to do, if the device is cheap... ;) Unless a subscription is involved, then its hit or miss. If I had to guess, the x86 ones, probably have more irritating issues. Regarding @wael, I don't know if he still works on this, but I haven't checked his activity on here, so... who knows... But yeah, libreboot devices are not 100% free. I would be stunned if *ANY* devices were ever created fully free.* Btw, the asterisk here is for a very specific reason: The goal of DRM-Free hardware alone is hard enough, especially for newer tech. I would be shocked if this is, is even 95% possible even for newer tech, even on the DRM level. Aka, anything with newer tech than 2017 not having any remote DRM enabled that is of any threat level. It might be possible for the future given something I heard about regarding Nitrokey conference I heard about, aka, they are trying to change the wifi situation for the future. Supposedly? Its in a massively alpha state.
wael commented 1 year ago
Poster

I do realize the EC is not free on these ThinkPads, but there is no point in testing for different versions currently.
This is merely a quality-of-life documentation improvement, as the current instructions already tell you to update the EC using the proprietary BIOS to the latest version BEFORE flashing Libreboot. And since these devices are well out of the support period provided by Lenovo, and since ECs rarely get patched anyway (it is just an MCU in the end) there is no point to even argue much about "versions".
1.06 has been the latest available version for probably over a decade by now, so there is a point to documenting the behavior thereof since even though it is a black-box, it doesn't seem to have a mechanism to modify and update the code in the meantime (not until someone manages to port this https://github.com/hamishcoleman/thinkpad-ec to the XX00 series ThinkPads or do something similar anyway).

I do realize the EC is not free on these ThinkPads, but there is no point in testing for different versions currently. This is merely a quality-of-life documentation improvement, as the current instructions already tell you to update the EC using the proprietary BIOS to the latest version BEFORE flashing Libreboot. And since these devices are well out of the support period provided by Lenovo, and since ECs rarely get patched anyway (it is just an MCU in the end) there is no point to even argue much about "versions". 1.06 has been the latest available version for probably over a decade by now, so there is a point to documenting the behavior thereof since even though it is a black-box, it doesn't seem to have a mechanism to modify and update the code in the meantime (not until someone manages to port this https://github.com/hamishcoleman/thinkpad-ec to the XX00 series ThinkPads or do something similar anyway).
Ghost commented 1 year ago

Point taken, regarding what you know...

That being said, if its possible to study the X230, studying the X200 should be way easier, if memory serves me right...

Aka, the newer tech intel tech, seems to get more and more obfuscated with worse blobs.

That being said, this does sound like an extremely wise idea.

Point taken, regarding what you know... That being said, if its possible to study the X230, studying the X200 should be way easier, if memory serves me right... Aka, the newer tech intel tech, seems to get more and more obfuscated with worse blobs. That being said, this does sound like an extremely wise idea.
Sign in to join this conversation.
No Label
No Milestone
No assignee
3 Participants
Loading...
Cancel
Save
There is no content yet.