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
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)
Re: X210 EC datasheet/better brightness control?
vladisslav2011's linux kernel ec debugfs patch ported to 5.1: https://dump.bitcheese.net/files/fazusa ... 1-ec.patch
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.
Re: X210 EC datasheet/better brightness control?
It feels like you have reverted your brightness table fix, haven't you?vladisslav2011 wrote: ↑Sun Sep 01, 2019 3:24 pmhttp://wdfiles.ru/eq21
http://wdfiles.ru/eq22
http://wdfiles.ru/eq1J
https://pastebin.com/rFD8vReJ
https://pastebin.com/J8F0yeue
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.
Re: X210 EC datasheet/better brightness control?
Wow, you're a lifesaver, do you accept donations? (BTC preferably)vladisslav2011 wrote: ↑Sun Sep 01, 2019 3:24 pmWhat diode are people talking about. There should not be any diodes in the battery discharge path. If it will be here, then it should be 10A rated and have a heatsink as the laptop drains about 6-7A when CPU is at full turbo, full brightness, hdd and 2 SSD's busy. And with USB devices attached it can drain even more. I don't see anything like such large diode at the PCB...
There may be some little diode (like 1n4148), that is used to power the charger IC when on battery. That's normal. Many laptops have such diodes according to chargers datasheets.
And some good news to everyone (some "not so good" news too):
I have looked at the EC firmware one more time and got interesting results
1. (bugfix) Correct reporting of battery charging status: charged when on AC and current is zero
2. (bugfix) Correct battery charge reporting: always report actual charge
3. (improvement) GPE spam removed. Emit "battery changed" acpi event only when battery is changed (stopped/started charge, stopped started discharge, battery inserted/removed)
4. (improvement) Never emit acpi "temperature changed" event as it does not look like anything uses it so far. The fan PWM is controlled by EC itself, so the fan is still operating correctly.
5. (improvement) Increase backlight PWM frequency to ~920 Hz. Should be enough for everyone.
6. (improvement) Enable thinkvantage button
7. (bugfix) EC debugging through PM interface is now working.
8. (bugfix) Use correct keycodes for "7" and "Enter" keys, so blender is now usable with internal keyboard.
9. (bugfix) Prevent fan from rotating at full speed at low temperature for short periods of time.
10. (patch) ec_sys driver patch to access the EC RAM and GPIO through debugfs.
11. Some keyboard controller (messy) and gpio (incomplete) documentation created.
12. EC boot ROM added to Ghidra project
http://wdfiles.ru/eq21
http://wdfiles.ru/eq22
http://wdfiles.ru/eq1J
https://pastebin.com/rFD8vReJ
https://pastebin.com/J8F0yeue
It is possible to patch the EC firmware online. Full CR16 memory space is available through /sys/kernel/debug/ec/ec0/ram.
To chage keyboard mapping find memory location via spreadsheet, read it to verify (!), then write desired value.
For example, to assign some key to Fn+F2 combination find location at Fn keys sheet (0x29F3A), read itAnd assign a code from "set 2 ref" or "specials" sheets. Assign WWW-search key for exampleCode: Select all
# dd if=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 skip=$[0x29F3A] 2>/dev/null|hexdump -C 00000000 00 |.| 00000001
It should be possible to swap Ctrl and FN too by swapping values at 0x00029eae and 0x00021e3a, but I have not tested itCode: Select all
# echo -ne "\x38" |dd of=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 seek=$[0x29F3A]
Changes will survive reboot and even power off when connected to AC. To make the EC boot from SPI flash, power the laptop off, disconnect AC adapter and wait about 15 seconds. The battery may be left connected.
Current GPIO state may be queried via /sys/kernel/debug/ec/ec0/gpio.
To drive GPO low, write GPIO number to /sys/kernel/debug/ec/ec0/gpio in binary:
Turn thinkllight offTo drive GPO high, or it's number with 0x08 and write resulting number to /sys/kernel/debug/ec/ec0/gpio in binary:Code: Select all
echo -ne "\x47" >/sys/kernel/debug/ec/ec0/gpio
Turn thinkllight onWARNING: Writing arbitrary values to EC RAM and messing with EC GPIOs may damage your laptop. Althrough chips should survive drive contention, it is still possible to make them latch by turning power supplies in wrong order. Latched up chips will heat to critical temperature quickly and will draw excessive currents exceeding absolute maximum ratings. Think twice before writing anything to EC RAM/GPIOs.Code: Select all
echo -ne "\x4f" >/sys/kernel/debug/ec/ec0/gpio
And some bad news:
1. UART Sin pin is used to switch touchpad power, so no interactive debugging via UART, only debug messages.
2. I have not figured out, which GPIO controls the LCD's power line (+3.3V). Maybe it is tied directly to +3.3V power plane without dedicated switch. So, it is not possible to cut power consumption by 1.6W when the display is in DPMS Off state.
Update:
I've tried swapping FN and Ctrl and found a bug. Swapped Ctrl did not flush scancode buffer until another key was pressed, and sometimes sticks in pressed state. And Ctrl+wheel was not possible too.
Fixed via nasty hack (jumping from one function to another. More spaghetti!)
Links to Ghidra project and patched binary updated.
Bugs to fix:
Trackpoint event noise on resume which prevents USB/Bluetooth mice from working correctly after resume.
Thank you for you work.
I'm trying to swap fn/ctrl but dd gives invalid arg
(it seems that ram is -r---- read only don't know how to remount this acpi_ec though)
Is it possible to set the bat thresholds with EC?
Last edited by verynice on Fri Sep 06, 2019 3:26 am, edited 1 time in total.
Re: X210 EC datasheet/better brightness control?
I second this. I'll happily make a donation too. After all we paid good money for this machine, don't see why we shouldn't reward vladisslav2011 for making it actually usable.
Re: X210 EC datasheet/better brightness control?
If anyone needs this is the latest coreboot master build with cleaned-up me and fixed ec (this is the first build which wakes from sleep/power on instantly)
https://files.catbox.moe/6m16wn.rom
If somebody will upload the ec with fn/ctrl swapped I'll do a new build.
Also, will try libgfxinit build later.
https://files.catbox.moe/6m16wn.rom
If somebody will upload the ec with fn/ctrl swapped I'll do a new build.
Also, will try libgfxinit build later.
Re: X210 EC datasheet/better brightness control?
modprobe ec_sys write_support=1
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.
-
- Posts: 30
- Joined: Fri Oct 12, 2018 6:33 am
- Location: Velikiye Luki, Pskov, Russia
Re: X210 EC datasheet/better brightness control?
No. Brightness fix is still here.L29Ah wrote: ↑Thu Sep 05, 2019 6:03 pmIt feels like you have reverted your brightness table fix, haven't you?vladisslav2011 wrote: ↑Sun Sep 01, 2019 3:24 pmhttp://wdfiles.ru/eq21
http://wdfiles.ru/eq22
http://wdfiles.ru/eq1J
https://pastebin.com/rFD8vReJ
https://pastebin.com/J8F0yeue
Code: Select all
dd if=newec.bin skip=$[0x09d7e] bs=1 count=32 2>/dev/null |hexdump -C
00000000 01 01 02 02 04 04 08 08 10 10 20 20 2c 2c 30 30 |.......... ,,00|
00000010 37 37 3c 3c 41 41 46 46 4e 4b 56 50 5e 55 63 5a |77<<AAFFNKVP^UcZ|
00000020
If you want to change brightness PWM frequency back to ~300 Hz, set uint16 at 0x1968 back to 300 or choose any other value, you want.
You have to change this value in newec.bin, recalculate checksum, merge it with BIOS image and flash. Changing it online would not work as it is used only ones in early init code.
Address for donations: bc1qlcszg46390xvvaxkcu4ecd899y85mc22hkx0d6
What was not still done:
1. Reading manufacturer, model and serial from a battery (will require DSDT patch along with EC one). Maybe it will be easier to setup a toolchain and rewrite the EC firmware from scratch than to patch it using machine codes...
2. Erratic mouse movement and clicking after waking suspend. It looks like there is bug in a psmouse driver, as it is triggered by unbind/binding it, but it is not reproduced during boot. I'll try to resolve this issue during this weekend.
Re: X210 EC datasheet/better brightness control?
Ok, I've got the same screen. and it shows 7-10W with my config, the only time I had 4W was with the stock x201 screen (and patched bios, maybe coreboot too, don't remember)vladisslav2011 wrote: ↑Fri Sep 06, 2019 10:51 amNo. Brightness fix is still here.Maybe your LCD does not work well at 925 Hz backlight PWM. Mine is BOE NV126A1M-N52 and it supports up to 1kHz PWM, down to 1% duty ratio.Code: Select all
dd if=newec.bin skip=$[0x09d7e] bs=1 count=32 2>/dev/null |hexdump -C 00000000 01 01 02 02 04 04 08 08 10 10 20 20 2c 2c 30 30 |.......... ,,00| 00000010 37 37 3c 3c 41 41 46 46 4e 4b 56 50 5e 55 63 5a |77<<AAFFNKVP^UcZ| 00000020
If you want to change brightness PWM frequency back to ~300 Hz, set uint16 at 0x1968 back to 300 or choose any other value, you want.
You have to change this value in newec.bin, recalculate checksum, merge it with BIOS image and flash. Changing it online would not work as it is used only ones in early init code.Address for donations: bc1qlcszg46390xvvaxkcu4ecd899y85mc22hkx0d6
What was not still done:
1. Reading manufacturer, model and serial from a battery (will require DSDT patch along with EC one). Maybe it will be easier to setup a toolchain and rewrite the EC firmware from scratch than to patch it using machine codes...
2. Erratic mouse movement and clicking after waking suspend. It looks like there is bug in a psmouse driver, as it is triggered by unbind/binding it, but it is not reproduced during boot. I'll try to resolve this issue during this weekend.
1. DSDT patch is okay, one can build coreboot with fixed dsdt (afaik).
Is there a possibility that disengaged fan mode will be added someday?
Do I understand correctly that I should swap those?
dd if=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 skip=$[0x00021e3a] 2>/dev/null|hexdump -C
dd if=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 skip=$[0x00029eae] 2>/dev/null|hexdump -C
\x14 \x8e (or \x89) if i understood correctly.
echo -ne "\x14" |dd of=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 seek=$[0x00021e3a]
-
- Posts: 30
- Joined: Fri Oct 12, 2018 6:33 am
- Location: Velikiye Luki, Pskov, Russia
Re: X210 EC datasheet/better brightness control?
Check /sys/kernel/debug/dri/0/i915_edp_psr_status
Code: Select all
cat /sys/kernel/debug/dri/0/i915_edp_psr_status
Sink_Support: yes
PSR mode: PSR1
Enabled: yes
Busy frontbuffer bits: 0x000
Main link in standby mode: no
HW Enabled & Active bit: yes
Source PSR status: 0x40010006 [SRDENT]
If pc9 is zero and PRS is not enabled...
1. Patch i915 to force-enable PSR regardless of timings. The patch was posted earlier in this thread.
2. Use r8168 driver for ethernet card.
3. Use network-manager to configure wired connection.
4. Your kernel cmdline should be like following:
BOOT_IMAGE=/boot/vmlinuz root=/dev/nvm0n1p1 ro drm.vblankoffdelay=1 i915.enable_psr=1 r8168.aspm=1 r8168.eee_enable=1 r8168.hwoptimize=1 r8168.debug=0 i915.enable_guc=-1 ath9k.btcoex_enable=0 ath9k.ps_enable=1 ath9k.blink=1 ath9k.bt_ant_diversity=1
5. If you are using atheros wireless card, then you may have to disconnect from wireless network to get minimal power consumption.
6. You may have to edit /etc/default/tlp to disable turboboost, enable aggressive powersaving for SATA/PCIe, etc if you are using tlp.
What is it? A way to disable the fan completely or something else?
"Periodic fan buzzing at idle" issue is fixed in latest EC firmware patch.
Yes.verynice wrote: ↑Fri Sep 06, 2019 11:07 amDo I understand correctly that I should swap those?
dd if=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 skip=$[0x00021e3a] 2>/dev/null|hexdump -C
dd if=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 skip=$[0x00029eae] 2>/dev/null|hexdump -C
\x14 \x8e (or \x89) if i understood correctly.
echo -ne "\x14" |dd of=/sys/kernel/debug/ec/ec0/ram bs=1 count=1 seek=$[0x00021e3a]
Code: Select all
echo -ne "\x14" |dd of=/sys/kernel/debug/ec/ec0/ram bs=1 seek=$[0x00021e3a]
echo -ne "\x8e" |dd of=/sys/kernel/debug/ec/ec0/ram bs=1 seek=$[0x00029eae]
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. And it looks like this behavior may be changed with soldering iron only.
But if you want to be able to stop charging from userspace, then you should just find the GPIO, which enables/disables charging. Then you may control it using ec_sys by writing to /sys/kernel/debug/ec/ec0/gpio. You may ask HOPE for schematic diagrams of this MB at 51nb forums or take a look at Ghidra project and experiment a bit (may be dangerous to your laptop)
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
Code: Select all
cat /sys/kernel/debug/dri/0/i915_edp_psr_status
Sink support: no
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.
-
- 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)
It looks, like you have updated a kernel, but forgot to patch the i915_psr.c to force-enable PSR.L29Ah wrote: ↑Fri Sep 06, 2019 12:08 pmWhat am i doing wrong?Code: Select all
cat /sys/kernel/debug/dri/0/i915_edp_psr_status Sink support: no
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
Nah, i'm running the patched kernel.vladisslav2011 wrote: ↑Fri Sep 06, 2019 12:30 pmIt looks, like you have updated a kernel, but forgot to patch the i915_psr.c to force-enable PSR.L29Ah wrote: ↑Fri Sep 06, 2019 12:08 pmWhat am i doing wrong?Code: Select all
cat /sys/kernel/debug/dri/0/i915_edp_psr_status Sink support: no
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.
-
- 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)
If so, let's take a debug log:L29Ah wrote: ↑Fri Sep 06, 2019 1:07 pmNah, i'm running the patched kernel.vladisslav2011 wrote: ↑Fri Sep 06, 2019 12:30 pm
It looks, like you have updated a kernel, but forgot to patch the i915_psr.c to force-enable PSR.
Code: Select all
# echo 4 > /sys/module/drm/parameters/debug
$ xset dpms force off
As I'm using distribution supplied kernels, I sometimes forget to update the initramfs after installing patched i915.ko. Maybe you forgot to update it too.
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
https://dump.bitcheese.net/files/zoputow/i915.logvladisslav2011 wrote: ↑Fri Sep 06, 2019 1:42 pmIf so, let's take a debug log:Wait some time, hit any key to wake a display, post part of dmesg after enabling logging here. There should be some messages about enabling PSR after display power on.Code: Select all
# echo 4 > /sys/module/drm/parameters/debug $ xset dpms force off
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.
Re: X210 EC datasheet/better brightness control?
1.If you have similar output, then you should get 3-4W idle. You may use powertop too. It should show nonzero pc9 percentage.
If pc9 is zero and PRS is not enabled...
1. Patch i915 to force-enable PSR regardless of timings. The patch was posted earlier in this thread.
Code: Select all
cat /sys/kernel/debug/dri/0/i915_edp_psr_status
Sink support: yes [0x01]
PSR mode: disabled
patch:
Code: Select all
diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index 84a0fb981561..53c811241979 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -625,9 +625,8 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) >
adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay - 1) {
- DRM_DEBUG_KMS("PSR condition failed: PSR setup time (%d us) too long\n",
+ DRM_DEBUG_KMS("PSR condition failed: PSR setup time (%d us) too long, proceeding anyway\n",
psr_setup_time);
- return;
}
crtc_state->has_psr = true;
2. So one should out-of-tree driver? (ok)2. Use r8168 driver for ethernet card.
3. I used wpa_supplicant, now switched to iwd/iwctl (No wired connection (almost never, when it's time to use the wired connection I only use udhcpc (maybe it's better to disable the driver for the sake of battery-life?)3. Use network-manager to configure wired connection.
4. command line:4. Your kernel cmdline should be like following:
BOOT_IMAGE=/boot/vmlinuz root=/dev/nvm0n1p1 ro drm.vblankoffdelay=1 i915.enable_psr=1 r8168.aspm=1 r8168.eee_enable=1 r8168.hwoptimize=1 r8168.debug=0 i915.enable_guc=-1 ath9k.btcoex_enable=0 ath9k.ps_enable=1 ath9k.blink=1 ath9k.bt_ant_diversity=1
CONFIG_CMDLINE=" kvm-intel.vmentry_l1d_flush=never noretpoline no_stf_barrier nopti nospectre_v2 nospec_store_bypass_disable l1tf=off noibrs noibpb nospec nogmb spectre_v2=off pti=off quiet i915.i915_enable_fbc=1 drm.vblankoffdelay=1 i915.i915_enable_rc6=7 i915.lvds_downclock=1 lvds_downclock=1 root=/dev/nvme0n1p2"
I'll add your flags later.
kernel config: https://files.catbox.moe/canfta.gz
5. Yes, I'm using Atheros wireless card;or use rf-kill/hardware switch?5. If you are using atheros wireless card, then you may have to disconnect from wireless network to get minimal power consumption.
6. I'll install tlp later6. You may have to edit /etc/default/tlp to disable turboboost, enable aggressive powersaving for SATA/PCIe, etc if you are using tlp.
7. http://www.thinkwiki.org/wiki/How_to_control_fan_speedWhat is it? A way to disable the fan completely or something else?
"Periodic fan buzzing at idle" issue is fixed in latest EC firmware patch.
Disengaged (full-speed) mode
In disengaged mode, the embedded controller does not monitor the fan speed. It "disengages" the closed-loop control function that keeps track of fan speed, and uses an open-loop control function that ramps up the fan to its maximum speed (100% duty-cycle). The end speed is not stable, but it is often much faster than the maximum speed manual and automatic modes would set the fan to.
# echo level disengaged | sudo tee /proc/acpi/ibm/fan (disengaged)
8. I'll try to hexedit this file later, and then reupload the fixed coreboot image.You may make this change permanent by patching the firmware image with a hex editor or Ghhidra (as I do) and flashing it.
9. How can one fix this issue with a soldering iron?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. And it looks like this behavior may be changed with soldering iron only.
But if you want to be able to stop charging from userspace, then you should just find the GPIO, which enables/disables charging. Then you may control it using ec_sys by writing to /sys/kernel/debug/ec/ec0/gpio. You may ask HOPE for schematic diagrams of this MB at 51nb forums or take a look at Ghidra project and experiment a bit (may be dangerous to your laptop)
-
- 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)
You are using 1920x1200 panel, that does not support PSR at all. So, you are out of luck. Power consumption will drop down to 3-4W only when the display is in DPMS off state.L29Ah wrote: ↑Fri Sep 06, 2019 2:18 pmhttps://dump.bitcheese.net/files/zoputow/i915.logvladisslav2011 wrote: ↑Fri Sep 06, 2019 1:42 pmIf so, let's take a debug log:Wait some time, hit any key to wake a display, post part of dmesg after enabling logging here. There should be some messages about enabling PSR after display power on.Code: Select all
# echo 4 > /sys/module/drm/parameters/debug $ xset dpms force off
But it still should be possible to order custom eDP cable from Jacky, buy BOE NV126A1M-N52 panel and apply "glossy display problem" solution to it (see picture).
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
dmesg | tail -220 > logIf so, let's take a debug log:Wait some time, hit any key to wake a display, post part of dmesg after enabling logging here. There should be some messages about enabling PSR after display power on.Code: Select all
# echo 4 > /sys/module/drm/parameters/debug $ xset dpms force off
https://files.catbox.moe/nbp3qr
about screen:
this?
Производитель KUDO
Артикул KU9004
Наименование Лак
Описание поставщика KU-9004 Лак акриловый матовый универсальный спрей (520мл)
i Guess you've made my life easier today.
I'll have to donate even more! (still, I'll do it later)
-
- Posts: 30
- Joined: Fri Oct 12, 2018 6:33 am
- Location: Velikiye Luki, Pskov, Russia
Re: X210 EC datasheet/better brightness control?
Yes. The driver from Realtek site. Or from r8168-dkms package if your distribution has it.
Wired, not wireless. Network manager somehow enables powersaving on wired network even when the interface is up, but there is no connection and reenables it after waking from suspend. I don't like network-manager, but I have not found, which ioctls it issues to an interface to enable powersaving yet.verynice wrote: ↑Fri Sep 06, 2019 3:16 pm3. I used wpa_supplicant, now switched to iwd/iwctl (No wired connection (almost never, when it's time to use the wired connection I only use udhcpc (maybe it's better to disable the driver for the sake of battery-life?)3. Use network-manager to configure wired connection.
Keeping the interface up and not associated to an access point is enough. Maybe network-manager helps here too.
OK. That's exactly opposite thing. You may edit fan speed table at 0x9aee (even online via debugfs at 0x29aee) to get exactly same result: set all pwm values to 0x64. Or maybe better to set low thresholds.verynice wrote: ↑Fri Sep 06, 2019 3:16 pm7. http://www.thinkwiki.org/wiki/How_to_control_fan_speed
Disengaged (full-speed) mode
In disengaged mode, the embedded controller does not monitor the fan speed. It "disengages" the closed-loop control function that keeps track of fan speed, and uses an open-loop control function that ramps up the fan to its maximum speed (100% duty-cycle). The end speed is not stable, but it is often much faster than the maximum speed manual and automatic modes would set the fan to.
# echo level disengaged | sudo tee /proc/acpi/ibm/fan (disengaged)
The table at 0x9aee has following type: struct{ uint8_t temp_in,uint8_t temp_out,uint16_t pwm}[7]
Now it has 90% at 76 deg and 100% at 90 deg. I think, that it's too much.
I've patched it to lower temperatures: 100% at 72 deg. You may test:
http://wdfiles.ru/eqQ2
http://wdfiles.ru/eqQ3
Some keyboard controller debug output to EC serial port is added. If you have soldered debug connector, then you may see, what the EC receives from/sends to a keyboard port.
I don't know. You may find the fix yourself. You'll have to take the MB out, remove protecting films, find and identify charger chip, find a datasheet, read it to find fb pin, test resistors near the chip, to find, which ones are connected to the fb pin, confirm that there is star-like topology, unsolder resistors, measure them, calculate more accurate value, order high precision resistors, solder them, test results and post here I have not done this yet. Maybe high quality scans of the pcb with protective films removed will help, but I have not found such scans on the net.
Re: X210 EC datasheet/better brightness control?
Have you tried powertop --auto-tune?vladisslav2011 wrote: ↑Fri Sep 06, 2019 4:32 pmWired, not wireless. Network manager somehow enables powersaving on wired network even when the interface is up, but there is no connection and reenables it after waking from suspend. I don't like network-manager, but I have not found, which ioctls it issues to an interface to enable powersaving yet.
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.
-
- 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)
You are lucky. Patch i915 driver and you'll have PSR working.
Yes. But any other clear acrylic matte coating should work too. Just find a clean room to avoid dust and result will be just amazing. Better, than stock matte displays, I think.
Yes. It did not change anything. I've already had most setting at "Tunables" tab set to "good".
I've got same 2.8-3.3W idle offline and 3.8-4.5W idle when associated to an AP.
There are 2 possible ways to improve power consumption:
1. Find a GPIO (it may be not EC GPIO, but chipset one), that will switch the eDP port power pins (3.3V) off. That will result in about 1.6W idle with display off (about 56-58 Hrs runtime with 94Wh battery)
2. Fix a bug in ath9k driver, that prevents it from using runtime PM being associated to an AP. This would result in 2.8-3.3W even online. Or put some other wifi card, that fully suporst powersaving with modern kernel (ath10k?).
Re: X210 EC datasheet/better brightness control?
https://files.catbox.moe/0fwzwz.bin fnctrlswap ec with fan adj
https://files.catbox.moe/jeog0j.rom coreboottemp
https://files.catbox.moe/2qdh28.rom corebootfnctrl
Now, this is getting interesting...
It seems that sensors are getting wrong results, when temp reaches 7* degrees->fan100%->temp 100*C almost immediately->throttle and then temp shows adequate results.
Maybe it's hardcoded somwhere else in EC? (to set temp to 100 degr on max fan, yes this sounds strange)
I added the psr to the BOOT config, still it shows 7W and the patch is applied, the difference between wifi on/of is 0.5W.
And powertop only shows that Pkg(HW) C2 and C3 states are used.
https://files.catbox.moe/jeog0j.rom coreboottemp
https://files.catbox.moe/2qdh28.rom corebootfnctrl
Now, this is getting interesting...
It seems that sensors are getting wrong results, when temp reaches 7* degrees->fan100%->temp 100*C almost immediately->throttle and then temp shows adequate results.
Maybe it's hardcoded somwhere else in EC? (to set temp to 100 degr on max fan, yes this sounds strange)
I added the psr to the BOOT config, still it shows 7W and the patch is applied, the difference between wifi on/of is 0.5W.
And powertop only shows that Pkg(HW) C2 and C3 states are used.
-
- Posts: 30
- Joined: Fri Oct 12, 2018 6:33 am
- Location: Velikiye Luki, Pskov, Russia
Re: X210 EC datasheet/better brightness control?
It looks like active ps/2 multiplexing is implementer incorrectly.vladisslav2011 wrote: ↑Fri Sep 06, 2019 10:51 am2. Erratic mouse movement and clicking after waking suspend. It looks like there is bug in a psmouse driver, as it is triggered by unbind/binding it, but it is not reproduced during boot. I'll try to resolve this issue during this weekend.
Temporary workaround is to pass i8042.nomux=1 parameter to a kernel. Both the trackpoint and a mouse should work well after suspend.
As I have no palmrest with integrated touchpad, I can't test whether it works or not with ps/2 active multiplexing disabled. Test, please, if you have such palmrest and report results here.
No. The EC just reads a temperature and sets PWM. It has nothing to do with throttling. See code:
Code: Select all
void __ptrcall set_fan_temp_change(void)
{
int iVar1;
if (cur_pstate == '\0') {
if (ec_temp != ec_temp_buf) {
ec_temp_buf = ec_temp;
}
if (fan_i_unc == '\0') {
if (ec_temp < 0x28) {
enable_set_fanpwm(5);
fan_flag = '\0';
}
else {
if ((fan_flag == '\0') && (0x29 < ec_temp)) {
fan_flag = 1;
enable_set_fanpwm(0x15);
return;
}
}
iVar1 = (uint)fan_tbl_p * 4;
if ((&fan_tbl[0].temp_lo)[(ulong)(iVar1 + 4)] < ec_temp) {
enable_set_fanpwm((&fan_tbl[0].temp_lo)[(ulong)(iVar1 + 6)]);
fan_tbl_p = fan_tbl_p + 1;
}
else {
if (ec_temp < (&fan_tbl[0].temp_lo)[(ulong)(iVar1 + 1)]) {
enable_set_fanpwm((&fan_tbl[0].temp_lo)[(ulong)(iVar1 - 2)]);
fan_tbl_p = fan_tbl_p - 1;
}
}
}
else {
fan_i_unc = fan_i_unc + -1;
}
}
else {
enable_set_fanpwm(0);
gpio_out(0x66,0);
}
return;
}
You have some other device preventing CPU from entering deeper C-states. Are you using r8168 driver for wired network? Are you using a nvme ssd? Does your ssd support aspm and have it enabled?
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
Silly me, of course throttling is done by other means. But nevertheless it's really fishy that sensors jump from 7*->100*C. Something is wrong here, and I don't knowNo. The EC just reads a temperature and sets PWM. It has nothing to do with throttling. See code:
what is responsible for this, as earlier (without fan patch), temp had no sudden jumps. Could EC have some buggy code in EC that accidentally sets temp or something else?
I've got samsung 970 pro nvme drive, I manually rmmod for 8168 now (Don't know whether it's good for power consumption or not though) (I can remove this driver for thy testing purposes).
About ASPM:
Code: Select all
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode])
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
00:1c.3 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #4 (rev f1) (prog-if 00 [Normal decode])
LnkCtl: ASPM L0s Enabled; RCB 64 bytes Disabled- CommClk-
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1) (prog-if 00 [Normal decode])
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
02:00.0 PCI bridge: Wilocity Ltd. Wil6200 PCI Express Upstream Port (rev 04) (prog-if 00 [Normal decode])
LnkCtl: ASPM L0s Enabled; Disabled- CommClk-
04:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk-
07:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 (prog-if 02 [NVM Express])
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
I believe the temperature does have the sudden jumps on the default throttling settings. The used i5/i7 CPU is capable to produce up to three times more power than the X201 cooling system is able to soak and heat up to 100°C in a second. You may want to play with `throttled` settings to find the thermal regiment you feel adequate.verynice wrote: ↑Sat Sep 07, 2019 12:21 pmSilly me, of course throttling is done by other means. But nevertheless it's really fishy that sensors jump from 7*->100*C. Something is wrong here, and I don't knowNo. The EC just reads a temperature and sets PWM. It has nothing to do with throttling. See code:
what is responsible for this, as earlier (without fan patch), temp had no sudden jumps. Could EC have some buggy code in EC that accidentally sets temp or something else?
I've got samsung 970 pro nvme drive, I manually rmmod for 8168 now (Don't know whether it's good for power consumption or not though) (I can remove this driver for thy testing purposes).
About ASPM:Code: Select all
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode]) LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+ 00:1c.3 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #4 (rev f1) (prog-if 00 [Normal decode]) LnkCtl: ASPM L0s Enabled; RCB 64 bytes Disabled- CommClk- 00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1) (prog-if 00 [Normal decode]) LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+ 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15) LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+ 02:00.0 PCI bridge: Wilocity Ltd. Wil6200 PCI Express Upstream Port (rev 04) (prog-if 00 [Normal decode]) LnkCtl: ASPM L0s Enabled; Disabled- CommClk- 04:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01) LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk- 07:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 (prog-if 02 [NVM Express]) LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
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.
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
Basically there should be a way to do this in coreboot without throttled. (afaik there is no way to undervolt in the coreboot) but still, maybe there can be a workaround for this.L29Ah wrote: ↑Sat Sep 07, 2019 12:41 pmI believe the temperature does have the sudden jumps on the default throttling settings. The used i5/i7 CPU is capable to produce up to three times more power than the X201 cooling system is able to soak and heat up to 100°C in a second. You may want to play with `throttled` settings to find the thermal regiment you feel adequate.
Because it's better when it works without supplementary software.
Still this is very strange, as this is the first time I see this.
Before there were no such sudden jumps.
-
- 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)
Removing r8168 module makes things worse to me. The module should be loaded with powersaving parameters (aspm, eee_enable, hwoptimize) set to 1 and the interface should be up.verynice wrote: ↑Sat Sep 07, 2019 12:21 pmAbout ASPM:Code: Select all
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode]) LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+ 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15) LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
Wireless interface should be up too, but not connected to a network.
And, as I see, 2 devices have ASPM disabled. That's why your cpu does not reach pc8/pc9.
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
Code: Select all
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode])
LnkCap: Port #3, Speed 8GT/s, Width x1, ASPM not supported
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.
-
- 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)
My result on a stock BIOS:L29Ah wrote: ↑Sun Sep 08, 2019 9:22 amon a stock BIOSCode: Select all
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode]) LnkCap: Port #3, Speed 8GT/s, Width x1, ASPM not supported
Code: Select all
# lspci -vv|grep -E 'LnkCtl|^0'
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07) (prog-if 00 [VGA controller])
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)
00:07.0 Performance counters: Intel Corporation Device 1907 (rev 08)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21) (prog-if 30 [XHCI])
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #3 (rev f1) (prog-if 00 [Normal decode])
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
00:1c.3 PCI bridge: Intel Corporation Device 9d13 (rev f1) (prog-if 00 [Normal decode])
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk+
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1) (prog-if 00 [Normal decode])
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
00:1f.0 ISA bridge: Intel Corporation Intel(R) 100 Series Chipset Family LPC Controller/eSPI Controller - 9D4E (rev 21)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
02:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes Disabled- CommClk+
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
03:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981 (prog-if 02 [NVM Express])
LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
Now there is only:
03:03.0 PCI bridge: Wilocity Ltd. Wil6200 PCI Express Upstream Port (rev 14) (prog-if 00 [Normal decode]) and
03:02.0 PCI bridge: Wilocity Ltd. Wil6200 PCI Express Upstream Port (rev 14) (prog-if 00 [Normal decode])
with ASPM Disabled (those are from wifi module)
AAAnnd, with my high int I was able to change two digits in coreboot tree and after that neither WIFI nor LAN is working and SATA is disabled too.
System is in the C8 pc8 state (no pc9 or pc10) and 6W power consumption. I'll keep investigating then.
The strange thing is that there are two display backlight in the device stat (powertop)
03:03.0 PCI bridge: Wilocity Ltd. Wil6200 PCI Express Upstream Port (rev 14) (prog-if 00 [Normal decode]) and
03:02.0 PCI bridge: Wilocity Ltd. Wil6200 PCI Express Upstream Port (rev 14) (prog-if 00 [Normal decode])
with ASPM Disabled (those are from wifi module)
AAAnnd, with my high int I was able to change two digits in coreboot tree and after that neither WIFI nor LAN is working and SATA is disabled too.
System is in the C8 pc8 state (no pc9 or pc10) and 6W power consumption. I'll keep investigating then.
The strange thing is that there are two display backlight in the device stat (powertop)
Re: X210 embedded controller fixes (was: X210 EC datasheet/better brightness control)
You're right, ASPM was disabled for all the PCIe interfaces in BIOS, thanks.
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.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
FS: X2100 with need of love and a new home.
by mcfado » Wed Nov 29, 2023 7:29 am » in Marketplace - Forum Members only - 2 Replies
- 1472 Views
-
Last post by lars-rasmussen
Thu Nov 30, 2023 6:30 am
-
-
- 0 Replies
- 1359 Views
-
Last post by hall
Mon Jan 15, 2024 2:50 pm
-
-
X2100 loses bios settings if left unplugged
by jamesfawcett » Fri Apr 05, 2024 9:00 am » in 51nb and other modded Thinkpads - 8 Replies
- 530 Views
-
Last post by kfzhu1229
Fri Apr 12, 2024 2:34 pm
-
-
-
Possibly missing SMD resistor on X210 board
by yitzhaq » Wed Nov 08, 2023 6:28 pm » in 51nb and other modded Thinkpads - 16 Replies
- 6443 Views
-
Last post by 755cdxd
Wed Jan 10, 2024 6:39 am
-
Who is online
Users browsing this forum: No registered users and 6 guests