With the Librem 14 laptop we went a couple of new ways all at once. First of all this is the most custom laptop design we have done so far. It embodies everything we wanted to have – at the time of writing the specification. But not only that, with the Librem 14 we also started to use a liberated embedded controller (EC) firmware, besides Coreboot / PureBoot of course.The EC is a pretty primitive microcontroller that evolved from the old PC keyboard controllers. Basically it is a tiny CPU running a tiny program that does a very limited set of tasks, controlling the keyboard is still one of them. The EC also controls the power up and power down of the laptop, sequencing the different voltages, making sure that all supply voltages are OK and turned on and off at the right time etc. Additionally the EC controls functions like battery charging and maintains active communication with the main Intel CPU, to feed keyboard events into it but also to poke out information like the current temperature of the Intel package so that the EC can spin up the fans when necessary.

All that may sound pretty straight forward but the devil is in the details, as always. One of such details is managing the power budget. It is common practice in PC / electronics design that the total maximum power budget can exceed the power source. This isn’t a problem as long as the total maximum is never actually reached. The total maximum is the sum of all maxima of all components and it is very unlikely that all components are using this at the same time. But nevertheless you need to take precautions that it actually can not happen or if it happens, that you have a plan-B.

Also in the Librem 14 the total power budget can exceed for example the 65W / 90W charger power input. The Intel package alone can peak (very short term) up to 65W, then take the LCD at full brightness of up to 10W, the USB3 ports with each up to 5W (and we have four of them!), the DDR4 RAM with a couple of Watts (depends on how much RAM) and at least one SSD and you can see that the 65W / 90W power supply can be exceeded quite quickly. And if you want to charge your battery too, this can demand another up to 20W from the charger.

Exceeding the DC input power supply does not lead to failure. The internal regulators are designed to withstand this power draw and if more power is used than the charger can supply some is taken from the battery to support further operation, which of course only works if the battery still has charge.

The Learning Curve

The EC though has only very limited means to actually figure out the current power usage. The EC does not see the LCD backlight level nor can it query its actual power draw. The EC also can not figure out which USB ports are used and how much power is drawn there. It even can not figure out the Intel package power draw. The only thing the EC can see is the state of charge (SOC) of the battery and the current flowing in and out of the battery. And of course it knows if an external power source is connected or not.

So to avoid possible issues in the beginning we set everything to pretty conservative values. What the EC can control to some extent is the input current taken from the charger and the current going into the battery. The EC can also set, through PECI, so called ‘PL’ power levels in the Intel package. To manage power consumption the Intel CPU offers three usable but not super well documented power levels, PL1, PL2 and PL4. PL1 and PL2 are maximum average power consumption targets for a short period of time and longer period of time (usually 28 seconds). So a CPU can peak way above these, only if the average over a time period exceeds a certain threshold then the power is capped, e.g. by disabling turbo modes etc. So PL1/2 can e.g. help to reduce heat since heat builds up over time. These settings usually correspond to the Thermal Design Power (TDP), PL1 gets set to the specified TDP, in our case 15W for the Core i7 10710U, and PL2, the short term goal, can be set to something higher, Intel recommend TDP * 1.25, so roughly 19W. But these values depend on the thermal solution, i.e. the design of the heat sink, fans, air throughput etc. We have a pretty decent heat pipe system and two fans in the Librem 14 so we can handle quite some thermal energy.

Then there is also PL4. PL4 is an active and immediate limit, not an average. The package should never exceed this limit – of course eventually limiting performance if you do a lot of things in the Intel package, which again of course includes not only the main host CPU but also the GPU and the Platform Control Hub (PCH) (what used to be North- and Southbridge).

So in the previous Coreboot and EC firmware versions we set these power levels to pretty conservative values in order to protect the system – and also because we lacked good ways to more dynamically change these during runtime. Now over time and more experience we refined these things to give you better performance!

New EC Behavior

Starting with release 1.9 of the EC firmware we made a couple of changes:

  • the default for PL4 is set to 65W when charger is connected, 45W without charger
  • we have introduced a new PL4 value of 20W that will get activated when running from battery and the battery charge level drops below 40%
  • we have introduced more fan levels and made them a bit more conservative so this will reduce fan noise – it kicks in a little earlier but stays on lower speed for longer
  • we do not preemptively shut down hard on low battery states – in the previous version we honored the “stop discharge” alarm of the battery a bit too rigorously by shutting down the laptop. This was a bit harsh and caused premature and disruptive power offs. Instead now the power LED will turn orange signaling that a recharge is urgently required.
  • a timing issue with the PL setting that could cause fans spinning at 100% after a resume from RAM was resolved
  • some bugs that caused super slow charging of the battery in certain circumstance were resolved

