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

Issue 6731011: Add Tegra2 SPI controller. (Closed)

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

Description

Add Tegra2 SPI controller. Co-worked with David Hendrix (dhendrix@) to finalize this difficult tasks. The credits of porting to ARM platform go to Stefan (reinauer@). Original code comes from u-boot, and is adapted to flashrom call model. The main change is fixing the endian issue (refer to next4Bytes(), for multiple bytes write/read in one GO). Another is we move UART disable in spi_init() so that there is no delay between every CS activate. We get quite good results (see TEST field below). Change-Id: Ica523803491c270059584695b3cff0cb68234425 R=dhendrix@chromium.org BUG=chrome-os-partner:2825 TEST=Tested the following cases on Tegra2 Seaboard. Compiled successfully and tested on x86. % flashrom -V | grep Found W25Q16 ... % flashrom --wp-status % flashrom --wp-range 0x100000 0x100000 % flashrom --wp-range 0 0 % flashrom --wp-enable % flashrom --wp-disable % flashrom -r /tmp/flash (it takes 5.6 secs, w/o fmap search) % flashrom -w /tmp/diff_content (it takes 32.6 secs, w/o fmap search) % flashrom -E (it takes 20.8 secs, w/o fmap search) Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=bc351d0

Patch Set 1 #

Patch Set 2 : fix endian problem and enable multi-byte write #

Patch Set 3 : refine comments #

Total comments: 44

Patch Set 4 : disable UART at chip init. combine Tx/Rx in one transaction if possible. refine comments. #

Patch Set 5 : david has clean up lots of files. thanks. #

Patch Set 6 : make x86 compilation happy. #

Patch Set 7 : remove duplicate changes #

Patch Set 8 : add a new line #

Patch Set 9 : recovery comment in physmap.c #

Patch Set 10 : refine according to code review. #

Total comments: 26

Patch Set 11 : upload per code review #

