Hi all,
I would like to see the following feature added to flashrom:
https://github.com/flashrom/flashrom/issues/185
If someone implemented it, would the idea (at least) be accepted?
Is anyone interested in implementing it and claiming the $100 bounty?
Text of the issue, for people too lazy to click:
Some chips require certain bits (and similar features) be set before the hardware write-protect pins can be used. Flashrom doesn't currently support setting these bits, which makes it impossible to e.g hardware write-protect a BIOS chip after flashing Coreboot. I would like to see Flashrom add support for this.
Attached is a patch which was written by someone else (they can identify themselves if they like) to toggle the relevant bits for a particular flash chip, each time flashrom is run, and tell the user what's going on.
Your task, if you want to claim the bounty, is to:
1- Add some UI sugar so that the user can choose to set the appropriate bits (or not), and any other "features" needed to enable hardware write-protect, via the command line
2- Ensure the necessary bits and features can be set for a specified set of chips (see below), so Flashrom supports hardware write protect for at least all of the listed chips, and
3- Get your patch accepted and merged (it may be wise to first check with the maintainers that they are willing to add this feature) using Gerrit or the mailing list as per the official process
If $100 isn't enough to make this attractive, I am open to increasing the bounty. I am also happy to escrow it if need be. Payment will be in Bitcoin.
Hello!
Thanks for flashrom!
Had a question about using "JTAG-lock-pick Tiny 2" (https://distortec.com/jtag-lock-pick-tiny-2/) as flashrom programmer. It is a FT232H based openocd jtag programmer so I figured I could use it like so:
$ flashrom -p ft2232_spi:type=232H -r dump.rom$ flashrom -p ft2232_spi:type=232H -w bios.rom
But the PID is not the standard FT232H of 0x6014 so I adjusted the 232H PID value in ft2232_spi.c to match: 0x6014 --> 0x8220. Then re-compiled and now flashrom seems to recognize the device. But still not able to read any spi eeproms.
Would be great to get any input on how I could make this work or things I could try.
ThanksVivek
I have a PC Engines apu2d4 running NetBSD 8 (amd64), and would like to
update coreboot/etc. on it. I searched the list (perhaps not well) and
didn't find any reports of success, although I realize things are
generally expected to work so success might well go unreported.
I am using flashrom 1.1 as built from pkgsrc.
I was able to read the existing bios without issues as:
flashrom --programmer internal -r 20200301-readflash.rom
Before I try to write, I am wondering if anyone has successfully done an
apu2 bios update with flashrom under NetBSD 8 amd64?
(I have a debricking adaptor (spi1a) and will prepare a Linux flashing
image on USB before trying myself, whether I not a get a report of
success.)
Thanks,
Greg
Hi all,
I am trying to flash a WInbond w25q64bv BIOS chip of a Thinkpad L530. I am on Ubuntu 20.04. Using a EEPROM ch341a and I am not able to copy correctly the content of the chip: diff and md5sum return all the time some errors. Trying to erase the chip gives random errors like
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip... FAILED at 0x000b6000! Expected=0xff, Found=0xae, failed byte count from 0x000b6000-0x000b6fff: 0x382
ERASE FAILED!
and so on. When I prompt the internal status I get:
$sudo flashrom -V -p internal
flashrom v1.2 on Linux 5.8.0-45-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org
flashrom was built with libpci 3.6.4, GCC 9.2.1 20200304, little endian
Command line (3 args): flashrom -V -p internal
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing internal programmer
/sys/class/mtd/mtd0 does not exist
No coreboot table found.
Using Internal DMI decoder.
DMI string chassis-type: "Notebook"
Laptop detected via DMI.
DMI string system-manufacturer: "LENOVO"
DMI string system-product-name: "20AWS01V01"
DMI string system-version: "ThinkPad T440p"
DMI string baseboard-manufacturer: "LENOVO"
DMI string baseboard-product-name: "20AWS01V01"
DMI string baseboard-version: "0B98401 PRO"
W836xx enter config mode worked or we were already in config mode. W836xx leave config mode had no effect.
Active config mode, unknown reg 0x20 ID: 00.
Found chipset "Intel QM87" with PCI ID 8086:8c4f.
This chipset is marked as untested. If you are using an up-to-date version
of flashrom *and* were (not) able to successfully update your firmware with it,
then please email a report to flashrom(a)flashrom.org including a verbose (-V) log.
Thank you!
Enabling flash write... Root Complex Register Block address = 0xfed1c000
GCS = 0xc21: BIOS Interface Lock-Down: enabled, Boot BIOS Straps: 0x3 (SPI)
Top Swap: not enabled
0x7fffffff/0x7fffffff FWH IDSEL: 0x0
0x7fffffff/0x7fffffff FWH IDSEL: 0x0
0x7fffffff/0x7fffffff FWH IDSEL: 0x1
0x7fffffff/0x7fffffff FWH IDSEL: 0x1
0x7fffffff/0x7fffffff FWH IDSEL: 0x2
0x7fffffff/0x7fffffff FWH IDSEL: 0x2
0x7fffffff/0x7fffffff FWH IDSEL: 0x3
0x7fffffff/0x7fffffff FWH IDSEL: 0x3
0x7fffffff/0x7fffffff FWH IDSEL: 0x4
0x7fffffff/0x7fffffff FWH IDSEL: 0x5
0x7fffffff/0x7fffffff FWH IDSEL: 0x6
0x7fffffff/0x7fffffff FWH IDSEL: 0x7
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
0x7fffffff/0x7fffffff FWH decode enabled
Maximum FWH chip size: 0x100000 bytes
SPI Read Configuration: prefetching enabled, caching enabled,
BIOS_CNTL = 0x2b: BIOS Lock Enable: enabled, BIOS Write Enable: enabled
Warning: BIOS region SMM protection is enabled!
Warning: Setting Bios Control at 0xdc from 0x2a to 0x09 failed.
New value is 0x2b.
SPIBAR = 0x00007f0d5db92000 + 0x3800
0x04: 0xe008 (HSFS)
HSFS: FDONE=0, FCERR=0, AEL=0, BERASE=1, SCIP=0, FDOPSS=1, FDV=1, FLOCKDN=1
SPI Configuration is locked down.
Reading OPCODES... done
0x06: 0x0000 (HSFC)
HSFC: FGO=0, FCYCLE=0, FDBC=0, SME=0
0x50: 0x00004a4b (FRAP)
BMWAG 0x00, BMRAG 0x00, BRWA 0x4a, BRRA 0x4b
0x54: 0x00000000 FREG0: Flash Descriptor region (0x00000000-0x00000fff) is read-only.
0x58: 0x0bff0500 FREG1: BIOS region (0x00500000-0x00bfffff) is read-write.
0x5C: 0x04ff0003 FREG2: Management Engine region (0x00003000-0x004fffff) is locked.
0x60: 0x00020001 FREG3: Gigabit Ethernet region (0x00001000-0x00002fff) is read-write.
Not all flash regions are freely accessible by flashrom. This is most likely
due to an active ME. Please see https://flashrom.org/ME for details.
0x74: 0x8aaf0800 PR0: Warning: 0x00800000-0x00aaffff is read-only.
0x78: 0x8ab00ab0 PR1: Warning: 0x00ab0000-0x00ab0fff is read-only.
0x7C: 0x8adf0ab1 PR2: Warning: 0x00ab1000-0x00adffff is read-only.
0x80: 0x8bff0b40 PR3: Warning: 0x00b40000-0x00bfffff is read-only.
At least some flash regions are read protected. You have to use a flash
layout and include only accessible regions. For write operations, you'll
additionally need the --noverify-all switch. See manpage for more details.
0x90: 0xc0 (SSFS)
SSFS: SCIP=0, FDONE=0, FCERR=0, AEL=0
0x91: 0xf94000 (SSFC)
SSFC: SCGO=0, ACS=0, SPOP=0, COP=0, DBC=0, SME=0, SCF=1
0x94: 0x0606 (PREOP)
0x96: 0x3f90 (OPTYPE)
0x98: 0x03003505 (OPMENU)
0x9c: 0x9f20d802 (OPMENU+4)
0xa0: 0x00000000 (BBAR)
0xc4: 0x80802025 (LVSCC)
LVSCC: BES=0x1, WG=1, WSR=0, WEWS=0, EO=0x20, VCL=1
0xc8: 0x80000000 (UVSCC)
UVSCC: BES=0x0, WG=0, WSR=0, WEWS=0, EO=0x0
0xd0: 0x50444653 (FPB)
Enabling hardware sequencing due to multiple flash chips detected.
OK.
The following protocols are supported: Programmer-specific.
Probing for Programmer Opaque flash chip, 0 kB: Hardware sequencing reports 2 attached SPI flash chips with a combined density of 12288 kB.
The first partition ranges from 0x000000 to 0x652fff.
In that range are 1619 erase blocks with 4096 B each.
The second partition ranges from 0x653000 to 0xbfffff.
In that range are 1453 erase blocks with 4096 B each.
Found Programmer flash chip "Opaque flash chip" (12288 kB, Programmer-specific) mapped at physical address 0x0000000000000000.
Found Programmer flash chip "Opaque flash chip" (12288 kB, Programmer-specific).
No operations were specified.
Restoring MMIO space at 0x7f0d5db958a0
Restoring PCI config space for 00:1f:0 reg 0xdc
///////////////////////////
$ sudo flashrom -V -p ch341a_spi
flashrom v1.2 on Linux 5.8.0-45-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org
flashrom was built with libpci 3.6.4, GCC 9.2.1 20200304, little endian
Command line (3 args): flashrom -V -p ch341a_spi
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing ch341a_spi programmer
Device revision is 3.0.4
The following protocols are supported: SPI.
......
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) on ch341a_spi.
Chip status register is 0x00.
This chip may contain one-time programmable memory. flashrom 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).
Cheers,
GN
Hello there!
The status is unknown in the latest version of flashrom. I couldn't erase
the chip with any of the cha341a or internal (SB600) programmers. Probe and
read are working.
The logs for normal and debug mode for write operation are attached. The
verbose log is 92MB.
Regards
Flashing BIOS chip is relatively easy, the end of this article shows
how to do this with a cheap USB CH341A adapter supported by the
opensource flashrom tool -
http://dangerousprototypes.com/docs/Flashing_a_BIOS_chip_with_Bus_Pirate
. However, hardware flashing a EC is more difficult -
http://dangerousprototypes.com/docs/Flashing_KB9012_with_Bus_Pirate -
especially if your EC isn't supported by flashrom. So it's preferable
to update EC by a proprietary UEFI tool if you can't hardware flash
it, but this could be done only if your laptop is already working. If
your laptop reacts to a power button, chances are you don't have to
touch your EC. Before flashing a BIOS image extracted from ASUS update
utility, make sure you cut the correct 4MB (correct offset, looking at
headers, and correct size). And in some cases you may need to populate
some areas with IDs (i.e. MAC address of a laptop's Ethernet
controller). You can learn more platform-specific info by looking them
up online.
On Fri, Mar 19, 2021 at 10:28 AM Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>
> I downloaded from asus. And there is EC firmware update. I extracted. Size is 2MB. Flash chip size is 4MB. Are there some tricks for flashing like this files?
>
> Thanks
> With Best Regards
> Aurimas
>
> Get BlueMail for Android
> On Mar 18, 2021, at 22:06, Mike Banon <mikebdp2(a)gmail.com> wrote:
>>
>> Hi there, 20cm wires is a bit long in my opinion - should be 10cm, but
>> still - if your board is "hungry" - there may be a voltage drop and
>> the resulting voltage level is insufficient for the successful
>> flashing. As for "desoldered & flashed & soldered and nothing happens"
>> - if you're confident your hardware is OK, then there may be an issue
>> with a proprietary BIOS image that you are flashing, and I could only
>> suggest searching for a good BIOS online or trying to extract it from
>> a manufacturer's UEFI update utility if nothing helps.
>>
>>
>> On Thu, Mar 18, 2021 at 7:45 PM Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>>>
>>>
>>> Hallo again. I flashed winbond bios on asus x54h only when desoldered. But when I soldered back, there was nothing. Even light on laptop not lighting. I flashed smaller bios file by adding in begin file difference ( coppied from bricked bios).
>>> Are there some solutions?
>>> Thanks for answer.
>>>
>>> With Best Regards
>>> Aurimas
>>>
>>> Get BlueMail for Android
>>> On Mar 2, 2021, at 18:47, Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>>>>
>>>>
>>>> I wired like schema. Resistors used like resistor divider signal-200 Om-to flash-200 Om-200 Om-GND. Wires are about 20cm. Wp, hold, vcc connected to 3.3v. when connected to external power supply, then flashrom wrote that is promblem with erase read or something. I wired SPI also as default pins (50-53)… and as schema (31-34).
>>>>
>>>> Thanks
>>>>
>>>> With Best Regards
>>>> Aurimas
>>>>
>>>> Get BlueMail for Android
>>>> On Mar 2, 2021, at 18:27, Mike Banon < mikebdp2(a)gmail.com> wrote:
>>>>>
>>>>>
>>>>> BV should also work fine. Please could you describe your flashing
>>>>> setup, length of wires etc.
>>>>>
>>>>> On Sun, Feb 28, 2021 at 10:41 PM Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Hallow,
>>>>>>
>>>>>> Thanks for your work (flashrom). In hardware list there is w25q32, but mine is BV. Flashrom can not detect my chip. Is it not supported or i am doing something wrong? I wired like example in tutorial. I have arduino mega2560.
>>>>>>
>>>>>> What i can do?
>>>>>>
>>>>>> Thanks for help.
>>>>>>
>>>>>>
>>>>>>
>>>>>> With Best Regards
>>>>>>
>>>>>> Aurimas
>>>>>>
>>>>>>
>>>>>>
>>>>>> Get BlueMail for Android
>>>>>>
>>>>>>
>>>>>>
>>>>>> ________________________________
>>>>>>
>>>>>>
>>>>>> flashrom mailing list -- flashrom(a)flashrom.org
>>>>>>
>>>>>> To unsubscribe send an email to flashrom-leave(a)flashrom.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>
--
Best regards, Mike Banon
Open Source Community Manager of 3mdeb - https://3mdeb.com/
Hi there, 20cm wires is a bit long in my opinion - should be 10cm, but
still - if your board is "hungry" - there may be a voltage drop and
the resulting voltage level is insufficient for the successful
flashing. As for "desoldered & flashed & soldered and nothing happens"
- if you're confident your hardware is OK, then there may be an issue
with a proprietary BIOS image that you are flashing, and I could only
suggest searching for a good BIOS online or trying to extract it from
a manufacturer's UEFI update utility if nothing helps.
On Thu, Mar 18, 2021 at 7:45 PM Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>
> Hallo again. I flashed winbond bios on asus x54h only when desoldered. But when I soldered back, there was nothing. Even light on laptop not lighting. I flashed smaller bios file by adding in begin file difference ( coppied from bricked bios).
> Are there some solutions?
> Thanks for answer.
>
> With Best Regards
> Aurimas
>
> Get BlueMail for Android
> On Mar 2, 2021, at 18:47, Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>>
>> I wired like schema. Resistors used like resistor divider signal-200 Om-to flash-200 Om-200 Om-GND. Wires are about 20cm. Wp, hold, vcc connected to 3.3v. when connected to external power supply, then flashrom wrote that is promblem with erase read or something. I wired SPI also as default pins (50-53)… and as schema (31-34).
>>
>> Thanks
>>
>> With Best Regards
>> Aurimas
>>
>> Get BlueMail for Android
>> On Mar 2, 2021, at 18:27, Mike Banon < mikebdp2(a)gmail.com> wrote:
>>>
>>> BV should also work fine. Please could you describe your flashing
>>> setup, length of wires etc.
>>>
>>> On Sun, Feb 28, 2021 at 10:41 PM Aurelijus Gogas <a.a.grigonis(a)gmail.com> wrote:
>>>
>>>
>>>>
>>>>
>>>> Hallow,
>>>>
>>>> Thanks for your work (flashrom). In hardware list there is w25q32, but mine is BV. Flashrom can not detect my chip. Is it not supported or i am doing something wrong? I wired like example in tutorial. I have arduino mega2560.
>>>>
>>>> What i can do?
>>>>
>>>> Thanks for help.
>>>>
>>>>
>>>>
>>>> With Best Regards
>>>>
>>>> Aurimas
>>>>
>>>>
>>>>
>>>> Get BlueMail for Android
>>>>
>>>>
>>>>
>>>> ________________________________
>>>>
>>>> flashrom mailing list -- flashrom(a)flashrom.org
>>>>
>>>> To unsubscribe send an email to flashrom-leave(a)flashrom.org
>>>>
>>>>
>>>>
>>>
>>>
>>>
--
Best regards, Mike Banon
Open Source Community Manager of 3mdeb - https://3mdeb.com/
Hi,
Following the instructions here
https://www.flashrom.org/Board_Testing_HOWTO
I have been able to successfully extract the old ROM and flash a new ROM
image to an Advantech SIMB-M22 motherboard. Follow the request on that
page, I've attached the output of
$ flashrom -p internal -V
and
$ lspci -nnvvxxx
but not
$ superiotool -deV
because that tool isn't available on Debian at the moment. Thanks for the
positive experience!
-Kipp
sudo ./flashrom -p ch341a_spi -w
backup_folder/coreboot_tiano-kip-mrchromebox_20200604.rom
[sudo] šifra za eeepc:
flashrom v1.2-99-gfbb2b25f61 on Linux 5.4.0-65-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip... FAILED at 0x000008f4! Expected=0xff,
Found=0xfe, failed byte count from 0x00000000-0x00000fff: 0x2
ERASE FAILED!
Reading current flash chip contents... done. Looking for another erase function.
FAILED at 0x0000020b! Expected=0xff, Found=0xdf, failed byte count
from 0x00000000-0x00007fff: 0x3
ERASE FAILED!
Reading current flash chip contents... done. Looking for another erase function.
FAILED at 0x0000020b! Expected=0xff, Found=0xdf, failed byte count
from 0x00000000-0x0000ffff: 0x6
ERASE FAILED!
Reading current flash chip contents... done. Looking for another erase function.
FAILED at 0x000005c5! Expected=0xff, Found=0xfd, failed byte count
from 0x00000000-0x007fffff: 0x360
ERASE FAILED!
Reading current flash chip contents... done. Looking for another erase function.
FAILED at 0x000009cd! Expected=0xff, Found=0xfd, failed byte count
from 0x00000000-0x007fffff: 0x37b
ERASE FAILED!
Reading current flash chip contents... done. Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
No usable erase functions left.
FAILED!
Uh oh. Erase/write failed. Checking if anything has changed.
Reading current flash chip contents... done.
Apparently at least some data has changed.
Your flash chip is in an unknown state.
Please report this on IRC at chat.freenode.net (channel #flashrom) or
mail flashrom(a)flashrom.org, thanks!
eeepc@eeepc-1005:~/ressurect$ sudo ./flashrom -p ch341a_spi
[sudo] šifra za eeepc:
flashrom v1.2-99-gfbb2b25f61 on Linux 5.4.0-65-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
No operations were specified.
eeepc@eeepc-1005:~/ressurect$