Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Issue 6791015: Support variable-size SPI chip for dummy programmer. (Closed)

Created:
9 years, 8 months ago by Louis
Modified:
9 years, 4 months ago
CC:
chromium-os-reviews_chromium.org
Visibility:
Public.

Description

Support variable-size SPI chip for dummy programmer. flashrom -p dummy:emulate=VARIABLE_SIZE,image=image_file,size=4M This is designed for firmware updater to preserve partitions easily. For example, the use case to keep VPDs when upgrading from H2O to H2C. Change-Id: I84e1a793639cc33b769f6db41be0a0f0b1eacc78 R=dhendrix@chromium.org,hungte@chromiumg.org,reinauer@chromium.org BUG=Not a bug TEST=Tested on Z600 and target. # a H2C file is ready to write. % flashrom -r H2O # read existing content from BIOS, including VPDs. % flashrom -p dummy:emulate=VARIABLE_SIZE,image=H2C,size=4M \ -i RO_VPD -i RW_VPD -w H2O # overwrite VPDs from H2O to H2C. % flashrom -w H2C # write it down, with VPDs from H2O. Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=e53fa0f

Patch Set 1 #

Total comments: 12

Patch Set 2 : change name from virtual to variable_size. add an SPI flash for any size. #

Patch Set 3 : fixed multiple chip detected problem on target machine. #

Total comments: 12

Patch Set 4 : refine according to code review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -9 lines) Patch
M chipdrivers.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M dummyflasher.c View 1 2 3 9 chunks +116 lines, -9 lines 0 comments Download
M flashchips.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M flashchips.c View 1 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Louis
9 years, 8 months ago (2011-04-01 16:53:12 UTC) #1
Louis
resend for Hungte's reference. David and Stefan, please kindly review this. Thanks.
9 years, 8 months ago (2011-04-01 16:54:59 UTC) #2
Stefan Reinauer
http://codereview.chromium.org/6791015/diff/1/dummyflasher.c File dummyflasher.c (right): http://codereview.chromium.org/6791015/diff/1/dummyflasher.c#newcode54 dummyflasher.c:54: EMULATE_VIRTUAL, Since this emulates a Winbond, should it be ...
9 years, 8 months ago (2011-04-01 17:47:06 UTC) #3
Louis
Thanks, Stefan. Your feedbacks inspire me another better approach. Will refine my code and send ...
9 years, 8 months ago (2011-04-02 01:48:52 UTC) #4
dhendrix
http://codereview.chromium.org/6791015/diff/1/dummyflasher.c File dummyflasher.c (right): http://codereview.chromium.org/6791015/diff/1/dummyflasher.c#newcode54 dummyflasher.c:54: EMULATE_VIRTUAL, On 2011/04/02 01:48:52, Louis wrote: > My initial ...
9 years, 8 months ago (2011-04-02 23:43:32 UTC) #5
Louis
9 years, 8 months ago (2011-04-06 10:00:55 UTC) #6
Louis
David and Stefan, I've modified code according to your inspiring feedbacks. I also tested it ...
9 years, 8 months ago (2011-04-07 02:28:14 UTC) #7
Stefan Reinauer
... otherwise LGTM http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c File dummyflasher.c (right): http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode38 dummyflasher.c:38: #endif There's another #if EMULATE_CHIP right ...
9 years, 8 months ago (2011-04-07 15:32:42 UTC) #8
Louis
9 years, 8 months ago (2011-04-08 01:40:07 UTC) #9
Stefan, thanks for the review. I've refined my code.

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c
File dummyflasher.c (right):

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode38
dummyflasher.c:38: #endif
On 2011/04/07 15:32:42, Stefan Reinauer wrote:
> There's another #if EMULATE_CHIP right below. Maybe unite them?

Done.

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode131
dummyflasher.c:131: case 'k': case 'K':
On 2011/04/07 15:32:42, Stefan Reinauer wrote:
> wonderful :-)

Done.

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode147
dummyflasher.c:147: #if EMULATE_CHIP
On 2011/04/07 15:32:42, Stefan Reinauer wrote:
> Move this before previous code block, and only check for EMULATE_SPI_CHIP
there?

Done.

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode597
dummyflasher.c:597: if (emu_chip != EMULATE_VARIABLE_SIZE) return 0;
On 2011/04/07 15:32:42, Stefan Reinauer wrote:
> put return 0 on next line?

Done.

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode599
dummyflasher.c:599: flash->total_size = emu_chip_size / 1024;
On 2011/04/07 15:32:42, Stefan Reinauer wrote:
> maybe warn if (emu_chip_size % 1024) != 0 ? 

Done.

http://codereview.chromium.org/6791015/diff/9001/dummyflasher.c#newcode604
dummyflasher.c:604: for (i = 0; i < NUM_ERASEFUNCTIONS; i++) {
On 2011/04/07 15:32:42, Stefan Reinauer wrote:
> This will break eventually, once upstream turns the flashchip structure to
> read-only. Despite plans of that happening, who knows if and when it ever
will.
> So I don't think it's an issue right now.

Done.

Powered by Google App Engine
This is Rietveld 408576698