Patch Set 12 : remove an empty line. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+581 lines, -0 lines) Patch
M Makefile View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M processor_enable.c View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +48 lines, -0 lines 0 comments Download
M programmer.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -0 lines 0 comments Download
M spi.c View 1 chunk +8 lines, -0 lines 0 comments Download
A tegra2_spi.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +81 lines, -0 lines 0 comments Download
A tegra2_spi.c View 1 2 3 4 5 6 7 8 9 10 1 chunk +427 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
Louis
9 years, 9 months ago (2011-03-24 01:38:12 UTC) #1
Louis
9 years, 9 months ago (2011-03-24 13:27:29 UTC) #2
dhendrix
I am still reviewing the stuff in tegra2_spi.c, but I have a few comments to ...
9 years, 9 months ago (2011-03-25 02:08:06 UTC) #3
Olof Johansson
I don't understand why you've chosen to re-implement the driver in userspace when there's already ...
9 years, 9 months ago (2011-03-25 04:08:38 UTC) #4
yjlou
Good question. Many applications use flashrom on x86 platform, for example, firmware updater, HWQual and ...
9 years, 9 months ago (2011-03-25 04:21:45 UTC) #5
Louis
9 years, 9 months ago (2011-03-25 04:24:02 UTC) #6
dhendrix
mostly cosmetic nit-picks. overall, good stuff! http://codereview.chromium.org/6731011/diff/3001/physmap.c File physmap.c (right): http://codereview.chromium.org/6731011/diff/3001/physmap.c#newcode523 physmap.c:523: /* MSRs do ...
9 years, 9 months ago (2011-03-25 04:34:43 UTC) #7
dhendrix
On 2011/03/25 04:08:38, Olof Johansson wrote: > I don't understand why you've chosen to re-implement ...
9 years, 9 months ago (2011-03-25 04:41:53 UTC) #8
Louis
David, thanks for the detailed review. I've changed my code according to your comments, and ...
9 years, 9 months ago (2011-03-25 10:55:48 UTC) #9
Stefan Reinauer
On 2011/03/25 04:08:38, Olof Johansson wrote: > I don't understand why you've chosen to re-implement ...
9 years, 9 months ago (2011-03-25 16:56:07 UTC) #10
Stefan Reinauer
Old comments. forgot to publish. Mostly obsolete now I guess http://codereview.chromium.org/6731011/diff/3001/Makefile File Makefile (right): http://codereview.chromium.org/6731011/diff/3001/Makefile#newcode120 ...
9 years, 9 months ago (2011-03-25 16:57:47 UTC) #11
Stefan Reinauer
some dead code that remained from the early attempts. http://codereview.chromium.org/6731011/diff/7004/tegra2_spi.h File tegra2_spi.h (right): http://codereview.chromium.org/6731011/diff/7004/tegra2_spi.h#newcode56 tegra2_spi.h:56: ...
9 years, 9 months ago (2011-03-25 17:01:17 UTC) #12
sjg
Hi, We should get a clear statement of why this user space program is re-implementing ...
9 years, 9 months ago (2011-03-25 17:20:44 UTC) #13
Stefan Reinauer
http://codereview.chromium.org/6731011/diff/7004/tegra2_spi.c File tegra2_spi.c (right): http://codereview.chromium.org/6731011/diff/7004/tegra2_spi.c#newcode411 tegra2_spi.c:411: spi_init(); It seems spi_init() could just be rolled into ...
9 years, 9 months ago (2011-03-25 17:22:03 UTC) #14
Stefan Reinauer
On 2011/03/25 17:20:44, sjg wrote: > Hi, > > We should get a clear statement ...
9 years, 9 months ago (2011-03-25 17:24:38 UTC) #15
sjg
On 2011/03/25 17:24:38, Stefan Reinauer wrote: > On 2011/03/25 17:20:44, sjg wrote: > > Hi, ...
9 years, 9 months ago (2011-03-25 17:29:07 UTC) #16
Stefan Reinauer
On 2011/03/25 17:20:44, sjg wrote: > We should get a clear statement of why this ...
9 years, 9 months ago (2011-03-25 17:34:06 UTC) #17
sjg
On 2011/03/25 17:34:06, Stefan Reinauer wrote: > On 2011/03/25 17:20:44, sjg wrote: > > We ...
9 years, 9 months ago (2011-03-25 18:00:55 UTC) #18
robotboy
I've managed to get this to write U-Boot to SPI on Kaen, but only with ...
9 years, 9 months ago (2011-03-25 22:15:56 UTC) #19
Stefan Reinauer
On 2011/03/25 22:15:56, robotboy wrote: > I've managed to get this to write U-Boot to ...
9 years, 9 months ago (2011-03-25 22:17:08 UTC) #20
dhendrix
On 2011/03/25 22:17:08, Stefan Reinauer wrote: > On 2011/03/25 22:15:56, robotboy wrote: > > I've ...
9 years, 9 months ago (2011-03-25 22:32:43 UTC) #21
dhendrix
LGTM, by the way :-) Bonus: We've already had a few successful trials. n 2011/03/25 ...
9 years, 9 months ago (2011-03-26 06:47:32 UTC) #22
Micah C
A few drive-by comments about readability and questions about constant delays. http://codereview.chromium.org/6731011/diff/7004/processor_enable.c File processor_enable.c (right): ...
9 years, 9 months ago (2011-03-28 02:08:22 UTC) #23
dhendrix
http://codereview.chromium.org/6731011/diff/7004/processor_enable.c File processor_enable.c (right): http://codereview.chromium.org/6731011/diff/7004/processor_enable.c#newcode134 processor_enable.c:134: msg_pinfo("Detected NVIDIA Tegra 2.\n"); On 2011/03/28 02:08:22, Micah C ...
9 years, 9 months ago (2011-03-28 05:06:05 UTC) #24
Louis
Replied Stefan's old comments. All are submitted by other CLs. http://codereview.chromium.org/6731011/diff/3001/Makefile File Makefile (right): http://codereview.chromium.org/6731011/diff/3001/Makefile#newcode120 ...
9 years, 9 months ago (2011-03-29 07:55:02 UTC) #25
Louis
For the reason using flashrom, the most important thing is we want most of clients ...
9 years, 9 months ago (2011-03-29 08:22:54 UTC) #26
robotboy1
I think the question was more about why flashrom implemented a driver in user space ...
9 years, 9 months ago (2011-03-29 15:40:28 UTC) #27
dhendrix
I think we've beaten this horse dead enough and should submit the code as-is and ...
9 years, 9 months ago (2011-03-29 18:24:02 UTC) #28
sjg
On 2011/03/29 18:24:02, dhendrix wrote: > I think we've beaten this horse dead enough and ...
9 years, 9 months ago (2011-03-29 18:45:44 UTC) #29
dhendrix
On 2011/03/29 18:45:44, sjg wrote: > On 2011/03/29 18:24:02, dhendrix wrote: > > I think ...
9 years, 9 months ago (2011-03-29 19:45:09 UTC) #30
Louis
Thanks everyone's reviews. I should have gone through all your comments and updated the code ...
9 years, 8 months ago (2011-03-30 10:15:39 UTC) #31
Micah C
LGTM On 2011/03/30 10:15:39, Louis wrote: > Thanks everyone's reviews. I should have gone through ...
9 years, 8 months ago (2011-03-30 23:26:53 UTC) #32
Stefan Reinauer
9 years, 8 months ago (2011-03-31 00:13:37 UTC) #33
LGTM

Powered by Google App Engine
This is Rietveld 408576698