Commit Graph

40119 Commits

Author SHA1 Message Date
David Woodhouse
dd36f26735 [MTD] Use EXPORT_SYMBOL_GPL() for exported symbols.
While we're fixing up the newly-added symbol, change the neighbouring ones
too, for consistency and also to reflect the author's interpretation of
the GPL -- which is that _no_ non-GPL modules are permitted. The author
always intended his code to be released under the GPL, and believes that
any new interpretation of 'EXPORT_SYMBOL' as being any different from
'EXPORT_SYMBOL_GPL' is entirely invalid; the GPL requires that _all_
exports have the semantics of the new 'EXPORT_SYMBOL_GPL', which means the
extra four characters are entirely redundant.

But since those four extra characters trigger the check for illegal
modules in a way that just EXPORT_SYMBOL does not, it's useful to change
anyway. This action in no way indicates an admission that there is any
legal distinction between the two states, and in particular does not
indicate that the author believes that non-GPL modules may use symbols
exported with EXPORT_SYMBOL alone.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 16:33:03 +00:00
Artem Bityutskiy
9c74034f8f [MTD] return error code from get_mtd_device()
get_mtd_device() returns NULL in case of any failure. Teach it to return an
error code instead. Fix all users as well.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:06:38 +02:00
Artem Bityutskiy
9fe912cea3 [MTD] add get and put methods
This patch adds get_device() and put_device() methods to the MTD description
structure (struct mtd_info). These methods are called by MTD whenever the MTD
device is get or put. They are needed when the underlying driver is something
smarter then just flash chip driver, for example UBI.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:04:53 +02:00
Artem Bityutskiy
7799308f34 [MTD] add get_mtd_device_nm() function
This patch adds one more function to the MTD interface to make it possible to
open MTD devices by their names, not only numbers. This is very handy in many
situations. Also, MTD device number depend on load order and may vary, while
names are fixed.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:04:31 +02:00
Thomas Gleixner
29072b9607 [MTD] NAND: add subpage write support
Many SLC NANDs support up to 4 writes at one NAND page. Add support
of this feature.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 17:03:52 +02:00
Josh Boyer
f6a7ecb18d [MTD] add MTD_BLKDEVS Kconfig option
Add a MTD_BLKDEVS Kconfig option to cleanup the makefile a bit

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 16:58:15 +02:00
Yoichi Yuasa
eb6cf7bb71 [MTD] fix map probe name for cstm_mips_ixx
This patch has fixed name of map probe for cstm_mips_ixx.c

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 16:57:55 +02:00
Artem Bityutskiy
c0fe10aef3 [MTD] increase MAX_MTD_DEVICES
Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
2006-11-29 16:57:34 +02:00
Andrew Morton
ce1060494a [MTD] Tidy bitrev usage in rtc_from4.c
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 00:19:14 +00:00
Timo Lindhorst
fc02919499 [MTD] [NAND] fix ifdef option in nand_ecc.c
Fix up the config option in the #ifdef statements in nand_ecc.c

Signed-off-by: Timo Lindhorst <lindhors@linux.vnet.ibm.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 00:11:39 +00:00
David Woodhouse
28bdd4a72d [MTD] [NAND] Update CAFÉ driver interrupt handler prototype
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-29 00:04:59 +00:00
David Woodhouse
103e40f633 Merge git://git.infradead.org/~kmpark/onenand-mtd-2.6 2006-11-29 00:03:10 +00:00
Burman Yan
95b93a0cd4 [MTD] replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <yan_952@hotmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 23:47:21 +00:00
Randy Dunlap
998a43e72d [MTD] Fix printk format warning in physmap. (resources again)
Fix printk format warning:
drivers/mtd/maps/physmap.c:93: warning: long long unsigned int format, long unsigned int arg (arg 2)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 23:40:46 +00:00
David Woodhouse
1aaaeabf36 Merge git://git.infradead.org/~dwmw2/cafe-2.6 2006-11-28 22:43:10 +00:00
Vitaly Wool
7014568bad [MTD] [NAND] remove len/ooblen confusion.
As was discussed between Ricard Wanderlöf, David Woodhouse, Artem 
Bityutskiy and me, the current API for reading/writing OOB is confusing. 

The thing that introduces confusion is the need to specify ops.len 
together with ops.ooblen for reads/writes that concern only OOB not data 
area. So, ops.len is overloaded: when ops.datbuf != NULL it serves to 
specify the length of the data read, and when ops.datbuf == NULL, it 
serves to specify the full OOB read length.

The patch inlined below is the slightly updated version of the previous 
patch serving the same purpose, but with the new Artem's comments taken 
into account.

