[coreboot] Powersavings: 8W of difference between bios and coreboot

Charlotte Plusplus pluspluscharlotte at gmail.com
Sat Nov 19 07:57:28 CET 2016


Quick update:

Just having "device pci 01.0 on end" in the devicetree results in the
following powertop measurements:
26W after boot, 21W with power savings applied, 20W at maximum power savings

So just declaring the nvidia makes things much worse, even without really
using the dGPU for anything. (there are no nvidia modules, to make sure it
would not interfere with the measurements)

Since it was in D0, I tried setting the Nvidia gpu in D3 state
setpci -s 01:00.0 CAP_PM+4.b
08
setpci -s 01:00.0 CAP_PM+4.b=0b

It didn't help with the power. To confirm whether disabling the Nvidia pcie
interface results in this +4W in maximal power savings, I completed
src/drivers/lenovo/hybrid_graphics.c with the PCI ID from my card. I could
return to 17W with all power savings applied.

So I'm back to trying to find a way to turn off the power completely with
the EC, and hoping this is where the extra 8W come from.

After some googling I found ec_access, but I don't know which register to
write to.

In case anyone is interested, here are the pci devices, of course ASPM is
already enabled (root: 0xB0 : 0x43, peripheral: 0x88 : 0x4B) and I am not
using the dGPU for anything at all.

$ cat /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/power/runtime_status
suspended
$ cat /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/power/runtime_status
active

$ lspci -s  00:01.0 -xxx

00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core
processor PCI Express Root Port (rev 09
)
00: 86 80 51 01 07 04 10 00 09 00 04 06 10 00 81 00
10: 00 00 00 00 00 00 00 00 00 01 01 00 20 20 00 20
20: 00 f0 00 f1 01 c0 f1 d1 00 00 00 00 00 00 00 00
30: 00 00 00 00 88 00 00 00 00 00 00 00 0b 01 03 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a
80: 01 90 03 c8 08 00 00 00 0d 80 00 00 86 80 00 00
90: 05 a0 01 00 d8 02 e0 fe 00 00 00 00 00 00 00 00
a0: 10 00 42 01 01 80 00 00 00 00 00 00 03 ad 61 02
b0: 43 00 02 51 00 00 04 00 00 00 48 00 08 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 0e 00 00 00
d0: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 01 00 00 00 00 00 01 00 10 00

#    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

$ lspci -d 10de:0dfa -xxx
01:00.0 VGA compatible controller: NVIDIA Corporation GF108GLM [Quadro
1000M] (rev a1)
00: de 10 fa 0d 03 00 10 00 a1 00 00 03 10 00 80 00
10: 00 00 00 f0 0c 00 00 c0 00 00 00 00 0c 00 00 d0
20: 00 00 00 00 01 20 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 f1 60 00 00 00 00 00 00 00 0b 01 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 01 00 00 00 ce d6 23 00 00 00 00 00
60: 01 68 03 00 08 00 00 00 05 78 80 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 10 b4 02 00 a0 8d 00 00
80: 10 28 00 00 02 2d 05 00 4b 01 02 11 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00
a0: 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00
b0: 00 00 00 00 09 00 14 01 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

#    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

# 78 contains 10, on 88 : 4b

$ lspci -d 10de:0bea -xxx

01:00.1 Audio device: NVIDIA Corporation GF108 High Definition Audio
Controller (rev a1)
00: de 10 ea 0b 06 00 18 00 a1 00 03 04 10 00 80 00
10: 00 00 08 f1 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 60 00 00 00 00 00 00 00 0b 02 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 ce d6 23 00 00 00 00 00
60: 01 68 03 00 08 00 00 00 05 78 80 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 10 00 02 00 a0 8d 00 00
80: 10 28 00 00 02 2d 05 00 4b 01 02 11 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 10 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Charlotte


On Fri, Nov 18, 2016 at 4:04 PM, Charlotte Plusplus <
pluspluscharlotte at gmail.com> wrote:

> Hello
>
> Super interesting, I didn't know all that!
>
> Currently, I have only set in devicetree:
>
> device pci 00.0 on end # host bridge
> device pci 01.0 off end # NVidia
> device pci 02.0 on end # Intel
>
> and in my nvram options I have:
> hybrid_graphics_mode = Integrated Only
>
> I assumed that would be sufficient to turn off the power for the dGPU
> until I figure out a way to make it work. I will enable the NVidia and do
> more power tests.
>
> After reading hybrid_graphics.c, I understand a bit more, but I also have
> more questions:
>  - can I add register "pcie_hotplug_map" = "{ 0, 1, 0}" to make the NVidia
> removable?
> (so that the operating system will not freak out when the NVidia
> disappears from the PCI bus if I find a way to control the power by talking
> to the EC and send
> GFXCORE_ON_D + the other signal for the VRAM)
>
>  - can you change the connection of the displayport? Based on the
> specsheets, it is connected to the dGPU, while the internal display is
> connected to the iGPU. If is it possible to control the muxes for the
> internal display, I suppose it is possible for the other displays as well.
> (I have just tested and I do not have any video on the displayport, and
> xrandr does not detect anything)
>
>  - there seem to be some missing IDs in pci_device_ids_nvidia : cf
> http://envytools.readthedocs.io/en/latest/hw/pciid.html which agrees with
> the W530 : 0x0ffb, so I will  propose a patch:
>                 0x0dfa, /* Nvidia NVS Quadro 1000m Lenovo W520 */
>                 0x0ffb, /* Nvidia NVS Quadro K1000m Lenovo W530
> */
>                 0x0ffc, /* Nvidia NVS Quadro K2000m Lenovo W530 */
>
> It may also be the reason why the Nvidia is still getting power, as Iru
> noted that hybrid_graphics should turn off the power. I will test that
> separately.
>
> - until I can find a better solution, I am thinking of letting the Nvidia
> show on on the PCIe bus and then sending commands to get in into advanced
> sleep - like on https://wireless.wiki.kernel.org/en/users/documentation/
> aspm
>
> It should be possible as the w530 lspci -v shows:
>         Capabilities: [60] Power Management version 3
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>
> Would you have a better idea?
>
> Thanks
> Charlotte
>
> On Fri, Nov 18, 2016 at 4:52 AM, Felix Held <felix-coreboot at felixheld.de>
> wrote:
>
>> Hi!
>>
>> I don't know if Charlotte has added the ID of the dGPU to
>>> src/drivers/lenovo/hybrid_graphics.c. Does the dGPU consume power after
>>> hybrid_graphics.c disable the dGPU?
>>>
>> OPTIMUS_ENABLE is a PCH GPIO and controls the muxes that select if the
>> internal display is connected to the iGPU or the dGPU; that's done in
>> hybrid_graphics.c.
>> GFXCORE_ON_D (and another signal that controls the power supply of the
>> VRAM) are driven by the Thinker-1 chip; those switch on/off the power
>> supply of the GPU. So to really disable the GPU you probably have to ask
>> the EC to make that chip turn off the voltage for the GPU and VRAM.
>>
>>
>> Regards
>> Felix
>>
>> --
>> coreboot mailing list: coreboot at coreboot.org
>> https://www.coreboot.org/mailman/listinfo/coreboot
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20161119/17f8ec79/attachment.html>


More information about the coreboot mailing list