summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/mxc_nand.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-20mtd: mxc_nand: Remove duplicate NAND_CMD_RESET case valueDavid Woodhouse1-1/+0
This reverts commit 66803762 ("mtd: mxc_nand: add RESET command support"). Support for NAND_CMD_RESET was added separately in commit d4840180 ("mtd: mxc_nand: set NFC registers after reset"), causing a build error: drivers/mtd/nand/mxc_nand.c: In function 'mxc_nand_command': drivers/mtd/nand/mxc_nand.c:689: error: duplicate case value drivers/mtd/nand/mxc_nand.c:606: error: previously used here Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14mtd: mxc_nand: support i.MX21Ivo Clarysse1-16/+25
On i.MX21 SoCs, if the NFC_CONFIG1:NFC_INT_MASK bit is set, NFC_CONFIG2:NFC_INT always reads out zero, even if an operation is completed. This patch uses enable_irq and disable_irq_nosync instead of NFC_CONFIG1:NFC_INT_MASK to mask NFC interrupts. This allows NFC_CONFIG2:NFC_INT to also be used to detect operation completion on i.MX21. The i.MX21 NFC does not signal reset completion using NFC_CONFIG1:NFC_INT_MASK, so instead reset completion is tested by checking if NFC_CONFIG2 becomes 0. Signed-off-by: Ivo Clarysse <ivo.clarysse@gmail.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-14mtd: mxc_nand: set NFC registers after resetIvo Clarysse1-42/+48
This patch allows the mxc_nand driver to reset the NAND flash controller. NFC registers are (re-)set after completion of the reset, as a reset will have reverted the NFC registers to their default values. Signed-off-by: Ivo Clarysse <ivo.clarysse@gmail.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-03-26Merge branch 'master' of ↵David Woodhouse1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: drivers/mtd/nand/sh_flctl.c Maxim's patch to initialise sysfs attributes depends on the patch which actually adds sysfs_attr_init().
2010-02-26mtd: nand: Allow caller to pass alternative ID table to nand_scan_ident()David Woodhouse1-1/+1
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-26mtd: mxc_nand: add RESET command supportEric Benard1-0/+1
mxc_nand driver must support the RESET Command in order to support Micron NAND which need a reset before any other command. Signed-off-by: Eric Benard <eric@eukrea.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: mxc-nand: don't disable clock in mxcnd-suspendUwe Kleine-König1-4/+6
The clock must already be off after mtd->suspend. Disabling it again results in an negative overflow of the clock usage count. This didn't hurt as mxcnd_resume undid it after wake up. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-25mtd: mxc-nand: no need to check for validity of platform driver dataUwe Kleine-König1-10/+7
The probe function calls platform_set_drvdata with a valid pointer when the probe is successful. As mxcnd_suspend and mxcnd_resume are only called on bound devices, platform_get_drvdata always returns non-NULL. This fix isn't critical as the pointer is always valid so it doesn't matter if the compiler generated code for it or not. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reported-by: David Binderman <dcb314@hotmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-02-09tree-wide: Assorted spelling fixesDaniel Mack1-1/+1
In particular, several occurances of funny versions of 'success', 'unknown', 'therefore', 'acknowledge', 'argument', 'achieve', 'address', 'beginning', 'desirable', 'separate' and 'necessary' are fixed. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Joe Perches <joe@perches.com> Cc: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-12-07Revert "mtd: move mxcnd_remove to .exit.text"Uwe Kleine-König1-1/+1
This reverts commit 82613b0da622efbd24cb7b23eb349966802310f1, because commit daa0f15 (mtd: don't use __exit_p to wrap mxcnd_remove) is a better solution. Not having a remove callback breaks rebinding because resources are not freed on remove. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-11-30Merge branch 'mxc-nand' of git://git.pengutronix.de/git/imx/linux-2.6David Woodhouse1-475/+298
2009-11-30mtd: don't use __exit_p to wrap mxcnd_removeUwe Kleine-König1-1/+1
The function mxcnd_remove is defined using __devexit, so don't use __exit_p but __devexit_p to wrap it. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-11-12mxc_nand: use DRIVER_NAME where appropriateSascha Hauer1-2/+2
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: remove TROP_US_DELAYSascha Hauer1-10/+7
wait_op_done is only called with the same timeout, so code the timeout into the function itself. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: Allow flash based bbtSascha Hauer1-0/+34
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: disable sp_en bit only onceSascha Hauer1-12/+3
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: Add NFC V2 supportSascha Hauer1-13/+68
The v2 version of this controller is used on i.MX35/25 SoCs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: Get rid of pagesize_2k flagSascha Hauer1-15/+14
Later versions of this controller also allow 4k pagesize, so use mtd->writesize instead of a flag. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: Make main/spare areas runtime configurableSascha Hauer1-22/+20
The main/spare areas are on different addresses on later versions of the controller, so make them configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: remove unused definesSascha Hauer1-7/+0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc nand: modify send_page to send all pages, not only oneSascha Hauer1-25/+20
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc nand: simplify command processingSascha Hauer1-46/+35
Instead of having two switch/case with other operations in between, use only one switch/case Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc nand: use buffersSascha Hauer1-233/+77
The NAND controller has some limitations how to access the internal buffers. It only allows 32 bit accesses. The driver used to work around this by having special alignment aware copy routines. We now copy the whole page to a buffer in memory and let the access functions use this buffer. This simplifies the driver. A bonnie++ test showed that this has no negative performance impact on the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc nand: use resource_size()Sascha Hauer1-1/+1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc nand: remove dead codeSascha Hauer1-17/+0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc nand: remove debug paramSascha Hauer1-8/+8
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: introduce mxc_do_addr_cycleSascha Hauer1-40/+47
This factors the address cycle to a seperate function. This becomes useful in a later patch where we can simplify the command processing by making use of this function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: merge send_read_page and send_prog_pageSascha Hauer1-41/+13
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: cleanup initializationSascha Hauer1-50/+22
The oob layout was initialized several times. Instead, use a smallpage layout by default and switch to a largepage afterwards if necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-12mxc_nand: cleanup eccoob descriptionsSascha Hauer1-15/+9
The original Freescale driver used to have eccoob descriptions like this: static struct nand_ecclayout nand_hw_eccoob_8 = { .eccbytes = 5, .eccpos = {6, 7, 8, 9, 10}, .oobfree = {{0, 5}, {11, 5}} }; static struct nand_ecclayout nand_hw_eccoob_16 = { .eccbytes = 5, .eccpos = {6, 7, 8, 9, 10}, .oobfree = {{0, 6}, {12, 4}} }; The former was used for 8bit flashes and the latter for 16bit flashes. They honored the fact that the bad block marker on 8bit flashes is on byte 5 while on 16bit flashes it is on byte 11. In the Kernel driver this was copied wrong and we ended up with two identical descriptions. Change it so that we have only one description which leaves byte 5 and byte 11 unspecified so that it won't be used by others. Also, rename the descriptions to nand_hw_eccoob_smallpage and nand_hw_eccoob_largepage so that it can't be confused with Nand chip bus widths (what actually happened in this driver) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-10-20Revert "mtd: mxc_nand: fix 2KiB pagesize NAND on i.MX27"David Woodhouse1-15/+1
This reverts commit 71b7d0d90d536ae4e70929cc59a1a9f6ba457c6c. The problem which that commit attempted to fix was a bootloader issue, which had been misunderstood. The 'fix' causes lots of false bad blocks for existing users with sane firmware. Thanks to Mathieu Berland for diagnosing the problem coherently. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-10-17mtd: move mxcnd_remove to .exit.textUwe Kleine-König1-1/+1
The function mxcnd_remove is used only wrapped by __exit_p so define it using __exit. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Vladimir Barinov <vova.barinov@gmail.com> Cc: Vladimir Barinov <vbarinov@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-09-19mtd: mxc_nand: fix 2KiB pagesize NAND on i.MX27Eric Benard1-1/+15
This patch allows i.MX27 to support 2KiB pagesize NAND flash. We are using a 1.8V NAND flash which datasheet (unfortunately only available under NDA) says : Page size: x8: 2,112 bytes (2,048 + 64 bytes). Without this patch, all sectors are marked as bad eraseblock. Signed-off-by: Eric Benard <ebenard@eukrea.com> Acked-by : Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-08Merge branch 'next-mtd' of git://aeryn.fluff.org.uk/bjdooks/linuxDavid Woodhouse1-16/+24
2009-06-05mtd: nand: max_retries off by one in mxc_nandRoel Kluin1-1/+1
with `while (max_retries-- > 0)' max_retries reaches -1 after the loop. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-05mtd: MXC NAND support for 2KiB page size flashesVladimir Barinov1-9/+51
- Add support for 2KiB page size flashes - Fix page address access for large pages - Detect oob layout at runtime - handle pagesize_2k variable - Fix oob16 layout: reserve location 5 of oob area since it's used for bbt Signed-off-by: Vladimir Barinov <vova.barinov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-05mtd: mxc_nand: add correct dev_id parameter to free_irq() callsMagnus Lilja1-2/+2
Make sure to pass the same dev_id data to free_irq() that was used when calling request_irq(), otherwise we get a warning about freeing an already free IRQ. Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-05-29mtd: MXC NAND driver fixes (v5)Vladimir Barinov1-20/+23
The following patch fixes: - re-initialization of host->col_addr which is used as byte index between the successive READID flash commands. - compile error when CONFIG_PM is enabled - pass on the error code from clk_get() - return -ENOMEM in case of failed ioremap() - pass on the return value of platform_driver_probe() directly - remove excessive printk - let command line partition table parsing with mxc_nand name. The cmd_line parsing is done via <mtd-id> name that differs from mxc_nand by default and looks like "NAND 256MiB 1,8V 8-bit" Signed-off-by: Vladimir Barinov <vbarinov@embeddedalley.com> Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-05-26[MTD] Remove mtd->{suspend,resume} calls from board driversDavid Woodhouse1-5/+0
Now the MTD core will do this for us, we don't need to hook it up from the board drivers. Shame we can't do shutdown from the class too... Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-04-06Merge git://git.infradead.org/mtd-2.6Linus Torvalds1-0/+1
* git://git.infradead.org/mtd-2.6: (53 commits) [MTD] struct device - replace bus_id with dev_name(), dev_set_name() [MTD] [NOR] Fixup for Numonyx M29W128 chips [MTD] mtdpart: Make ecc_stats more realistic. powerpc/85xx: TQM8548: Update DTS file for multi-chip support powerpc: NAND: FSL UPM: document new bindings [MTD] [NAND] FSL-UPM: Add wait flags to support board/chip specific delays [MTD] [NAND] FSL-UPM: add multi chip support [MTD] [NOR] Add device parent info to physmap_of [MTD] [NAND] Add support for NAND on the Socrates board [MTD] [NAND] Add support for 4KiB pages. [MTD] sysfs support should not depend on CONFIG_PROC_FS [MTD] [NAND] Add parent info for CAFÉ controller [MTD] support driver model updates [MTD] driver model updates (part 2) [MTD] driver model updates [MTD] [NAND] move gen_nand's probe function to .devinit.text [MTD] [MAPS] move sa1100 flash's probe function to .devinit.text [MTD] fix use after free in register_mtd_blktrans [MTD] [MAPS] Drop now unused sharpsl-flash map [MTD] ofpart: Check name property to determine partition nodes. ... Manually fix trivial conflict in drivers/mtd/maps/Makefile
2009-04-04[MTD] support driver model updatesDavid Brownell1-0/+1
Follow-on patch to the previous driver model patch for the MTD framework. This one makes various MTD drivers connect to the driver model tree, so /sys/devices/virtual/mtd/* nodes are no longer present ... mostly drivers used on boards I have handy. Based on a patch from Kay Sievers. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-03-13[ARM] MXC: remove _clk suffix from clock namesSascha Hauer1-1/+1
The context makes it clear already that these are clocks, so there's no need for such a suffix. This patch only changes the clocks actually used in the tree. The remaining clocks are renamed in the subsequent architecture specific patches. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-09-02[MTD] [NAND] Freescale i.MX2 NAND driverSascha Hauer1-0/+1077
This patch adds support for the integrated NAND flash controller of the i.MX2 and i.MX3 family. It is tested on MX27 but should work on MX3 aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Juergen Beisert <j.beisert@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>