Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message

X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

Old(er) Thinkpads with New(er) Intestines: X62/T50/T70/X210/X330 etc.
Message
Author
L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#91 Post by L29Ah » Sun Sep 08, 2019 8:25 pm

I get 3.8W on lowest backlight and associated wifi. 3.5W with deassociated. All the ASPM is enabled, but i still never reach pc9 and pc10.
Out-of-tree r8168 module is necessary for ASPM support.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

vladisslav2011
Posts: 30
Joined: Fri Oct 12, 2018 6:33 am
Location: Velikiye Luki, Pskov, Russia

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#92 Post by vladisslav2011 » Mon Sep 09, 2019 4:47 pm

L29Ah wrote:
Sun Sep 08, 2019 8:25 pm
I get 3.8W on lowest backlight and associated wifi. 3.5W with deassociated. All the ASPM is enabled, but i still never reach pc9 and pc10.
As your LCD does not support PSR, then you will get pc9 only when the LCD is in DPMS off state (and wifi is disconnected).
You may start powertop, issue

Code: Select all

xset dpms force off
in separate terminal, wait a minute, press any key to wake the display and see results.

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#93 Post by L29Ah » Mon Sep 09, 2019 7:27 pm

I've brought up some infra for comfortable patch selection and application: https://github.com/l29ah/x210-ec
It would be cool if you submit your patches/pull requests to avoid throwing lots of differing and poorly documented blobs around that bring a lot of changes and are a pain to merge.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#94 Post by L29Ah » Tue Sep 10, 2019 6:54 am

rm
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 EC datasheet/better brightness control?

#95 Post by L29Ah » Thu Sep 12, 2019 7:24 pm

vladisslav2011 wrote:
Fri Sep 06, 2019 11:55 am
verynice wrote:
Fri Sep 06, 2019 3:02 am
Is it possible to set the bat thresholds with EC?
If you want to undercharge the battery to prolong it's life, then it may be done already. :-) At least my laptop is constantly undercharging the battery by several parcent.
My X210 charges the battery to 4.16 per cell, while ~4V ceiling during typical use would make more sense: it's only ~25% less energy but only ~20% cycle wear compared to 4.2V cycles, also less time-based degradation.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#96 Post by mjg59 » Tue Nov 12, 2019 11:54 pm

I've posted a pull request at https://github.com/l29ah/x210-ec/pull/1 that allows the remaining hotkeys to be used under Linux.

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#97 Post by L29Ah » Fri Nov 22, 2019 4:31 pm

Is it me or the EC sometimes forgets how to send the power button events?
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#98 Post by L29Ah » Mon Nov 25, 2019 2:21 am

Idea for an EC patch: currently the battery LED blinks green when the battery is almost discharged and blinks orange when it's charging from such a state; it should be the other way around to bring attention when it should.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#99 Post by flyingfishfinger » Mon Dec 23, 2019 4:52 pm

Hi,
I've found a funny issue with vladisslav2011's EC. I built an otherwise working coreboot image against the latest master.

On Linux, I get 14 brightness steps and everything works great.

On Windows (10) brightness control doesn't work at all. It still registers the key events in that I see the on-screen brightness slider change, but it only has 10 steps and no effect on actual screen brightness.

I'm not sure where along the way this broke, but I'm 100% certain when I first started playing with the coreboot builds this worked properly in Windows. Hence my surprise that it no longer does.

Anyone have an idea why it would work fine in Linux, but not in Windows?

Cheers,
R

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#100 Post by L29Ah » Wed Dec 25, 2019 6:27 am

L29Ah wrote:
Fri Nov 22, 2019 4:31 pm
Is it me or the EC sometimes forgets how to send the power button events?
Okay, it was ME that have [censored] itself somehow; reflashing its region with its original firmware have fixed the problem.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#101 Post by flyingfishfinger » Fri Jun 12, 2020 7:00 pm

Finally had time to play with the power saving stuff. Patched the i915 and uninstalled WiFi for testing - now powertop reports between 3-4W, which is nice.

