Nikolai Artemiev uploaded patch set #5 to this change.

View Change

spi25_statusreg.c: restore SR contents at flashrom exit

register_chip_restore() provides a general mechanism for restoring a chip's state at flashrom exit; it can be used whenever the SR needs to be changed temporarily to perform some operation and changed back after the operation is complete. The only current current use case is in s25f.c, which changes the SR's sector layout bits so that entire flash accessible.

This patch uses the chip restore functionality to reset changes to the status register made by spi_disable_blockprotect_generic(). This is probably the safest approach, as the flash chip will usually be accessed by some external controller that may make unknown assumptions about state of the SR.

Imported from cros flashrom at `b170dd4e1d5c33b169c5`

Change-Id: If2f0e73518d40519b7569f627c90a34c364df47c
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
---
M spi25_statusreg.c
1 file changed, 9 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/78/48778/5

To view, visit change 48778. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If2f0e73518d40519b7569f627c90a34c364df47c
Gerrit-Change-Number: 48778
Gerrit-PatchSet: 5
Gerrit-Owner: Nikolai Artemiev <nartemiev@google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus@gmail.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: newpatchset