Skip to content
mfp19 edited this page Aug 18, 2015 · 58 revisions

(based on: http://www.coreboot.org/Board:lenovo/x201 )

Table of Contents

Status

I quickly checked the raminit and GPIOs part, and everything looks ... fine. There's the chance that the actual x201 code, renamed into t410 and modified to cope with Kconfig, will boot a T410 with minor quirks only. I didn't test it because the luck of a viable recovery procedure in the case of bad luck.

Issues

  • Nothing works yet :)

Done

  • copy coreboot/src/mainboard/lenovo/x201 to coreboot/src/mainboard/lenovo/t410
  • replace all occurences of x201 with t410 in coreboot/src/mainboard/lenovo/t410

To do

  • adapt X201's devicetree.cb to T410 (ramint, lspci -nnvvxxx )
  • adapt X201's romstage.c to T410 (gpios, coreboot/util/inteltool )
  • acpi ...
  • something else?

To test

  • RAM module combinations of 4G+4G, 4G, 2G+2G,4G+2G, 2G
  • suspend to RAM (S3)
  • Video
  • Sound
  • mini-PCIe slots (both wlan and wwan)
  • Expresscard slot (including hotplug)
  • USB
  • LAN
  • eSata
  • VGA
  • rs232
  • Firewire
  • SD card slot
  • Thermal management
  • Webcam
  • Bluetooth
  • Modem
  • Linux (through GRUB-as-payload & SeaBIOS-as-payload)
  • Windows (through GRUB-as-payload loading SeaBIOS image from disk; you have to use extracted VGA blob, dumped from memory isn't good enough)

Tested

  • nothing.

Can't test

My T410 don't have those features:

  • nVidia gpu.
  • Digitizer.
  • Fingerprint reader.
  • Smartcard reader.

Lenovo ThinkPad T410

The Lenovo ThinkPad T410 is exactly the same platform of the X201 (Core iX Westmere + Intel QM57). The X201 is the 'air version of the T410'; Lenovo used low power CPUs ( Core iX *LM instead of Core iX *M) and removed the Ricoh SD reader, to make it lighter, thinner, smaller, cooler ... more fancy.

For this reasons the X201 code already in the coreboot repo needs minor changes only.

X201 and T410

X201 lspci -nn

  1 00:00.0 Host bridge [0600]: Intel Corporation Core Processor DRAM Controller [8086:0044] (rev 02)
  2 00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02)
  3 00:16.0 Communication controller [0780]: Intel Corporation 5 Series/3400 Series Chipset HECI Controller [8086:3b64] (rev 06)
  4 00:16.3 Serial controller [0700]: Intel Corporation 5 Series/3400 Series Chipset KT Controller [8086:3b67] (rev 06)
  5 00:19.0 Ethernet controller [0200]: Intel Corporation 82577LM Gigabit Network Connection [8086:10ea] (rev 06)
  6 00:1a.0 USB controller [0c03]: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller [8086:3b3c] (rev 06)
  7 00:1b.0 Audio device [0403]: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio [8086:3b56] (rev 06)
  8 00:1c.0 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 [8086:3b42] (rev 06)
  9 00:1c.3 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 [8086:3b48] (rev 06)
 10 00:1c.4 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 [8086:3b4a] (rev 06)
 11 00:1d.0 USB controller [0c03]: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller [8086:3b34] (rev 06)
 12 00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev a6)
 13 00:1f.0 ISA bridge [0601]: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller [8086:3b07] (rev 06)
 14 00:1f.2 SATA controller [0106]: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller [8086:3b2f] (rev 06)
 15 00:1f.3 SMBus [0c05]: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller [8086:3b30] (rev 06)
 16 00:1f.6 Signal processing controller [1180]: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem [8086:3b32] (rev 06)
 17 02:00.0 Network controller [0280]: Intel Corporation Centrino Ultimate-N 6300 [8086:4238] (rev 35)
 18 ff:00.0 Host bridge [0600]: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers [8086:2c62] (rev 02)
 19 ff:00.1 Host bridge [0600]: Intel Corporation Core Processor QuickPath Architecture System Address Decoder [8086:2d01] (rev 02)
 20 ff:02.0 Host bridge [0600]: Intel Corporation Core Processor QPI Link 0 [8086:2d10] (rev 02)
 21 ff:02.1 Host bridge [0600]: Intel Corporation Core Processor QPI Physical 0 [8086:2d11] (rev 02)
 22 ff:02.2 Host bridge [0600]: Intel Corporation Core Processor Reserved [8086:2d12] (rev 02)
 23 ff:02.3 Host bridge [0600]: Intel Corporation Core Processor Reserved [8086:2d13] (rev 02)

