Commit Graph

592 Commits

Author SHA1 Message Date
Benoît Thébaudeau
365b2c0761 mxc nand: cosmectic: Light cleanup
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 19:42:46 -05:00
Benoît Thébaudeau
80c8ab7b25 mxc nand: Merge mtd and spl register definitions
This patches fixes the TODO to use same register definitions in mtd mxc_nand and
nand_spl fsl nfc drivers.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 19:42:46 -05:00
Marek Vasut
9c790a748f mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver
This is based on Linux kernel -next:

commit 14f44abf1dafc20ba42ce8616a8fc8fbd1b3712b
Author: Brian Norris <computersforpeace@gmail.com>
Date:   Fri Jul 13 09:28:24 2012 -0700

    mtd: nand: allow NAND_NO_SUBPAGE_WRITE to be set from driver

    The NAND_CHIPOPTIONS_MSK has limited utility and is causing real bugs. It
    silently masks off at least one flag that might be set by the driver
    (NAND_NO_SUBPAGE_WRITE). This breaks the GPMI NAND driver and possibly
    others.

    Really, as long as driver writers exercise a small amount of care with
    NAND_* options, this mask is not necessary at all; it was only here to
    prevent certain options from accidentally being set by the driver. But the
    original thought turns out to be a bad idea occasionally. Thus, kill it.

    Note, this patch fixes some major gpmi-nand breakage.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 18:54:43 -05:00
Joe Hershberger
e70bfa2986 nand: Make NAND lock status compatible with Micron
Micron NAND flash (e.g. MT29F4G08ABADAH4) BLOCK LOCK READ STATUS is not
the same as others.  Instead of bit 1 being lock, it is #lock_tight.
To make the driver support either format, ignore bit 1 and use only
bit 0 and bit 2.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 17:33:43 -05:00
Joe Hershberger
33b1d5cae3 nand: consolidate duplicated constants
NAND_CMD_ constants for lock/unlock should be in the header

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 17:33:42 -05:00
Joe Hershberger
e331ab2ee9 nand: Change ulong to loff_t and size_t
Missed in previous cleanup.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 17:33:42 -05:00
Joe Hershberger
eee623a504 nand: Add support for unlock.invert
NAND unlock command allows an invert bit to be set to unlock all but
the selected page range.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
[scottwood@freescale.com: updated docs and added comment about invert bit]
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 17:32:10 -05:00
Matthieu CASTET
d62e9caaaf mtd: support ONFI multi lun NAND
With onfi a flash is organized into one or more logical units (LUNs).
A logical unit (LUN) is the minimum unit that can independently execute
commands and report status.

Mtd does not exploit LUN, so make it see a big single flash where size is
lun_size * number_of_lun.

Without this patch MT29F8G08ADBDAH4 size is 512MiB instead of 1GiB.

Artem: split long line on 2 shorter ones.

This is commit 637957551c0ac80de8dfc7650d320c5a98c2c0c0 from Linux

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
Acked-by: Florian Fainelli <ffainelli@freebox.fr>
Signed-off-by:  Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
[scottwood@freescale.com: picked from Linux into U-Boot]
Reported-by: Rafael Beims <rafael.beims@gmail.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 16:17:28 -05:00
Bo Shen
83fd09a049 spiflash: at25: using common spi flash operation
Using common spi flash operation function to replace private operation
funtion

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-17 19:00:31 +02:00
Bo Shen
053a4d1f5d spi: add atmel at25df321 serial flash support
Add atmel at25df321 serial flash support

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-17 18:50:47 +02:00
Wu, Josh
b9c83c6815 atmel_nand: fix the U-Boot output information about nand flash with PMECC enable.
Before the patch, it looks like:
	|U-Boot 2012.07-00441-gd578d6f-dirty (Sep 10 2012 - 16:11:06)
	|
	|CPU: AT91SAM9G35
	|Crystal frequency:       12 MHz
	|CPU clock        :      400 MHz
	|Master clock     :  133.333 MHz
	|DRAM:  128 MiB
	|WARNING: Caches not enabled
>	|NAND:  Initialize PMECC params, cap: 2, sector: 512
>	|256 MiB
	|MMC:   mci: 0
	|In:    serial
	|Out:   serial
	|Err:   serial
	|Net:   macb0
	|Hit any key to stop autoboot:  0

After the patch:
	|U-Boot 2012.07-00441-gd578d6f-dirty (Sep 10 2012 - 16:18:11)
	|
	|CPU: AT91SAM9G35
	|Crystal frequency:       12 MHz
	|CPU clock        :      400 MHz
	|Master clock     :  133.333 MHz
	|DRAM:  128 MiB
	|WARNING: Caches not enabled
