Commit Graph

568 Commits

Author SHA1 Message Date
Peter Huewe
22ef197963 trivial: mtd: add __init/__exit macros to init/exitfunctions
Trivial patch which adds the __init and __exit macros to the module_init /
module_exit functions to the following modules from drivers/mtd/
 devices/m25p80.c
 devices/slram.c
 linux version 2.6.30
 ftl.c
 nand/cafe_nand.c
 nand/cmx270_nand.c

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-12-03 02:04:01 -06:00
Peter Chen
b2e4d44bb5 ENGR00124477 MXC-Nand: Add disable BI swap entry at sys filesystem
In that case, the user can choose not to swap BI
if necessary, such as programming the bootloader.

Signed-off-by: Peter Chen <b29397@freescale.com>
2010-08-10 11:51:07 -05:00
Patrick Turley
b422b1ca4e ENGR00123828 Improved timing for the i.MX23/i.MX28 NAND Flash driver
Added improved timing calculations to the driver, and various other
support work.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:50:42 -05:00
Frank Li
f508044cbb ENGR00123436 Clear GPMI LOCK_CS to lower suspend current.
GPMI LOCK_CS set to low can lower suspend current about 5mA.

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: Turley Patrick <b18601@freescale.com>
2010-08-10 11:50:34 -05:00
Jason Liu
963774c857 ENGR00123170 Preserve NAND bad block indication
Preserve bad block indication of NAND

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:50:07 -05:00
Jason Liu
f470223cff ENGR00123134-2 MX53 NAND driver support
MX53 NAND driver support

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:50:02 -05:00
Jason Liu
a6a9ff450b ENGR00123131 NAND:Get resources from platform data
Get resources from platform data

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:50:01 -05:00
Patrick Turley
0b7e7c7578 ENGR00122964 Second pass at unified i.MX23/i.MX28 NAND Flash driver
Deleted the old drivers.

Broke the driver into separate files, for readability and to isolate
hardware dependencies.

Fixed bad block problems in the boot area for the i.MX23.

At this writing, UBI can't handle MTDs larger than 2GiB. If the
general use partition is larger than 2GiB, the driver will create
sub-partitions, none of which are larger than 2GiB.

Updated the default configs for the i.MX23 and i.MX28.

Other, miscellaneous changes.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:49:55 -05:00
Patrick Turley
fcb50ee09c ENGR00122629 Unified i.MX23/i.MX28 NAND Flash Driver
This driver unifies the i.MX23 and i.MX28 NAND Flash drivers into a single
driver that supports both SoC's.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:49:42 -05:00
Patrick Turley
95510f65cd ENGR00122062 Interim i.MX28 NAND Flash driver change to support booting
Changed the driver to detect ECC-based writes to the boot area and write a
byte to the OOB that matches the ROM behavior.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:48:48 -05:00
Patrick Turley
1331736c27 ENGR00122007 Kernel panic caused by i.MX28 GPMI NAND Flash driver
Fixed the driver to properly initialize a variable.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:48:46 -05:00
Patrick Turley
959817f7e3 ENGR00121689 i.MX28 GPMI driver doesn't compile correctly under some conditions
Changed the driver to ignore CONFIG_MTD_CONCAT, and work correctly with
CONFIG_MTD_PARTITIONS. Also turned on the GPMI driver and UBIFS in the
default config.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:48:29 -05:00
Patrick Turley
406d9075cd ENGR00117735-2 MX28: SLC/MLC NAND
Port the i.MX23 NAND Flash driver to i.MX28.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:48:13 -05:00
Jason
b4566a78e2 ENGR00120405 MX23 BCH:output debug information via pr_debug function
Output debug information via pr_debug function

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:46:37 -05:00
Jason
160dee8d80 ENGR00119693 Uniform handling NFC INT bit clearance
Uniform handling NFC INT bit clearance, the INT bit
will be unformed cleared in the wait_op_done function
after any NFC operation.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:46:29 -05:00
Jason
66ff713019 ENGR00119484 Update NFC INT wait timeout value to 1s
Update NFC INT wait timeout value to 1s.
1s should be enough for all platforms.
If INT bit not set for 1s timeout value, this
should be high potential of IC issues.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:46:23 -05:00
Patrick Turley
bde9c04a2a ENGR00119443 [MX23_BSP] GPMI driver computes wrong block size for K9GAG08U0D
Improved the GPMI driver's use of information from the device identification
database.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:46:18 -05:00
Jason
e4bb87cf4a ENGR00119324 Put GPMI NAND flash scan scheme code to the common NAND directory
1.GPMI NAND flash scan scheme can overcome the shortcomings
  of MTD NAND community code.