However, it also says "Battery reported" power draw is around 12W, at the same time that two lines down it says 4W.

Shouldn't they be the same, and if not, why are they different?

Thanks,
R

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#102 Post by L29Ah » Fri Jun 12, 2020 9:06 pm

flyingfishfinger wrote:
Fri Jun 12, 2020 7:00 pm
Finally had time to play with the power saving stuff. Patched the i915 and uninstalled WiFi for testing - now powertop reports between 3-4W, which is nice.

However, it also says "Battery reported" power draw is around 12W, at the same time that two lines down it says 4W.

Shouldn't they be the same, and if not, why are they different?

Thanks,
R
No idea what lines are you talking about. The battery reported power consumption is the only one that powertop is able to fetch (from /sys/class/power_supply/BAT0) AFAIK. The rest is its hallucinations, and i've observed them go into gigawatts and assign huge consumption to virtual NICs, so i ignore them.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#103 Post by flyingfishfinger » Sat Jun 13, 2020 12:54 am

Sorry, I guess I wasn't very clear. Here's a screenshot of what I see now, on average. So you're saying the estimated number is just bogus?

With the i915 patch + the new EC I was able to see the display backlight wattage drop from about 6W (before mod + EC) to under 3W if I got lucky but obviously I couldn't tell by watching this if PSR is working correctly since the screen constantly refreshes.

Anyway, the further point of this question is where else I should be looking for power savings. I don't get anything above C3 at the moment.

I don't have ANY Ethernet driver installed and the SD card reader isn't even installed (sub-card removed).
ASPM is enabled on all PCI devices, as far as I can tell.
I'm on 5.7.1 - I guess I might have the GPU DDos fix issue from a couple threads down? harryk's "easy fix" is not obvious to me (or rather, I have no idea how to do it...)

What am I missing here?

Cheers,
R

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#104 Post by L29Ah » Sat Jun 13, 2020 9:21 am

flyingfishfinger wrote:
Sat Jun 13, 2020 12:54 am
Sorry, I guess I wasn't very clear. Here's a screenshot of what I see now, on average. So you're saying the estimated number is just bogus?

With the i915 patch + the new EC I was able to see the display backlight wattage drop from about 6W (before mod + EC) to under 3W if I got lucky but obviously I couldn't tell by watching this if PSR is working correctly since the screen constantly refreshes.

Anyway, the further point of this question is where else I should be looking for power savings. I don't get anything above C3 at the moment.
Yes.

Check `lspci -vvv | grep -i aspm`, it should be "L1 enabled" everywhere. AFAIK, you won't reach it without an ethernet driver.
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#105 Post by flyingfishfinger » Sat Jun 13, 2020 1:30 pm

Hi,
Thanks for the tips. I installed tlp, r8168, patched i915 (psr confirmed), ASPM is L1 for all PCI devices and I added the command line parameters from earlier in the thread.

Now I get C9 and 3W idle even WITH WiFi connected :D

R

jwise
Posts: 7
Joined: Fri Aug 28, 2020 11:14 pm
Location: Mountain View, CA

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#106 Post by jwise » Sat Aug 29, 2020 12:25 am

I just got my x2100. Unsurprisingly, it still has a relatively buggy EC (for instance, the current reporting from the battery is busted). I spent some time in Ghidra tonight; I tried porting forward vladisslav2011's changes to `ec_new_cmd`, but I still can't seem to get the EC-RAM-over-PM stuff working: the patched `ec_sys.ko` gives me the message "[ 32.958654] RDDATA TIMEO s=30".

Here's what I've got so far: https://github.com/jwise/x2100-ec -- and I can share the ghidra db, if anyone wants. vladisslav2011, do you remember what other changes are needed to make EC debugging work? I'm trying to flash the EC as few times as I can, since it makes me nervous :)

If you want to use flashrom on your x2100, you'll need my patch to make it work on Comet Lake: https://review.coreboot.org/c/flashrom/+/44921

jwise
Posts: 7
Joined: Fri Aug 28, 2020 11:14 pm
Location: Mountain View, CA

Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#107 Post by jwise » Sat Aug 29, 2020 1:29 am