>	|NAND:  256 MiB
	|	... ...
	|Hit any key to stop autoboot:  0

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-13 14:28:13 +02:00
Tom Warren
651eb73224 NAND: MXS: include common.h first so cache.h is included in correct order
With Simon Glass's include/nand.h alignment changes, some mxs builds
were generating errors. Fix is to ensure asm/cache.h is included before
linux/mtd/nand.h. Moving common.h to top of include list does that.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
2012-09-10 15:31:11 -07:00
Jim Lin
312693c3dd tegra: nand: Add Tegra NAND driver
A device tree is used to configure the NAND, including memory
timings and block/pages sizes.

If this node is not present or is disabled, then NAND will not
be initialized.

Signed-off-by: Jim Lin <jilin@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-09-07 13:54:31 -07:00
Simon Glass
b572595ee9 nand: Try to align the default buffers
The NAND layer needs to use cache-aligned buffers by default. Towards this
goal. align the default buffers and their members according to the minimum
DMA alignment defined for the architecture.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Acked-by: Scott Wood <scottwood@freescale.com>
2012-09-07 13:54:30 -07:00
Joe Hershberger
de15a06aad 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>
2012-09-03 11:24:27 +02:00
Joe Hershberger
6822a647b9 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>
2012-09-03 11:24:27 +02:00
Wu, Josh
bdfd59aa0f at91: atmel_nand: Update driver to support Programmable Multibit ECC controller
The Programmable Multibit ECC (PMECC) controller is a programmable binary
BCH(Bose, Chaudhuri and Hocquenghem) encoder and decoder. This controller
can be used to support both SLC and MLC NAND Flash devices. It supports to
generate ECC to correct 2, 4, 8, 12 or 24 bits of error per sector of data.

To use PMECC in this driver, the user needs to set the PMECC correction
capability, the sector size and ROM lookup table offsets in board config file.

This driver is ported from Linux kernel atmel_nand PMECC patch. The main difference
is in this version it uses registers structure access hardware instead of using macros.
It is tested in 9x5 serial boards.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
[rebase]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-01 17:06:14 +02:00
Wu, Josh
ae79794e54 at91: atmel_nand: remove unused variables.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-01 17:06:14 +02:00
Wu, Josh
fe2185ea80 at91: atmel_nand: extract HWECC initialization code into one function: atmel_hw_nand_init_param().
This patch
1. extract the hwecc initialization code into one function. It is a preparation for adding atmel PMECC support.
2. enable CONFIG_SYS_NAND_SELF_INIT. Which make us can configurate the ecc parameters between nand_scan_ident() and nand_scan_tail().

Signed-off-by: Josh Wu <josh.wu@atmel.com>
[fix empty newline at EOF error and move return value check into ifdef]
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-01 17:06:14 +02:00
Otavio Salvador
fa7a51cb82 mxs: Convert sys_proto.h prefixes to 'mxs'
The sys_proto.h functions (except the boot modes) are compatible with
i.MX233 and i.MX28 so we use 'mxs' prefix for its methods.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-09-01 14:58:25 +02:00
Jeroen Hofstee
d43950463c arm: omap: Fix switching back to nandecc sw.
Orjan Friberg wrote at [1]:

"For the beagleboard, ecc.size is not explicitly set when doing 'nandecc
sw'. If it's not set for the NAND_ECC_SOFT case in nand_scan_tail, it's
set to 256 bytes.

When doing 'nandecc hw', ecc.size is set to 512 bytes. Hence, when
changing back to 'nandecc sw' ecc.size remains at 512 bytes and suddenly
the format has changed."

No patch has been submitted and the issue was still present. This patch
adds the mentioned solution. Tested on a tam3517 board.

[1] http://lists.denx.de/pipermail/u-boot/2012-February/119002.html

cc: Orjan Friberg <of@flatfrog.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
2012-09-01 14:58:19 +02:00
Otavio Salvador
9c471142bc mxs: prefix register structs with 'mxs' prefix
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-09-01 14:58:17 +02:00
Wolfgang Denk
c51261e8db Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
* 'sf' of git://git.denx.de/u-boot-blackfin:
  sf: spansion: Add support for S25FL256S
  sf: winbond: fix page_size
  sf: stmicro: add support for N25Q128A
  sf: stmicro: add support N25Q128 parts
  sf: stmicro: support JEDEC standard two-byte signature
  sf: winbond: add W25Q32
  cmd_spi: remove superfluous semicolon

Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-09-01 12:22:31 +02:00
Michal Simek
4a4cb4e111 sf: spansion: Add support for S25FL256S
Add support for Spansion S25FL256S SPI flash.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-14 11:45:50 -04:00
Stephen Warren
c75942c7b7 sf: winbond: fix page_size
Commit a4ed3b6 "sf: inline data constants" modified winbond.c's page_size
from 256 to 4096. This prevents either/both of "sf write" writing the
correct data, or "sf read" from reading the correct data back.