Artem, BTW, thanks a lot for your valuable input!

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:39:03 +00:00
Richard Purdie
1918767299 [MTD] Allow variable block sizes in mtd_blkdevs
Currently, mtd_blkdevs enforces a block size of 512, even if the drivers
can seemingly request a different size. This patch fixes mtd_blkdevs so
block sizes other than 512 work correctly.

Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:27:47 +00:00
Dave Olsen
90afffc8bd [MTD] [MAPS] Support for BIOS flash chips on the nvidia ck804 southbridge
Add support for accessing BIOS flash chips connected to the NVIDIA ck804 southbridge.

Signed-off-by: Ryan Jackson <rjackson@lnxi.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:25:27 +00:00
Stefan Roese
4010db56c8 [MTD] [NAND] Fix endianess bug in ndfc.c
The writel() call accidentally clears all bits in the NDFC_CCR
register (endianess problem). Now __raw_writel() is used instead.

Tested on Bamboo with NAND on chip select 0 and chip select 1.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:22:55 +00:00
Adrian Bunk
ddacff1f20 [MTD] make drivers/mtd/cmdlinepart.c:mtdpart_setup() static
This patch makes the needlessly global mtdpart_setup() static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:19:16 +00:00
Adrian Bunk
1605cd3d9c [MTD] [NAND] rtc_from4.c: use lib/bitrev.c
This patch converts drivers/mtd/nand/rtc_from4.c to use the new
lib/bitrev.c

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-28 22:18:52 +00:00
Kyungmin Park
f4f91ac3c8 [MTD] OneNAND: Single bit error detection
Idea from Jarkko Lavinen

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-11-16 12:03:56 +09:00
Kyungmin Park
08f782b60a [MTD] OneNAND: lock support
Now you can use mtd lock inferface on OneNAND

The idea is from Nemakal, Vijaya, thanks

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-11-16 11:29:39 +09:00
Kyungmin Park
2c22120fbd MTD: OneNAND: interrupt based wait support
We can use the two methods to wait.
  1. polling: read interrupt status register
  2. interrupt: use kernel ineterrupt mechanism

  To use interrupt method, you first connect onenand interrupt pin to your
platform and configure interrupt properly

Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
2006-11-16 11:23:48 +09:00
David Woodhouse
cad40654c3 [MTD] NAND: Fix ECC settings in CAFÉ controller driver.
We were resetting cafe->ctl2 to zero after an erase (and also during a
write, but it was correctly reset after that). This meant that ECC reads
after an erase were failing. Doh.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-11-01 08:19:20 +08:00
David Woodhouse
be8444bdf3 [MTD] NAND: Add register debugging spew option to CAFÉ driver
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-31 12:36:04 +08:00
David Woodhouse
195a253b66 [MTD] NAND: Use register #defines throughout CAFÉ driver, not numbers
Also use cafe_readl() and cafe_writel() abstraction to make code
slightly cleaner -- especially if we want to use it in PIO mode.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-31 12:30:11 +08:00
David Woodhouse
a020727b16 [MTD] NAND: Fix timing calculation in CAFÉ debugging message
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-28 17:08:38 +03:00
David Woodhouse
63a1423763 [MTD] NAND: Remove empty block ECC workaround
They fixed the hardware so that ECC doesn't fail on reading an empty
block.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-27 22:12:02 +03:00
David Woodhouse
7608194c4a [MTD] NAND: Add ECC debugging for CAFÉ
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-27 15:40:51 +03:00
David Woodhouse
b478c775a0 [MTD] CAFÉ NAND: Add 'slowtiming' parameter, default usedma and checkecc on
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-27 14:50:04 +03:00
David Woodhouse
dcc41bc81c [MTD] NAND: Reset Café controller before initialising.
Fixes http://dev.laptop.org/ticket/237

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-27 09:55:34 +03:00
David Woodhouse
2c8cfdcbeb [MTD] NAND: Café ECC -- remove spurious BUG_ON() in err_pos()
Being a value which isn't in the table is a case we explicitly check for
in the caller. Don't BUG_ON() because it does actually happen in
practice.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-27 09:53:08 +03:00
Ricard Wanderlöf
ff0dab64b4 [MTD] NAND: Fix nand_default_mark_blockbad() when flash-based BBT disabled
When a flash-based BBT is not used, nand_default_mark_blockbad() is supposed
to mark the block bad in the oob. However, it sets the wrong length variable
so that no bad block marker is in fact written. This patch attempts to
rectify that.