So these changes will allow much better use of the Librem 14.

Update Recommended

We recommend to upgrade to this new EC version. The EC is an integral part of the hardware system and so upgrading this is a much more delicate procedure than upgrading parts of the operating system. If something fails during the process your device may become unusable (but recoverable).

We made the upgrade process as easy as possible. The most convenient method is to use the EC firmware upgrade bootable ISO. Just write the ISO to a (blank) USB stick like you would write a bootable live or install ISO image, then reboot your Librem 14 using this stick, follow the on-screen instructions and watch the upgrade process.

Once the firmware has been upgraded the EC will hard shutdown your Librem 14, i.e. it will just power off. This can cause some negative side effects when doing this from a running PureOS so best is to use this upgrade ISO and booting into its live system.

Another step by step approach is using a regular live system ans is well documented on this page:
https://puri.sm/projects/librem-ec/

You can basically do the same steps with your installed PureOS but I would recommend booting into a “Recovery System” – after powering on, on the Grub screen choose “Advanced Options” and then the “Recovery” option. This will boot into a recovery shell which has all your normal commands but most of the system is not started.

For development or recovery purposes, the EC chip can be directly flashed with a CH341A spi chip programmer.

And of course all EC firmware sourcecode is free and public here:
https://source.puri.sm/firmware/librem-ec

You Are In Control

For me one major motivation to dive into the EC development was to get more control over my laptop. In this regard I am a total control freak. With the Librem-EC users can control when battery charging is supposed to happen, the behavior of the notification LED and RF-kill LED (next to the WiFi/BT kill switch) as well as fine grain control of the keyboard backlight. All that can be done via Linux SysFS (/sys). But this is a bit cumbersome – and even I have to admit, though I am a total commandline junkie, that this is not really convenient. So I have started a small GTK+/GNOME tool that gives you a GUI for controlling your Librem 14, Librem-Control. From the project’s CI/CD pipeline you can download ready made installable packages that will also soon show up in PureOS.

Librem-Control right now offers four tabs with some controls, easy and convenient to use:

The first will help you to get control over the battery charging process. Here you can easily set the thresholds for when the battery shall start to charge again and when to stop charging. The less charge cycles the better for the battery. Also charging to full 100% should be avoided to reduce battery wear, better to only charge to 90% or even a bit less. I have set mine, as you can see in the screenshot, to start below 20% and to only charge to 90%. There are also two buttons to start and stop charging immediately – very handy if you know that you will need a bit more shortly, like before leaving for a train ride or such.

The second tab allows you to tweak the before mentioned PL1 and PL2 power levels of the Intel package. If you know what you are doing you can increase the short and long term power levels to get more performance at the cost of more heat, noise and eventually draining the battery even when connected to a charger. If you crank this up please be really careful, especially make sure that the vents on the bottom of the Librem 14 are not blocked. Cranking these up can speed up some things quite significantly but I would not advise to increase these levels by default. The other use case is of course to reduce these levels to save power. Assuming this train ride again you will probably not want to to compile a Linux kernel but rather want to run on battery for as long as possible. I have tried this at 5/10W which works really well for simple browsing, small development tasks, working through your emails etc. The average temperature really drops and battery runtime is significantly improved.The third tab gives you some control over some of the built in LEDs. First there is the keyboard backlight level which you can then set to any value, not just the pre defined levels using Fn-F4 / Fn-space. Next is the behavior of the WiFi/BT LED, the LED next to the WiFi/BT kill switch. You can select it to either signal the rfkill state or to signal WiFi receive or transmit by blinking. I find this to be very handy since I can get visual feedback of traffic on the WiFi and get an idea about what is going on – and if something has gone rogue. Last is the notification LED, which is a full color RGB LED. At some point we will use this for notifications from the GNOME shell in a similar way to what is done in the Librem5. But until this is fully there you can just play with the colors. I am planning on adding LED triggers too, like heartbeat for the red LED…

Last tab is the Info tab which gives you some information about the installed firmware versions of Coreboot and the EC itself. This can be handy to figure out if you have the latest versions installed.

I hope you enjoy your Librem 14 as much as I do!

Purism Products and Availability Chart

 ModelStatusLead Time 
Most Secure PC Purism Librem Mini
Librem MiniIn Stock10 days
Most Secure Server Purism Librem ServersLibrem ServersIn Stock10 days
USB Security Token Purism Librem KeyLibrem KeyIn Stock10 days
Most Secure Laptop Purism Librem 14Librem 14In Stock10 days
Made in USA Phone Purism Librem 5 USALibrem 5 USAIn Stock10 days
Librem 5Currently shipping backlogs52 weeks
The current product and shipping chart of Purism Librem products, updated on August 4, 2022

Recent Posts

Related Content

Tags