This allows U-Boot running on Compulab Tegra to upgrade itself.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-14 11:34:30 -04:00
Holger Brunck
81316a902a mtd/cfi_flash: fix write problems for Numonyx P33/30 32 MBit flashs
commit 54652991
Work around bug in Numonyx P33/P30 256-Mbit 65nm flash chips

fixes a problem for Numonyx P33/P30 flashes for 256-Mbit, but this leads
to problems for smaller versions of this chip e.g. the 32Mbit version
with deviceid 0x16 on mgcoge. So move the code for this work around to
an own function and check previously manufacturer id and device id to
not break other flashes which don't need this work around.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Stefan Roese <sr@denx.de>
cc: Philippe De Muyter <phdm@macqel.be>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-08-13 14:34:44 +02:00
Anatolij Gustschin
66863b0538 cfi_flash: add support for Spansion flash PPB sector protection
Erasing flash sectors protected with persistent protection bit (PPB)
mechanism on Spansion flash chips doesn't work. Add sector protection
status checking and sector lock and unlock commands to fix this.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-08-13 14:34:35 +02:00
Michal Simek
d945ce9704 sf: stmicro: add support for N25Q128A
Add support for Numonyx N25Q128A SPI flash.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-10 11:31:04 -04:00
Stephan Linz
6ad6c6dc1e sf: stmicro: add support N25Q128 parts
Adds support for Numonyx's N25Q128 SPI flash. These devices
are used on (among others) Avnet Spartan-6 LX9 micro-evaluation
boards. Tested with "sf" commands and CONFIG_ENV_IS_IN_SPI_FLASH.

Signed-off-by: Stephan Linz <linz@li-pro.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-09 20:41:54 -04:00
Stephan Linz
63ff6a66ae sf: stmicro: support JEDEC standard two-byte signature
There are more than the M25Pxx serial flashs that can be
used with the stmicro driver, for example: the M25PXxx or
N25Qxx serie. All these chips have burned in the original
stmicro manufacture id 0x20 together with a standard
two-byte signature.

In preperation to support all these chips the stmicro driver
have to decode the full two-byte signature.

Signed-off-by: Stephan Linz <linz@li-pro.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-09 20:41:54 -04:00
Rajeshwari Shinde
c969abc470 sf: winbond: add W25Q32
SMDK EVT1  has a different Winbond part, added its part details
to the SPI flash table.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-09 20:41:54 -04:00
Jérôme Carretero
b54d1f26ff sf: stmicro: add geometrical info for N25Q256 from Micron
Note: because 4-byte addressing is not supported yet,
at the moment only the first 16MiB of the device are available.

Signed-off-by: Jérôme Carretero <cJ@zougloub.eu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-08 10:55:55 +00:00
Mike Frysinger
41e1713425 sf: unify status register writing (and thus block unlocking)
The only two drivers to write the status register do it in the same
way, so unify the implementations.  This also makes the block unlock
logic the same.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-04 23:18:17 -05:00
Mike Frysinger
7a6d2a7ec1 sf: sst: inline duplicate write enable helper funcs
The local sst enable/disable write funcs don't really add anything
over the common API, so just inline the common calls directly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-04 23:12:23 -05:00
Mike Frysinger
04a3e90eaf sf: eon: drop duplicate id
Looks like Shaohui Xie's patch got merged twice.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-04 23:08:37 -05:00
Mike Frysinger
c4e932ce73 sf: unify erase commands
Analysis of the flash drivers shows that they all use 0x20 if the erase
size is 4KiB, or 0xd8 if it's larger.  So with this info in hand, we can
unify all the erase functionality in one place.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-04 22:35:50 -05:00
Mike Frysinger
a4ed3b6531 sf: inline data constants
I imagine much of these constants are due to copy & pasting previous
drivers rather than an actual reflection of the hardware layout.  At
any rate, inline the info that we don't care about externally as it
shrinks things nicely.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-03-04 22:56:52 -05:00
Mike Frysinger
7d72b80a90 sf: spansion: inline useless id defines
No need for dedicated defines when these really only get used once.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-07-20 00:41:36 -04:00
Mike Frysinger
b4c87d658c sf: drop unused/duplicate command defines
In an effort to unify the spi flash drivers further, drop all the
unused and/or duplicate command defines.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-07-20 00:41:36 -04:00
Stefan Roese
185b3b76a6 MTD: SPEAr SMI: Add write support for length < 4 bytes
Needed for redundant environment for example.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Amit Virdi <amit.virdi@st.com>
Cc: Vipin Kumar <vipin.kumar@st.com>
2012-07-07 14:07:44 +02:00
Armando Visconti
9264077635 st_smi: Fixed page size for Winbond W25Q128FV flash
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Amit Virdi
b5992fac88 st_smi: Change timeout loop implementation
There are two problems in the current timeout loop implementation:
1. In case initial test failing, there will always be a delay of 1 ms
2. The delay duration is not tunable

