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).
TEST=Tested the following cases on Tegra2 Seaboard. Compiled successfully and tested on x86.
% flashrom -V | grep Found
% 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)
Review URL: http://codereview.chromium.org/6731011
6 files changed