I've ported the 1% backlight change (and tested it), and the fn/ctrl swap change (not tested that one yet because I don't want it :) ). I've also added instructions for how to flash it.

Update: added vladisslav2001's hotpatch changes. Also added bug fix for state-of-charge reporting on 9 cell batteries.

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#108 Post by L29Ah » Sun Sep 06, 2020 1:40 pm

rm
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

Yao2000
Freshman Member
Posts: 62
Joined: Mon Jul 13, 2020 2:15 am
Location: Taipei, Taiwan

Re: X210 EC datasheet/better brightness control?

#109 Post by Yao2000 » Wed Apr 21, 2021 8:45 am

vladisslav2011 wrote:
Fri May 17, 2019 2:35 am
I have patched the EC firmware. Now brightness levels are 1%,2%,4%,8%,16%,32%,44%,48%,55%,60%,65%,70%,78%,84%,94%,99%. First 6 levels were replaced with more useful values.
http://rgho.st/6rB9RGr88
Now power consumption is ~3.1W idle, offline,minimal brightness and only 2.8W with LCD off. It looks like backlight consumes about 0.3W even at minimal brightness. That's more, than expected...
I've tried to fix battery current reporting too, but replacing 0x0b (average current) command with 0x0a (current) did not change anything. And switching off absolute mode did not change anything too. As sometimes the current is fetched correctly, it looks like there is still a bug in the code, that forces EC to overwrite the current reading with zero more often, than it is read from the battery. I'll try to find where it is going on and fill that place with NOPs.
And here are screenshots....
https://i.imgur.com/MYHrvK6.png
https://i.imgur.com/ZpntNrD.png
backlight off
https://i.imgur.com/hQjLmos.png
https://i.imgur.com/izI9302.png

hello vladisslav2011,

i know this is almost 2 years ago. Do you by chance have this bios on github? I recently bought a 3rd batch X210 and would like to get the 15 levels of Brightness adjustment for windows 10.

the original download link you have doesn't work anymore. thank you very much!

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 EC datasheet/better brightness control?

#110 Post by L29Ah » Wed Apr 21, 2021 9:11 am

Yao2000 wrote:
Wed Apr 21, 2021 8:45 am
vladisslav2011 wrote:
Fri May 17, 2019 2:35 am
I have patched the EC firmware. Now brightness levels are 1%,2%,4%,8%,16%,32%,44%,48%,55%,60%,65%,70%,78%,84%,94%,99%. First 6 levels were replaced with more useful values.
http://rgho.st/6rB9RGr88
Now power consumption is ~3.1W idle, offline,minimal brightness and only 2.8W with LCD off. It looks like backlight consumes about 0.3W even at minimal brightness. That's more, than expected...
I've tried to fix battery current reporting too, but replacing 0x0b (average current) command with 0x0a (current) did not change anything. And switching off absolute mode did not change anything too. As sometimes the current is fetched correctly, it looks like there is still a bug in the code, that forces EC to overwrite the current reading with zero more often, than it is read from the battery. I'll try to find where it is going on and fill that place with NOPs.
And here are screenshots....
https://i.imgur.com/MYHrvK6.png
https://i.imgur.com/ZpntNrD.png
backlight off
https://i.imgur.com/hQjLmos.png
https://i.imgur.com/izI9302.png

hello vladisslav2011,

i know this is almost 2 years ago. Do you by chance have this bios on github? I recently bought a 3rd batch X210 and would like to get the 15 levels of Brightness adjustment for windows 10.

the original download link you have doesn't work anymore. thank you very much!
Try this: https://tinystash.undef.im/il/5juKGwmef ... 7fufNqBFkh
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

Yao2000
Freshman Member
Posts: 62
Joined: Mon Jul 13, 2020 2:15 am
Location: Taipei, Taiwan

Re: X210 EC datasheet/better brightness control?

#111 Post by Yao2000 » Sat May 01, 2021 3:29 am

L29Ah wrote:
Wed Apr 21, 2021 9:11 am