The new implementation addresses both these limitations.

Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Armando Visconti
cf9026deb8 st_smi: Fix bug in flash_print_info()
If the flash size was smaller than 1MB then flash_print_info()
was erroneously reporting 0 MB.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Armando Visconti
6d6d23c143 st_smi: Change the flash probing method
THis patch introduces a new methodology for flash probing
in which flash_devices[] table, looked-up thru the dev_id, is
used to locate the flash geometry and information.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Armando Visconti
ae3e0cc924 st_smi: Removed no needed dependency on ST_M25Pxx_ID
Since the smi erase code is very generic and works for any kind
of flash, there is no need to test for ST_M25Pxx_ID flash types
like m25p40 flashes).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Vipin Kumar
a5ad7ccd74 st_smi: Fix smi read status
smi_read_sr fails sometimes because of TFF not getting set within assumed time.
This condition may arise because of, for example, smi memory being in a erase
mode.

This fix is to enable reading the status register until timeout.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Shiraz Hashim
a59c7b37b9 st_smi: Move status register read before modifying ctrl register
Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:39 +02:00
Vipin KUMAR
0befe7d7a3 st_smi: Read status until timeout happens
SMI driver read status fails because the control register could not be
overwritten. Instead, the read status should be tried until timeout.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:38 +02:00
Amit Virdi
69fcb55f71 st_smi: Enhance the error handling
This commit does the following:
 - Reports error if SNOR flash is not found on the board
 - Changes smi_read_sr to return error using which a retry mechanism is
   implemented for reading flash status

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:38 +02:00
Amit Virdi
5c16c54124 st_smi: Return error in case TFF is not set
Curently the code makes wrong assumption that the Transfer finished flag shall
be set within the stipulated time. However, there may occur a scenario in which
the TFF flag is not set. Return error in that case.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:38 +02:00
Vipin KUMAR
f3fcf92d59 st_smi: Add support for SPEAr SMI driver
SMI is the serial memory interface controller provided by ST.

Earlier, a driver exists in the u-boot source code for the SMI IP. However, it
was specific to spear platforms. This commit converts the same driver to a more
generic driver. As a result, the driver files are renamed to st_smi.c and
st_smi.h and moved into drivers/mtd folder for reusability by other platforms
using smi controller peripheral.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:38 +02:00
Vipin KUMAR
0def98e7be mtd/NAND: Remove obsolete SPEAr specific NAND drivers
Since, SPEAr platform uses generic FSMC driver now, so spear specific files
drivers/mtd/nand/spr_nand.c, arch/arm/include/asm/arch-spear/spr_nand.h are
removed

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
2012-07-07 14:07:38 +02:00
Vipin KUMAR
7f0730a02e mtd/NAND: Add FSMC driver support
Flexible static memory controller is a peripheral provided by ST,
which controls the access to NAND chips along with many other
memory device chips eg NOR, SRAM.

This patch adds the driver support for FSMC controller interfacing
with NAND memory.

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Scott Wood <scottwood@freescale.com>
2012-07-07 14:07:38 +02:00
Stephen Warren
1edaf094dc sf: winbond: Add support for the Winbond W25Q80BL
This chip is present on the Compulab TrimSlice.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-07-07 14:07:20 +02:00
Wolfgang Denk
8fa3d2b816 Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
* 'master' of git://git.denx.de/u-boot-nand-flash:
  NAND: Remove ONFI detection message to from bootup log
  driver/mtd:IFC: Fix possible memory leak
  driver/mtd: IFC NAND: Add support of ONFI NAND flash
  mtd, nand: move some printfs to debug output.
  nand_util: correct YAFFS image write function
  powerpc/85xx: fix NAND boot linker scripts for -fpic
  nand: extend .raw accesses to work on multiple pages
