Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T430s guides #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions Installing-and-Configuring/Building-Heads/t430s.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
layout: default
title: Lenovo T430s
nav_order: 1
permalink: /t430s-building/
parent: Step 1 - Building Heads
grand_parent: Installing and configuring
---

Lenovo T430s
====

<!-- markdownlint-disable MD033 -->
<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>
<!-- markdownlint-enable MD033 -->

This guide only documents build options you might be interested in, which are:
If you are not interested in those options follow the [General Building](/general-building/) guide.

- Setting an arbitrary MAC address.
- Change some BIOS options (like swap the fn and ctrl-key)

# Preparation

Follow the [General Building](/general-building/) until you have installed all dependencies and cloned the tree. _Do not_ execute `make BOARD=t430s-maximized` yet!

# Edit build (optional)

## Change MAC (via coreboots bincfg)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Siproqu That is confirmed to work?
I tested this on x230 which confirmed to not work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Siproqu Can you generated a GBE blob by modifying the bincfg /gbe-82579LM set using the same MAC address you used to test this? Then use a tool like vbindiff to show the differences between the blob you just created and the original that uses the MAC 00:de:ad:c0:ff:ee. As the validation is only a checksum, it is quite possible that the MAC you used and 00:de:ad:c0:ff:ee both generate the same checksum but for most other MAC addresses this would not work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlaurion It's been a while since I've done that (and since then a default coreboot is running on the board), but as far as I remember it worked.

@Thrilleratplay Will do it. And fix the guide if necessary. But Heads is a little low in the priority list at the moment. Please give me some time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could confirm that generating the gbe blob with bincfg works fine. I'll change the wiki entry in the next days.
Probably did something wrong when I simply changed the MAC via hexeditor. Anyways.

Will also update linuxboot/heads#1019 and linuxboot/heads#723 (if still needed?).

Sorry that everything takes so long and so many mistakes happen. Heads is currently very low on the priority unfortunately.

```bash
cd coreboot/utils/bincfg/
make

#
# Open gbe-82579LM.set and change the MAC address.
#

./bincfg gbe-82579LM.spec gbe-82579LM.set gbe_0x1000.bin
cat gbe_0x1000.bin gbe_0x1000.bin > /path_to_heads_dir/blobs/t430s/gbe.bin
```

## BIOS options

You can enable certain options like: swap the fn and ctrl key, enable sticky fn key etc.

```
cd ~/
git clone https://github.com/coreboot/coreboot.git
cd coreboot/src/mainboard/lenovo/t430s/
# Open the cmos.default file and enable or disable the options you like. Save the file and close it.
git diff cmos.default > ~/heads/patches/coreboot-4.13/0061-cmos-settings.patch
```

## Set different flash chip in flashrom arguments

**This step is only necessary if non of the detected chips matches MX25L12835F/MX25L12845E/MX25L12865E.**

- Open `heads/boards/t430s-maximized.config` with an editor.
- Search for `CONFIG_FLASHROM_OPTIONS=`
- Replace `-c MX25L12835F/MX25L12845E/MX25L12865E` with `-c <your chip name>`.

Run the build again and copy the new `coreboot.rom` to the USB dongle.

# Build Heads
```
make BOARD=t430s-maximized
```

Wait. Building will take some time...

The `coreboot.rom` image will be copied to `build/coreboot-4.13/t430s-maximized/coreboot.rom`.
Copy it to a USB dongle and follow the [Flashing Guide](/t430s-flashing/).
150 changes: 150 additions & 0 deletions Installing-and-Configuring/Flashing-Guides/t430s.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
layout: default
title: Lenovo T430s
nav_order: 1
permalink: /t430s-flashing/
parent: Step 2 - Flashing Guides
grand_parent: Installing and configuring
---

# Lenovo T430s


<!-- markdownlint-disable MD033 -->
<details open markdown="block">
<summary>
Table of contents
</summary>
{: .text-delta }
1. TOC
{:toc}
</details>
<!-- markdownlint-enable MD033 -->

## Prerequisits