T410 lspci -nn

  1 00:00.0 Host bridge [0600]: Intel Corporation Core Processor DRAM Controller [8086:0044] (rev 02)
  2 00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02)
  3 00:16.0 Communication controller [0780]: Intel Corporation 5 Series/3400 Series Chipset HECI Controller [8086:3b64] (rev 06)
  4 00:19.0 Ethernet controller [0200]: Intel Corporation 82577LM Gigabit Network Connection [8086:10ea] (rev 06)
  5 00:1a.0 USB controller [0c03]: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller [8086:3b3c] (rev 06)
  6 00:1b.0 Audio device [0403]: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio [8086:3b56] (rev 06)
  7 00:1c.0 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 [8086:3b42] (rev 06)
  8 00:1c.1 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 [8086:3b44] (rev 06)
  9 00:1c.3 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 [8086:3b48] (rev 06)
 10 00:1c.4 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 [8086:3b4a] (rev 06)
 11 00:1d.0 USB controller [0c03]: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller [8086:3b34] (rev 06)
 12 00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev a6)
 13 00:1f.0 ISA bridge [0601]: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller [8086:3b07] (rev 06)
 14 00:1f.2 SATA controller [0106]: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller [8086:3b2f] (rev 06)
 15 00:1f.3 SMBus [0c05]: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller [8086:3b30] (rev 06)
 16 00:1f.6 Signal processing controller [1180]: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem [8086:3b32] (rev 06)
 17 03:00.0 Network controller [0280]: Intel Corporation Centrino Ultimate-N 6300 [8086:4238] (rev 35)
 18 0d:00.0 SD Host controller [0805]: Ricoh Co Ltd MMC/SD Host Controller [1180:e822] (rev 01)
 19 0d:00.1 System peripheral [0880]: Ricoh Co Ltd R5U2xx (R5U230 / R5U231 / R5U241) [Memory Stick Host Controller] [1180:e230] (rev 01)
 20 0d:00.3 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 PCIe IEEE 1394 Controller [1180:e832] (rev 01)
 21 ff:00.0 Host bridge [0600]: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers [8086:2c62] (rev 02)
 22 ff:00.1 Host bridge [0600]: Intel Corporation Core Processor QuickPath Architecture System Address Decoder [8086:2d01] (rev 02)
 23 ff:02.0 Host bridge [0600]: Intel Corporation Core Processor QPI Link 0 [8086:2d10] (rev 02)
 24 ff:02.1 Host bridge [0600]: Intel Corporation Core Processor QPI Physical 0 [8086:2d11] (rev 02)
 25 ff:02.2 Host bridge [0600]: Intel Corporation Core Processor Reserved [8086:2d12] (rev 02)
 26 ff:02.3 Host bridge [0600]: Intel Corporation Core Processor Reserved [8086:2d13] (rev 02)

diff

 > 00:16.3 Serial controller [0700]: Intel Corporation 5 Series/3400 Series Chipset KT Controller 
 < 00:1c.1 PCI bridge [0604]: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 
 < 03:00.0 Network controller [0280]: Intel Corporation Centrino Ultimate-N 6300 [8086:4238] (rev 35)
 < 0d:00.0 SD Host controller [0805]: Ricoh Co Ltd MMC/SD Host Controller [1180:e822] (rev 01)
 < 0d:00.1 System peripheral [0880]: Ricoh Co Ltd R5U2xx (R5U230 / R5U231 / R5U241) [Memory Stick Host Controller] [1180:e230] (rev 01)
 < 0d:00.3 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 PCIe IEEE 1394 Controller [1180:e832] (rev 01)
 > 02:00.0 Network controller [0280]: Intel Corporation Centrino Ultimate-N 6300 [8086:4238] (rev 35)