2012-05-20 22:47:40 +02:00
Stefan Roese
e52fee9b04 NAND: Remove ONFI detection message to from bootup log
Without this patch, boot shows this messages upon NAND detection:

NAND:  ONFI flash detected
ONFI param page 0 valid
ONFI flash detected
ONFI param page 0 valid
128 MiB

With this patch, its back to the U-Boot "standard":

NAND:  128 MiB

Tested on x600 (SPEAr600).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Amit Virdi <amit.virdi@st.com>
Cc: Vipin Kumar <vipin.kumar@st.com>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
2012-05-18 18:17:06 -05:00
Prabhakar Kushwaha
76d067ac33 driver/mtd:IFC: Fix possible memory leak
if priv->bank >= MAX_BANK, priv should be freed before returning ENODEV.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
2012-05-18 18:15:24 -05:00
Prabhakar Kushwaha
807fc702e0 driver/mtd: IFC NAND: Add support of ONFI NAND flash
- Fix NAND_CMD_READID command for ONFI detect.
  - Add NAND_CMD_PARAM command to read the ONFI parameter page.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
2012-05-18 18:13:50 -05:00
Heiko Schocher
a35ea8070c mtd, nand: move some printfs to debug output.
current U-Boot shows on startup (for example on the enbw_cmc
board) the following printfs from the nand subsystem:

Flash: 2 MiB
NAND:  Bad block table found at page 65472, version 0x01
Bad block table found at page 65408, version 0x01
nand_read_bbt: Bad block at 0x000002980000
nand_read_bbt: Bad block at 0x000003240000
128 MiB
MMC:   davinci: 0

remove them to debug output, so it shows with this patch:

Flash: 2 MiB
NAND:  128 MiB
MMC:   davinci: 0

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
2012-05-18 18:11:37 -05:00
Liu, Wentao
65683026a5 nand_util: correct YAFFS image write function
In function nand_write_skip_bad(),for YAFFS filesystem part,
write_oob() will return 0 when success, so when rval equals 0,
it should continue to write the next page, and no break.

Signed-off-by: Wentao, Liu <wentao.liu@intel.com>
Acked-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
2012-05-18 18:08:45 -05:00
Timo Ketola
a1028730b5 imx: nand: Support flash based BBT
Signed-off-by: Timo Ketola <timo@exertus.fi>
Acked-by: Scott Wood <scottwood@freescale.com>
2012-05-15 08:31:33 +02:00
Mike Frysinger
7b15e2bb9b linux/compat.h: rename from linux/mtd/compat.h
This lets us use it in more places than just mtd code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-30 16:54:51 +02:00
Wolfgang Denk
1432c763f8 GCC4.6: Squash warnings in onenand_base.c
Fix gcc 4.6 build warnings:
onenand_base.c: In function 'onenand_probe':
onenand_base.c:2577:6: warning: variable 'maf_id' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
2012-04-21 16:45:35 +02:00
Wolfgang Denk
db39f24151 Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  ARM926EJS: Fix cache.c to comply with checkpatch.pl
  ARM926EJS: Make asm routines volatile in cache ops
  MX35: mx35pdk: wrong board revision
  ARM1136: MX35: Make asm routines volatile in cache ops
  ARM: add u-boot.imx as target for i.MX SOCs
  M28: Pull out CONFIG_APBH_DMA so it's always enabled
  DMA: Split the APBH DMA init into block and channel init
  imx: Return gpio_set_value in gpio_direction_output
  imx: Use GPIO_TO_PORT macro in the gpio driver instead of (gpio >> 5)
  imx: Add GPIO_TO_PORT macro in the mxc_gpio driver
  imx: Remove unneeded/repititive definitions from imx headers
  i.MX28: Allow coexistence of PIO and DMA mode for SD/MMC
  MX31: mx31pdk: drop enable_caches from board file
  i.MX28: Fix initial stack pointer position
  mx35: mx35pdk: fix when cache functions are linked
  mx35: flea3: fix when cache functions are linked
  ARM: 926ejs: use debug() for misaligned addresses
  ARM1136: add cache flush and invalidate operations
  mx6qsabrelite: Fix the serial console port
  mx6qsabrelite: Add boot switch setting information into the README
  i.MX6: mx6qsabrelite: add cache commands if cache is enabled
  i.MX6: implement enable_caches()
  i.MX6: define CACHELINE_SIZE
  MX53: DDR: Fix ZQHWCTRL field TZQ_CS
  mx28evk: Add a README file
  mx28: Split the README into a common part and a m28 specific part
  tricorder: Load kernel from ubifs
  tricorder: Add UBIFS
  cm-t35: fix Ethernet reset timing
  hawkboard: Add CONFIG_SPL_LIBGENERIC_SUPPORT
  BeagleBoard: Remove userbutton command and use gpio command instead
  OMAP: Move omap1510inn to Unmaintained / Orphaned
