Last modified: 2023-03-29

General notes

This is how I set-up my Raspberry Pi to be used as external flasher.

Info

There are two ways to flash coreboot into motherboard.

Internal flashing - boot a operating system on the motherboard, install flashrom and flash it via motherboard's internal SPI iterface. This methid is preferable due to simplicity, but not always possible.

External flashing - user external tool to flash the motherboard. If the flash-chip with BIOS is socketed, you can extract it and flash it with programmer. If the flash chip is soldered to the motherboard, you can do in-circuit flashing by connecting to chip's pins.

Gotchas

Tip

Create a backup of the original BIOS by reading the SPI flash chip.

The original can be flashed back in case the coreboot fails, but also some useful things might be extracted from it such as vgabios, IntelME, network card driver and so on.

Tip

Read out the SPI flash chip multiple times (two or three) and compare their checksums to veryfy that the electrical connection is solid.

Warning

If the flashing procedure failed, do not power down the setup! Research about possible solutions.

Tip

Always check the your RAM modules are placed into correct slots (look into manual).

Often there are 4 slots (from closest to CPU): A1, A2, B1, B2. Then there are following possible configurations:

  • 1 DIMMs: A2
  • 2 DIMMs: A2 B2
  • 4 DIMMs: all slots

With stock BIOS / UEFI it might be OK to use slightly different placement, but coreboot will likely end up with RAM INIT FAILURE! and fail to boot.

Warning

First boot of coreboot always takes longer - this is mostly because of training memory. Any subsequent boots should be faster.

Tip

To get started with new board, keep most settings on default (have as few features as possible to keep it simple). Then if succesful, you can enable more features.

Tip

You can use serial port for debugging, if you board has one. Enable debugging with Serial port console output and Show POST codes on the debug console.

Tip

Look for existing configuration files in coreboot/configs or in another projects like heads.

SPI flash chip pinout

Warning

While the following pinout and voltage is common, it might vary between various manufacturers and chip models! Always check datasheet.

PinNameFunction
1CSChip Select
2DOData Output
3WPWrite Protect
4GNDGround
5DIData Input
6CLKSerial clock input
7HOLDHold Input
8VCCPower supply

Coreboot bassics

Build crossgcc (this will take a while):

make crossgcc CPUS=4

Configure the coreboot build:

make menuconfig

Build coreboot:

make

Serial

Source

Open serial with:

screen /dev/ttyUSB0 115200

To close it Ctrl+A followed by K.