### Hardware
- The USB dongle with the Heads binary (`coreboot.com`).
- A Raspberry Pi and either:
- jumper wires (6xFemale-Female, 3xFemale-Male), a Bread-Board
- OR 6xFemale-Female, 3 jumper wires, the equipment to solder a "Y-jumper wire" to connect two pins to one 3v3 output.
- A [Pamona SOIC-8 Clip](https://www.pomonaelectronics.com/products/test-clips/soic-clip-8-pin) (You can also try a cheaper one, but I failed with it).
- A computer to connect to the RasperrbyPi

### Software

- `raspi-config` to enable SPI on the RaspberryPi. If your Raspberry runs the default OS ([Raspberry Pi OS](https://www.raspberrypi.org/software/)) it is already installed.
- `flashrom` on the Raspberry Pi (`sudo apt install flashrom`).
- (optional) [OpenBoardView](https://openboardview.org/)


## Flash Heads

### **Disassemble the laptop**

Follow _chapter 9_ of the [Lenovo maintenance guide](https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/t430s_t430si_hmm_en_0b48538_01.pdf) to disassembly the laptop.
You do not have to remove the smart card reader, the speakers and the Bluetooth card and its switch.

Though don't forget to remove the media card reader (page 75).

After you have taken out the mainboard flip it around.

The flash memory is located here:

![T430s-board](/images/T430s_board.jpg)

And has the following pin layout.

![T430s-chip](/images/T430s_chip_annotated.jpg)

In case you want reassure yourself: get the [board view file](https://drive.google.com/file/d/0B2mH6ffKfXjCUWJUb0FKa2g5SE0/view) to check out the pin layout there. You can open it with [OpenBoardView](https://openboardview.org/).

### **Prepare the Raspberry Pi**

First, you need to enable the SPI device on the Rapsberry Pi.

Do this by run `sudo raspi-config` and enable it under `Interface Options`. Reboot the Raspberry Pi.

Now connect the clip to the Raspberry Pi by using the jumper wires:

| Pi Pin | GPIO | chip pin |
|--------|------|--------------|
| 1 | First 3v3 | Vcc (8) |
| 17 | Second 3v3 | WB (3), HOLD (7) |
| 19 | 10 | MOSI (5) |
| 21 | 9 | MISO (2) |
| 23 | 11 | CLK (6) |
| 24 | 8 | CS0 (1) |
| 39 | Ground | GND (4) |

Since the RaspberryPi has only two 3v3 outputs you need to connect the WB and HOLD pin to the same 3v3 output. Use the bread board or your soldered wire for that.

### **Probe the chip**

Connect your USB dongle to the Raspberry and `cd` into it.

Connect the clip to the chip.

> In case flashrom can't detect or read the chip consider the following:
> - If your Raspberry Pi is connected to an laptop USB port plugin the laptop to the AC.
> - The legs of the chip are really tiny and wear down quickly. Does the clip has a proper connection to the chips legs?
> - Checkout flashroms [common problems](https://www.flashrom.org/Common_problems).
> - If noting helps you probably have to replace the chip on the mainboard.
> Here is a [guide](https://tobiasmanske.de/posts/thinkpad-coreboot-part1/) for that.

Detect the chip.

```
sudo flashrom -p linbux_spi:dev=/dev/spidev0.0,spispeed=10000
```

Flashrom should detect **two** chip types. One of them is `MX25L12835F/MX25L12845E/MX25L12865E`. Ignore the other one.

In case **non** of the detected chips match `MX25L12835F/MX25L12845E/MX25L12865E` you have to rebuild Coreboot unfortunately.

> If you have to rebuild:
> - Write down the name of the chip and follow [the build guide](/t430s-building/#set-different-flash-chip-in-flashrom-arguments) to edit the configuration.
> - Also replace `MX25L12835F/MX25L12845E/MX25L12865E` with your chip name in each of the commands below.

### **Backup and flash**

1. Backup the current BIOS

```
sudo flashrom -p linbux_spi:dev=/dev/spidev0.0,spispeed=10000 -c MX25L12835F/MX25L12845E/MX25L12865E -r ./dump_1.bin
sudo flashrom -p linbux_spi:dev=/dev/spidev0.0,spispeed=10000 -c MX25L12835F/MX25L12845E/MX25L12865E -r ./dump_2.bin
sudo flashrom -p linbux_spi:dev=/dev/spidev0.0,spispeed=10000 -c MX25L12835F/MX25L12845E/MX25L12865E -r ./dump_3.bin
```

2. Compare hash sums

```
sha256sum -b dump_1.bin > hashvalues.txt
sha256sum -b dump_2.bin >> hashvalues.txt
sha256sum -b dump_3.bin >> hashvalues.txt
```
Compare the hash sums. If they do not match, read the content again and compare until they match.

Copy the dumps and `hashvalues.txt` to your USB dongle.

Those dumps are your backup of the current BIOS! You can flash them in case something went wrong and your laptop won't boot.

3. Flash Heads

```
sudo flashrom -p linbux_spi:dev=/dev/spidev0.0,spispeed=10000 -c MX25L12835F/MX25L12845E/MX25L12865E -w coreboot.rom
```

Once its done assemble your laptop and boot into Heads.

Continue with [configuring keys](/Configuring-Keys/).

# Archived Technical Details and References

- [Maintenance guide for the T430s](https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/t430s_t430si_hmm_en_0b48538_01.pdf) ([archive](https://web.archive.org/web/20201112013412/https://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/t430s_t430si_hmm_en_0b48538_01.pdf))
- [T430s board view](https://drive.google.com/file/d/0B2mH6ffKfXjCUWJUb0FKa2g5SE0/view) ([archive](https://archive.org/details/t430s.boardview.11263-1_UMA))
- [Flash Memory Reference - MX25L12835F](https://www.mxic.com.tw/Lists/Datasheet/Attachments/7397/MX25L12835F,%203V,%20128Mb,%20v1.6.pdf) ([archive](https://web.archive.org/web/20210816122225/https://www.mxic.com.tw/Lists/Datasheet/Attachments/7397/MX25L12835F,%203V,%20128Mb,%20v1.6.pdf))
- [Solder new flash memory](https://tobiasmanske.de/posts/thinkpad-coreboot-part1/) ([archive](https://web.archive.org/web/20210824072910/https://tobiasmanske.de/posts/thinkpad-coreboot-part1/))
- [Flashrom RaspberryPi guide](https://flashrom.org/RaspberryPi) ([archive](https://web.archive.org/web/20210604150505/https://flashrom.org/RaspberryPi))
- [RaspberryPi Pin Layout](https://pinout.xyz/pinout/spi) ([archive](https://web.archive.org/web/20210818215850/https://pinout.xyz/))

Binary file added images/T430s_board.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/T430s_chip_annotated.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.