2.Put it to the common NAND directory can benifit I.MX NAND
  driver besides GPMI NAND driver.

3.Fix the section mismatch build warnings on ALL platforms.

4.Fix the kbuild build errors of I.MX platforms.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:46:16 -05:00
Jason
53e0dab7b7 ENGR00119242 Add wait timeout support to void dead loop in NAND driver
1. Add wait timeout support to void dead loop in NAND driver,
2. Try best to use IRQ mode instead of POLLING mode

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:46:12 -05:00
Jason
2cf6c691b9 ENGR00118872 Write bootstream to kernel by kobs with BCH ECC
Write bootstream to kernel by kobs with BCH ECC.
Using the same combined Metadata & Block 0 BCH layout
with ROM code.

Page size 2048B; spare area  64B => ECC8,  N=3, B0=512B, M=10B
Page size 4096B; spare area 128B => ECC8,  N=7, B0=512B, M=10B
Page size 4096B; spare area 218B => ECC16, N=7, B0=512B, M=10B

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:46:09 -05:00
Jason
86fde4a0b4 ENGR00118830 Update NAND driver scan scheme to support new nand type
Update NAND scan scheme to support new nand type. With this patch
Linux NAND driver can support new NAND flash on mx25/mx35 board while
compatible with old NAND on old boards.

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-08-10 11:46:07 -05:00
Frank.Li
2e21083d70 ENGR00118544 iMX23 Clear dangerous macro stmp3xxx_setl(clearl)
No all regiser use _SCT. stmp3xxx_setl may write to wrong address.
please use __raw_write (value, REG_XXX_SET) to write date to SCT
register.  Only REG_XXX_SCT is defined when it exist at hardware.

Signed-off-by: Frank.Li <Frank.Li@freescale.com>
2010-08-10 11:45:57 -05:00
Jason
5ebb0f1b19 ENGR00118706 Update NAND suspend-resume driver mechanism on 2.6.31 kernel
Suspend then resume, kernel will print one warning message.
This is due to mtd suspend/resume framework change on 2.6.31 kernel.
Please refer to the follwing commit for detailed information
commit 15bce40cb3
[MTD] Restore suspend/resume support for mtd devices

Signed-off-by: Jason Liu <r64343@freescale.com>
2010-08-10 11:45:45 -05:00
Jason
b619854611 ENGR00115039 iMX233 NAND MTD Support BCH
iMX233 NAND MTD Support BCH

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:45:38 -05:00
Patrick Turley
6416aff019 ENGR00116517 [MX233_BSP] Port ThreadX SDK NAND Flash device identification
Added the device identification and timing database. Adjusted the GPMI
NAND Flash driver to use this information.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:45:36 -05:00
Patrick Turley
d23f133ecb ENGR00118250 [MX23_BSP] GPMI driver crashes when only one chip
Fixed the one-chip branch during GPMI initialization.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:45:29 -05:00
Patrick Turley
f7cffaf97e ENGR00116542 [MX233_BSP] Simplify the GPMI NAND Flash driver's partitioning
Simplified the partitioning mechanism and, as a side effect, made the
GPMI NAND Flash driver usable (it was always crashing the kernel).

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:45:19 -05:00
Patrick Turley
1cafce73e5 ENGR00115074: [MX233_BSP] Comment, clarify and characterize the NAND Flash
New comments and some variable renaming to improve the understandability of
the code.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:45:08 -05:00
Jason
f0a38df344 ENGR00117212 BLS register is not set correcly on MX51 platform
BLS register is not set correcly on MX51 platform

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:44:56 -05:00
Jason
9dc721a7f1 ENGR00116717 Nand status is not correct on MX51 TO2 and TO3
Nand status does not correct on MX51 TO2 and TO3.
1. Should use RBB_MODE 1 instead of 0 due to NFC bug(ENGcm09970)
   For RBB_MODE 0,NFC has a bug,it doesn't sample correctly the
   returned data on the I/O and therefore the INT is
   asserted earlier than expected (i.e during the busy period)

