Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(38)

Issue 2539041: Massive integration with upstream code. This brings us up from r1130 to r1235 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 9 months ago by dhendrix
Modified:
14 years, 7 months ago
Reviewers:
stepan, Stefan Reinauer, reinauer, yjlou, hailfinger
CC:
yjlou
Base URL:
ssh://git@gitrw.chromium.org/flashrom
Visibility:
Public.

Description

Massive integration with upstream code. This brings us up from 1130 to 1235. Most merges trivial (or near-trivial): - Some print statements were adjusted to reduce verbosity. - Partial update logic in flashrom.c changed to use upstream version. - handle_romentries prototype from flash.h updated. - updated chip ID entries in writeprotect.c There is one UI change: UI change: --wp-range on AGZ platform with Nuvoton EC no longer does --wp-enable implicitly. User should specify both --wp-range and --wp-enable using the same command on the CLI. Minor code changes: - Made it so that chip commands (set_wp_*) are not mutually exclusive with each other in cli_mfg.c. This allows us to set a write-protect range and enable write protection simultaneously. This was helpful for wpce775x changes (below). WPCE775x code was completely re-factored to be a programmer instead of a chip. This was required to make it work with the new partial write logic. Here are the wpce775x.c changes: Forward-ported the code to integrate with Flashrom more now that Flashrom has generic core routines for partial updates and such. This has the pleasant side-effect of simplifying the code and allowing us to trivially support a broad range of flash chips. The updated flow is: - internal_init() calls wpce775x_probe_* commands. Probing and WCB setup are done here. EC enters "update" mode (even if EC content is not being changed) - Flashrom chip detect logic issues RDID command. The "flash" struct is determined with the corresponding flash chip.. - When read/write/erase/write protect functions are called, InitFlash() sets up WCB with appropriate chip parameters. - wpce775x_shutdown() exits flash update mode. Summary of wpce775x changes: - Implemented SPI --> WCB translation interface. - Switch over to using Flashrom's built-in partial write logic. - Simplify WPCE775x probe/init routines. Since Flashrom will handle chip detection by using the SPI --> WCB interface, we can remove chip-specific stuff. Also, probe_wpce775x is now known as wpce775x_spi_common_init. - Update all read, write, erase, and write-protect options with the ability to support any SPI chip. This is done by allowing each function to change WCB parameters on-the-fly using InitFlash(). (note: tested two different erase methods by forcing usage of either 4K or 64k erase block sizes) - Remove wp_wpce775x struct; we no longer need it. We will use write protect protect functions are provided for the detected chip (in writeprotect.c). - Make in_flash_update_mode a boolean rather than a counter. When we do write protect changes we need to force the sequence: InitFlash(), EnterFlashUpdate(), ExitFlashUpdateFirmwareNoChange(). Using a counter caused EnterFlashUpdate() and ExitFlashUpdateFirmwareNoChange() to abort prematurely. Tested on: Mario AGZ Alex partial_writes_x86_bios PASS PASS PASS partial_writes_ec PASS* PASS N/A wp-range (bios) PASS PASS FAIL** wp-range (ec) PASS PASS*** N/A wp-toggle (bios) PASS PASS FAIL** wp-toggle (ec) PASS PASS*** get-size (bios) PASS PASS FAIL** get-size (ec) PASS PASS N/A * - Tested on prototype hardware due to too small EC firmware ROM size of PVT machine. ** - Got weird bash error (probably due to "untested chip" spew). Will fix in follow-up. *** - Can't test with script (due to EC not supporting "read status register" command), tested with Dediprog Highlights from upstream include: r1232: Reversible PCI config space write functions (rpci_* functions) which automatically add a shutdown callback to "undo" changes. r1226, r1227: Improved Dediprog SF100 support r1224: Use "real partial writes" for all chips. r1223: Fix semantics of layout. r1220 and r1218: Added SPI flash chip emulator and torture script, which ought to greatly improve testing. r1217: Fix internal offset calculation for SPI byte program and AAI program, allowing us to start at non-zero offsets. r1215: Always read chip before writing, and skip erase/writing of blocks that do not need to change. r1211: Switch all chips to use partial write. r1208: Refactor all write functions to use the form: int write(struct flashchip *flash, uint8_t *src, int start, int len); r1206: Kill programmer/chip specific erase functions, call erase from generic code instead. r1201: Add polling for completion of SPI write status register operation r1193: On-the-fly reprogramming of ICH SPI opcode table r1181, r1186: Improved DOS support r1172: Add a delay to allow chips to exit ID mode before proceding with other operations. r1171: Improved SPI bitbanging support r1170: Honor ICH SPI addres window for reads r1147, r1148, r1149, r1150: Add FEATURE_WRSR_WREN to feature_bits for Eon, Amic, Macronix, and Winbond SPI chips.

