Lenovo M700/M900 BIOS mod to Coffee Lake CPUs

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

mkopec

New Member
Oct 8, 2024
15
10
3
Ooh I had no idea. Now the question is if all M700 SKUs don't have NVMe, or its a board revision thing.

If all M700 models don't have NVMe then we can detect and remap clkreqs automatically in coreboot based on board id. Will try to draft up a patch if you confirm that CLKREQ1 is correct
 
Last edited:

wyk72

New Member
Sep 16, 2024
26
5
3
Ooh I had no idea. Now the question is if all M700 SKUs don't have NVMe, or its a board revision thing.

If all M700 models don't have NVMe then we can detect and remap clkreqs automatically in coreboot based on board id. Will try to draft up a patch if you confirm that CLKREQ1 is correct
How can I check if CLKREQ1 is correct ?

In all my compiled coreboot ROMs with CLKREQ1 mods the wifi is not recognized.

Maybe I can check it in a Lenovo/OEM bios-booted machine (with wifi working) ? How ?
 

mkopec

New Member
Oct 8, 2024
15
10
3
I see in your lspci:

```
LnkCap: Port #7, Speed 8GT/s, Width x1, ASPM not supported
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp+
```

Clearly Lenovo UEFI does not enable clock PM. You can try disabling ClkReqSupport altogether, let's start there and see if it starts working.
 

wyk72

New Member
Sep 16, 2024
26
5
3
I see in your lspci:

```
LnkCap: Port #7, Speed 8GT/s, Width x1, ASPM not supported
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp+
```

Clearly Lenovo UEFI does not enable clock PM. You can try disabling ClkReqSupport altogether, let's start there and see if it starts working.

OK, here is the result with this config and original coreboot not touched at all, i.e.:

register "PcieRpClkReqNumber[6]" = "11"


Code:
CONFIG_CCACHE=y
CONFIG_VENDOR_LENOVO=y
CONFIG_CBFS_SIZE=0x600000
# CONFIG_PCIEXP_L1_SUB_STATE is not set
# CONFIG_PCIEXP_CLK_PM is not set
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_LENOVO_THINKCENTRE_M900_TINY=y
CONFIG_POWER_STATE_PREVIOUS_AFTER_FAILURE=y
CONFIG_MAINBOARD_SUPPORTS_COFFEELAKE_CPU=y
CONFIG_HAVE_ME_BIN=y
CONFIG_HAVE_GBE_BIN=y
CONFIG_PAYLOAD_EDK2=y
CONFIG_EDK2_BOOT_MANAGER_ESCAPE=y
Wifi slot NOT working, NOT eumerated.

-------------

Same config but with:

register "PcieRpClkReqNumber[6]" = "1"

(after a "make distclean" to make sure this part is recompiled)


Wifi slot NOT working, NOT eumerated.

------
EDIT:

Exact same machine reflashed with original LENOVO bios (swapped CPU with an i3 6100): wifi working perfectly.
 
Last edited:

mkopec

New Member
Oct 8, 2024
15
10
3
I meant, try deleting these 2 lines:

register "PcieRpClkReqSupport[6]" = "1"
register "PcieRpClkReqNumber[6]" = "11"
 

wyk72

New Member
Sep 16, 2024
26
5
3
I meant, try deleting these 2 lines:

register "PcieRpClkReqSupport[6]" = "1"
register "PcieRpClkReqNumber[6]" = "11"
Done, same result, no wifi, original, untouched coreboot config .

That's what I get in dmesg:


Code:
[  172.210435] pcieport 0000:00:1c.0: AER: Multiple Corrected error message received from 0000:00:1c.0
[  172.210456] pcieport 0000:00:1c.0: PCIe Bus Error: severity=Corrected, type=Physical Layer, (Receiver ID)
[  172.210458] pcieport 0000:00:1c.0:   device [8086:a116] error status/mask=00000001/00000000
[  172.210461] pcieport 0000:00:1c.0:    [ 0] RxErr                  (First)
[  173.736454] pcieport 0000:00:1c.0: pciehp: Slot(6): No link
[  173.736486] pcieport 0000:00:1c.0: pciehp: Slot(6): Card present
Trying disabling ASPM completely in next compile, to see if anything changes i.e. setting:

Code:
# CONFIG_PCIEXP_ASPM is not set
# CONFIG_PCIEXP_L1_SUB_STATE is not set
# CONFIG_PCIEXP_CLK_PM is not set

Flashing just now.... same result: dmesg full of AER errors, slot not working.


BTW, there is a simpler way to flash bios without using a programmer for testing ? It's taxing doing it all the time with a programmer. There is a flashrom version that works ?
 

mkopec

New Member
Oct 8, 2024
15
10
3
Try removing this from the WiFi slot config, some wifi cards are buggy and trip AER:

"PcieRpAdvancedErrorReporting[16]" = "1"

My M700 arrived finally and I'll look into this issue on my end

> BTW, there is a simpler way to flash bios without using a programmer for testing ? It's taxing doing it all the time with a programmer. There is a flashrom version that works ?

Sure, "flashrom -p internal" should just work once you have coreboot installed, it only doesn't work when you're on stock UEFI because it enables a ton of BIOS locks

> The must be something slightly different, since this unit (M700 tiny) does not have a PCIe NVME slot i.e. the slot is SATA-only (tested and working) .

It's because the B150 chipset has fewer PCIe lanes, the boards should be identical otherwise. Blame Intel :)
 
  • Like
Reactions: wyk72

mkopec

New Member
Oct 8, 2024
15
10
3
I confirm the wifi issue. I'm having trouble seeing what's going on here, I think FSP can't enable this port for whatever reason. Will try to debug this week

I don't see your display issue though, so far I can boot into Windows and get display without any issues, using libgfxinit. Tested with a Dell P2414H and Iiyama gb3461wqsu-b1.
 
  • Like
Reactions: wyk72

wyk72

New Member
Sep 16, 2024
26
5
3
I confirm the wifi issue. I'm having trouble seeing what's going on here, I think FSP can't enable this port for whatever reason. Will try to debug this week

I don't see your display issue though, so far I can boot into Windows and get display without any issues, using libgfxinit. Tested with a Dell P2414H and Iiyama gb3461wqsu-b1.
FYI: even the "mods" I see here (i.e. running the m710q bios, which has a different chipset, B250) have the same result: the wifi slot stops working.


I have several windows 10/11 machines that don't initialize the displayport at boot I have to plug in/out the connector to "wake up" the video port.

Strangely, OEM bios does not have this issue.

I have a straight Displayport/displayport cable for a Fujitsu B24W-7 monitor.
 
Last edited:

Th0mas51

New Member
Apr 4, 2024
12
6
3
Thanks guys for this very interesting thread.

I will try to replace some of the CPUs of the Lenovo Tiny computers used in my Proxmox cluster with some Xeon ones that have at least 6 cores (12 theads).

I have already ordered the Bios flashing kit from Aliexpress so I can start with updating the bios even if I don't have the new CPUs just yet.

It's not clear for me which Xeon CPUs are compatible, and which ones require to upgrade the cooler, but I will read through all the 14 pages of this thread to try to understand more precisely

My Lenovo Tiny computers are the following:
- 6x Lenovo Tiny m910q (i5-6500T, 2 cores, 4 threads)
- 1x Lenovo Tiny m900 (i7-6700T, 4 cores, 8 threads)
- 1x Lenovo Tiny m700 (i5-6500T, 2 cores, 4 threads)

I will try to contribue back to the thread once I have understood everything a bit more precisely :)
 

wyk72

New Member
Sep 16, 2024
26
5
3
I have already ordered the Bios flashing kit from Aliexpress so I can start with updating the bios even if I don't have the new CPUs just yet.

It's not clear for me which Xeon CPUs are compatible, and which ones require to upgrade the cooler, but I will read through all the 14 pages of this thread to try to understand more precisely

My Lenovo Tiny computers are the following:
- 6x Lenovo Tiny m910q (i5-6500T, 2 cores, 4 threads)
- 1x Lenovo Tiny m900 (i7-6700T, 4 cores, 8 threads)
- 1x Lenovo Tiny m700 (i5-6500T, 2 cores, 4 threads)