Try this: https://tinystash.undef.im/il/5juKGwmef ... 7fufNqBFkh
Much appreciated. thanks a lot!

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#112 Post by exander » Sat Nov 06, 2021 8:32 pm

Any idea how to control fan speed on X2100?

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210 EC datasheet/better brightness control?

#113 Post by exander » Mon Nov 08, 2021 10:26 am

L29Ah wrote:
Sun Sep 01, 2019 6:31 pm
vladisslav2011's linux kernel ec debugfs patch ported to 5.1: https://dump.bitcheese.net/files/fazusa ... 1-ec.patch
Is the patch still available somewhere?

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: X210 EC datasheet/better brightness control?

#114 Post by L29Ah » Mon Nov 08, 2021 2:54 pm

exander wrote:
Mon Nov 08, 2021 10:26 am
L29Ah wrote:
Sun Sep 01, 2019 6:31 pm
vladisslav2011's linux kernel ec debugfs patch ported to 5.1: https://dump.bitcheese.net/files/fazusa ... 1-ec.patch
Is the patch still available somewhere?
https://tinystash.undef.im/il/pBEEvVo8W ... 1Fn9nRvJnp
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210 EC datasheet/better brightness control?

#115 Post by exander » Mon Nov 08, 2021 5:34 pm

L29Ah wrote:
Mon Nov 08, 2021 2:54 pm
exander wrote:
Mon Nov 08, 2021 10:26 am


Is the patch still available somewhere?
https://tinystash.undef.im/il/pBEEvVo8W ... 1Fn9nRvJnp
Thank you very much.

Btw I already backported some changes from x210:
https://github.com/exander77/x2100-ec

Most notably hotkeys (FN + => F2, F3, F5, F7, F8, F12). I also added variants of fan PWM tables, so if anybody wants to alter the behaviour, ideas are there. I made two variants silent and silent2 for lower fan speeds. For me, it prevents sudden high rpm fan spikes.

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#116 Post by exander » Tue Nov 09, 2021 6:43 am

I backported ENTER and 7 fixes and ThinkVantage button fix.

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#117 Post by exander » Wed Nov 17, 2021 12:18 pm

I made that EC sys patch into separate DKMS: https://github.com/exander77/x2100-ec-sys

leecher
Posts: 3
Joined: Sat Dec 04, 2021 5:05 pm
Location: Vienna, Austria

Re: X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#118 Post by leecher » Sat Dec 04, 2021 5:18 pm

Any chance to get the keyboard controller documentation etc. again? Links are offline, unfortuantely.
Reason is that I'm trying to patch L530 firmware for 7-row keyboard, which seems to have a similar EC firmware:
https://github.com/hamishcoleman/thinkpad-ec/issues/203

Thanks in advance!

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210/X2100 embedded controller fixes (was: X210 EC datasheet/better brightness control)

#119 Post by exander » Sat Jan 01, 2022 6:54 am

leecher wrote:
Sat Dec 04, 2021 5:18 pm
Any chance to get the keyboard controller documentation etc. again? Links are offline, unfortuantely.
Reason is that I'm trying to patch L530 firmware for 7-row keyboard, which seems to have a similar EC firmware:
https://github.com/hamishcoleman/thinkpad-ec/issues/203

Thanks in advance!
I second that, I would like to get a keyboard mapping spreadsheet (for X2100 related purposes). Please anybody who has it to reupload.

exander
Posts: 47
Joined: Fri Aug 13, 2021 1:00 pm
Location: Prague, Czechia

Re: X210 EC datasheet/better brightness control?

#120 Post by exander » Sat Jan 01, 2022 6:56 am

L29Ah wrote:
Mon Nov 08, 2021 2:54 pm
exander wrote:
Mon Nov 08, 2021 10:26 am


Is the patch still available somewhere?
https://tinystash.undef.im/il/pBEEvVo8W ... 1Fn9nRvJnp
Could you be of help again? Also any related stuff you might have?

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “51nb and other modded Thinkpads”

Who is online

Users browsing this forum: No registered users and 4 guests