2. Should use atomic status read instead of auto mode.
   Auto mode status is not correct, the WP bit (IO7)
   is not correct randomly, it wrongly report nand in write-protect
   mode, which result in program/erase fail.

Signed-off-by:Jason Liu <r64343@freescale.com>
2010-08-10 11:44:44 -05:00
Rob Herring
be0524d38f ENGR00117389 Port 5.0.0 release to 2.6.31
This is i.MX BSP 5.0.0 release ported to 2.6.31

Signed-off-by: Rob Herring <r.herring@freescale.com>
Signed-off-by: Alan Tull <r80115@freescale.com>
Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2010-08-10 11:44:41 -05:00
Rob Herring
f320367045 nand: add more nand devices
Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:33 -05:00
Rob Herring
e86dae7d10 nand: export symbols needed for stmp3xxx nand
nand: increase max nand page and oob sizes

Signed-off-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:44:32 -05:00
Feng Kan
cb5cef6bfc mtd: nand: fix ECC Correction bug for SMC ordering for NDFC driver
commit 76c23c32e3b3ad48e07e07897075ab19ae1ef117 upstream.

Fix ECC Correction bug where the byte offset location were double
fliped causing correction routine to toggle the wrong byte location
in the ECC segment. The ndfc_calculate_ecc routine change the order
of getting the ECC code.
        /* The NDFC uses Smart Media (SMC) bytes order */
        ecc_code[0] = p[2];
        ecc_code[1] = p[1];
        ecc_code[2] = p[3];
But in the Correction algorithm when calculating the byte offset
location, the b1 is used as the upper part of the address. Which
again reverse the order making the final byte offset address
location incorrect.
	byte_addr = (addressbits[b1] << 4) + addressbits[b0];
The order is change to read it in straight and let the correction
function to revert it to SMC order.

Signed-off-by: Feng Kan <fkan@amcc.com>
Acked-by: Victor Gallardo <vgallardo@amcc.com>
Acked-by: Prodyut Hazarika <phazarika@amcc.com>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-05 09:31:51 -07:00
Simon Kagstrom
94da210af4 [ARM] Orion NAND: Make asm volatile avoid GCC pushing ldrd out of the loop
GCC 4.3.3 and 4.4.1 happily moves the dword load instruction out of the
loop in orion_nand_read_buf. This patch makes the instruction volatile
to avoid the issue. I've discussed this at gcc-help, refer to the thread
at

  http://gcc.gnu.org/ml/gcc-help/2009-08/msg00187.html

The early clobber is added to avoid the destination registers and the
source register overlapping.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
2009-08-24 11:56:00 -04:00
vimal singh
c276aca46d mtd: nand: fix build failure and incorrect return from omap_wait()
We need to include jiffies.h manually in some cases, and the status
returned from omap_wait() was broken in two separate ways.

