Changing the way Embedded Controller limits CPU power

I have discovered some year and half ago, that CPU power limit can´t be (to much frustration on my side) adjusted with ThrottleStop unlike on similar laptops from Dell, HP etc.

PL1 limit will kick in in about 30 seconds, limiting 11gen intels to 28W and 12gen intels to 30W (28W by default, but removing Intel´s limits in Throttlestop bring that to 30W).

That´s a shame, because the stock cooling solution can handle about 35W on 11gen and about 50W on 12gen (probably due to higher surface area)

Thanks to FW open sourcing their EC firmware (here: GitHub - FrameworkComputer/EmbeddedController: Embedded Controller firmware for the Framework Laptop ), I managed to find a few lines of code that caught my interest (in file: EmbeddedController-hx20-hx30\board\hx30\cpu_power.c

#define POWER_LIMIT_1_W 30

static int old_pl2_watt = -1;
static int old_pl4_watt = -1;
static int old_psys_watt = -1;

if (pl2_watt != old_pl2_watt || pl4_watt != old_pl4_watt ||
		psys_watt != old_psys_watt || force_update) {
	old_psys_watt = psys_watt;
	old_pl4_watt = pl4_watt;
	old_pl2_watt = pl2_watt;

	pl1_watt = POWER_LIMIT_1_W;

As far as I understand, this “if” condition will always trigger at least once, setting the PL1 to 30W (11gen board contains similar code, but PL1 will be set to 28W).
That would explain why Throttlestop can bring it to 30w but no matter what number do I set above 30W, the PL1 in practice still is 30W.

Throttlestop overrides the Intel CPU´s PL1 limit (but not the timer) and EC overrides Throttlestop´s limit, at least it seems.

What I´d love to do is to change the POWER_LIMIT_1_W value to a higher number (let´s say 64W) and flash the EC, but I would like if someone who already flashed their EC somehow reviewed this.

What I don´t understand:

  1. Why did FW even do this? I know it isn´t, but it really looks like a middle finger to tinkerers because Intel´s power limits are in place by default and these EC power limits seem only to kick in when one is trying to adjust Intel´s limits by using Throttlestop or XTU.

What I don´t fear:

  1. Burning the CPU - the CPU still throttles at 100 degrees celsius and also I can easily set a PL1 limit lower than the 64W in Throttlestop to prevent CPU being at 100 degrees celsius under constant, long time load.
  2. That my adapter won´t handle the load - I am using 100W power adapter.

What I do fear:

  1. That it won´t work - I will build and flash the EC firmware only for it to be overwritten at the next boot.
  2. That I won´t build the EC firmware correctly and somehow brick my board - the EC code on github is vast, seems to be made for many devices and I have little skill in this.

In the first two points, I would love to get advice from someone who managed to flash EC.

  1. That I will burn VRM or some other part of CPU power delivery as they may not have been made for increasing the delivered power by 100%.

Why do I want all this?
To get better performance. It seems that every Pcore at 4.7 GHz can consume about 22-24W of power, at all-core boost it´s around 18-20W and every Ecore can consume about 4-6W of power. That equals to roughly 120 watts, so the CPU is throttled down to 25% of its potential in terms of power.

In terms of performance, it seems to be capable of boosting Pcores to 3.8 GHz under all core load and Ecores likely to 3.4 GHz - this scenario should take some 80-90W.
When presented with 55W limit (what the heatsink can cool as of now, Pcores boost to 3.4-3.5 GHz and Ecores to 3 GHz
Under 30W limit, Pcores maintain about 2.5 GHz and Ecores 2.6 GHz.

There are plentiful custom projects that have potential for improved cooling. Imagine someone uses liquid metal. Imagine that someone who is using their old FW board as a desktop with eGPU can easily DIY some extra heatsink to provide extra watts of cooling, experiment with water cooling and with power limiters removed, get 40-50% performance boost?

1 Like

If you read the surrounding code, you see that the quoted code is just to check for changes in the power levels. So that the CPU is only notified when values actually changed. And that there is a “force_update” flag to update anyway, which is used on boot etc.

You can also see, that the code changes power limits based on how much power the system has available from power supply and battery. Such that the system will not brown out, when trying to use more power than an PD power supply can deliver. Or that the battery can deliver when running exclusively on battery.

The answer to that would be, because they are of the opinion it is needed either for simple stability or for the longterm stability. How close to practical limits those numbers are or if those numbers are also influenced by requirements from Intel we do not now. But reducing those numbers down to stay within the power that is actually available to the hardware seems very reasonable and necessary.

But you can also see, that the code defines a console command that can override ALL power levels, including PL1.
So a first step could be to get access to the console (over the EC uart for example, no need to flash the firmware) where you can observe how those values change and even manually override them and turn off any automatic changes by the logic you quoted. This way, if you wanted to play around with the power limits you can do this in sort of a trial run. If that shows fruitful and you decide that you want to risk leaving manufacturer ranges, you can still try to build firmware to permanently change this.