forked from flashrom/flashrom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I0f5a8f760660eae77e97c8b1a5c7dcf3dc6ba61d Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
- Loading branch information
Showing
3 changed files
with
410 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
# Flashrom WP test report | ||
|
||
## Intro | ||
|
||
* Chip name as read from the hardware chip itself: `MX25L3206E` | ||
* Chip name as detected in flashrom: `"MX25L3206E/MX25L3208E"` | ||
* [RTE](https://docs.dasharo.com/transparent-validation/rte/introduction/) was | ||
used as an external programmer and to control the WP pin state via software | ||
- any other programmer could be used there instead | ||
* [flash.sh](flash.sh) script was used as a wrapper for flashrom commands - | ||
please refer there if you need to take a look at the full flashrom commands | ||
|
||
![MX25L3206E.png](MX25L3206E.png) | ||
|
||
## Flashrom version | ||
|
||
```shell | ||
root@rte:~# flashrom --version | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
``` | ||
|
||
## Chip detection | ||
|
||
```shell | ||
root@rte:~# ./flash.sh probe | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Probing ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
No operations were specified. | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
|
||
## WP status | ||
|
||
```shell | ||
root@rte:~# ./flash.sh wp-status | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Checking WP status ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Protection range: start=0x00000000 length=0x00000000 (none) | ||
Protection mode: disabled | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
|
||
## WP list | ||
|
||
```shell | ||
root@rte:~# ./flash.sh wp-list | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Checking WP list ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Available protection ranges: | ||
start=0x00000000 length=0x00000000 (none) | ||
start=0x003f0000 length=0x00010000 (upper 1/64) | ||
start=0x003e0000 length=0x00020000 (upper 1/32) | ||
start=0x003c0000 length=0x00040000 (upper 1/16) | ||
start=0x00380000 length=0x00080000 (upper 1/8) | ||
start=0x00300000 length=0x00100000 (upper 1/4) | ||
start=0x00000000 length=0x00200000 (lower 1/2) | ||
start=0x00200000 length=0x00200000 (upper 1/2) | ||
start=0x00000000 length=0x00300000 (lower 3/4) | ||
start=0x00000000 length=0x00380000 (lower 7/8) | ||
start=0x00000000 length=0x003c0000 (lower 15/16) | ||
start=0x00000000 length=0x003e0000 (lower 31/32) | ||
start=0x00000000 length=0x003f0000 (lower 63/64) | ||
start=0x00000000 length=0x00400000 (all) | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
|
||
## WP enable | ||
|
||
* Set region `0,0x00400000` (whole chip) and enable protection: | ||
|
||
```shell | ||
root@rte:~# ./flash.sh wp-enable | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Setting WP region ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Activated protection range: start=0x00000000 length=0x00400000 (all) | ||
Enabling WP region ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Enabled hardware protection | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
|
||
* Check the status after locking: | ||
|
||
```shell | ||
root@rte:~# ./flash.sh wp-status | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Checking WP status ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Protection range: start=0x00000000 length=0x00400000 (all) | ||
Protection mode: hardware | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
|
||
* We can see that the `protection range` was set as desired | ||
|
||
* We can see that the `protection mode` was changed to `hardware` | ||
|
||
## Test WP protection | ||
|
||
* Drive the WP pin LOW: | ||
|
||
```shell | ||
root@rte:~# ./flash.sh wp-low | ||
Setting WP pin LOW ... | ||
``` | ||
|
||
* Try erasing: | ||
|
||
```shell | ||
root@rte:~# ./flash.sh erase | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Erasing chip ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Unsetting lock bit(s) failed. | ||
|
||
WARNING!: Updating only part of the image might render your device unusable if old and | ||
new parts are not compatible! | ||
|
||
If you think you know what you're doing, pass --skip-wp-area to exclude | ||
protected part of the flash from the operation. | ||
Your flash chip is in an unknown state. | ||
Please report this to the mailing list at flashrom@flashrom.org or | ||
on IRC (see https://www.flashrom.org/Contact for details), thanks! | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
## Disable WP protection | ||
* Set region `0,0` and disable protection (with WP pin still being LOW): | ||
```shell | ||
root@rte:~# ./flash.sh wp-disable | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Disabling WP protection ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Failed to apply new WP settings: unexpected WP configuration read back from chip | ||
Note: hardware status register protection is enabled. The chip's WP# pin must be set to an inactive voltage level to be able to change the WP settings. | ||
Clearing WP region ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
|
||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
W | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Failed to apply new WP settings: unexpected WP configuration read back from chip | ||
Note: hardware status register protection is enabled. The chip's WP# pin must be set to an inactive voltage level to be able to change the WP settings. | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
* The protection cannot be disabled by software as long as the WP pin is LOW | ||
* Drive the WP pin HIGH: | ||
```shell | ||
root@rte:~# ./flash.sh wp-high | ||
Setting WP pin HIGH ... | ||
``` | ||
* Set region `0,0` and disable protection (with WP pin HIGH already): | ||
```shell | ||
root@rte:~# ./flash.sh wp-disable | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Disabling WP protection ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Disabled hardware protection | ||
Clearing WP region ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Activated protection range: start=0x00000000 length=0x00000000 (none) | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
* Check the `wp-status` again: | ||
```shell | ||
root@rte:~# ./flash.sh wp-status | ||
set SPI Vcc to 3.3V | ||
SPI lines ON | ||
SPI Vcc ON | ||
Checking WP status ... | ||
flashrom v1.2-880-gd047111 on Linux 5.4.69 (armv7l) | ||
flashrom is free software, get the source code at https://flashrom.org | ||
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). | ||
Found Macronix flash chip "MX25L3206E/MX25L3208E" (4096 kB, SPI) on linux_spi. | ||
Protection range: start=0x00000000 length=0x00000000 (none) | ||
Protection mode: disabled | ||
SPI Vcc OFF | ||
SPI lines OFF | ||
``` | ||
* We can see that the `protection range` was set as desired | ||
* We can see that the `protection mode` was changed to `disabled` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.