Patch a two-chip Intel flash image (8MB+4MB) into a single-chip image (e.g. one 16MB W25Q128)
Find a file
2026-11-04 16:31:27 +01:00
ifd-singlechip.py Add ifd-singlechip: patch two-chip IFD images for a single SPI chip 2026-11-04 16:31:27 +01:00
README.md Add ifd-singlechip: patch two-chip IFD images for a single SPI chip 2026-11-04 16:31:27 +01:00

ifd-singlechip

Turn a two-chip Intel flash image (e.g. 8MB + 4MB = 12MB) into an image for one bigger chip (e.g. a single 16MB W25Q128), by patching the flash descriptor.

Useful when you replace the two SPI chips on a Sandy/Ivy Bridge laptop with one chip: ThinkPad X230/T430, Dell Latitude E6430/E6530, etc. It works on Libreboot and coreboot ROMs. Tested: Dell Latitude E6530, Libreboot 26.10 seabios txtmode ROM, 8MB MX25L6406E replaced by W25Q128JVSQ, 4MB chip removed. It boots.

Single file, Python 3, no dependencies.

What it changes

Only the descriptor, plus padding:

Field Two-chip image After
FLMAP0.NC (number of chips) 2 1
FLCOMP chip 1 size 8MB new chip size (default 16MB)
ME VSCC table no entry for the new chip entry for its JEDEC ID added (skipped if already there)
file size 12MB padded with 0xFF to the new chip size

The region layout (descriptor, GbE, ME, BIOS) is not touched. The chipset maps the top of the BIOS region (not the top of the chip) to the CPU reset vector, so the empty space at the end of the chip is fine.

The VSCC table tells the ME how to talk to the flash chip. If the table has no free slot, one existing entry is overwritten (slot 0 by default, --slot to change). On the E6530/X230 descriptors slot 0 is the old Winbond W25X32, which isn't on the board. The VSCC value is copied from another entry of the same vendor.

Usage

The input must be the full combined image. If you have split files:

cat bottom_8mb.rom top_4mb.rom > full_12mb.rom

Then:

./ifd-singlechip.py full_12mb.rom single_16mb.rom

Example output:

input: full_12mb.rom (0xc00000 bytes)
  components: 2, comp1 8192K, comp2 4096K
  VSCC slot 0 (replacing EF3015) -> EF4018, VSCC 0x20052005
  changed bytes: 0x15, 0x30, 0xdf1, 0xdf2
  padded 0xc00000 -> 0x1000000 with 0xFF
wrote single_16mb.rom

Options:

Option Default Meaning
--size 16M new chip size (512K … 64M)
--jedec EF4018 JEDEC ID of the new chip (flashrom prints it)
--vscc copied VSCC value for the new entry
--slot 0 VSCC slot to overwrite if none is free
--dry-run show what would change, write nothing

Check the result with coreboot's ifdtool -d single_16mb.rom (look for NC: 1 and the new Component 1 Density).

Before flashing

  • MAC address / blobs: do any nvmutil / ./mk inject steps on the 12MB image first, then run this script. The script copies the GbE and ME regions as they are.
  • Which chip goes where: the new chip goes in the place of the chip that held the first part of the image (the descriptor). That's the 8MB one on the X230 and E6530. The other chip can be removed or left on, because the chipset no longer selects it.
  • Package: W25Q128JVS is SOIC-8, 208mil wide. Check that the old chip's footprint is also 208mil.

Flash with an external programmer, then read the chip back and compare:

flashrom -p ch341a_spi -c W25Q128.V -w single_16mb.rom
flashrom -p ch341a_spi -c W25Q128.V -r readback.rom
cmp readback.rom single_16mb.rom

If it doesn't power on

A cold CPU and a fan that never spins means the chipset never got past reading the flash. In order:

  1. Drain all power: unplug AC, take out the main battery and the coin cell, hold the power button ~30s, wait a minute. The ME and the chipset keep state across flashing. In my case this was the fix.
  2. Read the chip back and cmp it with the image.
  3. Check the soldering: pin 1 orientation, bridges, continuity from each pin to its pad.
  4. Confirm flashrom reports the JEDEC ID you passed to --jedec.
  5. Put the original dumps back on the original chips. If stock firmware doesn't boot either, the board was damaged during the rework.

Disclaimer

Flashing firmware can brick your board. Keep your original dumps.