2012-04-16 23:01:12 +02:00
Marek Vasut
96666a39ae DMA: Split the APBH DMA init into block and channel init
This fixes the issue where mxs_dma_init() was called either twice or never,
without introducing any new init hooks.

The idea is to allow each and every device using the APBH DMA block to
configure and request only the channels it uses, instead of making it call init
for all the channels as is now.

The common DMA block init part, which only configures the block, is then called
from CPUs arch_cpu_init() call.

NOTE: This patch depends on:

	http://patchwork.ozlabs.org/patch/150957/

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
2012-04-16 14:53:59 +02:00
Anatolij Gustschin
b64c2420e0 drivers/mtd/spr_smi.c: Fix build warning
Fix:
spr_smi.c: In function 'smi_write':
spr_smi.c:325:15: warning: variable 'WM' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Vipin Kumar <vipin.kumar@st.com>
2012-04-14 23:03:13 +02:00
Lukasz Majewski
e26fd3d3bf onenand: Replace ONENAND_IS_MLC() with ONENAND_HAS_4KB()
This replacement causes 4KB page size devices to work properly with u-boot.

The old ONENAND_IS_MLC() behavior has been preserved by explicit
setting of ONENAND_HAS_4KB_PAGE for those devices.

This change makes the onenand_base.c file more resembling the respective
kernel sources.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

---
Test HW:
       - Samsung S5PC110 GONI
       - Samsung S5PC210 Universal
2012-04-04 17:08:40 +02:00
Lukasz Majewski
6b3967bbbb onenand:samsung Target dependent OneNAND chip probe function
Separate callback for probing OneNAND memory chip.
If no special function is defined, default implementation will be used.

This approach gives more flexibility for OneNAND device probing.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-04-04 16:27:34 +02:00
Marek Vasut
6b9408edd3 i.MX28: Add cache support to MXS NAND driver
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2012-03-29 07:56:28 +02:00
Stefano Babic
f7dad8f121 NAND: TI: fix warnings in omap_gpmc.c
The following warnings are reported for boards using SOFT ECC.

omap_gpmc.c:33:30: warning: 'hw_nand_oob' defined but not used
omap_gpmc.c:78:13: warning: 'omap_hwecc_init' defined but not used
omap_gpmc.c:116:12: warning: 'omap_correct_data' defined but not used
omap_gpmc.c:182:12: warning: 'omap_calculate_ecc' defined but not used
omap_gpmc.c:208:13: warning: 'omap_enable_hwecc' defined but not used

Signed-off-by: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@ti.com>
Cc: Scott Wood <scottwood@freescale.com>
2012-03-27 22:05:29 +02:00
Tao Hou
85c344e5f9 cfi: fix the incomplete erased status check in buffer write
Without the fix, flash_write_cfibuffer will terminate the erased
status check once an all-0xFF word has been found instead of
continuing the erased status check utill the first non-0xFF word.

Signed-off-by: Tao Hou <hotforest@gmail.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-03-21 16:25:33 +01:00
Prabhakar Kushwaha
5f720b8514 mtd/nand:Fix wrong usage of is_blank() in fsl_ifc_run_command
Freescale IFC NAND Machine calculates ECC on 512byte sector and same is used in
fsl_ifc_run_command() during ECC status verification. Also this sector is passed
to is_blank() for blank checking. It is wrong at first place because
is_blank()'s implementation checks for Page size and OOB area size.
is_blank() should be called per page for main and OOB area verification.

Variables name are redefined to avoid confusion between buffer and ecc sector.

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-02-28 14:03:39 -06:00
Prabhakar Kushwaha
d90361285c mtd/nand: Fix IFC driver to support 2K NAND page
1) OOB area should be updated irrespective of NAND page size. Earlier it was
updated only for 512byte NAND page.

