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.
Reading and writing to this chip worked, did several test with writing and read and compare using files system tools.
Thanks for your great work!
---
Write Log:
me@iMac % flashrom --programmer ch341a_spi -w O.rom
flashrom v1.2 on Darwin 20.6.0 (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK.
Found Eon flash chip "EN25F10" (128 kB, SPI) on ch341a_spi.
===
This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom(a)flashrom.org if any of the above operations
work correctly for you with this flash chip. Please include the flashrom log
file for all operations you tested (see the man page for details), and mention
which mainboard or programmer you tested in the subject line.
Thanks for your help!
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.
me@iMac %
Read Log:
me@iMac % flashrom --programmer ch341a_spi -r A.rom
flashrom v1.2 on Darwin 20.6.0 (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK.
Found Eon flash chip "EN25F10" (128 kB, SPI) on ch341a_spi.
===
This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom(a)flashrom.org if any of the above operations
work correctly for you with this flash chip. Please include the flashrom log
file for all operations you tested (see the man page for details), and mention
which mainboard or programmer you tested in the subject line.
Thanks for your help!
Reading flash... done.
me@iMac %
Hi Flashrom Team,
Please help me with my bios chip. I am getting an error when I reprogram my
bios chip using flashrom. I have already tried using different versions of
AsProgrammer and CH341 Mini Programmer but still unable to verify the new
rom. My Chip is an 8 pin and is removable (W25Q64BVAIG).
You may refer to the command below. I hope you can help me.
C:\Users\SKyFlaKes™\Downloads\Compressed\flashrom>flashrom
flashrom v1.2-50-gc19aa5e on Windows 6.2 (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) on ch341a_spi.
No operations were specified.
C:\Users\SKyFlaKes™\Downloads\Compressed\flashrom>flashrom -w
MAXIMUS-IV-GENE-Z-GEN3-ASUS-3603.ROM
flashrom v1.2-50-gc19aa5e on Windows 6.2 (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... FAILED at 0x00180004! Expected=0x00, Found=0x08, failed
byte count from 0x00000000-0x007fffff: 0xf364
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!
Thank you!
I'm trying to libreboot my r500 thinkpad but can't do a consistent read.
I've librebooted many T500s without issue.
bug at libreboot
https://notabug.org/libreboot/lbmk/issues/30
Issue is with flashrom though. Perhaps something about this chip in
particular? Any ideas moving forward?
Best regards,
--
CAEE B377 FC82 BAF9 102C D22F C5CE D003 1AA8 E281
Spenser Truex https://equwal.com
Hi there!
Downloading a tarball off website and trying to verify
signature. Can you point me towards the public key or fingerprint?
Thank you!
--
Aleks Ozolins
m:973.464.5242
aleks(a)aleksozolins.com
https://www.aleksozolins.com
Good day,
I tried calling your offline line yesterday, and earlier today, but
couldn't get through. Please can you kindly check our attached request
for an urgent quote of your products.
We are a bit behind schedule on our delivery time and would appreciate
it if you can treat this quotation request with priority. Hoping to hear
from you soon.
Kind regards,
Natalia
Natalia Chernenko | Supply Chain Analyst
Lasante Vital SA
1st Km Markopoulou-Kalyvion , Kalivia ,Attica
GR 19010 Greece , tel : +30 290 451 111
Fax: +30 229ewr0 61 443
Hi,
I've tried to make the Distortec JTAG-lock-pick Tiny 2[1][2] work with
flashrom and for some reason it always read the same thing.
Back in April there was also a thread about it[0], but not much details
were shared about the setup, so since I tried things, I also took the
occasion to try to share them here.
The JTAG-lock-pick Tiny 2 connector is similar to the one of the Olimex
ARM-USB-TINY that is described in the wiki[3].
Even if the connector is the same, there are some differences between
both hardware designs:
- On the JTAG-lock-pick Tiny 2, VREF and VTARGET are connected
together according to its schematics that are in its manual[4].
- Users are supposed to connect a reference voltage to any of these two
pins (VREF and VTARGET).
- The pins 17 and 19 are not connected (NC) at all.
- The JTAG-lock-pick Tiny 2 uses an FTD232HL chip (among with other
chips like a CPLD and some chips to isolate the target device from
it).
I've made the following patch to try to use it:
diff --git a/ft2232_spi.c b/ft2232_spi.c
index e32d7f81..d986e0a2 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -38,6 +38,7 @@
#define FTDI_FT2232H_PID 0x6010
#define FTDI_FT4232H_PID 0x6011
#define FTDI_FT232H_PID 0x6014
+#define DISTORTEC_JTAG_LOCK_PICK_TINY_2_PID 0x8220
#define TIAO_TUMPA_PID 0x8a98
#define TIAO_TUMPA_LITE_PID 0x8a99
#define AMONTEC_JTAGKEY_PID 0xCFF8
@@ -66,6 +67,7 @@ static const struct dev_entry devs_ft2232spi[] = {
{FTDI_VID, TIAO_TUMPA_PID, OK, "TIAO", "USB Multi-Protocol Adapter"},
{FTDI_VID, TIAO_TUMPA_LITE_PID, OK, "TIAO", "USB Multi-Protocol Adapter Lite"},
{FTDI_VID, AMONTEC_JTAGKEY_PID, OK, "Amontec", "JTAGkey"},
+ {FTDI_VID, DISTORTEC_JTAG_LOCK_PICK_TINY_2_PID, OK, "Distortec", "JTAG-lock-pick"},
{GOEPEL_VID, GOEPEL_PICOTAP_PID, OK, "GOEPEL", "PicoTAP"},
{GOOGLE_VID, GOOGLE_SERVO_PID, OK, "Google", "Servo"},
{GOOGLE_VID, GOOGLE_SERVO_V2_PID0, OK, "Google", "Servo V2 Legacy"},
@@ -350,6 +352,13 @@ static int ft2232_spi_init(void)
ft2232_vid = GOEPEL_VID;
ft2232_type = GOEPEL_PICOTAP_PID;
channel_count = 2;
+ } else if (!strcasecmp(arg, "JTAG-lock-pick")) {
+ ft2232_type = DISTORTEC_JTAG_LOCK_PICK_TINY_2_PID;
+ /* It contains an FTD232HL chip. Its datasheet has
+ * "FT232H SINGLE CHANNEL HI-SPEED USB TO MULTIPURPOSE
+ * UART/FIFO IC"
+ */
+ channel_count = 1;
} else if (!strcasecmp(arg, "tumpa")) {
/* Interface A is SPI1, B is SPI2. */
ft2232_type = TIAO_TUMPA_PID;
I've connected it in the same way described in the wiki for the Olimex
ARM-USB-TINY[3], with wires that are about 10 centimeters, and I've
provided 3.3v on VREF/VTARGET. When doing that flashrom always reads
0xff:
> ./flashrom -p ft2232_spi:type=JTAG-lock-pick,divisor=131072 --verbose
> [...]
> Probing for Sanyo unknown Sanyo SPI chip, 0 kB: RDID byte 0
> parity violation. compare_id: id1 0xff, id2 0xffff
> Probing for Winbond unknown Winbond (ex Nexcom) SPI chip, 0 kB: RDID
> byte 0 parity violation. compare_id: id1 0xff, id2 0xffff
> Probing for Generic Variable Size SPI chip, 64 kB: Probing for Generic
> unknown SPI chip (RDID), 0 kB: RDID byte 0 parity violation.
> compare_id: id1 0xff, id2 0xffff
> Probing for Generic unknown SPI chip (REMS), 0 kB: compare_id:
> id1 0xff, id2 0xff
> No EEPROM/flash device found.
> Note: flashrom can never write if the flash chip isn't found
> automatically.
> Releasing I/Os
If instead I remove the power source, flashrom always reads zeros
(0x00) instead of ones (0xff).
If I go to about 1volt, flashrom still reads 0xff.
That device is also supported by openocd and there I managed to use it
to reprogram a microcontroller through SWD.
With the same connection, on an openmoko debug board (connecting the
3.3v source to VTARGET), I get the following result:
> ./flashrom -p ft2232_spi:type=openmoko,divisor=131072 --verbose
> Probing for Winbond unknown Winbond (ex Nexcom) SPI chip, 0 kB:
> compare_id: id1 0xef, id2 0x4017
> Probing for Generic Variable Size SPI chip, 64 kB:
> Probing for Generic unknown SPI chip (RDID), 0 kB:
> compare_id: id1 0xef, id2 0x4017
> Probing for Generic unknown SPI chip (REMS), 0 kB:
> compare_id: id1 0xef, id2 0x16
> Found Winbond flash chip "W25Q64.V" (8192 kB, SPI).
> 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).
> No operations were specified.
> Releasing I/Os
So something is probably wrong somewhere.
Note that in the distribution I use (Parabola i686), the FT232H support
seems to be supported in libftdi as when running make in the flashrom
source directory I have:
> Checking for FTDI support... found.
> Checking for FT232H support in libftdi... found.
I wonder if there is some easy way to make the JTAG-lock-pick Tiny 2
work, as it is quite small and it also does JTAG and SWD, and it'd
probably be more reliable than the Arduino that I use at 3.3v (which
also needs a 3.3v power source to run at 3.3v).
References:
-----------
[0]https://www.mail-archive.com/flashrom@flashrom.org/msg14801.html
[1]https://distortec.com/jtag-lock-pick-tiny-2/
[2]https://shop.sysmocom.de/products/jtag-lock-pick-tiny-2
[3]https://www.flashrom.org/FT2232SPI_Programmer#Olimex_ARM-USB-TINY.2F-H_an…
[4]https://distortec.com/download/70/
[5]https://ftdichip.com/products/ft232hl/
[6]https://ftdichip.com/wp-content/uploads/2020/07/DS_FT232H.pdf
[7]https://www.mail-archive.com/flashrom@flashrom.org/msg14801.html
Denis.