summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* spi flash: fix crash due to spi flash miscommunicationBrad Bozarth2009-01-242-2/+4
| | | | | | | | | | | Higher spi flash layers expect to be given back a pointer that was malloced so that it can free the result, but the lower layers return a pointer that is in the middle of the malloced memory. Reorder the members of the lower spi structures so that things work out. Signed-off-by: Brad Bozarth <bflinux@yumbrad.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
* Added legacy flash ST Micro M29W040BNiklaus Giger2009-01-241-0/+14
|
* nand: fixup printf modifiers to match types usedMike Frysinger2009-01-231-6/+6
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Scott Wood <scottwood@freescale.com>
* NAND: rename NAND_MAX_CHIPS to CONFIG_SYS_NAND_MAX_CHIPSWolfgang Grandegger2009-01-232-2/+2
| | | | | | | | | | | | | | | | This patch renames NAND_MAX_CHIPS to CONFIG_SYS_NAND_MAX_CHIPS and changes the default from 8 to 1 for the legacy and the new MTD NAND layer. This allows to remove all NAND_MAX_CHIPS definitions in the board config files because none of the boards use multi chip support (NAND_MAX_CHIPS > 1) so far. The bamboo and the DU440 define #define NAND_MAX_CHIPS CONFIG_SYS_MAX_NAND_DEVICE but that's bogus and did not work anyhow. Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* NAND: Enable nand lock, unlock featureNishanth Menon2009-01-231-36/+43
| | | | | | | | | | | | | | | | Enable nand lock, unlock and status of lock feature. Not every device and platform requires this, hence, it is under define for CONFIG_CMD_NAND_LOCK_UNLOCK Nand unlock and status operate on block boundary instead of page boundary. Details in: http://www.micron.com/products/partdetail?part=MT29C2G24MAKLAJG-6%20IT Intial solution provided by Vikram Pandita <vikram.pandita@ti.com> Includes preliminary suggestions from Scott Wood Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* NAND: move board_nand_init to nand.hMike Frysinger2009-01-231-2/+0
| | | | | | | | | | | Rather than putting the function prototype for board_nand_init() in the one place where it gets called, put it into nand.h so that every place that also defines it gets the prototype. Otherwise, errors can go silently unnoticed such as using the wrong return value (void rather than int) when defining the function. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Scott Wood <scottwood@freescale.com>
* OneNAND: Additional sync with 2.6.27Stefan Roese2009-01-231-1/+71
| | | | | | | | | | | | - Add subpage write support - Add onenand_oob_64/32 ecclayout This has been missing and without it UBI has some incompatibilies issues with the current (>= 2.6.27) Linux kernel version. vid_hdr_offset is placed differently (2048 instead of 512) without this fix. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Scott Wood <scottwood@freescale.com>
* Add markbad functionKyungmin Park2009-01-231-0/+33
| | | | | | | Add missing markbad function If not, it's hang when it entered the mtd->mark_bad(). Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* OneNAND: Save version_id in onenand_chip structStefan Roese2009-01-231-0/+1
| | | | | | | | The version (ver_id) was not stored in the onenand_chip structure and because of this the continuous locking scheme could be enabled on some chips. Signed-off-by: Stefan Roese <sr@denx.de>
* OneNAND: Fix compiler warningsStefan Roese2009-01-231-0/+26
| | | | Signed-off-by: Stefan Roese <sr@denx.de>
* Sync with 2.6.27Kyungmin Park2009-01-233-156/+370
| | | | | | Sync with OneNAND kernel codes Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
* Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxWolfgang Denk2008-12-301-2/+4
|\
| * NAND FSL elbc: Use virt_to_phys to determine which bank is in useKumar Gala2008-12-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The current code that determines which bank/chipselect is used for a given NAND instance only worked for 32-bit addresses and assumed a 1:1 mapping. This breaks in 36-bit physical configs. The proper way to handle this is to use the virt_to_phys() and BR_PHYS_ADDR() routinues to match the 34-bit lbc bus address with the the virtual address the NAND code uses. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Scott Wood <scottwood@freescale.com>
* | NAND: Mark the BBT as scanned prior to calling scan_bbt.Scott Wood2008-12-161-1/+1
|/ | | | | | | | Otherwise, recursion can occur if scan_bbt does not find a bad block table, and tries to write one, and the attempt to erase the BBT area causes a bad block check. Signed-off-by: Scott Wood <scottwood@freescale.com>
* Coding style cleanup, update CHANGELOG.Wolfgang Denk2008-12-163-3/+3
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* spi/stmicro: fix debug() display of cmdMike Frysinger2008-12-161-1/+1
| | | | | | | | The stmicro_wait_ready() func tries to show the actual opcode that was sent to the device, but instead it displays the array pointer. Fix it to pull out the opcode from the start of the array. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* UBI: Return -ENOMEM upon failing mallocStefan Roese2008-12-101-2/+3
| | | | | | | Return with correct error code (-ENOMEM) from ubi_attach_mtd_dev() upon failing malloc(). Signed-off-by: Stefan Roese <sr@denx.de>
* UBI: Enable re-initializing of the "ubi part" commandStefan Roese2008-12-091-0/+1
| | | | | | | With this patch now, the user can call "ubi part" multiple times to re-connect the UBI device to another MTD partition. Signed-off-by: Stefan Roese <sr@denx.de>
* MTD: Fix problem based on non-working relocation (list head mtd_partitions)Stefan Roese2008-12-091-1/+9
| | | | | | | | Don't use LIST_HEAD() but initialize the struct via INIT_LIST_HEAD() upon first call of add_mtd_partitions(). Otherwise this won't work on platforms where the relocation is broken (like MIPS or PPC). Signed-off-by: Stefan Roese <sr@denx.de>
* mtd/dataflash.c: fix a problem with the last partitionIlko Iliev2008-12-021-1/+1
| | | | | | | | | This patch fix the problem that only the [NB_DATAFLASH_AREA - 1] dataflash partition can be defined to use the area to the end of dataflash size. Now it is possible to have only one dataflash partition from 0 to the end of of dataflash size. Signed-off-by: Ilko Iliev <iliev@ronetix.at>
* fix some coding style violations.Ilko Iliev2008-12-021-13/+12
| | | | | | This patch fix some coding style violations. Signed-off-by: Ilko Iliev <iliev@ronetix.at>
* NAND: Fix misplaced return statement in nand_{read,write}_skip_bad().Scott Wood2008-11-251-6/+6
| | | | | | | | This caused the operation to be needlessly repeated if there were no bad blocks and no errors. Signed-off-by: Valeriy Glushkov <gvv@lstec.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
* Merge branch 'master' of git://git.denx.de/u-boot-ubiWolfgang Denk2008-11-2522-0/+12566
|\
| * mtd: Remove a printf() from add_mtd_device().Piotr Ziecik2008-11-241-2/+0
| | | | | | | | | | | | | | Remove a printf() from add_mtd_device(), which produces spurious output. Signed-off-by: Piotr Ziecik <kosmo@semihalf.com> Signed-off-by: Stefan Roese <sr@denx.de>
| * UBI: Add basic UBI support to U-Boot (Part 5/8)Kyungmin Park2008-11-194-0/+3810
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic UBI (Unsorted Block Image) support to U-Boot. It's based on the Linux UBI version and basically has a "OS" translation wrapper that defines most Linux specific calls (spin_lock() etc.) into no-ops. Some source code parts have been uncommented by "#ifdef UBI_LINUX". This makes it easier to compare this version with the Linux version and simplifies future UBI ports/bug-fixes from the Linux version. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>
| * UBI: Add basic UBI support to U-Boot (Part 4/8)Kyungmin Park2008-11-194-0/+2538
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic UBI (Unsorted Block Image) support to U-Boot. It's based on the Linux UBI version and basically has a "OS" translation wrapper that defines most Linux specific calls (spin_lock() etc.) into no-ops. Some source code parts have been uncommented by "#ifdef UBI_LINUX". This makes it easier to compare this version with the Linux version and simplifies future UBI ports/bug-fixes from the Linux version. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>
| * UBI: Add basic UBI support to U-Boot (Part 3/8)Kyungmin Park2008-11-193-0/+2018
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic UBI (Unsorted Block Image) support to U-Boot. It's based on the Linux UBI version and basically has a "OS" translation wrapper that defines most Linux specific calls (spin_lock() etc.) into no-ops. Some source code parts have been uncommented by "#ifdef UBI_LINUX". This makes it easier to compare this version with the Linux version and simplifies future UBI ports/bug-fixes from the Linux version. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>
| * UBI: Add basic UBI support to U-Boot (Part 2/8)Kyungmin Park2008-11-195-0/+1768
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic UBI (Unsorted Block Image) support to U-Boot. It's based on the Linux UBI version and basically has a "OS" translation wrapper that defines most Linux specific calls (spin_lock() etc.) into no-ops. Some source code parts have been uncommented by "#ifdef UBI_LINUX". This makes it easier to compare this version with the Linux version and simplifies future UBI ports/bug-fixes from the Linux version. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>
| * UBI: Add basic UBI support to U-Boot (Part 1/8)Kyungmin Park2008-11-193-0/+1755
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic UBI (Unsorted Block Image) support to U-Boot. It's based on the Linux UBI version and basically has a "OS" translation wrapper that defines most Linux specific calls (spin_lock() etc.) into no-ops. Some source code parts have been uncommented by "#ifdef UBI_LINUX". This makes it easier to compare this version with the Linux version and simplifies future UBI ports/bug-fixes from the Linux version. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>
OpenPOWER on IntegriCloud