2) During OOB update fbcr should be equal to OOB size.

Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-02-28 14:03:39 -06:00
Scott Wood
fb49454b1b nand: reinstate lazy bad block scanning
commit 2a8e0fc8b3 ("nand: Merge changes
from Linux nand driver") accidentally reverted commit
13f0fd94e3 ("NAND: Scan bad blocks
lazily.").

Reinstate the change, as amended by commit
ff49ea8977 ("NAND: Mark the BBT as scanned
prior to calling scan_bbt.").

Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-02-28 14:03:39 -06:00
Scott Wood
1f7b1743d3 Revert "nand: make 1-bit software ECC configurable"
This reverts commit 4fee6c2f29.

It breaks boards that currently rely on soft-ecc, as pointed out here:
http://patchwork.ozlabs.org/patch/140872/

The reverted patch should be resubmitted with documentation, and with the
CONFIG_MTD_ECC_SOFT selected from every board that needs it.  We could
start by looking at what NAND driver the board selects, and whether
that driver ever asks for soft ECC.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-02-28 14:03:39 -06:00
Wolfgang Denk
e9d44b35be Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
* 'sf' of git://git.denx.de/u-boot-blackfin:
  README: Add description of SPI Flash (SF) command configuration
  sf command: allow default bus and chip selects
  sf: eeprom_m95xxx: set a sane default timeout
  sf: eeprom_m95xxx: fix up style
2012-02-13 23:15:25 +01:00
Mike Frysinger
8b463dab93 sf: eeprom_m95xxx: set a sane default timeout
Every board currently defines this to the same value, so just default
to that to avoid having to make everyone do the same thing.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 15:18:28 -05:00
Mike Frysinger
a1f77b696d sf: eeprom_m95xxx: fix up style
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 15:18:28 -05:00
Mike Frysinger
3f54108be9 Blackfin: bfin_nand: mark local func static
This devready func is only used in this driver, so mark it static.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 15:03:26 -05:00
Wolfgang Denk
7100a54604 Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
* 'master' of git://git.denx.de/u-boot-cfi-flash:
  add STM29F400BB to table of supported legacy flashs
  * Fix: watchdog timed out, if flash blank (0xFF) blocks
2012-02-11 22:16:47 +01:00
David Müller (ELSOFT AG)
5e72ef0810 add STM29F400BB to table of supported legacy flashs
Signed-off-by: David Mueller <d.mueller@elsoft.ch>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-02-09 09:45:53 +01:00
Jens Scharsig (BuS Elektronik)
a9f5faba6e * Fix: watchdog timed out, if flash blank (0xFF) blocks
The current implementation of cfi_flash uses udelay to reset watchdog.
If several blocks are blank (0xff filled) the watchdog timed out.
The reason is, udelay is never called, if flash device is ready to fast.

e.g.
     mw.w $(copy_addr) FFFF 10000;cp.b $(copy_addr) 10880000 20000

     -> watchdog timed out

     mw.w $(copy_addr) 0000 10000;cp.b $(copy_addr) 10880000 20000

     -> watchdog not timed out

This patch adds an extra watchdog reset in front of flash ready check.

Signed-off-by: Jens Scharsig (BuS Elektronik) <esw@bus-elektronik.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-02-09 09:45:40 +01:00
Scott Wood
c178347492 nand/fsl_elbc: Convert to self-init
This driver doesn't yet make use of the added flexibility (not that that
should stop anyone from converting...), but it will with the in-progress
hack to support 4k-page NAND.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:06 -06:00
Scott Wood
578931b34d nand: Introduce CONFIG_SYS_NAND_SELF_INIT
This allows a driver to run code between nand_scan_ident() and
nand_scan_tail(), among other things.  See the additions to
doc/README.nand for details.

To allow a gradual transition, Boards that don't set
CONFIG_SYS_NAND_SELF_INIT will still be initialized the old way, but
new drivers should not require this, and existing drivers should be
converted when convenient.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:06 -06:00
Shengzhou Liu
80519c8334 mtd/nand: Add ONFI support for FSL NAND controller
- fix NAND_CMD_READID command for ONFI detect.
- add NAND_CMD_PARAM command to read the ONFI parameter page.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:03 -06:00
Christian Hitz
4fee6c2f29 nand: make 1-bit software ECC configurable
The software ECC algorithm is not necessary when hardware ECC
is available and can be left out for a smaller image size.
Enable with CONFIG_MTD_ECC_SOFT.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Christian Hitz
5454ddbc9b nand: Sanitize ONFI strings.
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]

This is part of the synchronization with the nand driver to the
Linux 3.0 state.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Christian Hitz
ff8a8a7183 nand: Merge changes to BBT from Linux nand driver
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]

