1 # Lenovo X200 / T400 / T500 / X301 common
3 These models are sold with either 8 MiB or 4 MiB flash chip. You can identify
4 the chip in your machine through flashrom:
9 Note that this does not allow you to determine whether the chip is in a SOIC-8
12 ## Installing with ME firmware
14 To install coreboot and keep ME working, you don't need to do anything special
15 with the flash descriptor. Only flash the `bios` region externally and don't
16 touch any other regions:
18 # flashrom -p YOUR_PROGRAMMER -w coreboot.rom --ifd -i bios
21 ## Installing without ME firmware
25 **ThinkPad R500** has slightly different flash layout (it doesn't have
26 ``gbe`` region), so the process would be a little different for that model.
29 On Montevina machines it's possible to disable ME and remove its firmware from
30 SPI flash by modifying the flash descriptor. This also makes it possible to use
31 the flash region the ME used for `bios` region, allowing for much larger
34 First of all create a backup of your ROM with an external programmer:
36 # flashrom -p YOUR_PROGRAMMER -r backup.rom
39 Then, split the IFD regions into separate files with ifdtool. You will need
40 `flashregion_3_gbe.bin` later.
42 $ ifdtool -x backup.rom
45 Now you need to patch the flash descriptor. You can either [modify the one from
46 your backup with **ifdtool**](#modifying-flash-descriptor-using-ifdtool), or
47 [use one from the coreboot repository](#using-checked-in-flash-descriptor-via-bincfg).
49 ### Modifying flash descriptor using ifdtool
51 Pick the layout according to your chip size from the table below and save it to
52 the `new_layout.txt` file:
55 +---------------------------+---------------------------+---------------------------+
56 | 4 MiB chip | 8 MiB chip | 16 MiB chip |
57 +===========================+===========================+===========================+
58 | .. code-block:: none | .. code-block:: none | .. code-block:: none |
60 | 00000000:00000fff fd | 00000000:00000fff fd | 00000000:00000fff fd |
61 | 00001000:00002fff gbe | 00001000:00002fff gbe | 00001000:00002fff gbe |
62 | 00003000:003fffff bios | 00003000:007fffff bios | 00003000:00ffffff bios |
63 | 00fff000:00000fff pd | 00fff000:00000fff pd | 00fff000:00000fff pd |
64 | 00fff000:00000fff me | 00fff000:00000fff me | 00fff000:00000fff me |
65 +---------------------------+---------------------------+---------------------------+
68 The last two lines define `pd` and `me` regions of negative size. This way
69 ifdtool will mark those as unused.
71 Update regions in the flash descrpitor (it was extracted previously with
74 $ ifdtool -n new_layout.txt flashregion_0_flashdescriptor.bin
77 Set `MeDisable` bit in ICH0 and MCH0 straps:
79 $ ifdtool -M 1 flashregion_0_flashdescriptor.bin.new
82 Delete previous descriptors and rename the final one:
84 $ rm flashregion_0_flashdescriptor.bin
85 $ rm flashregion_0_flashdescriptor.bin.new
86 $ mv flashregion_0_flashdescriptor.bin.new.new flashregion_0_flashdescriptor.bin
89 Continue to the [Configuring coreboot](#configuring-coreboot) section.
91 ### Using checked-in flash descriptor via bincfg
93 There is a copy of an X200's flash descriptor checked into the coreboot
94 repository. It is supposed to work for the T400/T500 as well. The descriptor
95 can be converted back to its binary form using a tool called **bincfg**. Go
96 to `util/bincfg` and build it:
102 If your flash is not 8 MiB, you need to change values of `flcomp_density1` and
103 `flreg1_limit` in the `ifd-x200.set` file according to following table:
106 +-----------------+-------+-------+--------+
107 | | 4 MiB | 8 MiB | 16 MiB |
108 +=================+=======+=======+========+
109 | flcomp_density1 | 0x3 | 0x4 | 0x5 |
110 +-----------------+-------+-------+--------+
111 | flreg1_limit | 0x3ff | 0x7ff | 0xfff |
112 +-----------------+-------+-------+--------+
115 Then convert the flash descriptor:
120 It will be saved to the `flashregion_0_fd.bin` file.
122 ### Configuring coreboot
124 Now configure coreboot. You need to select correct chip size and specify paths
125 to flash descriptor and gbe dump.
129 ROM chip size (8192 KB (8 MB)) # According to your chip
130 (0x7fd000) Size of CBFS filesystem in ROM # or 0x3fd000 for 4 MiB chip / 0xffd000 for 16 MiB chip
133 [*] Add Intel descriptor.bin file
134 # Note: if you used bincfg, specify path to generated util/bincfg/flashregion_0_fd.bin
135 (/path/to/flashregion_0_flashdescriptor.bin) Path and filename of the descriptor.bin file
137 [*] Add gigabit ethernet configuration
138 (/path/to/flashregion_3_gbe.bin) Path to gigabit ethernet configuration
141 Then build coreboot and flash whole `build/coreboot.rom` to the chip.
145 The flash layouts of the OEM firmware are as follows:
148 +---------------------------------+---------------------------------+
149 | 4 MiB chip | 8 MiB chip |
150 +=================================+=================================+
151 | .. code-block:: none | .. code-block:: none |
153 | 00000000:00000fff fd | 00000000:00000fff fd |
154 | 00001000:001f5fff me | 00001000:005f5fff me |
155 | 001f6000:001f7fff gbe | 005f6000:005f7fff gbe |
156 | 001f8000:001fffff pd | 005f8000:005fffff pd |
157 | 00200000:003fffff bios | 00600000:007fffff bios |
158 | 00290000:002affff ec | 00690000:006affff ec |
159 | 003e0000:003fffff bootblock | 007e0000:007fffff bootblock |
160 +---------------------------------+---------------------------------+
163 On each boot of vendor BIOS `ec` area in flash is checked for having firmware
164 there, and if there is one, it proceedes to update firmware on H8S/2116 (when
165 both external power and main battery are attached). Once update is performed,
166 first 64 KiB of `ec` area is erased. Visit
167 [thinkpad-ec repository](https://github.com/hamishcoleman/thinkpad-ec) to learn
168 more about how to extract EC firmware from vendor updates.