Commit Graph

1663 Commits

Author SHA1 Message Date
Lily Zhang
3a8994f9c7 ENGR00124795 SPI NOR: uniform include header file
The default partitions are missing in MX53 SPI NOR MTD.
It's because spi nor driver and mx53 msl include different
header files. It causes struct definitions are different.
For i.MX SPI nor driver, need to use asm/mach/flash.h by
aligning with NAND driver.

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-08-10 11:51:19 -05: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
Lily Zhang
97e1b336f2 ENGR00119023-2 Fix build error in SPI NOR driver
1. Add SPI NOR flash driver in Makefile
2. Fix build error with gcc 4.3.3 toolchain

Signed-off-by: Lily Zhang <r58066@freescale.com>
2010-08-10 11:46:04 -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
Patrick Turley
32656e1ec6 ENGR00115003 [mx233_BSP] Cannot run fdisk on FTL over an UBI volume.
Added FTL support for UBI.

Signed-off-by: Patrick Turley <patrick.turley@freescale.com>
2010-08-10 11:45:53 -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
Mika Westerberg
77e4ffd96c UBI: fix volume creation input checking
commit c5ce5b46af76f52dea21f467397d24c4ae6cb3ff upstream.

Do not use an unchecked variable UBI_IOCMKVOL ioctl.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-01 15:55:27 -07:00
Massimo Cirillo
d3b56d9524 mtd: cfi_cmdset_0002: add 0xFF intolerance for M29W128G
commit 23af51ecfb04ff65bae51bd8e2270f4449abc789 upstream.

The M29W128G Numonyx flash devices are intolerant to any 0xFF command:
in the Cfi_util.c the function cfi_qry_mode_off() (that resets the device
after the autoselect mode) must have a 0xF0 command after the 0xFF command.
This fix solves also the cause of the fixup_M29W128G_write_buffer() fix,
that can be removed now.
The following patch applies to 2.6.30 kernel.

Signed-off-by: Massimo Cirillo <maxcir@gmail.com>
Acked-by: Alexey Korolev <akorolev@infradead.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-10-05 09:31:52 -07:00
Benjamin Krill
b4a665c77b mtd: ofpart: Check availability of reg property instead of name property
commit ebd5a74db74ee2db833d43ea35108a4be9cab42f upstream.

The previous implementation breaks the dts binding "mtd-physmap.txt". This
implementation fixes the issue by checking the availability of the reg
property instead of the name property.

Signed-off-by: Benjamin Krill <ben@codiert.org>
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
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
Dimitri Gorokhovik
16f05c2b68 mtd: nftl: fix offset alignments
Arithmetic conversion in the mask computation makes the upper word
of the second argument passed down to mtd->read_oob(), be always 0
(assuming 'offs' being a 64-bit signed long long type, and
'mtd->writesize' being a 32-bit unsigned int type).

This patch applies over the other one adding masking in nftl_write,
"nftl: write support is broken".

Signed-off-by: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Cc: Tim Gardner <tim.gardner@canonical.com>
Cc: Scott James Remnant <scott@canonical.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-09-03 14:59:16 +01:00
Dimitri Gorokhovik
4149ed1aa9 mtd: nftl: write support is broken
Write support is broken in NFTL. Fix it.

Signed-off-by: <dimitri.gorokhovik@free.fr>
Cc: Tim Gardner <tim.gardner@canonical.com>
Cc: Scott James Remnant <scott@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-09-03 14:59:13 +01:00
Anton Vorontsov
edcb3b1486 mtd: m25p80: fix null pointer dereference bug
This patch fixes the following oops, observed with MTD_PARTITIONS=n:

m25p80 spi32766.0: m25p80 (1024 Kbytes)
Unable to handle kernel paging request for data at address 0x00000008
Faulting instruction address: 0xc03a54b0
Oops: Kernel access of bad area, sig: 11 [#1]
Modules linked in:
NIP: c03a54b0 LR: c03a5494 CTR: c01e98b8
REGS: ef82bb60 TRAP: 0300   Not tainted  (2.6.31-rc4-00167-g4733fd3)
MSR: 00029000 <EE,ME,CE>  CR: 24022022  XER: 20000000
DEAR: 00000008, ESR: 00000000
TASK = ef82c000[1] 'swapper' THREAD: ef82a000
GPR00: 00000000 ef82bc10 ef82c000 0000002e 00001eb8 ffffffff c01e9824 00000036
GPR08: c054ed40 c0542a08 00001eb8 00004000 22022022 1001a1a0 3ff8fd00 00000000
GPR16: 00000000 00000001 00000000 00000000 ef82bddc c0530000 efbef500 ef8356d0
GPR24: 00000000 ef8356d0 00000000 efbf7a00 c0530ec4 ffffffed efbf5300 c0541f98
NIP [c03a54b0] m25p_probe+0x22c/0x354
LR [c03a5494] m25p_probe+0x210/0x354
Call Trace:
[ef82bc10] [c03a5494] m25p_probe+0x210/0x354 (unreliable)
[ef82bca0] [c024e37c] spi_drv_probe+0x2c/0x3c
[ef82bcb0] [c01f1afc] driver_probe_device+0xa4/0x178
[ef82bcd0] [c01f06e8] bus_for_each_drv+0x6c/0xa8
[ef82bd00] [c01f1a34] device_attach+0x84/0xa8
...

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-09-03 13:58:02 +01: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
Jeff Garzik
67fe068808 Remove zero-length file drivers/mtd/maps/sbc8240.c
It was "deleted" in commit 2bf961b7cc

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-08-12 06:29:57 -04:00
Linus Torvalds
f4b9a98868 Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6
* 'for-linus' of git://git.infradead.org/ubi-2.6:
  UBI: compatible fallback in absense of sequence numbers
  UBI: fix double free on error path
2009-08-09 14:58:34 -07:00
Matthias Kaehlcke
d676c11727 mtd: mtdblock: introduce mtdblks_lock
The mtdblks array and its content are prone to race conditions. Introduce
the mutex mtdblks_lock in order to solve this.

[Amended by Artem Bityutskiy]

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-08-03 14:25:00 +01:00
Subrata Modak
2bf961b7cc mtd: remove 'SBC8240 Wind River' Device Driver Code
This driver is causing build errors and is no longer needed -- it is obsoleted
by physmap_of.

Signed-off-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Tested-on-PPC64-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-08-03 14:22:54 +01:00
Mika Korhonen
3cae1cc149 mtd: OneNAND: OMAP2/3: free GPMC CS on module removal
GPMC CS was not freed in omap2_onenand_remove() preventing the module
from reloading after removal.

Signed-off-by: Mika Korhonen <ext-mika.2.korhonen@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-08-03 14:22:16 +01:00
Mika Korhonen
00acf4a807 mtd: OneNAND: fix incorrect bufferram offset
Fixes the case where CONFIG_MTD_ONENAND_2X_PROGRAM is set and
the real page size differs from mtd_info.writesize.

Signed-off-by: Mika Korhonen <mika.j.korhonen@gmail.com>
Acked-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>
2009-08-03 14:21:58 +01:00
Artem Bityutskiy
8022c13c27 mtd: blkdevs: do not forget to get MTD devices
Nowadays MTD devices have to be "get" before they can be
used. This has to be done with 'get_mtd_device()'. The
'blktrans_open()' function did not do this and instead
used 'try_module_get()'. Fix this.

Since 'get_mtd_device()' already gets the module, extra
'try_module_get()' is not needed.

This fixes oops when one tries to use mtdblock on top of
gluebi.

Reported-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-08-03 14:20:26 +01:00