u-boot/drivers
Anatolij Gustschin 34bbb8fb46 cfi_flash: fix bug introduced while recent change to flash_get_size()
commit ec50a8e389
"cfi_flash: handle 'chip size exceeds address window' situation"
added 3rd argument to flash_get_size() but didn't fix all the
function calls from the board specific code. Many boards have
their own flash_get_size() definitions in the board code and
use them there, but some boards (e.g. tqm834x, tqm85xx, pdm360ng)
use flash_get_size() from the cfi_flash.c driver.

The bug shows up if the value of the "max_size" argument (which
is not defined when calling the function with two arguments)
happens to be less than "info->size". In this case on the
affected boards we end up with a bank of reduced size and
in the worst case might even be not able to update U-Boot or
to boot the kernel from flash:

=> fli

Bank # 1: CFI conformant FLASH (32 x 16)  Size: 0 kB in 1 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 3 ms, buffer size: 64 bytes

  Sector Start Addresses:
  F0000000   RO

Bank # 2: CFI conformant FLASH (32 x 16)  Size: 128 MB in 512 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 3 ms, buffer size: 64 bytes

  Sector Start Addresses:
  F8000000        F8040000        F8080000        F80C0000        F8100000
  F8140000        F8180000        F81C0000        F8200000        F8240000
  ...

E.g., updating U-Boot is not possible now:

=> protect off ${u-boot_addr} +${u-boot_size}
Error: end address (0xf007ffff) not in flash!
Bad address format
=> era ${u-boot_addr} +${u-boot_size}
Error: end address (0xf007ffff) not in flash!
Bad address format

This patch removes the 3rd argument of flash_get_size() again
and sets "max_size" in the function itself instead of passing
it as a function argument.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2010-11-28 19:41:11 +01:00
..
bios_emulator Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
block Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
dma Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
fpga Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
gpio Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
hwmon Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
i2c Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
input Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
misc Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
mmc mmc: omap: timeout counter fix 2010-11-19 16:27:37 -05:00
mtd cfi_flash: fix bug introduced while recent change to flash_get_size() 2010-11-28 19:41:11 +01:00
net 824x: Cleanup for partial linking and --gc-sections 2010-11-27 23:35:12 +01:00
pci 74xx_7xx: Cleanup for partial linking and --gc-sections 2010-11-27 23:35:12 +01:00
pcmcia Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
power Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
qe Exclude drivers/qe/fdt.c without CONFIG_QE 2010-11-18 15:22:10 +01:00
rtc Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
serial Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
spi Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
twserial Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
usb usb: Remove usb_dev_init() from ehci-ppc4xx.c 2010-11-26 21:24:57 +01:00
video Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00
watchdog Switch from archive libraries to partial linking 2010-11-17 21:02:18 +01:00