New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 635241 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

flashrom: Enable write protect by FMAP section name

Project Member Reported by hungte@chromium.org, Aug 6 2016

Issue description

Currently when factory is going to enable write protection, we have to do dump_fmap to get offset & size.

However, it is very often that partners or developers may want to try write protection, and it seems no very trivial for them to find dump_fmap with scripts to set right WP range.

Since flashrom already understands FMAP and has the -i syntax, I wonder if it'll be much easier to allow enabling WP according to FMAP section, say:

 flashrom --wp-range WP_RO

or
 
 flashrom --wp-fmap WP_RO
 
Status: Started (was: Untriaged)
Hey Hung-Te,
I had a bit of time to look into this and the patch actually came out fairly simple: https://chromium-review.googlesource.com/383966

In the current patch it's implemented as a separate option, --wp-layout-range (I'm open to suggestions for name). We might be able to overload --wp-range to accept either format (start & length or region name), but that may depend on getopt_long() behavior.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/e8c9d1a07ecdf7e09814e2a5962eec9623710f91

commit e8c9d1a07ecdf7e09814e2a5962eec9623710f91
Author: David Hendricks <dhendrix@chromium.org>
Date: Sat Oct 29 03:11:52 2016

Add fmap regions to internal layout earlier

This makes flashrom search for an fmap and add its regions earlier.
The follow-up patch introduces a command-line option which depends
on this behavior.

BUG= chromium:635241 
BRANCH=none
TEST=tested with follow-up patch

Change-Id: I763f4dcdd5ab6d947ad59776931f42d31c2a253c
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/405109

[modify] https://crrev.com/e8c9d1a07ecdf7e09814e2a5962eec9623710f91/flash.h
[modify] https://crrev.com/e8c9d1a07ecdf7e09814e2a5962eec9623710f91/cli_mfg.c
[modify] https://crrev.com/e8c9d1a07ecdf7e09814e2a5962eec9623710f91/flashrom.c

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/flashrom/+/c36685af7ab9976c03f3cc3b389d3ff43959f136

commit c36685af7ab9976c03f3cc3b389d3ff43959f136
Author: David Hendricks <dhendrix@chromium.org>
Date: Tue Sep 13 03:41:05 2016

cli_mfg: Add option to specify write-protect range by region name

This adds a new command-line option, --wp-region, which sets the
write-protect range using a region name instead of a numeric
range and length.

BUG= chromium:635241 
BRANCH=none
TEST=on system with w25q128 (16MB flash), tested --wp-region
using fmap region names (SI_DESC covering 0-4k and WP_RO covering
0-4M) as well as using layout regions (e.g. "-i layout.txt
--wp-region region0").

Change-Id: I6a3087053f655ef0337d018baefc9d222df658d2
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/383966

[modify] https://crrev.com/c36685af7ab9976c03f3cc3b389d3ff43959f136/layout.h
[modify] https://crrev.com/c36685af7ab9976c03f3cc3b389d3ff43959f136/layout.c
[modify] https://crrev.com/c36685af7ab9976c03f3cc3b389d3ff43959f136/cli_mfg.c

Cc: hungte@chromium.org dchan@chromium.org
Relevant doc to follow-up with: https://docs.google.com/document/d/10bJhjHeqENNdJVAl9scf_c6xBrthk2ru9PchgDEzeiw/edit#heading=h.kcogqanht8m8

Comment 5 by hungte@chromium.org, Nov 23 2016

Status: Fixed (was: Started)
cool, thanks!

I'll try to migrate factory code to use the new syntax in future.

Comment 6 by dchan@google.com, Mar 4 2017

Labels: VerifyIn-58

Comment 7 by dchan@google.com, Apr 17 2017

Labels: VerifyIn-59

Comment 8 by dchan@google.com, May 30 2017

Labels: VerifyIn-60

Comment 9 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 10 by dchan@chromium.org, Oct 14 2017

Status: Archived (was: Fixed)
Status: Verified (was: Archived)

Sign in to add a comment