(As note, it seems to be that logically, it shouldn't be necessary to set
both length variables, as one appears to be for the main buffer, and
one for the oob buffer, but this is how it is done in several places,
including the code for the mtd character device MEMWRITEOOB and MEMREADOOB
ioctls. I'm not sure if this is a temporary solution during some rework of
the mtd infrastructure, or whether there is a deeper thought here.)

Signed-off-by: Ricard Wanderlöf <ricardw@axis.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-26 13:17:49 +03:00
David Woodhouse
470b0a90d6 [MTD] NAND: Disable ECC checking on CAFÉ since it's broken for now
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-23 14:29:04 +01:00
David Woodhouse
fbad5696c5 [MTD] NAND: CAFÉ NAND driver cleanup, fix ECC on reading empty flash
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-22 15:09:33 +01:00
David Woodhouse
04459d7c62 [MTD] NAND: Add hardware ECC correction support to CAFÉ NAND driver
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-22 02:18:48 +01:00
David Woodhouse
c45aa055c3 Merge git://git.infradead.org/~dwmw2/cafe-2.6
Conflicts:

	drivers/mtd/nand/Kconfig
2006-10-22 02:17:05 +01:00
David Woodhouse
784f4d5e66 [MTD] NAND: Correct setting of chip->oob_poi OOB buffer
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-22 01:47:45 +01:00
David Woodhouse
7dcdcbef5d [MTD] NAND: Combined oob buffer so it's contiguous with data
Ditch the separate oobrbuf and oobwbuf fields from the chip buffers,
and use only a single buffer immediately after the data. This accommodates
NAND controllers such as the OLPC CAFÉ chip, which can't do scatter/gather
DMA so needs the OOB buffer to be contiguous with the data, for both read
and write.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 17:48:58 +01:00
David Woodhouse
513b046c96 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2006-10-21 16:46:04 +01:00
Artem Bityutskiy
82810b7b6c [MTD] NAND: nandsim: support subpage write
As flash cannot do 0->1 bit transitions when programming, do not do this in
the simulator too. This makes nandsim able to accept subpage writes.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:44:23 +01:00
David Anders
a86aaa6ddf [MTD] NOR: leave Intel chips in read-array mode on suspend
During some testing with several samsung s3c24xx based
devices it was discovered that often the
cfi_cmdset_0001.c would not leave the chip in
read-array mode on suspend. this is an issue if the
same flash chip is used for the bootloader that needs
to be read on resume.

Signed-off-by: David Anders <danders@amltd.com>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:43:53 +01:00
Artem Bityutskiy
d29ebdbee4 [MTD] core: trivial comments fix
Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:42:53 +01:00
Vijay Kumar
a5602146c5 [MTD] NAND: nandsim coding style fix
Removes line break after return type in function definitions, to be
consistent with the Linux coding style.

Signed-off-by: Vijay Kumar <vijaykumar@bravegnu.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:40:55 +01:00
Vijay Kumar
d086d43640 [MTD] NAND: nandsim page-wise allocation (2/2)
For page wise allocation, an array of flash page pointers is allocated
during initialization. The flash pages are themselves allocated when a
write occurs to the page. The flash pages are deallocated when they
are erased.

Signed-off-by: Vijay Kumar <vijaykumar@bravegnu.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:40:27 +01:00
Vijay Kumar
47e3774338 [MTD] NAND: nandsim page-wise allocation (1/2)
This patch removes code that does chip mapping. The chip mapping code
is no longer used.

Signed-off-by: Vijay Kumar <vijaykumar@bravegnu.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:39:56 +01:00
Yoichi Yuasa
6652018c82 [MTD] MAPS: Remove ITE 8172G and Globespan IVR MTD support
This patch has removed ITE 8172G and Globespan IVR MTD support.
These boards support have already been removed.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Acked-by: Ralf Bächle <ralf@linux-mips.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:35:05 +01:00
Ricard Wanderlöf
d25ade71ef [MTD] mtdchar: Fix MEMGETOOBSEL and ECCGETLAYOUT ioctls
1. The ECCGETLAYOUT ioctl copy_to_user() call has a superfluous '&'
causing the resulting information to be garbage rather than the intended
mtd->ecclayout.

2. The MEMGETOOBSEL misses copying mtd->ecclayout->eccbytes so the
resulting field of the returned structure contains garbage.

Signed-off-by: Ricard Wanderlöf <ricardw@axis.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:33:17 +01:00
Andrew Victor
42cb1403af [MTD] NAND: AT91 NAND driver
This version only differs from version posted by Savin Zlobec (20 Jun
2006) in that the AT91RM9200-specific chip-select / bus setup code has
been moved from the at91_nand.c driver into the processor-specific file.

From: Savin Zlobec <savin@epico.si>
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:28:26 +01:00