This patch synchronizes the nand driver with the Linux 3.0 state.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Christian Hitz
2a8e0fc8b3 nand: Merge changes from Linux nand driver
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]

This patch synchronizes the nand driver with the Linux 3.0 state.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
[scottwood@freescale.com: minor fixes]
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Christian Hitz
90e3f395bf nand: cleanup whitespace
Bring up to date with corresponding file from linux.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Christian Hitz
8c2d9c6862 nand: Add more NAND types from Linux nand driver
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]

This patch merges the additional NAND flash types from the 3.0 Linux
kernel.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Christian Hitz
4c6de8560c nand: Merge BCH code from Linux nand driver
[backport from linux commit 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe]

This patch merges the BCH ECC algorithm from the 3.0 Linux kernel.
This enables U-Boot to support modern NAND flash chips that
require more than 1-bit of ECC in software.

Signed-off-by: Christian Hitz <christian.hitz@aizo.com>
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:09:02 -06:00
Stefano Babic
d3022c5f5c nand_spl_simple: store ecc data on the stack
Currently nand_spl_simple puts it's temp data at 0x10000 offset in SDRAM
which is likely to contain already loaded data.
The patch saves the oob data and the ecc on the stack replacing
the fixed address in RAM.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Ilya Yanok <yanok@emcraft.com>
CC: Scott Wood <scottwood@freescale.com>
CC: Tom Rini <tom.rini@gmail.com>
CC: Simon Schwarz <simonschwarzcor@googlemail.com>
CC: Wolfgang Denk <wd@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-01-26 16:06:21 -06:00
Christian Riesch
32b1127397 sf: Add spi_boot() to allow booting from SPI flash in an SPL
Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Heiko Schocher <hs@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-24 10:23:30 +01:00
Anatolij Gustschin
b7fde587bf drivers/mtd/nand/nand_spl_load.c: Fix GCC 4.6 warning
Fix:
nand_spl_load.c: In function 'nand_boot':
nand_spl_load.c:31:6: warning: variable 'ret' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-12-07 16:02:07 -06:00
Anatolij Gustschin
18b89072f6 drivers/mtd/nand/nand_spl_simple.c: Fix GCC 4.6 warnings
Fix warnings for both cases:

definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST:
nand_spl_simple.c: In function 'nand_read_page':
nand_spl_simple.c:156:6: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]

not definded CONFIG_SYS_NAND_HW_ECC_OOBFIRST:
nand_spl_simple.c: In function 'nand_read_page':
nand_spl_simple.c:196:6: warning: variable 'stat' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Heiko Schocher <hs@denx.de>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-12-07 16:01:56 -06:00
Ilya Yanok
ff62fb4c6a omap_gpmc: use SOFTECC in SPL if it's enabled
Use software ECC for the SPL build if support for software ECC in SPL is
enabled.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Acked-by: Scott Wood <scottwood@freescale.com>
2011-12-06 23:59:36 +01:00
Ilya Yanok
1df308e5be nand_spl_simple: add support for software ECC
This patch adds support for software ECC to the nand_spl_simple driver.
To enable this one have to define CONFIG_SPL_NAND_SOFTECC.

Tested on OMAP3.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Acked-by: Scott Wood <scottwood@freescale.com>
2011-12-06 23:59:36 +01:00
Simon Schwarz
56c91bc3b6 Fix regression in SMDK6400
s3c64xx.c implemented its own nand_read_byte, nand_write_buf and
nand_read_buf functions. This provoked a regression when these functions
were made public by patch 55f429bb39614a16b1bacc9a8bea9ac01a60bfc8.

This deletes these duplicated functions from s3c64xx.c and adds the generic
implementations in nand_base.c to the spl Makefile. It also adds
-ffcuntion-sections and -gc-sections to the compilation flags of the SPL to
avoid errors originating from unused functions in nand_base.c.

Description of the regression:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/108873

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
Cc: scottwood@freescale.com
Cc: s-paulraj@ti.com
Cc: albert.u.boot@aribaud.net
2011-12-06 23:59:31 +01:00
Simon Schwarz
82645f816f nand: Add common functions to linux/mtd/nand.h
Functions often used in SPL are now part of linux/mtd/nand.h.
Static modifiers are removed from these functions in
drivers/mtd/nand/nand_base.c.

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
Cc: scottwood@freescale.com
Cc: s-paulraj@ti.com
Cc: albert.u.boot@aribaud.net
Acked-by: Scott Wood <scottwood@freescale.com>
2011-12-06 23:59:31 +01:00