summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* Redundant Environment: protect full sector sizeWolfgang Denk2009-06-041-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-031-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-231-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-291-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-282-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-281-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-161-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-061-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-041-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-041-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-031-0/+3
|\
| * Noisily disable the legacy NAND subsystem.Scott Wood2009-04-031-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-021-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-021-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-021-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-022-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-021-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-024-0/+365
| | | | | | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* | sf: drop DEBUG definesMike Frysinger2009-04-022-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-021-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>
* | mtd: SPI Flash: Support the Spansion FlashMingkai Hu2009-04-022-0/+357
|/ | | | | | | | Add MTD SPI Flash support for S25FL008A, S25FL016A, S25FL032A, S25FL064A, S25FL128P. Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* s3c2410: move nand driver to drivers/mtd/nandJean-Christophe PLAGNIOL-VILLARD2009-03-302-0/+172
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* davinci: move nand driver to drivers/mtd/nandJean-Christophe PLAGNIOL-VILLARD2009-03-302-0/+467
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'master' of git://git.denx.de/u-boot-at91Wolfgang Denk2009-03-262-0/+79
|\
| * at91sam9/at91cap: move nand drivers to drivers/mtd/nandJean-Christophe PLAGNIOL-VILLARD2009-03-222-0/+79
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | Add wait flags to support board/chip specific delaysWolfgang Grandegger2009-03-231-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The NAND flash on the TQM8548_BE modules requires a short delay after running the UPM pattern like the MPC8360ERDK board does. The TQM8548_BE requires a further short delay after writing out a buffer. Normally the R/B pin should be checked, but it's not connected on the TQM8548_BE. The corresponding Linux FSL UPM driver uses similar delay points at the same locations. To manage these extra delays in a more general way, I introduced the "wait_flags" field allowing the board-specific driver to specify various types of extra delay. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | Add support for TQM-specific chip select logic to FSL-UPMWolfgang Grandegger2009-03-231-1/+4
| | | | | | | | | | | | | | | | | | For the NAND chips on the TQM8548 modules, a special chip-select logic is used. It uses dedicated address lines to be set via UPM machine address register (mar). This patch adds such support to the FSL-UPM driver. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | Add multi chip support to the FSL-UPM driverWolfgang Grandegger2009-03-231-8/+36
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for multi-chip NAND devices to the FSL-UPM driver. The "dev_ready" callback of the "struct fsl_upm_nand" is now called with the argument "chip_nr" to allow testing the proper chip select line. The NAND support of the MPC8360ERDK is updated as well. No other boards are currently using the FSL UPM driver. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | Enable multi chip support in the NAND layerWolfgang Grandegger2009-03-232-1/+7
| | | | | | | | | | | | | | | | | | | | This patch adds support for NAND_MAX_CHIPS to the MTD NAND layer. Multi-chips devices are displayed as shown: Device 0: 2x NAND 512MiB 3,3V 8-bit, sector size 128 KiB Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* | Make flash protection work, when the environment is in EEPROMEric Schumann2009-03-231-1/+3
|/ | | | | | | | | | | | | | | | On the pcm030 the environment is located in the onboard EEPROM. But we want to handle flash sector protection in a safe manner. So we must read the unlock environment variable from EEPROM instead from flash. This patch is required as long the evironment is saved into the EEPROM. Stefan: Additional change as suggested by Wolfgang, use bigger char array (instead of 4). Signed-off-by: Eric Schumann <E.Schumann@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* CFI: geometry reversal for STMicro M29W320DTRichard Retanubun2009-03-191-2/+3
| | | | | | | | Follow up to the flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash chip. The M29W320DT has 4 erase region. Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com> Signed-off-by: Stefan Roese <sr@denx.de>
* nomadik/nand: fix 'ecc512' discards qualifiers from pointer target typeJean-Christophe PLAGNIOL-VILLARD2009-02-221-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Nand driver for Nomadik SoCAlessandro Rubini2009-02-222-0/+222
| | | | | | | | | | This driver implements the ECC algorithm described in the CPU data sheet and uses the OOB layout chosen in already-released development systems (shipped with a custom-made u-boot 1.3.1). Signed-off-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Andrea Gallo <andrea.gallo@stnwireless.com>
* cfi: make flash_get_info() non staticHeiko Schocher2009-02-111-1/+1
| | | | | | | | | | | If on your board is more than one flash, you must know the size of every single flash, for example, for updating the DTS before booting Linux. So make this function flash_get_info() extern, and you can have all info about your flashes. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/masterWolfgang Denk2009-02-074-41/+53
|\
| * Merge branch 'master' of git://git.denx.de/u-boot-nand-flashWolfgang Denk2009-02-072-2/+23
| |\
| | * NAND: Add timeout for reset commandPeter Tyser2009-02-061-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | Without the timeout present an infinite loop can occur if the NAND device is broken or not present. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
| | * NAND: Silence warning when CONFIG_SYS_NAND_QUIET_TESTPeter Tyser2009-02-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit cfa460adfdefcc30d104e1a9ee44994ee349bb7b removed support for disabling the "No NAND device found!!!" warning when CONFIG_SYS_NAND_QUIET_TEST was defined. This re-adds support for silencing the warning. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
| | * NAND: Fixed invalid pointers to static relocated chip namesValeriy Glushkov2009-02-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dear Wolfgang, You are right, the patch was ugly. The new one seems to be better. Signed-off-by: Valeriy Glushkov <gvv@lstec.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
| * | cfi_flash: Fix typo in cfi_flash.cStefan Roese2009-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Patch "flash/cfi_flash: Use virtual sector start address, not phys" introduced a small typo and compilation warning for systems with CFI legacy support (e.g. hcu4). This patch fixes it. Signed-off-by: Stefan Roese <sr@denx.de>
| * | jedec_flash: Only use manufacturer defines from common flash.hStefan Roese2009-02-051-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the double defined manufacturer defines from jedec_flash.c. Since the common defines in flash.h are 32bit we now need the (16) cast. This patch also removes the compilation warning (e.g. seen on hcu5): ./MAKEALL hcu5 Configuring for hcu5 board... jedec_flash.c:219: warning: large integer implicitly truncated to unsigned type Signed-off-by: Stefan Roese <sr@denx.de>
| * | cfi_flash: Silence compilation warningStefan Roese2009-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Patch "flash/cfi_flash: Use virtual sector start address, not phys" introduced a small compilation warning. This patch fixes it. Signed-off-by: Stefan Roese <sr@denx.de>
| * | flash/cfi_flash: Use virtual sector start address, not physBecky Bruce2009-02-051-29/+24
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/flash.h was commented to say that the address in flash_info->start was a physical address. However, from u-boot's point of view, and looking at most flash code, it makes more sense for this to be a virtual address. So I corrected the comment to indicate that this was a virtual address. The only flash driver that was actually treating the address as physical was the mtd/cfi_flash driver. However, this code was using it inconsistently as it actually directly dereferenced the "start" element, while it used map_physmem to get a virtual address in other places. I changed this driver so that the code which initializes the info->start field calls map_physmem to get a virtual address, eliminating the need for further map_physmem calls. The code is now consistent. The *only* place a physical address should be used is when defining the flash banks list that is used to initialize the flash_info struct, usually found in the board config file. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Signed-off-by: Stefan Roese <sr@denx.de>
* | Fix compiler warningWolfgang Denk2009-02-041-1/+1
|/ | | | | | (shows up only when DEBUG is enabled) Signed-off-by: Wolfgang Denk <wd@denx.de>
* Blackfin: add driver for on-chip NAND controllerMike Frysinger2009-02-022-0/+386
| | | | | | This is a port of the Linux Blackfin on-chip NFC driver to U-Boot. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk2009-02-012-0/+354
|\
| * OMAP3: Add NAND supportDirk Behme2009-01-242-0/+354
| | | | | | | | | | | | | | | | Add NAND support. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Syed Mohammed Khasim <khasim@ti.com> Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
* | CFI: Add geometry reversal for STMicro M29W320ETRichard Retanubun2009-01-261-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Added flash_fixup_stm to fix geometry reversal on STMicro M29W320ET flash chip. Modeled after flash_fixup_amd, this patch handles the geometry reversal or erase sectors that exist for ST Micro (now Numonyx) M29W320ET flash. Since I cannot test all STM's chips, the detection is implemented as narrow as possible for now. Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com> Signed-off-by: Stefan Roese <sr@denx.de>
* | CFI: increase performance of function find_sector()Jens Gehrlein2009-01-261-7/+16
| | | | | | | | | | | | | | Tested on TQM5200S-BD with Samsung K8P2815UQB Signed-off-by: Jens Gehrlein <sew_s@tqs.de> Signed-off-by: Stefan Roese <sr@denx.de>
* | CFI: avoid redundant function call in single word programming modeJens Gehrlein2009-01-261-3/+7
|/ | | | | | | | | The function find_sector() doesn't need to be called twice in the case of AMD command set. Tested on TQM5200S-BD with Samsung K8P2815UQB. Signed-off-by: Jens Gehrlein <sew_s@tqs.de> Signed-off-by: Stefan Roese <sr@denx.de>
OpenPOWER on IntegriCloud