Other differences can be seen on the USB bus.

SPI chip & Programming methods

To program the flash chip there are 3+ ways: external, internal, martian. The first one is the only known to succeed.

It looks like inside the machine there's a special version of the LPC protocol, called FWH (Firmware Hub) and made by Intel starting from their ICH8 to support movement of firmware from LPC to SPI, that leads to this:

 === Master Section ===
 FLMSTR1  0x0a0b0000
 FLMSTR2  0x0c0d0000
 FLMSTR3  0x08080118
 --- Details ---
       Descr. BIOS ME GbE Platf.
 BIOS    r     rw      rw
 ME      r         rw  rw
 GbE                   rw

As you can see a running system (BIOS row, ME column) can't read/write the ME region; making impossible for any software running on the machine, to access it. In theory. In practice:

  • use an external SPI programmer.
  • there are always backdoors from NSA and good fellows finding and sharing new exploits in Intel Shitem Tools; one day we could be able to recover 3-4Mb of that wasted flash precious space, to implement our own toys on our own computers.
What happens thank to those Security Features is that the B.O.F.H. (tip: Bastard Operator From Hell; a remote AMT operator) can remotely update the ME (that have access to the whole system memory), but you, in front of your keyboard and your monitor, of your computer, can't. Thanks Intel, much appreciated. Much. Much. Cough... much.

External

There are plenty external programmers to buy or implement yourself with Cheap Charlie electronics; the one described here is just a beautified cut&paste from the x201 page on the coreboot wiki.

Depending on the flasher you use, you may have to use separate 3.3V source. Make sure not to feed more than 3.3V ot the chip. I used buspirate as flasher and 3.3V power lines from another computer. I recommend using SOIC-8 clip (Example: POMONA 5250). The pinout is as follows, the colors are buspirate colors

  ===  front (display) ====
  3.3V (red)   N/C          violet (CLK)  MOSI (gray)
       |        |             |              |
  dot  |        |             |              |
  CS (white)   MISO (black) N/C           ground (brown)
  ===  back (touchpad) ===

Proceed as follows:

  • Turn off your laptop, remove battery and AC adapter.
  • Remove the keyboard.
  • Connect your external SPI flasher to the SPI chip which is under keyboard, around the position of trackpoint under protective layer.
  • Burn ...
The cable shipped with buspirate was too long, and needed to be trimmed. If you have trouble reading the chip successfully, the most common problems are
  • insufficient power supply
  • bad contacts
  • too long wires
  • bad pinout
See also In-System Programming

Internal

It's known that the locking mechanism is in bootblock itself and that original firmware has a way to update it. For this reason a way to unlock the bootblock would be:

  • Modify a firmware update to have a copy of bootblock without protection bit set on the other regions.
  • Flash the special update of rewritable region.
  • Reboot.
  • The bootblock parses the image and sees that it contains a compressed copy of new bootblock. That copy is uncompressed and flashed as a new bootblock.
For this method to work you need to compress the modified block to fit into original space. The compression used is Lempel-Ziv-Huffman variant. There is a compressor for the modified block but unfortunately it's not performant enough. So, this method has never been reported to be successfully used.

Martian

Using Windows and one of those:

  • Intel System Tools. (specific for your Intel AMT/ME, T410 has version 6.0 for IbexPeak)
  • phlash and winphlash.
In theory using Intel System Tools (or phlash/winphlash) you can dump the entire flash, reconfigure the rom and reflash the chip. Last Lenovo bios update for T410 packs phlash (32 and 64 bit).

In the case of brick you can use Crisis or WinCrisis to recover a bad flash that gave you a brick. Theoretically. Martianly.

In practice on T410 I haven't been able to trigger the automatic bios reflash using a USB memory and the Fn+R (or Fn+B or Win+R or Win+B) at boot. The whole procedure it is supposed to be: disconnect battery, disconnect AC, insert USB memory, keep Fn+R, reconnect AC, push Poweron button, release Fn+R+Poweron, check USB memory LED blinking, wait 10+ minutes, reboot. The Fn-R trick could be the way IBM wired the SMM execution mode to the keyboard in the old ICH models, but it doesn't work any more on PCH models.