I will try to contribue back to the thread once I have understood everything a bit more precisely :)
If you can share the modded BIOS for the M700 I'll be happy: I doubt the seller can hack it but never say never I guess.

The Coreboot image for M700 I built (made by mkopec) works perfectly under Linux and has been tested with Skylake/KabyLake/Coffelake cpus, until "9" gen (cofeelake refresh). Any Xeon/i3/i5/i7 "mutant" of gen 6/7/8/9 should work OOB.

The only issue is the wifi/pcie slot not working on M700, but mkopec is generously working in it.

M910q is no problem usually, because you can just run the hack/utility "coffeetime" over a BIOS image and patch it with PCU microcodes.

The only "issue" is that you'll have to use a hardware flash/SPI programmer to read/patch/reflash the BIOS, not a big deal.

As for heat issues: the M910q can run 65W cpus, so a six or even eight core mobile Xeon (usually they sell engeneering samples on aliexpress...) is no problem, they have a 45W TDP.

A word of advice: AVOID the "sync cores" hack if you use Coffeetime in a M910q bios. It makes the cpu cores run all at the same frequency, it will OVERHEAT. Just insert microcodes and do not touch anything else.

The M700 I own can be safley run with a Kaby Lake 7100/Skylake 6100 cpu (non-T) that has a 51W TDP, a 45W mobile Xeon/i5/i7 should be no problem.

The power draw I measured with those dual core cpus (7100/6100 non-T) is 33W MAX.

A 6600T (rated for 35W) I tested can peak to 44W for a few seconds, but it generally sits around 20/30W.

Windows is pretty poor in power consumption, since it runs like A TON of background processes, defender is a hog, windows update too.

For some reason (better code I guess) Coreboot BIOS is FAR better then Lenovo OEM BIOS in heat/power management.

If you use any Linux distro, Coreboot is far superior, imo.
 

mkopec

New Member
Oct 8, 2024
15
10
3
Alright I got the wifi working, turns out the "PcieRpClkReqSupport" parameter doesn't do anything, the FSP just looks at the gpio configuration. I had the CLKREQ pads configured in native function mode, thus they were enabled.

Changed these pads to match M700 bios exactly and now the wifi card is working. As a side effect, we can now enable ASPM, clock PM and L1 and it doesn't cause issues anymore. Patch: https://review.coreboot.org/c/coreboot/+/84813
 
Last edited:
  • Like
Reactions: Stephan and wyk72

mkopec

New Member
Oct 8, 2024
15
10
3
> For some reason (better code I guess) Coreboot BIOS is FAR better then Lenovo OEM BIOS in heat/power management.

Hmm, the m700 / m900 platform is only capable of dissipating ~35W, right? I guess I can add a TDP override to 35W to make sure it's not exceeded if you install a cpu with a higher tdp

M900x has 65W CPUs and a beefier cooler so you could probably get one of them and go wild with coffee lake :)
 
Last edited:
  • Like
Reactions: wyk72

wyk72

New Member
Sep 16, 2024
26
5
3
Alright I got the wifi working, turns out the "PcieRpClkReqSupport" parameter doesn't do anything, the FSP just looks at the gpio configuration. I had the CLKREQ pads configured in native function mode, thus they were enabled.

Changed these pads to match M700 bios exactly and now the wifi card is working. As a side effect, we can now enable ASPM, clock PM and L1 and it doesn't cause issues anymore. Patch: https://review.coreboot.org/c/coreboot/+/84813
That's great news. Patched source and compiling just now.....done. Flashing W flashrom........done.

I can confirm the PCIe slot/wifi is working: tested with an (ancient) Atheros wifi card:

Code:
01:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01)
But in dmesg I get AER (timeout) errors:

Code:
[  332.842160] pcieport 0000:00:1c.0: AER: Corrected error message received from 0000:01:00.0
[  332.842184] ath9k 0000:01:00.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID)
[  332.842192] ath9k 0000:01:00.0:   device [168c:0036] error status/mask=00001000/00002000
[  332.842201] ath9k 0000:01:00.0:    [12] Timeout
In my sysadmin carreer, I encountered these kind of errors before especially on HP servers: our OEM told us simply to ignore them, or disable AER in linux kernel command line (by adding pci=noaer ).

