summaryrefslogtreecommitdiff
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeLines
* Remove legacy NAND and disk on chip code.Scott Wood2009-07-16-1663/+0
| | | | | | | | | | | | | Legacy NAND had been scheduled for removal. Any boards that use this were already not building in the previous release due to an #error. The disk on chip code in common/cmd_doc.c relies on legacy NAND, and it has also been removed. There is newer disk on chip code in drivers/mtd/nand; someone with access to hardware and sufficient time and motivation can try to get that working, but for now disk on chip is not supported. Signed-off-by: Scott Wood <scottwood@freescale.com>
* nand: ndfc: Remove unnecessary #ifdef'sStefan Roese2009-07-16-6/+0
| | | | | | | | | Now that the 4xx NAND driver ndfc is moved to the common NAND driver directory we don't need this #ifdef's anymore. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* nand/ppc4xx: Move PPC4xx NAND driver to common NAND driver directoryStefan Roese2009-07-16-0/+224
| | | | | | Signed-off-by: Stefan Roese <sr@denx.de> Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* nand: fixed failed reads on corrected ECC errors in nand_util.cValeriy Glushkov2009-07-16-5/+5
| | | | | | Signed-off-by: Valeriy Glushkov <gvv@lstec.com> Signed-off-by: Paulraj, Sandeep <s-paulraj@ti.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* Typo fix: use CONFIG_SOC_DM644X, not CONFIG_SOC_DM646.David Brownell2009-07-16-1/+1
| | | | | Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Scott Wood <scottwood@freescale.com>
* mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarationsKim Phillips2009-07-16-2/+9
| | | | | | | | | | | | | a.k.a cfi_mtd.c does as cfi_flash.c does. This also prevents the TQM834x build from doing a: cfi_mtd.c:36: error: variably modified 'cfi_mtd_info' at file scope cfi_mtd.c:37: error: variably modified 'cfi_mtd_names' at file scope using gcc 4.4. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Stefan Roese <sr@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk2009-07-13-0/+83
|\
| * nand: Add Marvell Kirkwood NAND driverPrafulla Wadaskar2009-07-08-0/+83
| | | | | | | | | | | | | | This patch adds a NAND driver for the Marvell Kirkwood SoC's Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Acked-by: Scott Wood <scottwood@freescale.com>
* | issue write command to base for JEDEC flashPo-Yu Chuang2009-07-13-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For JEDEC flash, we should issue word programming command relative to base address rather than sector base address. Original source makes SST Flash fails to program sectors which are not on the 0x10000 boundaries. e.g. SST39LF040 uses addr1=0x5555 and addr2=0x2AAA, however, each sector is 0x1000 bytes. Thus, if we issue command to "sector base (0x41000) + offset(0x5555)", it sends to 0x46555 and the chip fails to recognize that address. This patch is tested with SST39LF040. Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com> Signed-off-by: Stefan Roese <sr@denx.de>
* | fsl_elbc_nand: redirect the pointer of bbt pattern to RAMMingkai Hu2009-07-07-0/+4
| | | | | | | | | | | | | | | | | | | | | | The bbt descriptors contains the pointer to the bbt pattern which are statically initialized memory struct. When relocated to RAM, these pointers will continue point to NOR flash(or L2 SRAM, or other boot device). If the contents of NOR flash changed or L2 SRAM disabled, it'll hang the system. Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | Bug-fix in drivers mtd nand Makefilekevin.morfitt@fearnside-systems.co.uk2009-07-07-1/+1
| | | | | | | | | | | | | | | | The S3C2410 NAND driver source file is included in the makefile instead of the object file. Signed-off-by: Kevin Morfitt <kevin.morfitt@fearnside-systems.co.uk> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | mtd: nand: use loff_t for offsetJean-Christophe PLAGNIOL-VILLARD2009-07-07-10/+10
| | | | | | | | | | | | | | | | nand_util currently uses size_t which is arch dependent and not always a unsigned long. Now use loff_t, as does the linux mtd layer. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | mtd: nand: new base driver for memory mapped nand devicesMike Frysinger2009-07-07-0/+54
| | | | | | | | | | | | | | | | | | The BF537-STAMP Blackfin board had a driver for working with NAND devices that are simply memory mapped. Since there is nothing Blackfin specific about this, generalize the driver a bit so that everyone can leverage it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | davinci_nand chipselect/init cleanupDavid Brownell2009-07-07-20/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update chipselect handling in davinci_nand.c so that it can handle 2 GByte chips the same way Linux does: as one device, even though it has two halves with independent chip selects. For such chips the "nand info" command reports: Device 0: 2x nand0, sector size 128 KiB Switch to use the default chipselect function unless the board really needs its own. The logic for the Sonata board moves out of the driver into board-specific code. (Which doesn't affect current build breakage if its NAND support is enabled...) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | davinci_nand: cleanup II (CONFIG_SYS_DAVINCI_BROKEN_ECC)David Brownell2009-07-07-205/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove CONFIG_SYS_DAVINCI_BROKEN_ECC option. It's not just nasty; it's also unused by any current boards, and doesn't even match the main U-Boot distributions from TI (which use soft ECC, or 4-bit ECC on newer chips that support it). DaVinci GIT kernels since 2.6.24, and mainline Linux since 2.6.30, match non-BROKEN code paths for 1-bit HW ECC. The BROKEN code paths do seem to partially match what MontaVista/TI kernels (4.0/2.6.10, and 5.0/2.6.18) do ... but only for small pages. Large page support is really broken (and it's unclear just what software it was trying to match!), and the ECC layout was making three more bytes available for use by filesystem (or whatever) code. Since this option itself seems broken, remove it. Add a comment about the MV/TI compat issue, and the most straightforward way to address it (should someone really need to solve it). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | davinci_nand: cleanup I (minor)David Brownell2009-07-07-33/+22
|/ | | | | | | | | | | | | | | | | | | | | | | | Minor cleanup for DaVinci NAND code: - Use I/O addresses from nand_chip; CONFIG_SYS_NAND_BASE won't be defined when there are multiple chipselect lines in use (as with common 2 GByte chips). - Cleanup handling of EMIF control registers * Only need one pointer pointing to them * Remove incorrect and unused struct supersetting them - Use the standard waitfunc; we don't need a custom version - Partial legacy cleanup: * Don't initialize every board like it's a DM6446 EVM * #ifdef a bit more code for BROKEN_ECC Sanity checked with small page NAND on dm355 and dm6446 EVMs; and large page on dm355 EVM (packaged as two devices, not one). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Scott Wood <scottwood@freescale.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk2009-07-07-9/+3
|\ | | | | | | | | | | | | Conflicts: drivers/spi/Makefile Signed-off-by: Wolfgang Denk <wd@denx.de>
| * ARM DaVinci: EMIF settingsThomas Lange2009-07-06-9/+3
| | | | | | | | | | | | | | | | | | | | | | NAND module should not modify EMIF registers unrelated to CS2 that is used for NAND, i.e. do not modify EWAIT config register or registers for other Chip Selects. Without this patch, EMIF configurations made in board_init() will be invalidated. Signed-off-by: Thomas Lange <thomas@corelatus.se>
* | Merge branch 'master' of git://git.denx.de/u-boot-ubiWolfgang Denk2009-07-07-1/+1
|\ \
| * | UBI: Fix build problem noticed on Apollon (arm/testing repo)Stefan Roese2009-07-07-1/+1
| |/ | | | | | | | | | | | | | | | | This patch fixes a build problem noticed on Apollon by using mtd_dev_by_eb() instead of "/" as done in the Linux UBI version. So this brings the U-Boot UBI version more in sync with the Linux version again. Signed-off-by: Stefan Roese <sr@denx.de>
* | sf: Macronix additional chips supportedPrafulla Wadaskar2009-07-06-12/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | new chips supported:- MX25L1605D, MX25L3205D, MX25L6405D, MX25L12855E out of which MX25L6405D and MX25L12855E tested on Kirkwood platforms Modified the Macronix flash support to use 2 bytes of device id instead of 1 This was required to support MX25L12855E Signed-off-by: Piyush Shah <spiyush@marvell.com> Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | sf: sst: add sst25vf###b idsMike Frysinger2009-07-06-0/+16
| | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | sf: sst: fix sector sizeMike Frysinger2009-07-06-4/+4
|/ | | | | | | | Looks like when I was encoding the sector sizes, I forgot to divide by 8 (due to the stupid marketing driven process that declares all sizes in useless megabits and not megabytes). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* nand/mpc512x: Add MPC512x NAND support (NFC)Stefan Roese2009-06-12-0/+693
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds NAND Flash Controller driver for MPC5121 revision 2. All device features, except hardware ECC and power management, are supported. This NFC driver replaces the one orignally posted by John Rigby: "[PATCH] Freescale NFC NAND driver" It's a port of the Linux driver version posted by Piotr Ziecik a few weeks ago. Using this driver has the following advantages (from my point of view): - Compatibility with the Linux NAND driver (e.g. ECC usage) - Better code quality in general - Resulting U-Boot image is a bit smaller (approx. 3k) - Better to sync with newer Linux driver versions The only disadvantage I can see, is that HW-ECC is not supported right now. But this could be added later (e.g. port from Linux driver after it's supported there). Using HW-ECC on the MCP5121 NFC has a general problem because of the ECC usage in the spare area. This collides with JFFS2 for example. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Piotr Ziecik <kosmo@semihalf.com> Cc: Wolfgang Denk <wd@denx.de> Cc: John Rigby <jcrigby@gmail.com> Cc: Scott Wood <scottwood@freescale.com>
* UBI: Add compile-time check for correct malloc area configurationStefan Roese2009-06-12-0/+4
| | | | | | | | UBI is quite memory greedy and requires at least approx. 512k of malloc area. This patch adds a compile-time check, so that boards will not build with less memory reserved for this area (CONFIG_SYS_MALLOC_LEN). Signed-off-by: Stefan Roese <sr@denx.de>
* sf: new Macronix MX25xx SPI flash driverPrafulla Wadaskar2009-06-12-0/+319
| | | | | | | | | Added macronix SF driver for MTD framework MX25L12805D is supported and tested TBD: sector erase implementation, other deivces support Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sf: atmel: implement power-of-two write/erase funcsTodor I Mollov2009-06-12-0/+139
| | | | | | Signed-off-by: Todor I Mollov <tmollov@ucsd.edu> Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* mtd: Introduce CONFIG_MTD_DEVICE to select compilation of mtdcore.oStefan Roese2009-06-12-3/+4
| | | | | | | | | | | | | This new define enables mtdcore.c compilation and with this we can select the MTD device infrastructure needed for the reworked mtdparts command. We now have the 2 MTD infrastructure defines, CONFIG_MTD_DEVICE and CONFIG_MTD_PARTITIONS. CONFIG_MTD_DEVICE is needed (as explained above) for the "mtdparts" command and CONFIG_MTD_PARTITIONS is needed for UBI. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Scott Wood <scottwood@freescale.com>
* mtd: Update MTD infrastructure to support 64bit device sizeStefan Roese2009-06-12-274/+229
| | | | | | | | | | | This patch brings the U-Boot MTD infrastructure in sync with the current Linux MTD version (2.6.30-rc3). Biggest change is the 64bit device size support and a resync of the mtdpart.c file which has seen multiple fixes meanwhile. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Scott Wood <scottwood@freescale.com> Cc: Kyungmin Park <kmpark@infradead.org>
* mtd: Add MTD concat support to concatenate multiple MTD NOR devicesStefan Roese2009-06-12-1/+886
| | | | | | | | | This patch adds concatenation support to the U-Boot MTD infrastructure. By enabling CONFIG_MTD_CONCAT this MTD CFI wrapper will concatenate all found NOR devices into one single MTD device. This can be used by e.g by UBI to access a partition that spans over multiple NOR chips. Signed-off-by: Stefan Roese <sr@denx.de>
* Redundant Environment: protect full sector sizeWolfgang Denk2009-06-04-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several boards used different ways to specify the size of the protected area when enabling flash write protection for the sectors holding the environment variables: some used CONFIG_ENV_SIZE and CONFIG_ENV_SIZE_REDUND, some used CONFIG_ENV_SECT_SIZE, and some even a mix of both for the "normal" and the "redundant" areas. Normally, this makes no difference at all. However, things are different when you have to deal with boards that can come with different types of flash chips, which may have different sector sizes. Here we may have to chose CONFIG_ENV_SECT_SIZE such that it fits the biggest sector size, which may include several sectors on boards using the smaller sector flash types. In such a case, using CONFIG_ENV_SIZE or CONFIG_ENV_SIZE_REDUND to enable the protection may lead to the case that only the first of these sectors get protected, while the following ones aren't. This is no real problem, but it can be confusing for the user - especially on boards that use CONFIG_ENV_SECT_SIZE to protect the "normal" areas, while using CONFIG_ENV_SIZE_REDUND for the "redundant" area. To avoid such inconsistencies, I changed all sucn boards that I found to consistently use CONFIG_ENV_SECT_SIZE for protection. This should not cause any functional changes to the code. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Paul Ruhland Cc: Pantelis Antoniou <panto@intracom.gr> Cc: Stefan Roese <sr@denx.de> Cc: Gary Jennejohn <garyj@denx.de> Cc: Dave Ellis <DGE@sixnetio.com> Acked-by: Stefan Roese <sr@denx.de>
* cfi_mtd: Fix bug in last sector detectionStefan Roese2009-06-03-2/+7
| | | | | | | This patch now enabled this cfi-mtd wrapper to correctly detect and erase the last sector in an NOR FLASH device. Signed-off-by: Stefan Roese <sr@denx.de>
* nand: Fix problem with ECC ordering for PPC4xx NDFC platformsStefan Roese2009-05-23-0/+5
| | | | | | | | | This patch enables Smart Media (SMC) ECC byte ordering which is used on the PPC4xx NAND FLASH controller (NDFC). Without this patch we have incompatible ECC byte ordering to the Linux kernel NDFC driver. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Scott Wood <scottwood@freescale.com>
* MTD: Change cfi-mtd to accept non-uniform sector sizesStefan Roese2009-04-29-14/+4
| | | | | | | | | With this patch non-uniform NOR FLASH chips (chips with multiple erase regions) can be exported via the cfi-mtd layer and therefor used by UBI. We select the largest sector size as erasesize. The cfi driver will make sure that the smaller sectors are handled correctly. Signed-off-by: Stefan Roese <sr@denx.de>
* mtd: nand/onenand: Register mtd device upon device scanningStefan Roese2009-04-28-0/+22
| | | | | | | | | With this patch the NAND and OneNAND devices are registered in the MTD subsystem and can then be referenced by the mtdcore code (e.g. get_mtd_device_nm()). This is needed for the new "ubi part" command syntax without the flash type parameter (nor|nand|onenand). Signed-off-by: Stefan Roese <sr@denx.de>
* mtd: nand: Include linux/mtd/partitions.h in nand_base.hStefan Roese2009-04-28-0/+4
| | | | | | | | | | This patch removes this compilation warning when CONFIG_MTD_PARTITIONS is defined: nand_base.c: In function 'nand_release': nand_base.c:2922: warning: implicit declaration of function 'del_mtd_partitions' Signed-off-by: Stefan Roese <sr@denx.de>
* CMD_UBI != MTD_PARTITIONSDavid Brownell2009-04-16-1/+1
| | | | | | | | Fix dependency goofage: it should certainly be possible to have the partition support without bringing in UBI commands. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Stefan Roese <sr@denx.de>
* Blackfin: nand: flush peripheral before polling itGraf Yang2009-04-06-0/+1
| | | | | | | | | | We need to make sure the data written to the nand flash controller makes it there before we start polling its status register. Otherwise, we may get stale data and return before the controller is actually ready. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Scott Wood <scottwood@freescale.com>
* UBI/cfi-mtd: Fix mtd name for multiple chipsAndreas Huber2009-04-04-1/+3
| | | | | | | | | | | | | On platforms with multiple NOR chips, currently only the first one can be selected using the "ubi part" command. This patch fixes this problem by using different names for the NOR "mtd devices". It also changes the name of the NOR MTD device from "cfi-mtd" to "norX" (X indexing the device numer) to better match the mtdparts defaults. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
* Add support for the AT91RM9200EK Board.Ulf Samuelsson2009-04-04-4/+1
| | | | | | | | | | | | | | | | | | | The AT91RM9200-EK Evaluation Board supports the AT91RM9200 ARM9-based 32-bit RISC microcontroller and enables real-time code development and evaluation. Here is the chip page on Atmel website: http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507 with - NOR (cfi driver) - DataFlash - USB OHCI - Net - I2C (hard) Signed-off-by: Ulf Samuelsson <ulf@atmel.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'master' of git://git.denx.de/u-boot-nand-flashWolfgang Denk2009-04-03-0/+3
|\
| * Noisily disable the legacy NAND subsystem.Scott Wood2009-04-03-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Legacy NAND is marked for feature removal after April 2009 (i.e. this upcoming release). There are still several boards that reference it (though many do so only for disk-on-chip support which has been silently disabled for a while now). These boards will now fail to build with #error, though the code is still there if the user removes #error. The plan is to remove the code outright in the next release, along with any board code that refers to it (such as board/esd/common/auto_update.c). Also, remove the legacy NAND API description from README.nand. Signed-off-by: Scott Wood <scottwood@freescale.com>
* | sf: stmicro: dont send 4 bytes when reading status registerMike Frysinger2009-04-02-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | I can't find anywhere in the datasheet that says the status register needs 3 dummy bytes sent to it before being able to read back the first real result. Tests on a Blackfin board show that after writing the opcode, the status register starts coming back immediately. So only write out the read status register opcode before polling the result. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Jason McMullan <mcmullan@netapp.com> CC: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
* | sf: set common timeouts in seconds, not millisecondsMike Frysinger2009-04-02-3/+6
| | | | | | | | | | | | | | | | | | | | | | Since timeouts are only hit when there is a problem in the system, we don't want to prematurely timeout on a functioning setup. Thus having low timeouts (in milliseconds) doesn't gain us anything in the production case, but rather increases likely hood of causing problems where none otherwise exist. Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* | sf: stmicro: use common page timeout defineMike Frysinger2009-04-02-2/+1
| | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* | sf: always read 5 bytes for the idcodeMike Frysinger2009-04-02-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | Some SPI flash drivers like to have extended id information available (like the spansion flash), so rather than making it re-issue the ID cmd to get at the last 2 bytes, have the common code read 5 bytes rather than just 3. This also matches the Linux behavior where it always reads 5 id bytes from all flashes. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> CC: Mingkai Hu <Mingkai.hu@freescale.com>
* | sf: stmicro: drop redundant id readMike Frysinger2009-04-02-7/+1
| | | | | | | | | | | | | | | | | | | | The common SPI flash code reads the idcode and passes it down to the SPI flash driver, so there is no need to read it again ourselves. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> CC: Jason McMullan <mcmullan@netapp.com> CC: TsiChung Liew <Tsi-Chung.Liew@freescale.com>
* | sf: add driver for SST flashesMike Frysinger2009-04-02-0/+365
| | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* | sf: drop DEBUG definesMike Frysinger2009-04-02-2/+2
| | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* | mtd: add some at45 spi flash supportJean-Christophe PLAGNIOL-VILLARD2009-04-02-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | - AT45DB321D - AT45DB161D - AT45DB081D - AT45DB041D - AT45DB021D - AT45DB011D Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>