summaryrefslogtreecommitdiff
path: root/drivers/mtd
AgeCommit message (Collapse)Author
2009-02-07Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/masterWolfgang Denk
2009-02-07Merge branch 'master' of git://git.denx.de/u-boot-nand-flashWolfgang Denk
2009-02-06NAND: Add timeout for reset commandPeter Tyser
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>
2009-02-06NAND: Silence warning when CONFIG_SYS_NAND_QUIET_TESTPeter Tyser
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>
2009-02-06NAND: Fixed invalid pointers to static relocated chip namesValeriy Glushkov
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>
2009-02-05cfi_flash: Fix typo in cfi_flash.cStefan Roese
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>
2009-02-05jedec_flash: Only use manufacturer defines from common flash.hStefan Roese
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>
2009-02-05cfi_flash: Silence compilation warningStefan Roese
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>
2009-02-05flash/cfi_flash: Use virtual sector start address, not physBecky Bruce
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>
2009-02-04Fix compiler warningWolfgang Denk
(shows up only when DEBUG is enabled) Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-02-02Blackfin: add driver for on-chip NAND controllerMike Frysinger
This is a port of the Linux Blackfin on-chip NFC driver to U-Boot. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-01Merge branch 'master' of git://git.denx.de/u-boot-armWolfgang Denk
2009-01-26CFI: Add geometry reversal for STMicro M29W320ETRichard Retanubun
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>
2009-01-26CFI: increase performance of function find_sector()Jens Gehrlein
Tested on TQM5200S-BD with Samsung K8P2815UQB Signed-off-by: Jens Gehrlein <sew_s@tqs.de> Signed-off-by: Stefan Roese <sr@denx.de>
2009-01-26CFI: avoid redundant function call in single word programming modeJens Gehrlein
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>
2009-01-24OMAP3: Add NAND supportDirk Behme
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>
2009-01-24spi flash: fix crash due to spi flash miscommunicationBrad Bozarth
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>
2009-01-24Added legacy flash ST Micro M29W040BNiklaus Giger
2009-01-23nand: fixup printf modifiers to match types usedMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-01-23NAND: rename NAND_MAX_CHIPS to CONFIG_SYS_NAND_MAX_CHIPSWolfgang Grandegger
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>
2009-01-23NAND: Enable nand lock, unlock featureNishanth Menon
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>
2009-01-23NAND: move board_nand_init to nand.hMike Frysinger
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>
2009-01-23OneNAND: Additional sync with 2.6.27Stefan Roese
- 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>
2009-01-23Add markbad functionKyungmin Park
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>
2009-01-23OneNAND: Save version_id in onenand_chip structStefan Roese
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>
2009-01-23OneNAND: Fix compiler warningsStefan Roese
Signed-off-by: Stefan Roese <sr@denx.de>
2009-01-23Sync with 2.6.27Kyungmin Park
Sync with OneNAND kernel codes Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-12-30Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxWolfgang Denk
2008-12-19NAND FSL elbc: Use virt_to_phys to determine which bank is in useKumar Gala
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>
2008-12-16NAND: Mark the BBT as scanned prior to calling scan_bbt.Scott Wood
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>
2008-12-16Coding style cleanup, update CHANGELOG.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-12-16spi/stmicro: fix debug() display of cmdMike Frysinger
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>
2008-12-10UBI: Return -ENOMEM upon failing mallocStefan Roese
Return with correct error code (-ENOMEM) from ubi_attach_mtd_dev() upon failing malloc(). Signed-off-by: Stefan Roese <sr@denx.de>
2008-12-09UBI: Enable re-initializing of the "ubi part" commandStefan Roese
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>
2008-12-09MTD: Fix problem based on non-working relocation (list head mtd_partitions)Stefan Roese
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>
2008-12-02mtd/dataflash.c: fix a problem with the last partitionIlko Iliev
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>
2008-12-02fix some coding style violations.Ilko Iliev
This patch fix some coding style violations. Signed-off-by: Ilko Iliev <iliev@ronetix.at>
2008-11-25NAND: Fix misplaced return statement in nand_{read,write}_skip_bad().Scott Wood
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>
2008-11-25Merge branch 'master' of git://git.denx.de/u-boot-ubiWolfgang Denk
2008-11-24mtd: Remove a printf() from add_mtd_device().Piotr Ziecik
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>
2008-11-24cfi-mtd: Add cfi-mtd driver.Piotr Ziecik
Add cfi-mtd driver, which exports CFI flash to MTD layer. This allows CFI flash devices to be used from MTD layer. Building of the new driver is controlled by CONFIG_FLASH_CFI_MTD option. Initialization is done by calling cfi_mtd_init() from flash_init(). Signed-off-by: Piotr Ziecik <kosmo@semihalf.com> Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-24cfi_flash: Add interface for flash verbosity controlPiotr Ziecik
Add interface for flash verbosity control. It allows to disable output from low-level flash API. It is useful when calling these low-level functions from context other than flash commands (for example the MTD/CFI interface implmentation). Signed-off-by: Piotr Ziecik <kosmo@semihalf.com> Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-24cfi_flash: Export flash_sector_size() function.Piotr Ziecik
Export flash_sector_size() function from drivers/mtd/cfi_flash.c, so that it can be used in the upcoming cfi-mtd driver. Signed-off-by: Piotr Ziecik <kosmo@semihalf.com> Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-24cfi_flash: Make all flash access functions weakStefan Roese
This patch defines all flash access functions as weak so that they can be overridden by board specific versions. This will be used by the upcoming VCTH board support where the NOR FLASH unfortunately can't be accessed memory-mapped. Special accessor functions are needed here. To enable this weak functions you need to define CONFIG_CFI_FLASH_USE_WEAK_ACCESSORS in your board config header. Otherwise the "old" default functions will be used resulting in smaller code. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-11-19UBI: Add basic UBI support to U-Boot (Part 5/8)Kyungmin Park
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>
2008-11-19UBI: Add basic UBI support to U-Boot (Part 4/8)Kyungmin Park
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>
2008-11-19UBI: Add basic UBI support to U-Boot (Part 3/8)Kyungmin Park
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>
2008-11-19UBI: Add basic UBI support to U-Boot (Part 2/8)Kyungmin Park
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>
2008-11-19UBI: Add basic UBI support to U-Boot (Part 1/8)Kyungmin Park
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>
2008-11-19MTD: Add MTD paritioning infrastructureKyungmin Park
This MTD part infrastructure will be used by the upcoming UBI support. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>