File site/docs/install/t480.md changed (mode: 100644) (index 33d1fad..f028690) |
... |
... |
Thunderbolt issue (READ THIS BEFORE FLASHING) |
177 |
177 |
|
|
178 |
178 |
The thunderbolt firmware on launch units had a bug where certain debug |
The thunderbolt firmware on launch units had a bug where certain debug |
179 |
179 |
info is written on certain events, such as plugging in a charger to the USB-C |
info is written on certain events, such as plugging in a charger to the USB-C |
180 |
|
connector. This logging is stored in the Thunderbolt firmware's own SPI flash, |
|
|
180 |
|
connector. Log data is stored in the Thunderbolt firmware's own SPI flash, |
181 |
181 |
which is separate from the main SPI flash containing the system firmware |
which is separate from the main SPI flash containing the system firmware |
182 |
182 |
e.g. coreboot. |
e.g. coreboot. |
183 |
183 |
|
|
184 |
|
If that flash gets full, thunderbolt (on factory firmware) stops working and |
|
185 |
|
fast charging stops working. It can be prevented by updating the Thunderbolt |
|
186 |
|
firmware. You can do this from Lenovo's firmware, using these instructions: |
|
|
184 |
|
This photo shows that flash chip on a ThinkPad T480: |
187 |
185 |
|
|
188 |
|
<https://pcsupport.lenovo.com/gb/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t480s-type-20l7-20l8/solutions/ht508988-critical-intel-thunderbolt-software-and-firmware-updates-thinkpad> |
|
|
186 |
|
<img tabindex=1 alt="ThinkPad T480 NOR flash (thunderbolt firmware)" class="p" src="https://av.libreboot.org/t480/t480tbspi.jpg" /><span class="f"><img src="https://av.libreboot.org/t480/t480tbspi.jpg" /></span> |
189 |
187 |
|
|
190 |
|
If you're already affected by the bug, you can restore it to a working state |
|
191 |
|
by flashing the Thunderbolt firmware externally. For example this is where its |
|
192 |
|
NOR flash is on a T480: |
|
|
188 |
|
It's also present on the T480S (S model), but in a different location; on |
|
189 |
|
the S model, the main system flash is still located somewhere near the |
|
190 |
|
centre of the board, and the ThunderBolt flash near the edge of the board, as |
|
191 |
|
it is on the T480, but the T480/T480s use slightly different wiring and they |
|
192 |
|
have a slightly different board layout. |
193 |
193 |
|
|
194 |
|
<img tabindex=1 alt="ThinkPad T480 NOR flash (thunderbolt firmware)" class="p" src="https://av.libreboot.org/t480/t480tbspi.jpg" /><span class="f"><img src="https://av.libreboot.org/t480/t480tbspi.jpg" /></span> |
|
|
194 |
|
If that flash gets full, thunderbolt PCI-E stops working and fast charging |
|
195 |
|
stops working, but slow charging still works. The issue can be prevented by |
|
196 |
|
updating the firmware. See: |
195 |
197 |
|
|
196 |
|
This page shows how to do that: |
|
197 |
|
|
|
198 |
|
<https://gitlab.com/MobileAZN/lenovo-t480-thunderbolt-firmware-fixes>\ |
|
199 |
|
**WARNING! Please follow the guide PRECISELY, if you follow it, but please |
|
200 |
|
only follow it if your ThunderBolt is already broken. If it isn't, use |
|
201 |
|
Lenovo's software-based updater. If you do the external method, you MUST be |
|
202 |
|
very careful; the guide there for example says to disable ThunderBolt assist. |
|
203 |
|
It also says to erase first, then flash the `null.bin` (file with zeroes in |
|
204 |
|
it), then BOOT, and when it boots, power off and re-connect clip again and |
|
205 |
|
then flash the padded TBT.bin - whereas, for example, if you simply flashed |
|
206 |
|
a padded TBT.bin and nothing else first, and boot, it will be perma-bricked, |
|
207 |
|
in that the CPU won't come out of reset (it'll bootloop). We don't yet know |
|
208 |
|
how to recover from this brick scenario. So all of this is to say: flashing |
|
209 |
|
the ThunderBolt externally is EXTREMELY HAZARDOUS, and should be done with |
|
210 |
|
the UTMOST CARE, ideally NOT AT ALL. -- ALSO: the guide only covers T480, |
|
211 |
|
but should be similar on T480s and other ThinkPad models.** |
|
212 |
|
|
|
213 |
|
You unbrick the Thunderbolt controller by pulling the firmware from Lenovo's |
|
214 |
|
update, from Lenovo's update utility. Once extracted, you then pad it properly |
|
215 |
|
so that it can be flashed manually, using a normal SPI flasher (the same one |
|
216 |
|
that you would use to flash Libreboot). |
|
|
198 |
|
<https://pcsupport.lenovo.com/gb/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t480s-type-20l7-20l8/solutions/ht508988-critical-intel-thunderbolt-software-and-firmware-updates-thinkpad> |
|
199 |
|
|
|
200 |
|
If you're already affected by the bug, you can restore it to a working state |
|
201 |
|
by flashing the Thunderbolt firmware externally. You *cannot* fix the issue |
|
202 |
|
with Lenovo's software-based flasher, if the issue is already present, so |
|
203 |
|
you *must* flash externally in that case; you can also flash externally, even |
|
204 |
|
if the issue is not yet present. |
|
205 |
|
|
|
206 |
|
The benefit of flashing it *externally* is that you would then no longer need |
|
207 |
|
to boot Windows, because there is currently no way of doing it from Linux, and |
|
208 |
|
Lenovo does not provide a *boot image* like they do for UEFI updates. So, to |
|
209 |
|
use Lenovo's software-based flasher, you must install and boot Windows. We |
|
210 |
|
always recommend using Free Software whenever possible, *so we always recommend |
|
211 |
|
flashing the new firmware externally, as a matter of course.* |
217 |
212 |
|
|
218 |
213 |
Use the [25XX NOR flashing guide](spi.md) if you need to flash this chip. It's |
Use the [25XX NOR flashing guide](spi.md) if you need to flash this chip. It's |
219 |
214 |
the same guide that you will use for the main system flash, which is a separate |
the same guide that you will use for the main system flash, which is a separate |
220 |
215 |
flash IC. |
flash IC. |
221 |
216 |
|
|
222 |
|
AGAIN: This is not the Libreboot flash IC. This is separate to the system flash. |
|
223 |
|
Read on to know how to reprogram the main system flash! |
|
|
217 |
|
The firmware can be extracted from Lenovo's updater, specifically the `.exe` |
|
218 |
|
file. For your convenience, lbmk (Libreboot's build system) can download this |
|
219 |
|
for you. Run the following commands in lbmk: |
|
220 |
|
|
|
221 |
|
(please install [build dependencies](../build/) first) |
|
222 |
|
|
|
223 |
|
Commands: |
|
224 |
|
|
|
225 |
|
./mk -d coreboot t480s_vfsp_16mb |
|
226 |
|
./mk -d coreboot t480_vfsp_16mb |
|
227 |
|
|
|
228 |
|
You will find the files at these locations in lbmk: |
|
229 |
|
|
|
230 |
|
* `vendorfiles/t480/tb.bin` |
|
231 |
|
* `vendorfiles/t480s/tb.bin` |
|
232 |
|
|
|
233 |
|
These have already been padded, to the correct size of 1MB, whereas the original |
|
234 |
|
size (within the `.exe` file) was 256KB. |
|
235 |
|
|
|
236 |
|
These files are *also* generated, if you used the `./mk inject` command, |
|
237 |
|
on a pre-compiled release image, as documented [here](ivy_has_common.md). |
|
238 |
|
|
|
239 |
|
**WARNING: DO NOT FLASH IT FIRST; YOU MUST PERFORM SOME PRE-REQUISITE STEPS |
|
240 |
|
FIRST, BEFORE FLASHING `tb.bin`**: |
|
241 |
|
|
|
242 |
|
**Firstly, please note that this procedure has *only* been tested with Lenovo's |
|
243 |
|
UEFI firmware installed on the main flash. Please ensure that you have also |
|
244 |
|
switched Lenovo UEFI/EC firmware to the specific version referenced on this |
|
245 |
|
page, for your board.** - for the rest of this, we will assume that you've not |
|
246 |
|
yet flashed Libreboot, though there's no reason in principle why this can't |
|
247 |
|
also work *after* you've flashed Libreboot; it's just that we only tested it |
|
248 |
|
from Lenovo UEFI firmware. |
|
249 |
|
|
|
250 |
|
Now, *remove* the CR2032 battery (yellow coin-cell battery). Please also ensure |
|
251 |
|
that you've disabled *ThunderBolt Assist* in the Lenovo UEFI setup menu. You |
|
252 |
|
should also disable the internal battery, on T480 specifically (T480s only has |
|
253 |
|
an internal battery). You should do this with no batteries connected anyway. |
|
254 |
|
|
|
255 |
|
Firstly, make *two dumps* of the flash, using [flashprog](spi.md) - and the |
|
256 |
|
linked guide generally tells you how to dump/flash the chip. Make sure both |
|
257 |
|
dumps have the same checksum, using e.g. `sha512sum`. |
|
258 |
|
|
|
259 |
|
Now, *erase* the flash. This example command is when using a Raspberry Pi Pico, |
|
260 |
|
assuming that the device shows up as `/dev/ttyACM0` - please adapt accordingly |
|
261 |
|
to whatever programmer you have: |
|
262 |
|
|
|
263 |
|
flashprog -p serprog:dev=/dev/ttyACM0 -E |
|
264 |
|
|
|
265 |
|
Note that the `-E` argument is what specifies that the chip should be *erased*. |
|
266 |
|
|
|
267 |
|
Now, you must create a file called `null.bin`, which contains all zeroes: |
|
268 |
|
|
|
269 |
|
dd if=/dev/zero of=null.bin bs=1M count=1 |
|
270 |
|
|
|
271 |
|
Please ensure (in hexdump) that the file does contain all zeroes, and that it |
|
272 |
|
is 1MB in size. You will now flash it, again adapting the command below to |
|
273 |
|
whatever programmer you have: |
|
274 |
|
|
|
275 |
|
flashprog -p serprog:dev=/dev/ttyACM0 -w null.bin |
|
276 |
|
|
|
277 |
|
**NOW, REMOVE the clip. Button it back up and turn the T480 on, with both |
|
278 |
|
the battery and the charger connected, plugging in the battery first.** |
|
279 |
|
|
|
280 |
|
It *should* boot up and show the Lenovo boot screen. Give it a few moments. |
|
281 |
|
When you've confirmed that it has booted the Lenovo firmware, *shut down* the |
|
282 |
|
machine and remove the battery / power supply again. It *may take a while* to |
|
283 |
|
boot Lenovo's firmware when doing this, so please be very patient. |
|
284 |
|
|
|
285 |
|
After you've confirmed that the machine boots, I say again: make sure to shut |
|
286 |
|
it down fully, removing all batteries and power supplies. |
|
287 |
|
|
|
288 |
|
It is at this moment that you will externally flash the `tb.bin` file. Please |
|
289 |
|
make sure to flash the correct one for your board: |
|
290 |
|
|
|
291 |
|
* T480: `vendorfiles/t480/tb.bin` |
|
292 |
|
* T480s: `vendorfiles/t480s/tb.bin` |
|
293 |
|
|
|
294 |
|
Libreboot's automated build system has a lot more dependencies. If you want to |
|
295 |
|
avoid installing them, and extract the file manually, you can. Simply download |
|
296 |
|
the `.exe` file and do this: |
|
297 |
|
|
|
298 |
|
innoextract filename.exe |
|
299 |
|
|
|
300 |
|
The `innoextract` utility will probably be available in your distro's package |
|
301 |
|
manager. You can otherwise find it here:\ |
|
302 |
|
<https://constexpr.org/innoextract/> - credit goes to Daniel Scharrer for |
|
303 |
|
writing this excellent software. |
|
304 |
|
|
|
305 |
|
A directory will be created with the extracted files. Inside it, you will |
|
306 |
|
find a file named `TBT.bin`. You can pad it like so: |
|
307 |
|
|
|
308 |
|
dd if=/dev/null of=TBT.bin bs=1 seek=1048576 |
|
309 |
|
|
|
310 |
|
Note that the `seek` variable here matching 1MB flash size. If you encounter |
|
311 |
|
a different flash size, adapt accordingly (the same applies when creating |
|
312 |
|
the `null.bin` file). Libreboot's build system makes this size configurable |
|
313 |
|
per board, on the theory that we may encounter other flash sizes in the future, |
|
314 |
|
when we add more ThinkPads of this generation to Libreboot. |
|
315 |
|
|
|
316 |
|
Ok, so you have the file. Now you can flash it. |
|
317 |
|
|
|
318 |
|
Example: |
|
319 |
|
|
|
320 |
|
flashprog -p serprog:dev=/dev/ttyACM0 -w tb.bin |
|
321 |
|
|
|
322 |
|
Adapt `tb.bin` in the command above, to the actual one that you wish to flash. |
|
323 |
|
|
|
324 |
|
You *MUST* do it in the exact order as prescribed above. After flashing |
|
325 |
|
the `tb.bin` image, un-clip and simply re-assemble. After you boot up, it should |
|
326 |
|
once again show the boot screen, and USB-C / ThunderBolt will work perfectly. |
|
327 |
|
|
|
328 |
|
You can repeat the above steps to restore the old firmware version. This is why |
|
329 |
|
you were instructed to make a backup, on the off-chance that you may wish to do |
|
330 |
|
so for some reason in the future. |
|
331 |
|
|
|
332 |
|
Troubleshooting: |
|
333 |
|
|
|
334 |
|
If you accidentally flashed an incorrect firmware image, or you didn't properly |
|
335 |
|
erase and boot first before flashing the new image, you can simply repeat the |
|
336 |
|
steps again; on erase/null, you then boot up and *wait* and it'll eventually |
|
337 |
|
show the boot screen again. If it doesn't work, just keep doing it until it does. |
224 |
338 |
|
|
225 |
|
**AGAIN: It is extremely easy to permanently brick the ThunderBolt controller, |
|
226 |
|
rendering your system completely unbootable, if you use the external recovery |
|
227 |
|
method. If you're still able to fix it with a software-based flasher like the |
|
228 |
|
one Lenovo provides, please use that at all - or simply don't fix it at all, |
|
229 |
|
because the machine will at least still charge while it has the ThunderBolt |
|
230 |
|
issue, where older firmware is used.** |
|
|
339 |
|
Credits go |
|
340 |
|
to [Adam McNutt](https://gitlab.com/MobileAZN/lenovo-t480-thunderbolt-firmware-fixes) |
|
341 |
|
who originally provided such instructions, for the ThinkPad T480. The information |
|
342 |
|
there was adapted for *this* guide, in the Libreboot documentation. Libreboot |
|
343 |
|
may very well support other ThinkPads from the same generation, in a future |
|
344 |
|
release after Libreboot 20241206, and many of those have this same issue; when |
|
345 |
|
it does, Libreboot will document this fix for those machines too, and probably |
|
346 |
|
move these instructions to a dedicated page on the website. |
231 |
347 |
|
|
232 |
348 |
Flash a ROM image (software) |
Flash a ROM image (software) |
233 |
349 |
----------------------- |
----------------------- |