User Tools

Site Tools


doc:appunti:linux:lenovo_thinkpad_l380

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:lenovo_thinkpad_l380 [2025/11/30 08:58] – [Battery] niccolodoc:appunti:linux:lenovo_thinkpad_l380 [2025/12/07 06:26] (current) – [Battery] niccolo
Line 1: Line 1:
 ====== GNU/Linux on the Lenovo ThinkPad L380 ====== ====== GNU/Linux on the Lenovo ThinkPad L380 ======
 +
 +Notes about installing **Debian GNU/Linux 13 Trixie** on the **Lenovo ThinkPad L380** notebook.
  
 ^ CPU         | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, 4 cores  | ^ CPU         | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, 4 cores  |
Line 19: Line 21:
 Replacing the SSD requires to **disassemble tha back** of the notebook, unscrewing the **9 screws** and gently separating the back cover with a plastic blade. Replacing the SSD requires to **disassemble tha back** of the notebook, unscrewing the **9 screws** and gently separating the back cover with a plastic blade.
  
-===== Installing Debian 12 =====+===== Installing Debian 13 =====
  
 === Supported devices === === Supported devices ===
Line 34: Line 36:
 ===== BIOS ===== ===== BIOS =====
  
-FIXME+^ UEFI BIOS Verion             | R0RET29W (1.12) 
 +^ UEFI BIOS Date               | 2018-05-24       | 
 +^ Embedded Controller Version  | R0RHT24W (1.07) 
 +^ ME Firmware Version          | 11.8.50.3460     |  
 +^ Machine Type Model           | 20M6S1NA00       | 
 + 
 +  * BIOS 
 +    * Config 
 +      * Fn and Ctrl Key swap [Enabled] 
 +      * F1-F12 as Primary Function [Enabled]
  
 ===== Battery ===== ===== Battery =====
Line 75: Line 86:
 <code> <code>
 # Battery charge level below which charging will begin when connecting the charger.  # Battery charge level below which charging will begin when connecting the charger. 
-START_CHARGE_THRESH_BAT0=75+START_CHARGE_THRESH_BAT0=80
 # Battery charge level above which charging will stop while the charger is connected. # Battery charge level above which charging will stop while the charger is connected.
-STOP_CHARGE_THRESH_BAT0=80+STOP_CHARGE_THRESH_BAT0=85
 </code> </code>
  
-:!: **NOTICE**: Once configured and restarted the service, the output of ''%%tlp-stat --battery%%'' **may not reflect the configured values**. It is common on the Thinkpad that one of the two threshold values is always displayed incorrectly. Another common pitfall is that you have to discharge the battery below the old start threshold after writing the new threshold.+:!: **NOTICE**: Once configured and restarted the service, the output of ''%%tlp-stat --battery%%'' **may not reflect the configured values**. As reported in **[[https://linrunner.de/tlp/faq/battery.html|this page]]** it is common on the Thinkpad that one of the two threshold values is always displayed incorrectly. Another common pitfall is that you have to discharge the battery below the old start threshold after writing the new threshold. I can confirm that the **charge_control_end_threshold** reported by the pseudofile does not reflect the set value but it show the same value of **charge_control_start_threshold**, neverthless the charge logic is working correctly.  
 + 
 +=== Setcharge: start and stop (end) thresholds ===
  
 To change the battery charge thresholds temporarily you can issue the command: To change the battery charge thresholds temporarily you can issue the command:
Line 94: Line 107:
 </code> </code>
  
-FIXME **WARNING**It seems that there is a problem changing these thresholdsif you specify a **start** and an **end** value, the **charge_control_start_threshold** is actually changedbut the **charge_control_end_threshold** is forced to be equal to the start (as reported by ''tlp-stat --battery''). Setting the **charge_control_start_threshold** to zero will automatically set the **charge_control_end_threshold** to 100. So it seems that the ''charge_control_end_threshold'' is ignored and it is set automatically upon the start value.+:!: **NOTICE**: As noted aboveafter you set the **charge_control_end_threshold**, its value is reported incorrectly by ''tlp-stat --battery'' (it shows a value equal to the charge_control_start_thresholddespite it is working as expectedSo also the **Recommendations** shown by the tlp-stat command are misleading. Notice also that setting the **charge_control_start_threshold** to zero will automatically set the **charge_control_end_threshold** to 100.
  
-You can also trigger a battery charge to the full capacity (according to the vendor presets) issuing the command:+You can also trigger a battery charge to the full capacity (according to the vendor presets) issuing the command (FIXME check if this is actually working):
  
 <code> <code>
 tlp fullcharge tlp fullcharge
 </code> </code>
 +
 +=== Recalibrate ===
  
 While on AC power you can force a recalibration cycle, i.e. completely discharge the battery and recharge to 100%, by issuing the command: While on AC power you can force a recalibration cycle, i.e. completely discharge the battery and recharge to 100%, by issuing the command:
Line 108: Line 123:
 </code> </code>
  
 +The **recalibrate** procedure is actually an interactive multistep process. The program will set the start and stop thresholds to 96 and switches the **charge_behaviour**  to **force-discharge**. Then it waits for the battery to go below 10% before switching back the **charge_behaviour** to **auto**. You should then allow the battery to reach a 100% charge, to let the firmware to update the **energy_full** parameter, which along with the energy_full_design determines the battery actual capacity.
  
-This command will force the battery status to **Discharging**, even if AC adapter is attached (the system return the error message ''write error: Input/output error'', but the charge_behaviour does actually change):+=== charge_behaviour === 
 + 
 +The following command will force the battery status to **Discharging**, even if AC adapter is attached. Sometimes the system returns the error message ''write error: Input/output error'', and you need to issue the command a second time to let the charge_behaviour actually change:
  
 <code> <code>
 +# Sometime need to be issued two times to work.
 echo "force-discharge" > /sys/class/power_supply/BAT0/charge_behaviour echo "force-discharge" > /sys/class/power_supply/BAT0/charge_behaviour
 </code> </code>
Line 118: Line 137:
  
 <code> <code>
 +# Does not work!
 echo "inhibit-charge" > /sys/class/power_supply/BAT0/charge_behaviour echo "inhibit-charge" > /sys/class/power_supply/BAT0/charge_behaviour
 </code> </code>
  
 +The default behavior is **auto** where the BIOS should take care of the best setting:
 +
 +<code>
 +echo "auto" > /sys/class/power_supply/BAT0/charge_behaviour
 +</code>
 +
 +According to this **[[https://forums.lenovo.com/t5/Other-Linux-Discussions/ThinkPad-P14s-Gen-4-AMD-charge-behaviour-doesn-t-work/m-p/5287155|post]]**, it seems that there are some incompatibilities between Linux kernel and battery firmware.
  
 ===== Boot on lid opening ===== ===== Boot on lid opening =====
doc/appunti/linux/lenovo_thinkpad_l380.1764489519.txt.gz · Last modified: by niccolo