So, without having a viable software recovery procedure (nor an external flasher), I didn't investigate further the Martian option. Curious fact: every time I investigated this option installing crappy tools found around the net, a bad strip appeared on my display. The first one was blue, the second was red ... and I don't want 50 stars appearing during the next 50 attempts, covering my porno in the intimate moments between me and my laptop!

Flash Layout

The flash chip in T410 is divided roughly in 4 regions:

  • Descriptor (12K)
  • ME firmware (5M-12K)
  • Rewriteable flash (3M-96K)
  • Locked bootblock (96K)
Descriptor and bootblock are read-only. ME firmware is not readable. Rewriteable region can be rewritten easily with flashrom. But flashrom refuses to read partially locked regions (because of the locked bootblock nested in the bios region); so it will always report a read failure unless you modify it to allow the read of "3M-96K" (see flashrom's ME page for patches).

We need to make the file rom.layout to allow flashrom to preserve descriptor and ME firmware while overwriting rewriteable region and bootblock.

For your courtesy there is a T410 whitelisted version of flashrom in my github fork. Otherwhise you will have to add

 -pinternal:laptop=force_I_want_a_brick 

to flashrom command lines.

Identify the chip

Flashrom can identify the chip for you, example:

 Found Macronix flash chip "MX25L6405" (8192 kB, SPI) at physical address 0xff800000.

But as in this case, flashrom might misidentify the chip, this output is from MX25L6445E.

If flashrom fail, you must visually identify your chip's part number and find an appropriate datasheet then add the chip name to the command line, example:

 -c "MX25L6436E/MX25L6445E/MX25L6465E/MX25L6473E"

The Intel System Tools flashing utility (fptw.exe) reported that my T410 have a MX25L6405D.

Identify the regions

Read the flash.

 flashrom -VVV -p <yourprogrammer> -c <yourchip> -r flash.bin

Full example using the laptop itself (ie: no external programmer) to read the flash:

 # flashrom -VVVV -p internal:laptop=force_I_want_a_brick -c "MX25L6436E/MX25L6445E/MX25L6465E/MX25L6473E" -r t410.bin
 flashrom v0.9.6.1-r1563 on Linux 3.10-1-grml-amd64 (x86_64)
 flashrom is free software, get the source code at http://www.flashrom.org
 ...

It will print the ME regions, something like:

 FREG2: WARNING: Management Engine region (0x00003000-0x004fffff) is locked.

You can use that output to make your rom.layout file.

rom.layout example:

 000000000:00000fff fd
 000001000:00002fff gbe
 000003000:004fffff me
 000500000:007fffff bios

Once we got the rom.layout file we can use it with the proper flashrom option:

        -l, --layout <file>

Currently flashrom uses the layout feature for writing only. Flashrom's ME page (third workaround) reports that there are some flashrom patches to use the layout file for reading but they are locked behind an ident/confirm request for which I've no credentials.

If you can access the Intel System Tools, you can use those to read existing descriptor, gbe and bios regions. Probably more.

Flashing

Once you got your current bios backup, you must extract descriptor and ME from it, than compile coreboot using those two blobs, and then flash back the new coreboot.rom. Recipe:

  • Read the flash the second time and compare the two files to be sure that there's no corruption in the backup.
 flashrom -VVV -p <yourprogrammer> -c <yourchip> -r flash2.bin
 diff flash.bin flash2.bin
  • Save a copy of it on external media.
 cp flash.bin /mnt/usb/
  • Recover descriptor and me firmware:
  dd if=flash.bin of=coreboot/3rdparty/mainboard/lenovo/x201/descriptor.bin \
    count=12288 bs=1M iflag=count_bytes
  dd if=flash.bin of=coreboot/3rdparty/mainboard/lenovo/x201/me.bin \
    skip=12288 count=5230592 bs=1M iflag=count_bytes,skip_bytes
  • Compile coreboot. Remember to enable HAVE_IFD and HAVE_ME_BIN.
  • Flash the resulting build/coreboot.rom
 flashrom -l rom.layout -i bios -w coreboot.rom

Welcome to Coreboot.

Proprietary BIOS components

Flashing coreboot in your bios chip won't set your laptop free, because some of the components are compulsory binary blobs from Intel&Co and there's a tall, long lasting, wall of indifference, on this issue:

  • EC (Embedded Controller): DO NOT TOUCH.
  • CPU Microcode: DO NOT TOUCH.
  • ME (Management Engine): DO NOT TOUCH.
  • GbE (Gigabit Ethernet): DO NOT TOUCH.
  • VGA option rom: you need it if you want graphics in SeaBIOS, but most payloads should work without it (text mode or corebootfb mode)
  • misc serialz and IDs entangling the whole machine here (S/N) and there (UUID) in the idiocratic attempt to close the gap between a machine and its owner, so that the legal department can assert accountability on insider trading cases, without lies to the prosecutor office.
By modifying one of those you could loose the laptop. Beware the dog...

... but If you actually think that you can talk with the animals, well, no worry: you are not crazy. Here some resources to get to the (tipping) point:

Starting from the first Intel PCH (Calpella, IbexPeak+Nehalem), every generation of Core iX processors brought to a new arch change (ex: moving the DRAM controller form the northbridge to the CPU die; moving the northbridge and the southbridge into the same die; finally, with Intel Skylake, moving everything into the same die) that modified the whole 'secure boot' process. So, parts of the ME falled deeper and deeper into the obscurity.

Newer chip-not-sets (6th generation, Cougar Point; 7th gen, Panther Point; 8th gen, Lynx Point) are even worse. And the last one (Intel Skylake) is the definitive one: The major expected changes between the Haswell and Skylake architectures include ... the integration of the Platform Controller Hub (PCH) onto the die for Skylake's H, U and Y variants, effectively following a system-on-chip (SoC) design layout.. As far as I understand the T410 (5th gen chipset, and its ME/AMT 6.0) have chances to be set free because the only foreseeable extra limits, compared to the older ones (ICHx) are: ME read-locked flash region, and a new cryptographic algo in the extracted blob.

(Philosophy follows)

For this reason, today, you must beware a worst animal than a dog: Cerbero, a three headed dog!!!

Three heads:

... and if you are still alive, not in prison, and you still can use your credit cards to buy technology without a fake postman to deliver it to you after a private shipping company denied their services to you, and the neighbour is not looking at you badly from the kitchen window because someone told her that you kill elders and rape kids, chill out a bit, because you are a lucky one. Wondering what was that road train that stepped over your body, asking around if someone had the chance to take the plate number of it ... but alive. Just make yourself a favour: before continuing with your reversing attempt to set you free, give up your email, and train some good pigeons for message delivery. It's underachieving from the engineering perspective but way safer for your person. Way safer. Because there are an horde of 70s, 90s, and counting, Middle Men that missed the whole thing, examples:
 Managers: http://news.bbc.co.uk/2/hi/asia-pacific/4396831.stm
 System Integrators: https://www.crowdsupply.com/purism/librem-15
 Journalists: http://surveillance.rsf.org/en/hacking-team/
 Industry Leaders: http://www.zdnet.com/article/oracle-to-sinner-customers-reverse-engineering-is-a-sin-youd-better-pack-it-in/

The hope is still the same that was in place when the first Clipper Chip appeared: Intel would split its effort in two, one to support the corporate world (ie: cost-based choices of their equipment, to increase efficiency and security of the organization), and a new one to support the human rights (ie: release the FSP source code so that individuals can take full control over their own tools, for own safety).

At this point in time someone should have notice that the FYCs are the ones that loved Data Mining, Data Analysis, and Behavioural Sciences, all things that lead to believe in ... an Oracle; any: shamans, magicians, TV, computers, clerics, smartphones, credit cards ... whatever. I tell you more: Oracle's CEO in 2014 "was listed by Forbes as the third-wealthiest man in America and as the fifth-wealthiest person in the world, with a fortune of $56.2 billion". Compared to that one, Zucky is a poor paedophilia victim.

Good luck.

(End Of Philosophy)