-
Notifications
You must be signed in to change notification settings - Fork 6
Description
flashprog v1.3
I try to fix HP 8300 USDT with BIOS that was self destructed in a mysterious way. I use external SPI programmer with a clip for SOIC16. I can flash BIOS from HP (v2.90, file K01_0290.BIN) and after this operation I can boot PC but NIC is not working because MAC address is FF:FF:FF:FF:FF:FF. NIC is disabled, even Linux ignores such NIC and I cannot set MAC address from software. This has to be fixed in BIOS...
I have found an article related to this issue but article doesn't describe how they found what flash regions are related to NIC and how they patched BIOS with NIC code from "damaged" FLASH.
I want to use flashprog and I think I can use layout file to update just part of flash chip. "layout" file has to be defined.
I have found that flashprog understands Intel Firmware Descriptor (flag --ifd) but I cannot find a way to dump Intel Firmware Descriptor to a file in "layout format".
I have found a way to display Intel firmware Descriptor but I have to use this information and write "layout file":
$ flashprog -p ch341a_spi --ifd -V -r test.bin
flashprog v1.3 on Linux 6.8.0-48-generic (x86_64)
flashprog is free software, get the source code at https://flashprog.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
flashprog was built with GCC 13.2.0, little endian
Command line (6 args): flashprog -p ch341a_spi --ifd -V -r test.bin
Initializing ch341a_spi programmer
Device revision is 3.0.4
The following protocols are supported: SPI.
Probing for AMIC A25L010, 128 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
...
Probing for Winbond W25Q128.V, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
Added layout entry 00000000 - 00ffffff named complete flash
Found Winbond flash chip "W25Q128.V" (16384 kB, SPI) on ch341a_spi.
Chip status register is 0x00.
Probing for Winbond W25Q128.V..M, 16384 kB: probe_spi_rdid_generic: id1 0xef, id2 0x4018
...
Probing for Generic unknown SPI chip (REMS), 0 kB: probe_spi_rems: id1 0xef, id2 0x17
Found Winbond flash chip "W25Q128.V" (16384 kB, SPI).
This chip may contain one-time programmable memory. flashprog cannot read
and may never be able to write it, hence it may not be able to completely
clone the contents of this chip (see man page for details).
Reading ich descriptor... done.
Added layout entry 00000000 - 00000fff named fd
Added layout entry 00a90000 - 00ffffff named bios
Added layout entry 00003000 - 00a8ffff named me
Added layout entry 00001000 - 00002fff named gbe
Reading flash... done.
I created layout file (layout-ifd.cfg):
0x00000000:0x00000fff fd
0x00001000:0x00002fff gbe
0x00003000:0x00a8ffff me
0x00a90000:0x00ffffff bios
Could be new option added to flashprog to dump Intel Firmware Descriptor (or any other FLASH descriptor) in the format compatible with layout file?
I know I should not use cheap SPI programmer based on CH341A. Programmer I received was designed in the way that voltage for SPI FLASH was 5V but I have found warning on libreboot - Do not use CH341A project and fixed my SPI programmer before it damaged any FLASH chip. I also found that test clip for SOIC-16 I received with my programmer was wired in a strange way, and I had to fix it first.... Anyway, my CH341A programmer now works reliably...
I tried to flash LibreBoot to my broken machine but it was not working, I booted it once, I started memtest but after reset machine was "dead" again. That is why I try to restore original BIOS...