u-boot-brain/drivers
aaron.williams@caviumnetworks.com 239cb9d904 mtd: cfi_flash: Fix CFI flash driver for 8-bit bus support
This commit is based on that patch from aaron.williams@caviumnetworks.com
with same commit title. pulled the same code changes into current u-boot tree.

http://patchwork.ozlabs.org/patch/140863/
http://lists.denx.de/pipermail/u-boot/2011-April/089606.html

This patch corrects the addresses used when working with Spansion/AMD FLASH chips.
Addressing for 8 and 16 bits is almost identical except in the 16-bit case the
LSB of the address is always 0.  The confusion arose because the addresses
in the datasheet for 16-bit mode are word addresses but this code assumed it was
byte addresses.

I have only been able to test this on our Octeon boards which use either an 8-bit
or 16-bit bus.  I have not tested the case where there's an 8-bit part on a 16-bit
bus.

This patch also adds some delays as suggested by Spansion.

If a part can be both 8 and 16-bits, it forces it to work in 8-bit mode if an
8-bit bus is detected.

Apart from the pulled changes, fixed few minor code cleanups and tested
on 256M29EW, 512M29EW flashes.

Before this fix:
---------------
Bank # 1: CFI conformant flash (8 x 8)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0xFF, Device ID: 0xFF
  Erase timeout: 4096 ms, write timeout: 2 ms
  Buffer write timeout: 5 ms, buffer size: 1024 bytes

After this fix:
--------------
Bank # 1: CFI conformant flash (8 x 8)  Size: 64 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0x89, Device ID: 0x7E2301
  Erase timeout: 4096 ms, write timeout: 2 ms
  Buffer write timeout: 5 ms, buffer size: 1024 bytes

Signed-off-by: Aaron Williams <aaron.williams@caviumnetworks.com>
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Tested-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
2013-04-02 14:27:45 +02:00
..
bios_emulator Add abs() macro to return absolute value 2012-05-15 08:31:37 +02:00
block mvsata_ide.c: Correction of typo in comments 2013-03-11 17:00:28 -04:00
bootcount Consolidate bootcount code into drivers/bootcount 2012-09-01 14:26:02 +02:00
dfu dfu: Add a partition type target 2013-03-16 21:12:01 +01:00
dma mxs: dma: Fix APBH DMA driver for MX23 2013-01-28 11:43:00 +01:00
fpga FPGA: Cyclon II: Correctly reset the FPGA before configuration 2012-10-29 14:21:20 -07:00
gpio Merge u-boot/master into u-boot-ti/master 2013-03-11 12:16:13 -04:00
hwmon hwmon: do not init sensors on startup 2011-08-04 23:30:38 +02:00
i2c Merge branch 'master' of git://git.denx.de/u-boot-arm 2013-03-18 14:37:18 -04:00
input ppc: Move mpc5xxx clocks to arch_global_data 2013-02-04 09:05:43 -05:00
misc Merge remote-tracking branch 'u-boot/master' into u-boot-arm-merged 2012-12-19 13:02:36 -08:00
mmc Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master' 2013-03-26 09:51:09 +01:00
mtd mtd: cfi_flash: Fix CFI flash driver for 8-bit bus support 2013-04-02 14:27:45 +02:00
net am33xx: Add required includes to some omap/am33xx code 2013-03-24 12:49:11 -04:00
pci powerpc/p4080ds: fix PCI-e x8 link training down failure 2012-11-27 18:28:07 -06:00
pcmcia PXA: Remove PXA PCMCIA support 2012-03-26 23:09:23 +02:00
power Exynos5: TMU: Add hardware tripping 2013-03-12 17:07:31 +09:00
qe ppc: Move CONFIG_QE to arch_global_data 2013-02-04 09:05:42 -05:00
rtc ppc: Remove PCIPPC2 and PCIPPC6 boards 2013-03-11 17:00:28 -04:00
serial ns16550: enable quirks for ti814x 2013-03-24 12:49:12 -04:00
sound Sound: Support for MAX98095 codec in driver 2013-03-08 22:34:18 +09:00
spi Merge branch 'u-boot/master' into 'u-boot-arm/master' 2013-03-28 18:50:01 +01:00
tpm Introduce generic TPM support in u-boot 2011-12-07 08:45:51 +01:00
twserial Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
usb Merge branch 'master' of git://git.denx.de/u-boot-usb 2013-03-18 15:33:47 -04:00
video video: bcm2835: fix build issues 2013-03-29 14:29:39 +01:00
watchdog mx31/mx35/mx51/mx53/mx6: add watchdog 2013-01-13 11:39:57 +01:00