Also add cond_resched() to the loop.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-28 10:24:13 +01:00
Thadeu Lima de Souza Cascardo
ae27a7ab2c mtd: atmel_nand: Fix typo s/parititions/partitions/
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-25 08:18:36 +01:00
Linus Torvalds
ac1b7c378e Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (63 commits)
  mtd: OneNAND: Allow setting of boundary information when built as module
  jffs2: leaking jffs2_summary in function jffs2_scan_medium
  mtd: nand: Fix memory leak on txx9ndfmc probe failure.
  mtd: orion_nand: use burst reads with double word accesses
  mtd/nand: s3c6400 support for s3c2410 driver
  [MTD] [NAND] S3C2410: Use DIV_ROUND_UP
  [MTD] [NAND] S3C2410: Deal with unaligned lengths in S3C2440 buffer read/write
  [MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND
  [MTD] [NAND] S3C2410: Added a kerneldoc for s3c2410_nand_set
  mtd: physmap_of: Add multiple regions and concatenation support
  mtd: nand: max_retries off by one in mxc_nand
  mtd: nand: s3c2410_nand_setrate(): use correct macros for 2412/2440
  mtd: onenand: add bbt_wait & unlock_all as replaceable for some platform
  mtd: Flex-OneNAND support
  mtd: nand: add OMAP2/OMAP3 NAND driver
  mtd: maps: Blackfin async: fix memory leaks in probe/remove funcs
  mtd: uclinux: mark local stuff static
  mtd: uclinux: do not allow to be built as a module
  mtd: uclinux: allow systems to override map addr/size
  mtd: blackfin NFC: fix hang when using NAND on BF527-EZKITs
  ...
2009-06-22 16:56:22 -07:00
Pavel Machek
4737f0978d trivial: Kconfig: .ko is normally not included in module names
.ko is normally not included in Kconfig help, make it consistent.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-12 18:01:50 +02:00
Atsushi Nemoto
272023df26 mtd: nand: Fix memory leak on txx9ndfmc probe failure.
Commit 81933046ef ('mtd: Fix handling of
mtdname in txx9ndfmc.c') introduced a potential memory leak. The
'mtdname' member of the private data structure is now allocated
separately, but was not freed on certain error paths.

Fix that, and make things simpler by _always_ allocating it separately
so that we don't need 'if (mtdname != dev_name()) kfree(mtdname);'...
which gets ugly now that we're doing it more than once, and more likely
that we'll get it wrong some time.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-09 14:31:15 +01:00
Nicolas Pitre
bfee1a4311 mtd: orion_nand: use burst reads with double word accesses
This is not 8 times faster than byte access, but still around 60% faster.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-08 12:26:59 +01:00
Peter Korsgaard
9dbc090274 mtd/nand: s3c6400 support for s3c2410 driver
Add s3c6400 support to the s3c2410 driver. The nand controller in
the s3c64xx devices is compatible with the one in the s3c2412, so
simply reuse that code.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-08 12:23:23 +01:00
David Woodhouse
e635a01ea0 Merge branch 'next-mtd' of git://aeryn.fluff.org.uk/bjdooks/linux 2009-06-08 12:21:27 +01:00
Ben Dooks
947391cfba [MTD] [NAND] S3C2410: Use DIV_ROUND_UP
Change to using DIV_ROUND_UP() in the timing calculation
instead of blindly doing result++

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-08 12:10:37 +01:00
Ben Dooks
dea2aa6fd7 [MTD] [NAND] S3C2410: Deal with unaligned lengths in S3C2440 buffer read/write
Add code to deal with fractional lengths, as reported by
Werner Almesberger. Re-work of his original patch.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-08 12:10:36 +01:00
Michel Pollet
9db41f9edc [MTD] [NAND] S3C2410: Allow the machine code to get the BBT table from NAND
Added a flag to allow the machine code to tell the NAND
subsystem that it should try to pickup a BBT from the flash,
and also skip the NAND full scan at startup.

Signed-off-by: Michel Pollet <buserror@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-06-08 12:10:36 +01:00
Roel Kluin
43950a605d mtd: nand: max_retries off by one in mxc_nand
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-05 21:33:14 +01:00
Peter Korsgaard
a755a3858f mtd: nand: s3c2410_nand_setrate(): use correct macros for 2412/2440
Use the correct S3C2440_NFCONF_* macros for the mask for the 2412/2440
variants instead of the 2410 ones which use wrong bit positions.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-05 21:27:05 +01:00
Kevin Hilman
cd24f8c1e7 mtd: davinci nand: update clock naming
DaVinci clock support has been updated in mainline.
Update clock names accordingly.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-05 11:54:17 -07:00
Vimal Singh
67ce04bf27 mtd: nand: add OMAP2/OMAP3 NAND driver
This driver is present in the OMAP tree, now pushing it to MTD.

Original author(s):
       Jian Zhang <jzhang@ti.com>

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Cc: Jian Zhang <jzhang@ti.com>
Cc: Artem Bityutskiy <dedekind@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-06-05 18:57:09 +01:00