Commit graph

483 commits

Author SHA1 Message Date
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
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 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
Alan Cox c7438d02b3 [MTD] MAPS: esb2rom: use hotplug safe interfaces
Fairly self explanatory.  Keep a reference initially, drop it when we free up
the driver resources.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:22:58 +01:00
Alexey Dobriyan f33686b5a7 [MTD] JEDEC probe: fix comment typo (devic)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:22:04 +01:00
Lew Glendenning 29175778b0 [MTD] MAPS: Support for BIOS flash chips on Intel ESB2 southbridge
Add MTD map driver for BIOS flash chips connected to the Intel ESB2
southbridge.

[akpm@osdl.org: coding-style fixes, build fix]
Signed-off-by: Ryan Jackson <rjackson@lnxi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:21:04 +01:00
Ryan Jackson 89072ef993 [MTD] CHIPS: Support for SST 49LF040B flash chip
Add chip driver and JEDEC probe support for the SST 49LF040B flash chip.

Signed-off-by: Ryan Jackson <rjackson@lnxi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:18:51 +01:00
Ryan Jackson c9073ce02a [MTD] MAPS: Add parameter to amd76xrom to override rom window size
The 2 bits controlling the window size are often set to allow reading the
BIOS, but too small to allow writing, since the lock registers are 4MiB
lower in the address space than the data.  This is intended to prevent
flashing the bios, perhaps accidentally.

The bits are 6 and 7.  If both bits are set, it is a 5MiB window. If only
the 7 Bit is set, it is a 4MiB window.  Otherwise, it is a 64KiB window.

This parameter allows the driver to override the BIOS settings.

Signed-off-by: Ryan Jackson <rjackson@lnxi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-21 16:15:43 +01:00
Al Viro afc12d30a7 [PATCH] mtd: remove several bogus casts to void * in iounmap() argument
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-10-10 15:37:22 -07:00
Adrian Bunk 1ef93a0f66 [MTD] SSFDC must depend on BLOCK
This patch fixes the following compile error with
CONFIG_SSFDC=m, CONFIG_BLOCK=n:

<--  snip  -->

...
  CC [M]  drivers/mtd/mtd_blkdevs.o
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtd_blkdevs.c:40: warning: ‘struct request’ declared inside parameter list
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtd_blkdevs.c:40: warning: its scope is only this definition or declaration, which is probably not what you want
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtd_blkdevs.c: In function ‘do_blktrans_request’:
/home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/mtd/mtd_blkdevs.c:45: error: dereferencing pointer to incomplete type
...
make[3]: *** [drivers/mtd/mtd_blkdevs.o] Error 1

<--  snip  -->

Bug report by Jesper Juhl.

This patch also removes a pointless "default n" from the SSFDC option.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-09 07:25:28 +01:00
Uwe Zeisberger f30c226954 fix file specification in comments
Many files include the filename at the beginning, serveral used a wrong one.

Signed-off-by: Uwe Zeisberger <Uwe_Zeisberger@digi.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-10-03 23:01:26 +02:00
Matt LaPlante 095096038d Fix several typos in drivers/
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-10-03 22:31:37 +02:00
Amol Lad 76a5027c37 [MTD] Cleanup of 'ioremap balanced with iounmap for drivers/mtd subsystem'
Updated version of patch, in response to comments from Francois Romieu
<romieu@fr.zoreil.com>

Remove gratuitous casts from iounmap and initialisation of variables.

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-02 09:48:23 +01:00
Frederik Deweerdt 553a801208 [MTD] fix nftl_write warning
Building 2.6.18-mm2 issues the following warning if CONFIG_NFTL_RW is not set:

  CC [M]  drivers/mtd/nftlcore.o
drivers/mtd/nftlcore.c:183: warning: 'nftl_write' defined but not used
The following patch only compiles nftl_write if CONFIG_NFTL_RW is set.

Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-02 09:42:25 +01:00
Jeff Garzik 9a29230825 [MTD] fix printk warning
gcc spits out this warning:

drivers/mtd/mtd_blkdevs.c: In function ‘do_blktrans_request’:
drivers/mtd/mtd_blkdevs.c:72: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’

This could be fixed any number of ways, including use of BUG().
rq_data_dir() only returns 0 or 1, so this entire case is superfluous.
I did the most simple fix.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-01 17:57:26 +01:00
David Woodhouse 8a84fc15ae Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Manually resolve conflict in include/mtd/Kbuild

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-10-01 17:55:53 +01:00
David Howells 9361401eb7 [PATCH] BLOCK: Make it possible to disable the block layer [try #6]
Make it possible to disable the block layer.  Not all embedded devices require
it, some can make do with just JFFS2, NFS, ramfs, etc - none of which require
the block layer to be present.

This patch does the following:

 (*) Introduces CONFIG_BLOCK to disable the block layer, buffering and blockdev
     support.

 (*) Adds dependencies on CONFIG_BLOCK to any configuration item that controls
     an item that uses the block layer.  This includes:

     (*) Block I/O tracing.

     (*) Disk partition code.

     (*) All filesystems that are block based, eg: Ext3, ReiserFS, ISOFS.

     (*) The SCSI layer.  As far as I can tell, even SCSI chardevs use the
     	 block layer to do scheduling.  Some drivers that use SCSI facilities -
     	 such as USB storage - end up disabled indirectly from this.

     (*) Various block-based device drivers, such as IDE and the old CDROM
     	 drivers.

     (*) MTD blockdev handling and FTL.

     (*) JFFS - which uses set_bdev_super(), something it could avoid doing by
     	 taking a leaf out of JFFS2's book.

 (*) Makes most of the contents of linux/blkdev.h, linux/buffer_head.h and
     linux/elevator.h contingent on CONFIG_BLOCK being set.  sector_div() is,
     however, still used in places, and so is still available.

 (*) Also made contingent are the contents of linux/mpage.h, linux/genhd.h and
     parts of linux/fs.h.

 (*) Makes a number of files in fs/ contingent on CONFIG_BLOCK.

 (*) Makes mm/bounce.c (bounce buffering) contingent on CONFIG_BLOCK.

 (*) set_page_dirty() doesn't call __set_page_dirty_buffers() if CONFIG_BLOCK
     is not enabled.

 (*) fs/no-block.c is created to hold out-of-line stubs and things that are
     required when CONFIG_BLOCK is not set:

     (*) Default blockdev file operations (to give error ENODEV on opening).

 (*) Makes some /proc changes:

     (*) /proc/devices does not list any blockdevs.

     (*) /proc/diskstats and /proc/partitions are contingent on CONFIG_BLOCK.

 (*) Makes some compat ioctl handling contingent on CONFIG_BLOCK.

 (*) If CONFIG_BLOCK is not defined, makes sys_quotactl() return -ENODEV if
     given command other than Q_SYNC or if a special device is specified.

 (*) In init/do_mounts.c, no reference is made to the blockdev routines if
     CONFIG_BLOCK is not defined.  This does not prohibit NFS roots or JFFS2.

 (*) The bdflush, ioprio_set and ioprio_get syscalls can now be absent (return
     error ENOSYS by way of cond_syscall if so).

 (*) The seclvl_bd_claim() and seclvl_bd_release() security calls do nothing if
     CONFIG_BLOCK is not set, since they can't then happen.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2006-09-30 20:52:31 +02:00
Jens Axboe 4aff5e2333 [PATCH] Split struct request ->flags into two parts
Right now ->flags is a bit of a mess: some are request types, and
others are just modifiers. Clean this up by splitting it into
->cmd_type and ->cmd_flags. This allows introduction of generic
Linux block message types, useful for sending generic Linux commands
to block devices.

Signed-off-by: Jens Axboe <axboe@suse.de>
2006-09-30 20:23:37 +02:00
Kyungmin Park 28b79ff966 [MTD ONENAND] Check OneNAND lock scheme & all block unlock command support
OneNAND lock scheme depends on density and process of chip.
Some OneNAND chips support all block unlock

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-26 16:46:28 +01:00
Kyungmin Park 98638ee2ed [MTD ONENAND] Remove unused MTD_ONENAND_SYNC_READ configuration
Now the bootloader configures the OneNAND sync. burst mode.
So we don't access Sync. burst mode related registers in kernel.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-26 10:02:37 +01:00
Kyungmin Park 47e777e02e [MTD ONENAND] Fix OneNAND probe
- fix OneNAND probe whether OneNAND Sync. Burst read mode or not
        - fix OneNAND reset wait problem

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-26 09:16:06 +01:00
David Woodhouse 956e944c76 [MTD NAND] Allow override of page read and write functions.
- allow high-level nand_write_page() function to be overridden
- likewise low-level write_page_raw() and read_page_raw() functions
- Clean up the abuse of chip->ecc.{write,read}_page() with MTD_OOB_RAW

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-25 17:12:39 +01:00
David Woodhouse 4bf63fcb83 [MTD NAND] Allocate chip->buffers separately to allow it to be overridden
In particular, the board driver might need it to be DMAable.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-25 17:08:04 +01:00
David Woodhouse 3b85c3211e [MTD NAND] Split nand_scan() into two parts; allow board driver to intervene
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-25 17:06:53 +01:00
David Woodhouse 4b648b0253 [MTD NAND] Export nand_wait_ready() for use by board drivers
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-25 17:05:24 +01:00
David Woodhouse 08d3ad6a51 [MTD] Whitespace cleanup in SSFDC driver.
Says akpm: ' - search for "( " and " )", fix.'

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-23 16:20:48 +01:00
David Woodhouse 9a05eded5d [MTD] SSFDC translation layer minor cleanup
Don't include <linux/config.h>.
Don't say 'MB' where you mean 'MiB'.
Don't allocate 512 bytes on the stack.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-23 10:56:24 +01:00
David Woodhouse 892e4fba1c [MTD] Fix dependencies with CONFIG_MTD=m
CMDLINEPARTS shouldn't be selectable, and neither should SSFDC, which
can be a tristate anyway.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-23 10:24:36 +01:00
David Woodhouse e4e3295f0c Revert "[MTD] blkdev helper code: fix printk format warning"
This reverts commit 668040fcd1.

The 'flags' field of the struct request is 'unsigned long'. Quite
how Randy came to see 'long int format, different type arg' I don't
know, but it doesn't seem to be the case any more.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 11:05:42 +01:00
Claudio Lanconelli 51197abf29 [MTD] Add SSFDC (SmartMedia) read-only translation layer
Signed-off-by: Claudio Lanconelli <lanconelli.claudio@eptar.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 11:01:37 +01:00
Jiri Slaby 98aacdfde0 [MTD] pmc551 pci cleanup
Use pci_resource_start for getting start of regions and pci_iomap to not
doing this directly by using dev->resource... (Thanks to Rolf Eike Beer)

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 10:34:15 +01:00
Jiri Slaby 7fefb924d7 [MTD] pmc551 use kzalloc
Use kzalloc instad of kmalloc+memset(0).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 10:33:52 +01:00
Jiri Slaby cdf0a7d169 [MTD] pmc551 whitespace cleanup
Spaces were used for indent, there was more than 80 columns per line. Get
rid of that stuff.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 10:33:31 +01:00
Lennert Buytenhek e417fcfb85 [MTD] Remove iq80310 map driver
The iq80310 mtd map driver depends on ARCH_IQ80310, which isn't
defined anywhere in the tree (as we don't have 80310 support), and
furthermore, everything the driver does can be done with physmap
instead.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 10:31:01 +01:00
Frank Haverkamp 6a545a0d60 [MTD NAND] Fix in typo ndfc.c causing wrong ECC layout
Due to this typo, a wrong ECC layout table is chosen.

Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-09-22 10:30:25 +01:00