I have to report that it does not happen with Lenovo OEM bios: AER seems to report no errors (don't even know if it's enabled).

EDIT: I compiled coreboot with ASPM L1 enabled. I'll try to recompile it with ASPM OFF first.
EDIT2: even with ASPM L1 disabled in coreboot, AER timeout report persists and spams into dmesg. Card works regularly even with those messages.

EDIT3: It was the wifi card. With an Intel wifi card problem DOES NOT HAPPEN and all is 100% working.


Anyways: thanks a lot for a job well done!
 
Last edited:

mkopec

New Member
Oct 8, 2024
15
10
3
> In my sysadmin carreer, I encountered these kind of errors before especially on HP servers: our OEM told us simply to ignore them, or disable AER in linux kernel command line (by adding pci=noaer ).

I think I saw something like this with Atheros cards at work too, usually we just disable AER if the vendor requires support for these cards. In this case it looks like it's exposing a valid bug in the card :\
 
  • Like
Reactions: wyk72

wyk72

New Member
Sep 16, 2024
26
5
3
I am doing some more testing/tweaking and the image works really well.

Even the video issues are gone: the machine initializes video correctly now.

It had problems in suspend (no video after suspend) too: now the behaviour is correct.

Can't be happier.

A cute thing to have would be the blinking led in suspend mode as per original oem bios: in suspend mode it just stays ON.

It's possible, mkopec ?
 

wyk72

New Member
Sep 16, 2024
26
5
3
I have to report that with coreboot video issues are still present i.e. the second DP port is NOT working at all.

My M700 units have 3 ports:

1 DP (center, between 2 USB ports)
2 VGA (near LAN port)
3 DP (near power socket)

If I connect 1 DP port: OK
If i connect 2 VGA port: OK

BOTH port 1 DP and 2 VGA: OK (always)

Secondary port (3 DP) alone: NOT WORKING, see splash logo of coreboot but when OS loads it disappears and does not come up

BOTH Displayports (DP1 and DP3) connected: splash logo ok, when OS loads (windows or Linux) then both ports get fuzzy/striped horizontal lines/go crazy (very strange)


Secondary DisplayPort (near power socket) is never recognized in windows nor linux.

This on a Kaby Lake GPU (i3 7100).


On OEM bios the behaviour is normal (all 3 ports work) (with Skylake GPU).


EDIT:

I managed to make the secondary port work by extracting the VBT data from original M700 BIOS, and using it in my compiles (it's a different version):



This is the version in coreboot data.vbt:

BIOS_DATA_BLOCK Ë��—þê��d1001Intel(R) SKL Mobile/Desktop PCI Accelerated SVGA BIOS
Build Number: 1000 PC 14.34 1/21/2015 10:16:59


This is the one into the M700 OEM BIOS:

BIOS_DATA_BLOCK È��Êþê��d1037Intel(R) SKL/KBL Mobile/Desktop PCI Accelerated SVGA BIOS
Build Number: 1037 PC 14.34 12/23/2015 19:33:49
 
Last edited:

mkopec

New Member
Oct 8, 2024
15
10
3
Ooh I probably extracted the VBT from an earlier BIOS revision, we probably need to update it for kabylake. The one from M700 OEM BIOS, is that from the latest bios version available? If so, I'll look there

A cute thing to have would be the blinking led in suspend mode as per original oem bios: in suspend mode it just stays ON.

It's possible, mkopec ?
Probably, I admit I haven't even tested sleep on OEM firmware so I didn't know it's a thing :) I'll take a look at how it's implemented

EDIT: It's a regular GPIO in blink mode, should be easy to make it blink once per second
 
Last edited:

wyk72

New Member
Sep 16, 2024
26
5
3
Ooh I probably extracted the VBT from an earlier BIOS revision, we probably need to update it for kabylake. The one from M700 OEM BIOS, is that from the latest bios version available? If so, I'll look there
Yes, I extracted it directly from a BIOS dump of a M700/tiny machine freshly updated with the latest FW from LENOVO.