Patch Set 1 #

Patch Set 2 : updated chip IDs and write_wpce775x signature #

Patch Set 3 : update the testing status of w25q80, add some reviewers to CL #

Patch Set 4 : add stefan to reviewers #

Total comments: 20

Patch Set 5 : bring us up to r1222, see CL description for more details #

Patch Set 6 : Move the final "SUCCESS/FAILURE" message so it's always displayed. #

Patch Set 7 : Update to r1232 #

Patch Set 8 : Bring us up to r1235 #

Patch Set 9 : Re-factoring of wpce775x to use generic partial write and write protect logic. #

Total comments: 5

Patch Set 10 : Moved SUCCESS/FAILED message to cli_mfg() to avoid duplicate messages from writeprotect stuff. #

Patch Set 11 : init rc=0 in cli_mfg() and fix verbosity of a print statement in writeprotect.c #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4868 lines, -2448 lines) Patch
M 82802ab.c View 2 chunks +9 lines, -47 lines 0 comments Download
M Makefile View 7 chunks +27 lines, -13 lines 0 comments Download
M README View 3 chunks +23 lines, -6 lines 0 comments Download
M atahpt.c View 1 2 3 4 5 6 4 chunks +3 lines, -10 lines 0 comments Download
M bitbang_spi.c View 5 chunks +46 lines, -3 lines 0 comments Download
M board_enable.c View 1 2 3 4 47 chunks +493 lines, -277 lines 0 comments Download
M buspirate_spi.c View 4 chunks +21 lines, -1 line 0 comments Download
M cbtable.c View 1 2 3 4 4 chunks +3 lines, -4 lines 0 comments Download
M chipdrivers.h View 1 5 chunks +11 lines, -21 lines 0 comments Download
M chipset_enable.c View 1 2 3 4 5 6 7 33 chunks +79 lines, -54 lines 0 comments Download
M cli_classic.c View 4 chunks +7 lines, -31 lines 0 comments Download
M cli_mfg.c View 9 10 3 chunks +23 lines, -10 lines 0 comments Download
M dediprog.c View 7 12 chunks +207 lines, -26 lines 0 comments Download
M dmi.c View 1 2 3 4 3 chunks +46 lines, -12 lines 0 comments Download
M drkaiser.c View 2 chunks +2 lines, -3 lines 0 comments Download
M dummyflasher.c View 1 2 3 4 5 6 6 chunks +366 lines, -18 lines 0 comments Download
M flash.h View 1 2 3 4 5 6 7 8 6 chunks +12 lines, -7 lines 0 comments Download
M flashchips.h View 8 chunks +401 lines, -340 lines 0 comments Download
M flashchips.c View 1 2 3 4 5 6 7 8 219 chunks +519 lines, -358 lines 0 comments Download
M flashrom.8 View 1 2 3 4 5 6 8 chunks +86 lines, -23 lines 0 comments Download
M flashrom.c View 1 2 3 4 5 6 7 8 9 27 chunks +448 lines, -189 lines 0 comments Download
M ft2232_spi.c View 1 2 3 4 5 6 13 chunks +47 lines, -26 lines 0 comments Download
M gfxnvidia.c View 1 2 3 4 5 6 3 chunks +4 lines, -9 lines 0 comments Download
M hwaccess.h View 4 chunks +12 lines, -2 lines 0 comments Download
M hwaccess.c View 2 chunks +4 lines, -2 lines 0 comments Download
M ichspi.c View 1 2 3 4 5 chunks +82 lines, -21 lines 0 comments Download
M internal.c View 1 2 3 4 5 6 7 8 5 chunks +7 lines, -3 lines 0 comments Download
M it87spi.c View 1 2 3 4 3 chunks +21 lines, -18 lines 0 comments Download
M jedec.c View 1 2 3 4 6 chunks +83 lines, -74 lines 0 comments Download
M layout.c View 1 2 3 4 5 6 7 8 4 chunks +48 lines, -81 lines 0 comments Download
M m29f400bt.c View 3 chunks +11 lines, -75 lines 0 comments Download
M mcp6x_spi.c View 6 chunks +29 lines, -47 lines 0 comments Download
A nicintel_spi.c View 1 chunk +181 lines, -0 lines 0 comments Download
M nicnatsemi.c View 2 chunks +4 lines, -4 lines 0 comments Download
M pcidev.c View 1 2 3 4 5 6 4 chunks +78 lines, -6 lines 0 comments Download
M physmap.c View 11 chunks +59 lines, -14 lines 0 comments Download
M print.c View 1 2 3 4 9 chunks +177 lines, -76 lines 0 comments Download
M print_wiki.c View 2 chunks +4 lines, -1 line 0 comments Download
M processor_enable.c View 1 chunk +51 lines, -0 lines 0 comments Download
M programmer.h View 1 2 3 4 5 6 7 8 12 chunks +50 lines, -8 lines 0 comments Download
M rayer_spi.c View 3 chunks +56 lines, -34 lines 0 comments Download
M satasii.c View 1 chunk +1 line, -1 line 0 comments Download
M sb600spi.c View 8 chunks +92 lines, -7 lines 0 comments Download
M serial.c View 4 chunks +9 lines, -5 lines 0 comments Download
M serprog.c View 1 chunk +0 lines, -1 line 0 comments Download
M sharplhf00l04.c View 4 chunks +3 lines, -27 lines 0 comments Download
M spi.h View 1 chunk +1 line, -0 lines 0 comments Download
M spi.c View 1 2 3 4 5 6 7 8 9 chunks +42 lines, -24 lines 0 comments Download
M spi25.c View 1 2 3 4 5 6 7 8 10 chunks +71 lines, -31 lines 0 comments Download
M sst28sf040.c View 6 chunks +17 lines, -38 lines 0 comments Download
M sst49lfxxxc.c View 2 chunks +1 line, -30 lines 0 comments Download
M stm50flw0x0x.c View 3 chunks +3 lines, -7 lines 0 comments Download
M udelay.c View 1 2 3 4 2 chunks +14 lines, -0 lines 0 comments Download
A util/flashrom_partial_write_test.sh View 1 chunk +293 lines, -0 lines 0 comments Download
M wpce775x.c View 2 3 4 5 6 7 8 9 chunks +465 lines, -302 lines 0 comments Download
M writeprotect.c View 2 3 4 5 6 7 8 9 10 6 chunks +16 lines, -21 lines 0 comments Download

