cfi: Check for blank before erase

Added an optional check in the CFI driver to evaluate if the sector is
already blank before issuing an erase command.  Improves erase time by
over a factor of 10 if already blank.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Stefan Roese <sr@denx.de>
cfi: Make the flash erase and write operations abortable

Check for ctrlc() in operations that take time and loop over the flash
addresses.

In netconsole, tstc() is expensive.  Only check once in a while to not
slow down the operation significantly.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Stefan Roese <sr@denx.de>
ppc4xx: Canyonlands/Glacier: Squeeze NAND image a bit to fit again

This patch removes some superfluous SDRAM init calls to fit the
NAND_SPL image into 4k again.

Signed-off-by: Stefan Roese <sr@denx.de>
ubifs: Fix memory leak in ubifs_finddir

This patch fixes a memory leak in ubifs_finddir().

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: dev.ma.dma@gmail.com
edminiv2: orion5x: fix GPIO inits and values

Orion5x did not actually write GPIO output values
or input polarities, and ED Mini V2 had bad or
missing values for GPIO settings.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Acked-By: Prafulla Wadaskar <prafulla@marvell.com>
km/arm: set SPI NOR Flash default parameters

These parameters are used by the the sf probe command that are used by
our update script and they therefore need to be set for all of our
boards.

The timing is the same as for the ENV SPI NOR Flash (since it's the
same physical device) and takes the boco2 delay on the bus into account.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
kw_spi: fix clock prescaler computation

The computation was not correct with low clock values: setting a 1MHz
clock would result in an overlap that would then configure a 25Mhz
clock.

This patch implements a correct computation method according to the
kirkwood functionnal spec. table 600 (Serial Memory Interface
Configuration Register).

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
km/ivm: fix string len check to support 7 char board names

The fanless boards now have a 7-digit (XXXXX-F) board name. This
triggers a border condition when reading this string in the IVM although
this string is smaller than the currenly read string size, but only by 1
character.

This patch corrects this by changing the size check condition for string
length. It is the same change that was done in the platform for this
same bug.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Stefan Bigler <stefan.bigler@keymile.com>
arm/km: fix frequency of the SPI NOR Flash

According to our last HW measures, this could be raised while still
compatible with the potential delays on the lines.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Acked-By: Prafulla Wadaskar <prafulla@marvell.com>
arm/km: remove unused code

For some reasons we had an own implementaion of dram_init and
dram_init_banksize. This is not needed anymore, use the standard
kirkwood functions instead.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-By: Prafulla Wadaskar <prafulla@marvell.com>
Cosmetic doc typo fixes to the kwbimage feature docs

Signed-off-by: Karl O. Pinc <kop@meme.com>
cosmetic: Better explain how to use the kirkwood kwbimage.cfg file.

Hi,

This adds to the documenation to explain how to use the
kwbimage.cfg file necessary to generate an image with
prefixed board setup values necessary for the kirkwood
boards.

Signed-off-by: Karl O. Pinc <kop@meme.com>
lsxl: support power switch

This patch restores the Linkstation's original behaviour when powering off.
Once the (soft) power switch is turned off, linux will reboot and the
bootloader turns off HDD and USB power. Then it loops as long as the switch
is in the off position, before continuing the boot process again.

Additionally, this patch fixes the board function set_led(LED_OFF).

Signed-off-by: Michael Walle <michael@walle.cc>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx

* 'master' of git://git.denx.de/u-boot-ppc4xx:
  ppc4xx: Canyonlands/Glacier: Squeeze NAND image a bit to fit again

Signed-off-by: Wolfgang Denk <wd@denx.de>
Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash

* 'master' of git://git.denx.de/u-boot-cfi-flash:
  cfi: Make the flash erase and write operations abortable
  cfi: Check for blank before erase

Signed-off-by: Wolfgang Denk <wd@denx.de>
Merge branch 'master' of git://git.denx.de/u-boot-ubi

* 'master' of git://git.denx.de/u-boot-ubi:
  ubifs: Fix memory leak in ubifs_finddir

Signed-off-by: Wolfgang Denk <wd@denx.de>
eb_cpux9k2: fix chip select

* fix chip select initialization for frame buffer, this will be
  increase frame buffer access speed

Signed-off-by: Jens Scharsig <js_at_ng@scharsoft.de>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
avr32:portmux: fix setup for macb1

Use portd_mask instead of portc_mask to setup the pins for port D.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
net:macb: add line break

Without this patch we see annoying output like this:

---8<---
U-Boot> dhcp
macb1: PHY not foundmacb0: PHY present at 1
macb0: Starting autonegotiation...
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
cc: Joe Hershberger <joe.hershberger@gmail.com>
Merge branch 'master' of git://git.denx.de/u-boot-avr32

* 'master' of git://git.denx.de/u-boot-avr32:
  net:macb: add line break
  avr32:portmux: fix setup for macb1
  avr32: Remove redundant LDSCRIPT definition

Signed-off-by: Wolfgang Denk <wd@denx.de>