Nikolai Artemiev uploaded patch set #4 to this change.

View Change

[RFC] writeprotect: add range decoding functions

This patch adds a pointer to `struct flashchip` for a function that maps
`struct wp_chip_state` to a `struct wp_range`. This provides the ability
to determine what protection ranges will be activated by particular
status register values.

The patch also implements a range decoding function for the example
chips. Many other chips can also be handled by it, though some will
require new additional functions (e.g. MX25L6406).

Another approach that has been tried in cros flashrom is to maintain
tables of range data for each chip, but it is very error prone and
quickly becomes hard to validate. Using functions to interpret the
ranges allows compact encoding for most chips and is flexible enough to
handle chips without predictable ranges as well.

BUG=b:195381327,b:153800563
TEST=dumped range tables, checked against datasheets
BRANCH=none

Change-Id: Id163ed80938a946a502ed116e48e8236e36eb203
Signed-off-by: Nikolai Artemiev <nartemiev@google.com>
---
M Makefile
M chipdrivers.h
M flash.h
M flashchips.c
M meson.build
M writeprotect.c
A writeprotect_ranges.c
7 files changed, 111 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/80/58480/4

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id163ed80938a946a502ed116e48e8236e36eb203
Gerrit-Change-Number: 58480
Gerrit-PatchSet: 4
Gerrit-Owner: Nikolai Artemiev <nartemiev@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: newpatchset