Messages

Total messages: 22
dhendrix
14 years, 9 months ago (2010-10-16 01:29:48 UTC) #1
dhendrix
14 years, 9 months ago (2010-10-16 01:30:43 UTC) #2
Stefan Reinauer
LGTM. Added some comments, but I think they should be handled upstream by Carl-Daniel. http://codereview.appspot.com/2539041/diff/52/README ...
14 years, 9 months ago (2010-10-19 17:10:38 UTC) #3
yjlou
LGTM for write_protect.c and wpce775.c For other merges, I guess they are okay as long ...
14 years, 9 months ago (2010-10-20 08:32:08 UTC) #4
dhendrix
On 2010/10/20 08:32:08, yjlou wrote: > LGTM for write_protect.c and wpce775.c > > For other ...
14 years, 9 months ago (2010-10-20 22:10:17 UTC) #5
yjlou
Thank you for your understanding, David. On Thu, Oct 21, 2010 at 6:10 AM, <dhendrix@chromium.org> ...
14 years, 9 months ago (2010-10-22 11:35:17 UTC) #6
yjlou
Since the image for factory has done now. We can push this. Thanks, David. :-)
14 years, 8 months ago (2010-11-01 03:54:25 UTC) #7
dhendrix
On 2010/11/01 03:54:25, yjlou wrote: > Since the image for factory has done now. We ...
14 years, 8 months ago (2010-11-01 23:10:06 UTC) #8
yjlou
Ya ~ testing is definitely needed. By the way, if there is any argument changed, ...
14 years, 8 months ago (2010-11-02 01:20:19 UTC) #9
hailfinger
On 2010/11/02 01:20:19, yjlou wrote: > if there is any argument > changed, please let ...
14 years, 8 months ago (2010-11-08 21:15:39 UTC) #10
hailfinger
http://codereview.appspot.com/2539041/diff/52/internal.c File internal.c (right): http://codereview.appspot.com/2539041/diff/52/internal.c#newcode121 internal.c:121: #if __FLASHROM_LITTLE_ENDIAN__ This #ifdef just removes the ret variable ...
14 years, 8 months ago (2010-11-08 21:21:32 UTC) #11
hailfinger
http://codereview.appspot.com/2539041/diff/52/m29f400bt.c File m29f400bt.c (right): http://codereview.appspot.com/2539041/diff/52/m29f400bt.c#newcode30 m29f400bt.c:30: /* chunksize is 1 */ On 2010/10/19 17:10:39, reinauer ...
14 years, 8 months ago (2010-11-08 21:24:37 UTC) #12
hailfinger
http://codereview.appspot.com/2539041/diff/52/physmap.c File physmap.c (right): http://codereview.appspot.com/2539041/diff/52/physmap.c#newcode141 physmap.c:141: /* The short form of ?: is a GNU ...
14 years, 8 months ago (2010-11-08 21:25:54 UTC) #13
hailfinger
http://codereview.appspot.com/2539041/diff/52/print.c File print.c (right): http://codereview.appspot.com/2539041/diff/52/print.c#newcode245 print.c:245: programmer_table[PROGRAMMER_NIC3COM].name); On 2010/10/19 17:10:39, reinauer wrote: > odd... lots ...
14 years, 8 months ago (2010-11-08 21:31:37 UTC) #14
hailfinger
http://codereview.appspot.com/2539041/diff/52/sharplhf00l04.c File sharplhf00l04.c (right): http://codereview.appspot.com/2539041/diff/52/sharplhf00l04.c#newcode26 sharplhf00l04.c:26: * FIXME: This file is unused. On 2010/10/19 17:10:39, ...
14 years, 8 months ago (2010-11-08 21:33:34 UTC) #15
hailfinger
http://codereview.appspot.com/2539041/diff/52/stm50flw0x0x.c File stm50flw0x0x.c (right): http://codereview.appspot.com/2539041/diff/52/stm50flw0x0x.c#newcode96 stm50flw0x0x.c:96: /* This function is unused. */ On 2010/10/19 17:10:39, ...
14 years, 8 months ago (2010-11-08 21:34:57 UTC) #16
hailfinger
Looks good to me.
14 years, 8 months ago (2010-11-09 22:49:25 UTC) #17
dhendrix
Hi guys, I updated this patch late last night with much focus on forward-porting wpce775x. ...
14 years, 7 months ago (2010-12-09 20:59:19 UTC) #18
Stefan Reinauer
LGTM
14 years, 7 months ago (2010-12-09 21:17:56 UTC) #19
yjlou
LGTM. Thanks for doing this that brings us a better flashrom. This is really important ...
14 years, 7 months ago (2010-12-10 00:18:20 UTC) #20
dhendrix
Thanks, Louis! I unified the printing of SUCCESS/FAILED. Before, that message was printed by various ...
14 years, 7 months ago (2010-12-10 00:43:01 UTC) #21
dhendrix
14 years, 7 months ago (2010-12-10 00:44:08 UTC) #22

          
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b