summaryrefslogtreecommitdiff
path: root/src/flash/nand
Commit message (Collapse)AuthorAgeFilesLines
* fileio: fileio_size() can now failØyvind Harboe2010-09-292-3/+14
| | | | | | Part of making the fileio API more robust. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fileio: refactor struct fileio to be an opaque structureØyvind Harboe2010-09-292-3/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: fix error handlingØyvind Harboe2010-09-211-29/+3
| | | | | | sensible error must be reported at failure site Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* warnings: fix alignment warningsØyvind Harboe2010-09-201-2/+2
| | | | | | | These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* flash: add nuc910 nand driverSpencer Oliver2010-07-194-2/+306
| | | | | | | | This adds a nand driver support for the nuc910 target. Note that ECC is not currently supported by this driver, although it is supported by the peripheral. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* nand: nand probe also outputs manufacturerSpencer Oliver2010-07-191-1/+2
| | | | | | The nand probe now outputs the manufacturer if found. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* nand/mx2: review scope of symbolsAntonio Borneo2010-06-211-1/+1
| | | | | | Add "static" qualifier to private variable. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* arm_io: -Wshadow warning fixØyvind Harboe2010-06-161-6/+6
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* nand: when verify failed, it didn't return an errorØyvind Harboe2010-06-161-6/+10
| | | | | | | | | | when the verify failed, it didn't return an error, which breaks e.g. tcl scripts that rely on this for exceptions to work. Found by -Wshadow Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* -Wshadow fixesØyvind Harboe2010-06-141-1/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* nand : Add Freescale iMX27 nand flash controller supportgcembed2010-05-204-0/+900
| | | | | | | | This patch add support of iMX27 nand flash controller. This is based on driver for imx31 nand flash controller. OOB functionality is not fully working. As in mx31 controller, mx2 NFC has a bug that swap two bytes between SPARE and MAIN buffer. I used this driver for several months and no problems appear.
* NAND/davinci: Fix segfault for hwecc4_infix readsJon Povey2010-05-181-12/+62
| | | | | | | | | | | | | | | | | | | | Page reads using hwecc4_infix layout segfaulted for check_bad_blocks because the read assumed a valid data buffer, which check_bad_blocks does not use (it only passes a 6 byte buffer for the start of OOB). This version copes with undersized or missing data or oob buffers and uses random read commands within the page to skip unwanted areas of data/OOB for speed. NOTE: Running check_bad_blocks with this layout will be reading infix OOB locations, not manufacturer bad block markers. This means that if you check blocks written in infix layout they will appear good, but manufacturer- marked bad blocks may also appear good. If you want to scan for manufactuer-marked bad blocks, you need to enable raw_access before running check_bad_blocks, or use the non-infix layout. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> CC: David Brownell <dbrownell@users.sourceforge.net>
* NAND: catch read errors when building BBTJon Povey2010-05-181-1/+4
| | | | | | | | nand_build_bbt() was ignoring the return value from nand_read_page() and blindly continuing. It now passes the return value up to the caller if the read fails. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
* Change kb/s to KiB/s in messages about kibibytesJon Povey2010-05-161-3/+3
| | | | | | | Change download rate messages about kibibytes from "kb/s" to "KiB/s" units. See: http://en.wikipedia.org/wiki/Data_rate_units Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
* NAND: fix first and last handling in nand_build_bbtJon Povey2010-05-141-3/+5
| | | | | | | | | | Last block was being skipped, fix by changing the loop test from "<" to "<=" First block argument was ignored, always started from block 0 (and counted the wrong blocks as bad if first was nonzero). Now we use it. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* NAND: fix off-by-one error in erase command argument rangeJon Povey2010-05-141-1/+1
| | | | | | | | | The last_block argument to nand_erase() is checked against nand->num_blocks, but the highest valid block number is (total - 1), the test for invalid should be ">=" rather than ">". Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* NAND/TCL: review scope of functionsAntonio Borneo2010-04-102-3/+4
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/ARM_IO: review scope of functionsAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/CORE: review scope of functionsAntonio Borneo2010-04-102-10/+8
| | | | | | | Add "static" qualifier to private functions. Move function's comment from core.h to core.c. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* NAND/MX3: review scope of dataAntonio Borneo2010-04-101-1/+1
| | | | | | Add "static" qualifier to private data. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* change %x and %d to PRIx32 and PRId32 where needed for cygwinDaniel Bäder2010-03-251-4/+4
|
* lpc3180: LPC3180(LPC3250) SLC driver implementedrichard vegh2010-03-162-9/+441
| | | | | | | | | | | | | | | | Until this time only basic SLC functionality exists when you want to use SLC to access external nand flash. Basic functionality can be selected with command: lpc3180 select 0 slc It is anyway very slow to write/read to/from nand flash. With the new command, SLC speed improved about 20 times, and hardware ECC info also read/written from/to nand flash OOB area: lpc3180 select 0 slc bulk Speed improvement achieved by using working are in SRAM of the LPC3250 chip and controlling DMA controller to interact between SRAM and SLC peripheral. Here are the patches, and if they are ok than take them. Tested with hitex LPC3250 usb stick. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* NAND: lpc3180 crashes on LPC3250richard vegh2010-01-161-13/+38
| | | | | | | | | | | | | The LPC3180 NAND driver was crashing on some large page chips. Fix: - Crash and related functionality (don't memset too much OOB data) - Some debug messages - Command handling now works [dbrownell@users.sourceforge.net: whitespace/linelength/message cleanup] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* nand flash support for s3c64xxPeter Korsgaard2010-01-143-0/+79
| | | | | | | | | | | | Identical to the existing 2412/2443 support except for the base address and NFCONF value (bit 2 is reserved and should be written as 1 ref UM). Tested on a s3c6410 board, but controller is identical in 6400/6410 except for 8bit MLC ECC support in 6410 which isn't supported by the driver. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* NAND: help/usage/doc updatesDavid Brownell2010-01-083-48/+50
| | | | | | | | | | | | | | Usage messages should use the same EBNF as the User's Guide; no angle brackets. Be more complete too ... some params were missing. Improve and correct various helptexts. Make user's guide refer to the NAND "driver" name, not the controller name; that's a bit more precise. Don't use "&function"; its name is its address. Line up struct initializers properly. Remove some blank lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* MinGW build fixesFreddie Chopin2009-12-281-2/+2
| | | | | | | | Print "ssize_t" as "%ld" (+ cast to long) not as "%zu". Official MinGW (gcc 3.4.5) doesn't understand "z" flag. Signed-off-by: Freddie Chopin <freddie_chopin@op.pl> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Packaging fix, NEWS updateDavid Brownell2009-12-211-1/+3
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* cygwin build fixesDavid Brownell2009-12-191-2/+6
| | | | | | and shrink some too-long lines Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* AT91SAM9 NAND flash driver.Dean Glazeski2009-12-193-1/+754
| | | | | | | | | | This creates the TCL interface for configuring an AT91SAM9 NAND flash controller and implements the necessary functions to correctly work with a NAND flash device connected to the chip. This includes updates to the driver list and the Makefile.am to support building the driver and also houses the documentation update in openocd.texi. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NAND write data page refactoring.Dean Glazeski2009-12-182-59/+69
| | | | | | | | | | | Refactored the write page raw function into two new functions for writing data to a NAND device and then another function to finish up a write to a NAND device. This includes some new updates to introduce more error checking to existing code. [dbrownell@users.sourceforge.net: fix fault handling, whitespace] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* NAND read data page refactor.Dean Glazeski2009-12-182-45/+25
| | | | | | | | | | | | | | Added a new function to encapsulate reading a page of data from a NAND device using either the read_block_data function of a NAND controller or to use direct reading of data from the NAND device. This also adds some performance enhancements and uses the read_data function if the read_block_data function fails safely (because it can't allocate a buffer in the working area). [dbrownell@users.sourceforge.net: fix fault handling, whitespace] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* add missing call to add new NAND devicesZachary T Welch2009-12-112-0/+4
| | | | | I forgot to add a call to the newly factored nand_device_add(), along with its forward declaration.
* Comment and doxygen fixesDavid Brownell2009-12-091-1/+1
| | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* build: add build/src to include pathØyvind Harboe2009-12-081-1/+3
| | | | | | This allows including generated include files. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM: use <target/arm.h> not armv4_5.hDavid Brownell2009-12-072-2/+2
| | | | | | | | | | | | | | Move most declarations in <target/armv4_5.h> to <target/arm.h> and update users. What's left in the older file is stuff that I think should be removed ... the old register cache access stuff, which makes it awkward to support microcontroller profile (Cortex-M) cores. The armv4_5_run_algorithm() declaration was moved too, even though it's not yet as generic as it probably ought to be. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* rename nand.h to flash//nand/core.hZachary T Welch2009-12-0418-16/+268
| | | | | | | | | Rename nand.h as flash/nand/core.h, chase consumers. The public APIs need to be sorted out with imp.h, but this allows other changes to begin improving the separation between policy and mechanism. Moves #include <target/target.h> and #include "driver.h" into the internal headers or source files, removing it from <flash/nand/core.h>.
* move remaining nand helper filesZachary T Welch2009-12-047-2/+606
| | | | Move remaining NAND implementation files into src/flash/nand/.
* split nand.c into nand/{core,fileio,tcl}.cZachary T Welch2009-12-046-0/+1900
| | | | | | | Moves commands into nand/tcl.c and core implementation to 'nand/core.c' and 'nand/fileio.c'. Eliminates 'flash/nand.c'. Adds 'nand/imp.h' to share routines between TCL commands and core.
* split NAND driver handling into nand/driver.[ch]Zachary T Welch2009-12-043-0/+190
| | | | | | | This work parallels the NOR directory, encapsulating the NAND drivers into a separate file. This takes an extra step by encapsulating the type of data structure used to manage the drivers, allowing it to be changed from an array to a dynamic list in the future.
* ARM NAND I/O interface updateDean Glazeski2009-12-032-0/+2
| | | | | | | | | | | Modify the arm_nand_data struct to better support both read and write operations while using the same struct. An additional field was added, and initialized, to record the last operation so that the correct code can be loaded to the working area. [dbrownell@users.sourceforge.net: merge init patch, tweak GPL note] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* remove tertiary include pathsZachary T Welch2009-12-031-6/+1
| | | | | With all #include directives converted, we only need to have the top-level src/ directory in the search path.
* change #include "../hello.h" to "hello.h"Zachary T Welch2009-12-031-0/+2
| | | | | | Before we can -I the top-level src/ directory alone, references to "hello.h" must be updated. This is an internal header, so it does not need angle brackets.
* change #include "s3c24xx_regs.h" to <flash/nand/s3c24xx_regs.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "s3c24xx_regs.h" the following form should be used. #include <flash/nand/s3c24xx_regs.h> The exception is from .c files in the same directory.
* change #include "nand.h" to <flash/nand.h>Zachary T Welch2009-12-034-4/+4
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "nand.h" the following form should be used. #include <flash/nand.h> The exception is from .c files in the same directory.
* change #include "arm_nandio.h" to <flash/arm_nandio.h>Zachary T Welch2009-12-032-2/+2
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "arm_nandio.h" the following form should be used. #include <flash/arm_nandio.h> The exception is from .c files in the same directory.
* change #include "armv4_5.h" to <target/armv4_5.h>Zachary T Welch2009-12-031-1/+1
| | | | | | | | | | | | Changes from the flat namespace to heirarchical one. Instead of writing: #include "armv4_5.h" the following form should be used. #include <target/armv4_5.h> The exception is from .c files in the same directory.
* normalize headers to make changing easierZachary T Welch2009-12-031-1/+1
| | | | | These headers need minor tweaks to paves the way for wholesale scripted coversion of the header files.
* allow #include directives to use module nameZachary T Welch2009-12-031-0/+1
| | | | | | | | | | | | Includes the src directory in the search path, so header files may be migrated from: #include "foo.h" to #include <module/foo.h> which is more conducive for installation.
* move nand drivers to src/flash/nand/Zachary T Welch2009-12-0215-0/+3791
Moves NAND drivers to src/flash/nand/. Adds src/flash/nand/Makefile.am. Builds libocdflashnand.la.