aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAge
* UBI: fix check_data_ff return codeArtem Bityutskiy2010-10-21
| | | | | | | | When the data does not contain all 0xFF bytes, 'check_data_ff()' should return 1, not -EINVAL; Also, the caller ('process_eb()') should not add the PEB to the "corrupted" list if there was a read error. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: remember copy_flag while scanningArtem Bityutskiy2010-10-21
| | | | | | | | | | | While scanning the flash we read all VID headers and store some important information in 'struct ubi_scan_leb'. Store also the 'copy_flag' value there as it is needed when comparing LEBs. We do not increase memory consumption because this is just one bit and we have plenty of spare bits in 'struct ubi_scan_leb' (sizeof(struct ubi_scan_leb) is 48 both with and without this patch). Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: preserve corrupted PEBsArtem Bityutskiy2010-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently UBI erases all corrupted eraseblocks, irrespectively of the nature of corruption: corruption due to power cuts and non-power cut corruption. The former case is OK, but the latter is not, because UBI may destroy potentially important data. With this patch, during scanning, when UBI hits a PEB with corrupted VID header, it checks whether this PEB contains only 0xFF data. If yes, it is safe to erase this PEB and it is put to the 'erase' list. If not, this may be important data and it is better to avoid erasing this PEB. Instead, UBI puts it to the corr list and moves out of the pool of available PEB. IOW, UBI preserves this PEB. Such corrupted PEB lessen the amount of available PEBs. So the more of them we accumulate, the less PEBs are available. The maximum amount of non-power cut corrupted PEBs is 8. This patch is a response to UBIFS problem where reporter (Matthew L. Creech <mlcreech@gmail.com>) observes that UBIFS index points to an unmapped LEB. The theory is that corresponding PEB somehow got corrupted and UBI wiped it. This patch (actually a series of patches) tries to make sure such PEBs are preserved - this would make it is easier to analyze the corruption. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: add truly corrupted PEBs to corrupted listArtem Bityutskiy2010-10-19
| | | | | | | | | | | | Start using the 'corr' list and add there PEBs which look truly corrupted, which means they have corrupted VID header and the data which follows the corrupted header does not contain all 0xFF bytes. At the moment, this does not change UBI functionality much because these PEBs will be erase when scanning finishes. But the plan is to teach UBI preserving them. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: introduce debugging helper functionArtem Bityutskiy2010-10-19
| | | | | | | Introduce a helper function to print hexdump: 'ubi_dbg_print_hex_dump()'. It is compiled out if debugging is enabled. Will be used in the next patch. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: make check_pattern function non-staticArtem Bityutskiy2010-10-19
| | | | | | | | This patch turns static function 'check_pattern()' into a non-static 'ubi_check_pattern()'. This is just a preparation for the chages which are coming in the next patches. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: do not put eraseblocks to the corrupted list unnecessarilyArtem Bityutskiy2010-10-19
| | | | | | | | | | | | | | | | | | | | | | | Currently UBI maintains 2 lists of PEBs during scanning: 1. 'erase' list - PEBs which have no corruptions but should be erased 2. 'corr' list - PEBs which have some corruptions and should be erased But we do not really need 2 lists for PEBs which should be erased after scanning is done - this is redundant. So this patch makes sure all PEBs which are corrupted are moved to the head of the 'erase' list. We add them to the head to make sure they are erased first and we get rid of corruption ASAP. However, we do not remove the 'corr' list and realted functions, because the plan is to use this list for other purposes. Namely, we plan to put eraseblocks with corruption which does not look like it was caused by unclean power cut. Then we'll preserve thes PEBs in order to avoid killing potentially valuable user data. This patch also amends PEBs accounting, because it was closely tight to the 'erase'/'corr' lists separation. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: separate out corrupted listArtem Bityutskiy2010-10-19
| | | | | | | | This patch introduces 'add_corrupted()' function and separates out 'corr' list manipulation from the common 'add_to_list()' function. This is just a preparation for further changes - this patch does not change functionality. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: change cascade of ifs to switch statementsArtem Bityutskiy2010-10-19
| | | | | | | | This patch improves readability and simplifies scanning code by changing a long cascade of 'if' statements to a switch statement. This should presumably be a little faster as well. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: rename a local variableArtem Bityutskiy2010-10-19
| | | | | | | | | | Rename local variable 'ec_corr' into 'ec_err' to make the code a little bit more readable. 'ec_err' is more appropriate because it sounds more like 'error when EC was read' and it looks more logical because we use it together with 'err'. Just a minor nicification which should improve the rather complex scanning code. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: handle bit-flips when no header foundArtem Bityutskiy2010-10-19
| | | | | | | | | | | | | | Currently UBI has one small flaw - when we read EC or VID header, but find only 0xFF bytes, we return UBI_IO_FF and do not report whether we had bit-flips or not. In case of the VID header, the scanning code adds this PEB to the free list, even though there were bit-flips. Imagine the following situation: we start writing VID header to a PEB and have a power cut, so the PEB becomes unstable. When we scan and read the PEB, we get a bit-flip. Currently, UBI would just ignore this and treat the PEB as free. This patch changes UBI behavior and now UBI will schedule this PEB for erasure. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: remove duplicate IO error codesArtem Bityutskiy2010-10-19
| | | | | | | | | | | The 'UBI_IO_PEB_EMPTY' and 'UBI_IO_PEB_FREE' are essentially the same and mean that there are only 0xFF bytes instead of headers. Simplify UBI a little by turning them into a single 'UBI_IO_FF' error code. Also, stop maintaining commentaries in 'ubi_io_read_vid_hdr()' which are almost identical to commentaries in 'ubi_io_read_ec_hdr()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: rename IO error codeArtem Bityutskiy2010-10-19
| | | | | | | | | Rename UBI_IO_BAD_HDR_READ into UBI_IO_BAD_HDR_EBADMSG which is presumably more self-documenting and readable. Indeed, the '_READ' suffix does not tell much and even confuses, while '_EBADMSG' tells about uncorrectable ECC error, because we use -EBADMSG all over the place to represent ECC errors. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: fix small 80 characters limit style issueArtem Bityutskiy2010-10-19
| | | | | | One line was longer than 80 lines, make it shorter. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* UBI: cleanup and simplify KconfigH Hartley Sweeten2010-10-19
| | | | | | | | | | | Cleanup the Kconfig for UBI by using menuconfig to enable/disable the entire driver. Remove the dependency checks for MTD_UBI and MTD_UBI_DEBUG by wrapping the options in if/endif blocks and remove any redundant checks. Remove all default n since that is the Kconfig default. Change menu "Additional UBI debugging messages" into a comment to remove one menu level. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* fix OMAP2 MTD build failureDaniel J Blueman2010-09-29
| | | | | | | | | Fix build failure from recent interface change and merge. Tested on OMAP3430. Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge git://git.infradead.org/mtd-2.6Linus Torvalds2010-09-14
|\ | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: mtd: pxa3xx: fix build error when CONFIG_MTD_PARTITIONS is not defined mtd: mxc_nand: configure pages per block for v2 controller mtd: OneNAND: Fix loop hang when DMA error at Samsung SoCs mtd: OneNAND: Fix 2KiB pagesize handling at Samsung SoCs mtd: Blackfin NFC: fix invalid free in remove() mtd: Blackfin NFC: fix build error after nand_scan_ident() change mxc_nand: Do not do byte accesses to the NFC buffer.
| * mtd: pxa3xx: fix build error when CONFIG_MTD_PARTITIONS is not definedMark F. Brown2010-09-13
| | | | | | | | | | | | Signed-off-by: Mark F. Brown <mark.brown314@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: mxc_nand: configure pages per block for v2 controllerSascha Hauer2010-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch initializes the pages per block field in CONFIG1 for v2 controllers. It also sets the FP_INT field. This is the last field not correctly initialized, so we can switch from read/modify/write the CONFIG1 reg to just write the correct value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: John Ogness <john.ogness@linutronix.de> Tested-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: OneNAND: Fix loop hang when DMA error at Samsung SoCsKyungmin Park2010-09-13
| | | | | | | | | | | | | | | | | | When DMA error occurs. it's loop hang since it can't exit the loop. and it's the right DMA handling code as Spec. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: OneNAND: Fix 2KiB pagesize handling at Samsung SoCsKyungmin Park2010-09-13
| | | | | | | | | | | | | | Wrong assumption bufferram can be switched between BufferRAM0 and BufferRAM1 Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: Blackfin NFC: fix invalid free in remove()Mike Frysinger2010-09-13
| | | | | | | | | | | | | | | | | | | | Since info->mtd isn't dynamically allocated, we shouldn't attempt to kfree() it. Otherwise we get random fun corruption when unloading the driver built as a module. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: Blackfin NFC: fix build error after nand_scan_ident() changeMike Frysinger2010-09-13
| | | | | | | | | | | | | | | | | | | | | | Seems some patches got out sync when being merged. The Blackfin NFC driver was updated to use nand_scan_ident(), but it missed the change where nand_scan_ident() now takes 3 arguments. So update this driver to fix build failures. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mxc_nand: Do not do byte accesses to the NFC buffer.John Ogness2010-08-26
| | | | | | | | | | | | | | | | | | | | | | | | This patch avoids byte access to the NFC buffer. Byte access to the NFC is not allowed. The patch is against linux-next 20100618. Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | UBI: do not oops when erroneous PEB is scheduled for scrubbingArtem Bityutskiy2010-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an erroneous PEB is scheduling for scrubbing, we end up with the following oops: [<c0162404>] (prot_queue_del+0x0/0x50) from [<c01635b4>] (ubi_wl_scrub_peb+0xec/0x13c) [<c01634c8>] (ubi_wl_scrub_peb+0x0/0x13c) from [<c01603bc>] (ubi_eba_read_leb+0x200/0x428) [<c01601bc>] (ubi_eba_read_leb+0x0/0x428) from [<c015e3c0>] (ubi_leb_read+0xe8/0x138) [<c015e2d8>] (ubi_leb_read+0x0/0x138) from [<c00d6918>] (ubifs_start_scan+0x7c/0xf4) [<c00d689c>] (ubifs_start_scan+0x0/0xf4) from [<c00e3650>] (ubifs_recover_leb+0x3c/0x730) [<c00e3614>] (ubifs_recover_leb+0x0/0x730) from [<c00e444c>] (ubifs_recover_log_leb+0xc8/0x2dc) [<c00e4384>] (ubifs_recover_log_leb+0x0/0x2dc) from [<c00d7c20>] (ubifs_replay_journal+0xb90/0x13a4) [<c00d7090>] (ubifs_replay_journal+0x0/0x13a4) from [<c00cdd68>] (ubifs_fill_super+0xb84/0x1054) [<c00cd1e4>] (ubifs_fill_super+0x0/0x1054) from [<c00ced04>] (ubifs_get_sb+0xc4/0x2ac) [<c00cec40>] (ubifs_get_sb+0x0/0x2ac) from [<c007f04c>] (vfs_kern_mount+0x58/0x94) [<c007eff4>] (vfs_kern_mount+0x0/0x94) from [<c007f0e8>] (do_kern_mount+0x40/0xe8) [<c007f0a8>] (do_kern_mount+0x0/0xe8) from [<c0095628>] (do_new_mount+0x68/0x8c) [<c00955c0>] (do_new_mount+0x0/0x8c) from [<c00957a8>] (do_mount+0x15c/0x1b8) [<c009564c>] (do_mount+0x0/0x1b8) from [<c0095890>] (sys_mount+0x8c/0xd4) [<c0095804>] (sys_mount+0x0/0xd4) from [<c0023c00>] (ret_fast_syscall+0x0/0x2c) Kernel panic - not syncing: Fatal exception The problem is that 'ubi_wl_scrub_peb()' does not expect that PEBs may be in the erroneous tree, which is a bug. This patch fixes the bug and adds corresponding check to 'ubi_wl_scrub_peb()'. Now it will simply ignore erroneous PEBs, instead of causing an oops. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* | UBI: fix kconfig unmet dependencyRandy Dunlap2010-08-30
| | | | | | | | | | | | | | | | | | | | | | | | warning: (OPTPROBES && KPROBES && HAVE_OPTPROBES && !PREEMPT && DEBUG_KERNEL || MTD_UBI_DEBUG && MTD && SYSFS && MTD_UBI || UBIFS_FS_DEBUG && MISC_FILESYSTEMS && UBIFS_FS || LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT || LATENCYTOP && HAVE_LATENCYTOP_SUPPORT && DEBUG_KERNEL && STACKTRACE_SUPPORT && PROC_FS) selects KALLSYMS_ALL which has unmet direct dependencies (DEBUG_KERNEL && KALLSYMS) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* | UBI: fix forward compatibilityArtem Bityutskiy2010-08-30
| | | | | | | | | | | | | | | | | | | | | | | | Commit 0798cea8c2e1afee59686c51d27d0e96b05e42d1 "UBI: improve corrupted flash handling" broke delet-compatible volumes handling - it introduced a limit of 8 eraseblocks which may be corrupted. And delete-compatible eraseblocks are added to the "corrupted" list, so if we'd have a large delete-compatible volume, UBI would refuse it. The fix is to add delete-compatible volumes to the erase list instead. Indeed, they are corrupted, we just have to erase them. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* | UBI: eliminate update of list_for_each_entry loop cursorJulia Lawall2010-08-30
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | list_for_each_entry uses its first argument to move from one element to the next, so modifying it can break the iteration. The variable re1 is already used within the loop as a temporary variable, and is not live here. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ iterator name list_for_each_entry; expression x,E; position p1,p2; @@ list_for_each_entry@p1(x,...) { <... x =@p2 E ...> } @@ expression x,E; position r.p1,r.p2; statement S; @@ *x =@p2 E ... list_for_each_entry@p1(x,...) S // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* Merge git://git.infradead.org/mtd-2.6Linus Torvalds2010-08-21
|\ | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: mtd: nand: Fix probe of Samsung NAND chips mtd: nand: Fix regression in BBM detection pxa3xx: fix ns2cycle equation
| * mtd: nand: Fix probe of Samsung NAND chipsTilman Sauerbeck2010-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, the check for a 6-byte ID string introduced by commit 426c457a3216fac74e3d44dd39729b0689f4c7ab ("mtd: nand: extend NAND flash detection to new MLC chips") is NOT sufficient to determine whether or not a Samsung chip uses their new MLC detection scheme or the old, standard scheme. This adds a condition to check cell type. Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de> Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Cc: stable@kernel.org
| * mtd: nand: Fix regression in BBM detectionBrian Norris2010-08-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c7b28e25cb9beb943aead770ff14551b55fa8c79 ("mtd: nand: refactor BB marker detection") caused a regression in detection of factory-set bad block markers, especially for certain small-page NAND. This fix removes some unneeded constraints on using NAND_SMALL_BADBLOCK_POS, making the detection code more correct. This regression can be seen, for example, in Hynix HY27US081G1M and similar. Signed-off-by: Brian Norris <norris@broadcom.com> Tested-by: Michael Guntsche <mike@it-loops.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * pxa3xx: fix ns2cycle equationAxel Lin2010-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test on a PXA310 platform with Samsung K9F2G08X0B NAND flash, with tCH=5 and clk is 156MHz, ns2cycle(5, 156000000) returns -1. ns2cycle returns negtive value will break NDTR0_tXX macros. After checking the commit log, I found the problem is introduced by commit 5b0d4d7c8a67c5ba3d35e6ceb0c5530cc6846db7 "[MTD] [NAND] pxa3xx: convert from ns to clock ticks more accurately" To get num of clock cycles, we use below equation: num of clock cycles = time (ns) / one clock cycle (ns) + 1 We need to add 1 cycle here because integer division will truncate the result. It is possible the developers set the Min values in SPEC for timing settings. Thus the truncate may cause problem, and it is safe to add an extra cycle here. The various fields in NDTR{01} are in units of clock ticks minus one, thus we should subtract 1 cycle then. Thus the correct equation should be: num of clock cycles = time (ns) / one clock cycle (ns) + 1 - 1 = time (ns) / one clock cycle (ns) Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Lei Wen <leiwen@marvell.com> Acked-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Cc: stable@kernel.org
* | of: fix missing headers for of_address_to_resource() in MTD and SysACE driversGraeme Smecher2010-08-17
|/ | | | | | | | | The drivers for Xilinx' SystemACE and physically mapped MTDs were missing prototypes for of_address_to_resource(). This patch adds the necessary headers. Signed-off-by: Graeme Smecher <graeme.smecher@mail.mcgill.ca> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Merge git://git.infradead.org/mtd-2.6Linus Torvalds2010-08-15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: mtd/nand_ids: Fix buswidth mtd/m25p80: fix test for end of loop mtd/m25p80: retlen is never NULL MIPS: Fix gen_nand probe structures contents gen_nand: Test if nr_chips field is valid BFIN: Fix gen_nand probe structures contents nand/denali: move all hardware initialization work to denali_hw_init nand/denali: Add a page check in denali_read_page & denali_read_page_raw nand/denali: use cpu_relax() while waiting for hardware interrupt nand/denali: change read_status function method nand/denali: Fixed check patch warnings ARM: Fix gen_nand probe structures contents mtd/nand_base: fix kernel-doc warnings & typos nand/denali: use dev_xx debug function to replace nand_dbg_print and some printk nand/denali: Fixed handle ECC error bugs nand/denali: use iowrite32() to replace denali_write32() nand/denali: Fixed probe function bugs
| * mtd/nand_ids: Fix buswidthBrian Norris2010-08-13
| | | | | | | | | | | | | | | | The buswidth for chips of ID 0xD7 is x8, not x16. This was my previous typo. Signed-off-by: Brian Norris <norris@broadcom.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd/m25p80: fix test for end of loopDan Carpenter2010-08-12
| | | | | | | | | | | | | | | | | | | | | | | | "plat_id" is always non-NULL here. There is a zero element on the end of the m25p_ids[] array and if we hit the end of the loop then plat_id points to that. This would lead to a NULL pointer dereference later on in the function. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd/m25p80: retlen is never NULLDan Carpenter2010-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just a cleanup, it doesn't fix any bugs. These functions all check retlen inconsistently and it generates a warning in Smatch (http://smatch.sf.net). If retlen were ever NULL it would cause an oops and the code has been this way since 2006 so someone would have complained. Also I looked at other places that implemented the mtd read and write functions and they dereference retlen without checking. I removed the checks. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * gen_nand: Test if nr_chips field is validMarek Vasut2010-08-12
| | | | | | | | | | Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: move all hardware initialization work to denali_hw_initChuanxiao Dong2010-08-12
| | | | | | | | | | | | | | | | | | | | All hardware initialization will be done in denali_hw_init before irq handler registered Change mtd name from "DENALI NAND" to be "denali-nand" since whitespace in name can cause problems if we use cmdlinepart Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: Add a page check in denali_read_page & denali_read_page_rawChuanxiao Dong2010-08-12
| | | | | | | | | | Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: use cpu_relax() while waiting for hardware interruptChuanxiao Dong2010-08-12
| | | | | | | | | | Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: change read_status function methodChuanxiao Dong2010-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In mtd->write, Denali controller will use MODE_11 mode to read NAND flash status, then return back to MODE_1O mode to do page write. Here comes a bug for this kind of using, sometimes controller will not write data to NAND and just return a good interrupt to tell driver writing work is done. The data in this page is all 0xff and this page can not be written again. The reason is unknow. So read Denali controller register WRITE_PROTECT to get NAND status instead. Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: Fixed check patch warningsChuanxiao Dong2010-08-12
| | | | | | | | | | | | | | waring: no space for starting a line Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd/nand_base: fix kernel-doc warnings & typosRandy Dunlap2010-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix mtd/nand_base.c kernel-doc warnings and typos. Warning(drivers/mtd/nand/nand_base.c:893): No description found for parameter 'mtd' Warning(drivers/mtd/nand/nand_base.c:893): No description found for parameter 'ofs' Warning(drivers/mtd/nand/nand_base.c:893): No description found for parameter 'len' Warning(drivers/mtd/nand/nand_base.c:893): No description found for parameter 'invert' Warning(drivers/mtd/nand/nand_base.c:930): No description found for parameter 'mtd' Warning(drivers/mtd/nand/nand_base.c:930): No description found for parameter 'ofs' Warning(drivers/mtd/nand/nand_base.c:930): No description found for parameter 'len' Warning(drivers/mtd/nand/nand_base.c:987): No description found for parameter 'mtd' Warning(drivers/mtd/nand/nand_base.c:987): No description found for parameter 'ofs' Warning(drivers/mtd/nand/nand_base.c:987): No description found for parameter 'len' Warning(drivers/mtd/nand/nand_base.c:2087): No description found for parameter 'len' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: use dev_xx debug function to replace nand_dbg_print and some printkChuanxiao Dong2010-08-10
| | | | | | | | | | Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: Fixed handle ECC error bugsChuanxiao Dong2010-08-10
| | | | | | | | | | | | | | | | | | Once the last ECC error was handled, controller will triger an interrupt. If this interrupt can not be clean on time, controller may corrupt. Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: use iowrite32() to replace denali_write32()Chuanxiao Dong2010-08-10
| | | | | | | | | | | | | | | | denali_write32() just implements a debug function for iowrite32(), only print out the write value. Remove this function since it's useless Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * nand/denali: Fixed probe function bugsChuanxiao Dong2010-08-10
| | | | | | | | | | | | | | | | Fixed a pci_resource_len function error; Changed returning sequence of probe function; Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds2010-08-12
|\ \ | | | | | | | | | | | | | | | | | | * 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: mmc_spi: Fix unterminated of_match_table of/sparc: fix build regression from of_device changes of/device: Replace struct of_device with struct platform_device
| * | of/device: Replace struct of_device with struct platform_deviceGrant Likely2010-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_device is just an alias for platform_device, so remove it entirely. Also replace to_of_device() with to_platform_device() and update comment blocks. This patch was initially generated from the following semantic patch, and then edited by hand to pick up the bits that coccinelle didn't catch. @@ @@ -struct of_device +struct platform_device Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Reviewed-by: David S. Miller <davem@davemloft.net>