1
0
Fork 0
Commit Graph

459 Commits (ac27a0ec112a089f1a5102bc8dffc79c8c815571)

Author SHA1 Message Date
David Woodhouse 52239da1b0 [MTD NAND] Modify check for modules registering NAND devices without ->owner
Make it work even with compilers which lack the wit to notice that
THIS_MODULE is always non-NULL. Use #ifdef MODULE instead. It's only
a temporary debugging check anyway.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 16:54:39 +01:00
David Woodhouse 2f206701ae [MTD] Remove gratuitous inclusion of ARM-only header from physmap.c
The physmap platform driver conversion added to physmap.c an include
of asm/mach/flash.h which is 1) ARM-specific; and 2) isn't actually
necessary.  Remove it.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 11:59:20 +01:00
David Woodhouse 151e76590f [MTD] Fix legacy character sets throughout drivers/mtd, include/linux/mtd
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 01:51:54 +01:00
David Woodhouse 0f5ae3d2e9 [MTD] Deal correctly with NOR chips which are smaller than the map window
We used to calculate the number of chips to be zero, allocate an array
of that size, then nasty things would happen when we attempt to access
the first object in that zero-sized array.

Now, if the number of _full_ chips that would fit into the map is zero,
we allocate an array of one anyway, and then artificially reduce the
total size of the resulting MTD device to fit in the map.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 01:40:50 +01:00
Jesper Juhl a6550e57f9 mtd: fix memory leak in block2mtd_setup()
There's a mem leak in drivers/mtd/devices/block2mtd.c::block2mtd_setup()

We can leak 'name' allocated with kmalloc in 'parse_name' if leave via
the 'parse_err' macro since it contains a return but doesn't do any
freeing.

Spotted by coverity checker as bug 615.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 01:21:31 +01:00
David Woodhouse 552d920518 [MTD] Fix module refcounting in NAND board drivers.
The _board_ driver needs to be mtd->owner, and it in turn pins the
nand.ko module. Fix them all to actually do that, and fix nand.ko not to
overwrite it -- and also to check that the caller sets it, if the caller
is a module.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 01:20:46 +01:00
Jesper Juhl 4f678a58d3 mtd: fix memory leaks in phram_setup
There are two code paths in drivers/mtd/devices/phram.c::phram_setup() that
will leak memory.
Memory is allocated to the variable 'name' with kmalloc() by the
parse_name() function, but if we leave by way of the parse_err() macro,
then that memory is never kfree()'d, nor is it ever used with
register_device() so it won't be freed later either - leak.

Found by the Coverity checker as #593 - simple fix below.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-14 00:13:30 +01:00
David Woodhouse e0c7d76753 [MTD NAND] Indent all of drivers/mtd/nand/*.c.
It was just too painful to deal with.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-13 18:07:53 +01:00
David Woodhouse 6943f8af7d [MTD NAND] Reduce paranoia level when scanning for bad blocks on virgin chips
We were scanning for 0xFF through the entire chip -- which takes a while
when it's a 512MiB device as I have on my current toy. The specs only say
we need to check certain bytes -- so do only that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-13 16:14:26 +01:00
David Woodhouse 9d75414b4f [MTD NAND] Update CS553x NAND driver: Hardware ECC support, optimisations.
- Implement HW ECC support,
- Provide read_buf() and write_buf() routines using memcpy
- Use on-flash bad block table
- Fix module refcounting
- Avoid read/modify/write in hwcontrol()
- Minor cosmetic fixes

Partly based on code and ideas from Tom Sylla <tom.sylla@amd.com>

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-13 04:12:40 +01:00
David Woodhouse c3f8abf481 [MTD NAND] Use vmalloc for buffer when scanning for bad blocks.
These new chips have 128KiB blocks. Don't try to kmalloc that.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-13 04:03:42 +01:00
Egry Gábor 4992a9e888 Trivial typo fixes in Kconfig files (MTD).
Signed-off-by: Egry Gábor <gaboregry@t-online.hu>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-12 17:35:02 +01:00
Kyungmin Park 752870707f OneNAND: fix block command typo
We need to check block cmd only instead with comparing with cmd

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-05-12 15:35:51 +01:00
Kyungmin Park 493c646077 OneNAND: One-Time Programmable (OTP) support
One Block of the NAND Flash Array memory is reserved as
a One-Time Programmable Block memory area.
Also, 1st Block of NAND Flash Array can be used as OTP.

The OTP block can be read, programmed and locked using the same
operations as any other NAND Flash Array memory block.
OTP block cannot be erased.

OTP block is fully-guaranteed to be a valid block.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-05-12 15:35:50 +01:00
Kyungmin Park 3cecf69ecd OneNAND: Handle erase correctly in Double Density Package (DDP)
There's erase bug in DDP.
We need to add DDP select in erase

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-05-12 15:35:48 +01:00
Kyungmin Park 34c1060959 OneNAND: Write oob area with aligned size, mtd->oobsize
There's some problem with write oob in serveral platform.
So we write oob with oobsize aligned (16bytes) instead of 3 bytes (from {2,
3})

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-05-12 15:35:47 +01:00
Kyungmin Park 8e6ec69059 OneNAND: Add write_oob verify function
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
2006-05-12 15:35:47 +01:00
Jarkko Lavinen d9777f1c42 OneNand: Fix free byte positions.
Some free byte positions at onenand_oob_64 were wrong. This was also
reported by Christian Lehne. 3 byte slots are at 2+16*i and 2 byte
slots at 14+16*i.

Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com>
2006-05-12 15:35:46 +01:00
Kyungmin Park 9c01f87db1 OneNAND: handle byte access on BufferRAM
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-05-12 15:35:45 +01:00
Kyungmin Park 628bee6593 OneNAND: Add touch_softlock_watchdog()
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2006-05-12 15:35:45 +01:00
Jean-Luc Leger 1867b7e3f8 [MTD] Fix invalid default value of CONFIG_MTD_PCMCIA_ANONYMOUS in Kconfig
Default values for boolean and tristate options can only be 'y', 'm' or 'n'.
This patch removes wrong default for MTD_PCMCIA_ANONYMOUS.

Signed-off-by: Jean-Luc Leger <jean-luc.leger@dspnet.fr.eu.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-12 11:53:40 +01:00
David Woodhouse f0ad11d060 [MTD] Fix capitalisation in export of old doc2001.c initfunc
Oops. Stupid StudlyCaps. Again.

This driver is doubly-deprecated because is was subsumed into doc2000.c
and _also_ we want people to start using the new NAND wrapper for these
devices anyway. But ISTR there was still one person using it because
something didn't work for them. Must chase that up and then I can kill
this.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-12 11:40:13 +01:00
David Woodhouse 179fdc3f8d [MTD] Basic NAND driver for AMD/NatSemi CS5535/CS5536 Geode companion chip
This lacks hardware ECC support and a few optimisations we're going to
want fairly soon, but it works well enough to mount and use JFFS2.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-11 22:35:28 +01:00
David Woodhouse b04ecae3d6 [MTD] Fix capitalisation in export of DiskOnChip Millennium initfunc
Stupid StudlyCaps. Who did that?

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-10 16:16:13 +01:00
David Woodhouse 83ea4ef213 Export cfi_cmdset_0020 and cfi_cmdset_0002 with EXPORT_SYMBOL_GPL
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-08 22:58:25 +01:00
David Woodhouse a15bdeef10 Remove use of inter_module_crap in NOR flash chip drivers.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-08 22:35:05 +01:00
David Woodhouse 396674e58f Fix non-modular case for DiskOnChip probe
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-08 17:10:11 +01:00
David Woodhouse 5e535429a9 Remove inter_module_xxx() from DiskOnChip drivers.
Finally putting it back how it was before Keith got at it -- yay :)

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-08 14:05:05 +01:00
Lennert Buytenhek 73566edf9b [MTD] Convert physmap to platform driver
After dwmw2 let me know it ought to be done, I rewrote the physmap map
driver to be a platform driver.  I know zilch about the driver model,
so I probably botched it in some way, but I've done some tests on an
ixp23xx board which uses physmap, and it all seems to work.

In order to not break existing physmap users, I've added some compat
code that will instantiate a platform device iff CONFIG_MTD_PHYSMAP_LEN
is defined and != 0.  Also, I've changed the default value for
CONFIG_MTD_PHYSMAP_LEN to zero, so that people who inadvertently
compile in physmap (or new, platform-style, users of physmap) don't get
burned.

This works pretty well -- the new physmap driver is a drop-in replacement
for the old one, and works on said ixp23xx board without any code changes
needed.  (This should hold as long as users don't touch 'physmap_map'
directly.)

Once all physmap users have been converted to instantiate their own
platform devices, the compat code can go.  (Or we decide that we can
change all the in-tree users at the same time, and never merge the
compat code.)

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-07 17:16:36 +01:00
Lennert Buytenhek 7d532dd50d ts72xx NAND driver
The TS-72xx is a series of embedded single board computers from
Technologic Systems based on the Cirrus ep93xx (arm920t based) CPU.

The TS-7200 uses NOR flash, while all the other models in the series
(TS-7250, TS-7260) use NAND flash -- included is a driver for the NAND
flash on those boards.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-30 21:19:44 +01:00
Daniel Drake fbbc21c6a4 mtd: SC520CDP should depend on MTD_CONCAT
Toralf Förster found a compile error when CONFIG_MTD_SC520CDP=y and
CONFIG_MTD_CONCAT=n:

drivers/built-in.o: In function `init_sc520cdp':
sc520cdp.c:(.init.text+0xb4de): undefined reference to `mtd_concat_create'
drivers/built-in.o: In function `cleanup_sc520cdp':
sc520cdp.c:(.exit.text+0x14bc): undefined reference to `mtd_concat_destroy'

This patch fixes it.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
2006-04-29 08:48:55 -05:00
Joern Engel 954c242273 mtd: improve parameter parsing for block2mtd
Expand the parameter parsing for block2mtd.  It now accepts:
Ki, Mi, Gi	- the official prefixes for binary multiples,
		  see http://physics.nist.gov/cuu/Units/binary.html,
ki		- mistake on my side and analog to "k" for decimal multiples,
KiB, MiB, GiB	- for people that prefer to add a "B" for byte,
kiB		- combination of the above.

There were complaints about not accepting "k" for 1024.  This has long
been common practice, but is known to lead to confusion.  Hence the new
SI units and hence block2mtd only accepts units that cannot be confused
with decimal units.  Diverging from common practice doesn't always please
people, even if the change is for the better.

Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
2006-04-19 09:10:06 +01:00
Richard Purdie 6e62e8c2c7 MTD: Correct Poodle partition size
Correct the MTD NAND partition size for Poodle (Sharp Zaurus SL-5600)

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2006-04-18 02:04:18 +01:00
Thago Galesi b802c07411 [PATCH] Remove unnecessary kmalloc/kfree calls in mtdchar
This patch removes repeated calls to kmalloc / kfree in mtd_write /
mtd_read functions, replacing them by a single kmalloc / kfree pair.

Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-17 17:38:15 +01:00
Jörn Engel a6c591eda3 Remove unchecked MTD flags
Several flags are set by some devices, but never checked.  Remove them.

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-17 15:48:17 +01:00
Jörn Engel af63a3bcac Make mtdblock_ro unconditionally readonly
mtdblock_ro is by definition readonly.  Remove the silly checks.

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-17 15:48:16 +01:00
Jörn Engel 7f7c08dfdf Simplify test for RAM devices
mtdblock is the only user of aggregate capabilities in mtd.  This is clearly
bogus and should be changed.  In particular, it tries to determine whether
the device in question is a piece of RAM.  For every single driver that fits
the current criteria, an easier test would be to check for the type being
MTD_RAM.

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-17 15:48:16 +01:00
Randy Dunlap b104513c74 [PATCH] MTD: m25p80: fix printk format warning
Fix printk format warning:
drivers/mtd/devices/m25p80.c:189: warning: format '%zd' expects type
'signed size_t', but argument 6 has type 'u_int32_t'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-11 20:05:20 -04:00
Jesper Juhl 6cc449c7d0 [PATCH] mtd, nettel: fix build error and implicit declaration
I just hit the following error and warning :
  drivers/mtd/maps/nettel.c: In function `nettel_init':
  drivers/mtd/maps/nettel.c:418: error: `ROOT_DEV' undeclared (first use in this function)
  drivers/mtd/maps/nettel.c:418: error: (Each undeclared identifier is reported only once
  drivers/mtd/maps/nettel.c:418: error: for each function it appears in.)
  drivers/mtd/maps/nettel.c:418: warning: implicit declaration of function `MKDEV'
  make[3]: *** [drivers/mtd/maps/nettel.o] Error 1
  make[2]: *** [drivers/mtd/maps] Error 2
  make[1]: *** [drivers/mtd] Error 2
The patch fixes the missing ROOT_DEV declaration by including linux/root_dev.h
and fixes the implicit declaration of MKDEV by including linux/kdev_t.h .

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-04-11 19:42:44 -04:00
Joern Engel acc8dadc0b [PATCH] Remove blkmtd
Remove the blkmtd driver.

- An alternative exists (block2mtd) that hasn't had  bug report for > 1 year.

- Most embedded people tend to use ancient kernels with custom patches from
  mtd cvs and elsewhere, so the 1 year warning period neither helps nor hurts
  them too much.

- It's in the way of klibc.  The problems caused by pulling blkmtd support
  are fairly low, while the problems caused by delaying klibc can be fairly
  substantial.  At best, this would be a severe burden on hpa's time.

Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-04-11 06:18:43 -07:00
Linus Torvalds 63589ed078 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (48 commits)
  Documentation: fix minor kernel-doc warnings
  BUG_ON() Conversion in drivers/net/
  BUG_ON() Conversion in drivers/s390/net/lcs.c
  BUG_ON() Conversion in mm/slab.c
  BUG_ON() Conversion in mm/highmem.c
  BUG_ON() Conversion in kernel/signal.c
  BUG_ON() Conversion in kernel/signal.c
  BUG_ON() Conversion in kernel/ptrace.c
  BUG_ON() Conversion in ipc/shm.c
  BUG_ON() Conversion in fs/freevxfs/
  BUG_ON() Conversion in fs/udf/
  BUG_ON() Conversion in fs/sysv/
  BUG_ON() Conversion in fs/inode.c
  BUG_ON() Conversion in fs/fcntl.c
  BUG_ON() Conversion in fs/dquot.c
  BUG_ON() Conversion in md/raid10.c
  BUG_ON() Conversion in md/raid6main.c
  BUG_ON() Conversion in md/raid5.c
  Fix minor documentation typo
  BFP->BPF in Documentation/networking/tuntap.txt
  ...
2006-04-02 12:58:45 -07:00
Linus Torvalds 86dca4f8e6 Merge master.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (33 commits)
  [PATCH] pcmcia: declare pccard_iodyn_ops (fix m8xx_pcmcia.c compilation error)
  [PATCH] pcmcia: fix pcmcia_device_remove oops
  [PATCH] pcmcia: Add support for Possio GCC AKA PCMCIA Siemens MC45
  [PATCH] pcmcia: pseudo device handling update
  [PATCH] pcmcia: convert DEV_OK to pcmcia_dev_present
  [PATCH] pcmcia: use bitfield instead of p_state and state
  [PATCH] pcmcia: remove unused p_dev->state flags
  [PATCH] pcmcia: make pcmcia_release_{io,irq} static
  [PATCH] pcmcia: add return value to _config() functions
  [PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
  [PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
  [PATCH] pcmcia: rename pcmcia_device.state
  [PATCH] pcmcia: remove unneeded Vcc pseudo setting
  [PATCH] pcmcia: remove export of pcmcia_release_configuration
  [PATCH] pcmcia: default suspend and resume handling
  [PATCH] pcmcia: convert remaining users of pcmcia_release_io and _irq
  [PATCH] pcmcia: add pcmcia_disable_device
  [PATCH] serial_cs: add Merlin U630 IDs
  [PATCH] pcmcia: AT91RM9200 Compact Flash driver
  [PATCH] pcmcia: socket.functions starts with 1
  ...
2006-04-02 12:49:59 -07:00
Anders Larsen 3a3f8a126d MTD: remove obsolete Kconfig options
Remove the obsolete Kconfig options MTD_CFI_AMDSTD_RETRY
and MTD_CFI_AMDSTD_RETRY_MAX

The code that depended on these was removed in early 2004, but
Kconfig was not updated accordingly.

Signed-off-by: Anders Larsen <al@alarsen.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-04-01 01:02:42 +02:00
Richard Purdie 8fe833c1b0 [PATCH] LED: add NAND MTD activity LED trigger
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:57 -08:00
Petri T. Koistinen b5ac5d7edb [PATCH] drivers/mtd/maps/vmax301.c: fix off by one vmax_mtd
Fix an obvious off-by-one error (vmax_mtd[] contains two elements).

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:49 -08:00
Herbert Poetzl 4d55146598 [PATCH] mtd: fix broken name_to_dev_t() declaration
drivers/mtd/devices/blkmtd.c uses a local declaration of name_to_dev_t()
which is inconsistant with the real one.  the following patch fixes this by
removing the local declaration and including mount.h instead

this patch was originally done by Micah Anderson.

Signed-off-by: Herbert Poetzl <herbert@13thfloor.at>
Acked-by: Micah Anderson <micah@riseup.net>
Acked-by: Daniel Hokka Zakrisson <daniel@hozac.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:49 -08:00
Peter Korsgaard 84e699e6ec [PATCH] mtd/redboot: Handle holes in fis table
Redboot simply sets the first character of a fis entry to 0xff on "fis
delete".  The kernel redboot parser stops parsing on such an entry, and
without this patch any entries after a deleted image would not be detected.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:49 -08:00
Pavel Machek a63ec1b7b7 [PATCH] Add chip used in collie to jedec_probe
This adds flash chip used in Sharp Zaurus sl5500 (collie) to jedec_probe.
Values work for read-only access, but I have not figured out how to do
read-write.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:49 -08:00
Eric Sesterhenn edcbce2150 [PATCH] Dead code in mtd/maps/pci.c
This fixes coverity bug #12.  The first two gotos in the function still
have the initial value for mtd set.  And the third goto just triggers for
!mtd

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:49 -08:00
Pavel Machek 2d2dce0eb6 [PATCH] Kill ifdefs in mtdcore.c
Kill unneccessary ifdefs in mtdcore.c.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:49 -08:00
Eric Sesterhenn / snakebyte 8b68a12633 [PATCH] Fix debug statement in inftlcore.c
Fix a copy/paste bug found by cpminer inside the inftlcore.c file

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Acked-by: Greg Ungerer <gerg@snapgear.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Atsushi Nemoto b175d03dd2 [PATCH] mtd cmdlinepart: allow zero offset value
Current cmdlinepart.c uses offset value 0 to specify a continuous
partition.  This prevents creating a second partition starting at 0.

For example, I can split 4MB device using "mtdparts=id:2M,2M", but I can
not do "mtdparts=id:2M@2M,2M@0" to swap mtd0 and mtd1.

This patch introduces special OFFSET_CONTINUOUS value for a continuous
partition and allows 0 for offset value.

Also this patch replaces 0xffffffff with UINT_MAX for SIZE_REMAINING.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Tobias Klauser 87d10f3c79 [PATCH] drivers/mtd: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of the macro.

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Adrian Bunk 54af6b4648 [PATCH] MTD_NAND_SHARPSL and MTD_NAND_NANDSIM should be tristate's
MTD_NAND=m and MTD_NAND_SHARPSL=y or MTD_NAND_NANDSIM=y are illegal
combinations that mustn't be allowed.

This patch fixes this bug by making MTD_NAND_SHARPSL and MTD_NAND_NANDSIM
tristate's.

Additionally, it fixes some whitespace damage at these options.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Acked-by: "Artem B. Bityutskiy" <dedekind@yandex.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Adrian Bunk 0500abf521 [PATCH] drivers/mtd/: small cleanups
- chips/sharp.c: make two needlessly global functions static

- move some declarations to a header file where they belong to

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Ingo Molnar 48b192686d [PATCH] sem2mutex: drivers/mtd/
Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Ingo Molnar 040d79f906 [PATCH] sem2mutex: mtd/doc2000.c
Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Andrew Morton 37466ea85a [PATCH] m25p80: printk warning fix
drivers/mtd/devices/m25p80.c: In function `m25p80_erase':
drivers/mtd/devices/m25p80.c:189: warning: signed size_t format, different type arg (arg 6)

Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-31 12:18:48 -08:00
Dominik Brodowski e2d4096365 [PATCH] pcmcia: use bitfield instead of p_state and state
Instead of the two status values struct pcmcia_device->p_state and state,
use descriptive bitfields. Most value-checking in drivers was invalid, as
the core now only calls the ->remove() (a.k.a. detach) function in case the
attachement _and_ configuration was successful.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:26:33 +02:00
Dominik Brodowski 15b99ac172 [PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in
the internal _config() functions. Make them return a value, so that .probe
can properly report whether the probing of the device succeeded or not.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:26:06 +02:00
Dominik Brodowski fba395eee7 [PATCH] pcmcia: remove dev_link_t and client_handle_t indirection
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now.
Therefore, remove all such indirections.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:21:06 +02:00
Dominik Brodowski fd238232cd [PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:57 +02:00
Dominik Brodowski 70294b4683 [PATCH] pcmcia: remove unneeded Vcc pseudo setting
As we do not allow setting Vcc in the pcmcia core, and Vpp1 and
Vpp2 can only be set to the same value, a lot of code can be
streamlined.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:55 +02:00
Dominik Brodowski 4bbed52314 [PATCH] pcmcia: remove export of pcmcia_release_configuration
Handle the _modifying_ operation sm91c92_cs requires in
pcmcia_modify_configuration, so that the only remaining users
of pcmcia_release_configuration() are within the pcmcia core
module.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-03-31 17:15:53 +02:00
Adrian Bunk 8917f6f70b Kconfig help: MTD_JEDECPROBE already supports Intel
Intel chips are already supported.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
2006-03-26 19:15:03 +02:00
Eric Sesterhenn 373ebfbf17 BUG_ON() Conversion in drivers/mtd/
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-26 18:15:12 +02:00
Rusty Russell 8d3b33f67f [PATCH] Remove MODULE_PARM
MODULE_PARM was actually breaking: recent gcc version optimize them out as
unused.  It's time to replace the last users, which are generally in the
most unloved drivers anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-25 08:22:52 -08:00
David Brownell 3cb4f09fc2 [PATCH] mtd_dataflash, fix block vs page erase
Fix a bug in the block-erase optimization for Dataflash; it was using block
erase even for smaller segments that need page erase.

That wouldn't matter for JFFS2, which never erases less than one block
(sometimes several blocks), but for other callers it might.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-14 07:57:17 -08:00
John Bowler 77a3313551 [PATCH] "drivers/mtd/redboot.c: recognise a foreign byte sex partition table" update
Sync up the recent redboot fix with MTD CVS.  It uses the correct swab()
functions.

Cc: John Bowler <jbowler@acm.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-02 08:33:07 -08:00
John Bowler 9cff3372bf [PATCH] drivers/mtd/redboot.c: recognise a foreign byte sex partition table
The RedBoot boot loader writes flash partition tables containing native
byte sex 32 bit values.  When booting an opposite byte sex kernel (e.g.  an
LE kernel from BE RedBoot) the current MTD driver fails to handle the
partition table and therefore is unable to generate the correct partition
map for the flash.

So far as I am aware this problem is ARM specific, because only ARM
supports software change of the CPU (memory system) byte sex, however the
partition table parsing is in generic MTD code.  The patch below has been
tested on NSLU2 (an IXP4XX based system) with a patch,
10-ixp4xx-copy-from.patch (submitted to linux-arm-kernel - it's ARM
specific) required to make the maps/ixp4xx.c driver work with an LE kernel.

Builds of the patched system are in the 'unstable' release of OpenSlug and
UcSlugC available from www.nslu2-linux.org.  These builds are BE, the
archives at www.nslu2-linux.org and www.handhelds.org (see
monotone.vanille.de) can be built LE (currently DISTRO targets
nslu-ltu.conf for LE thumb uclibc (32 bit kernel) and nslu2-lau.conf,
nslu2-lag.conf for LE arm uclibc/glibc) and this patch has been tested
extensively will both BE and LE systems on the NSLU2 (including swapping
between BE and LE by reflashing from both RedBoot and Linux).

The patch recognises that the FIS directory (the partition table) is
byte-reversed by examining the partition table size, which is known to be
one erase block (this is an assumption made elsewhere in redboot.c).  If
the size matches the erase block after byte swapping the value then
byte-reversal is assumed, if not no further action is taken.  The patched
code is fail safe; should redboot.c be changed to support a partition table
with a modified size field the test will fail and the partition table will
be assumed to have the host byte sex.

If byte-reversal is detected the patch byte swaps the remainder of the 32
bit fields in the copy of the table; this copy is then used to set up the
MTD partition map.

Signed-off-by: John Bowler <jbowler@acm.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-28 20:53:43 -08:00
Simon Vogl c314b6f1fa [PATCH] cfi: init wait queue in chip struct
Fix a kernel oops for Intel P30 flashes, where the wait queue head was not
initialized for the flchip struct, which in turn caused a crash at the
first read operation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-24 14:31:37 -08:00
Alexey Korolev d86d43706a [PATCH] cfi_cmdset_0001: fix range for cache invalidation
I found an issue in cfi_cmdset0001.c.  It is related to cache region
invalidation in the buffered write procedure.

The code performs cache invalidation from "cmd_addr" to "cmd_adr + len" in
do_write_buffer() while we modify region from "adr" to "adr+len".

This issue affects writes + reads of data by small chunks.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-20 20:00:09 -08:00
Al Viro 034d2f5af1 [PATCH] arm: fix dependencies for MTD_XIP
MTD_XIP depends on having working asm/mtd-xip.h; it's not just per-architecture
(arm-only, as current Kconfig would have it), but actually per-subarch as
well.  Introduced a new symbol (ARCH_MTD_XIP) set by arch Kconfig; MTD_XIP
depends on it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-02-08 01:02:58 -05:00
Martin Michlmayr 75b84e94aa [PATCH] Fix compilation errors in maps/dc21285.c
CC      drivers/mtd/maps/dc21285.o
drivers/mtd/maps/dc21285.c: In function `dc21285_copy_to_32':
drivers/mtd/maps/dc21285.c:113: error: invalid lvalue in increment
drivers/mtd/maps/dc21285.c: In function `dc21285_copy_to_16':
drivers/mtd/maps/dc21285.c:124: error: invalid lvalue in increment
drivers/mtd/maps/dc21285.c: In function `dc21285_copy_to_8':
drivers/mtd/maps/dc21285.c:134: error: invalid lvalue in increment
make[3]: *** [drivers/mtd/maps/dc21285.o] Error 1

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-03 08:32:01 -08:00
Alexey Dobriyan 70e5101576 [PATCH] tsunami_flash: fix "parse error before ';' token"
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-01 08:53:10 -08:00
Adrian Bunk fd279197b1 [PATCH] build kernel/intermodule.c only when required
Build kernel/intermodule.c only when required.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-16 23:15:26 -08:00
Adrian Bunk 3001aa826e [PATCH] no longer mark MTD_OBSOLETE_CHIPS as BROKEN
This patch removes the wrong dependency of MTD_OBSOLETE_CHIPS on BROKEN and
marks the non-compiling MTD_AMDSTD and MTD_JEDEC drivers as BROKEN.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-16 23:15:26 -08:00
Arjan van de Ven 858119e159 [PATCH] Unlinline a bunch of other functions
Remove the "inline" keyword from a bunch of big functions in the kernel with
the goal of shrinking it by 30kb to 40kb

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-14 18:27:06 -08:00
David Brownell 7111763d39 [PATCH] spi: misc fixes
This collects some small SPI patches that seem to be missing from the MM tree:

  - spi_butterfly kbuild hooks got dropped somehow; this restores them
  - quick fix for a (theoretical?) m25p80_write() oops noted by Andrew
  - quick fix for a potential config-specific oops for mtd_dataflash()
  - minor doc tweaks

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-13 16:29:56 -08:00
Vitaly Wool 8275c642cc [PATCH] spi: use linked lists rather than an array
This makes the SPI core and its users access transfers in the SPI message
structure as linked list not as an array, as discussed on LKML.

From: David Brownell <dbrownell@users.sourceforge.net>

  Updates including doc, bugfixes to the list code, add
  spi_message_add_tail().  Plus, initialize things _before_ grabbing the
  locks in some cases (in case it grows more expensive).  This also merges
  some bitbang updates of mine that didn't yet make it into the mm tree.

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Dmitry Pervushin <dpervushin@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-13 16:29:56 -08:00
Mike Lavender 2f9f762879 [PATCH] spi: M25 series SPI flash
This was originally a driver for the ST M25P80 SPI flash.  It's been
updated slightly to handle other M25P series chips.

For many of these chips, the specific type could be probed, but for now
this just requires static setup with flash_platform_data that lists the
chip type (size, format) and any default partitioning to use.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Mike Lavender <mike@steroidmicros.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-13 16:29:55 -08:00
David Brownell 1d6432fe10 [PATCH] spi: mtd dataflash driver
This is a conversion of the AT91rm9200 DataFlash MTD driver to use the
lightweight SPI framework, and no longer be AT91-specific.  It compiles
down to less than 3KBytes on ARM.

The driver allows board-specific init code to provide platform_data with
the relevant MTD partitioning information, and hotplugs.

This version has been lightly tested.  Its parent at91_dataflash driver has
been pretty well banged on, although kernel.org JFFS2 dataflash support was
acting broken the last time I tried it.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-13 16:29:54 -08:00
Jesper Juhl 3c6bee1d40 [PATCH] turn "const static" into "static const"
ICC likes to complain about storage class not being first, GCC doesn't
care much (except for cases like "inline static").
have a hard time seeing how it could break anything.

Thanks to Gabriel A. Devenyi for pointing out
http://linuxicc.sourceforge.net/ which is what made me create this patch.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-10 08:01:55 -08:00
Russell King 0a3a98f6dd Merge Linus' tree. 2006-01-09 19:18:33 +00:00
Christoph Hellwig a885c8c431 [PATCH] Add block_device_operations.getgeo block device method
HDIO_GETGEO is implemented in most block drivers, and all of them have to
duplicate the code to copy the structure to userspace, as well as getting
the start sector.  This patch moves that to common code [1] and adds a
->getgeo method to fill out the raw kernel hd_geometry structure.  For many
drivers this means ->ioctl can go away now.

[1] the s390 block drivers are odd in this respect.  xpram sets ->start
    to 4 always which seems more than odd, and the dasd driver shifts
    the start offset around, probably because of it's non-standard
    sector size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@suse.de>
Cc: <mike.miller@hp.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:54 -08:00
Tim Schmielau de25968cc8 [PATCH] fix more missing includes
Include fixes for 2.6.14-git11.  Should allow to remove sched.h from
module.h on i386, x86_64, arm, ia64, ppc, ppc64, and s390.  Probably more
to come since I haven't yet checked the other archs.

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:13:45 -08:00
Russell King 0fec53a24a [ARM] Remove EPXA10DB machine support
EPXA10DB seems to be uncared for:
- the "PLD" code has never been merged
- no one has reported that this platform has been broken since
  at least 2.6.10
- interest seems to have dried up around March 2003.

Therefore, remove EPXA10DB support.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-08 22:37:46 +00:00
Russell King f8ce25476d [ARM] Move asm/hardware/clock.h to linux/clk.h
This is needs to be visible to other architectures using the AMBA
bus and peripherals.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-07 16:15:52 +00:00
Russell King 123656d4cc Merge with Linus' kernel. 2006-01-07 14:40:05 +00:00
Dominik Brodowski f8cfa618dc [PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified
probe() callback. As all in-kernel drivers are changed to this new
callback, there will be no temporary backwards-compatibility. Inside a
probe() function, each driver _must_ set struct pcmcia_device
*p_dev->instance and instance->handle correctly.

With these patches, the basic driver interface for 16-bit PCMCIA drivers
now has the classic four callbacks known also from other buses:

        int (*probe)            (struct pcmcia_device *dev);
        void (*remove)          (struct pcmcia_device *dev);

        int (*suspend)          (struct pcmcia_device *dev);
        int (*resume)           (struct pcmcia_device *dev);

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:24 +01:00
Dominik Brodowski b463581154 [PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most
cases, unused. Therefore, remove it from many drivers.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:20 +01:00
Dominik Brodowski cc3b4866be [PATCH] pcmcia: unify detach, REMOVAL_EVENT handlers into one remove callback
Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function.
Old functionality is preserved, for the moment.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-06 00:03:10 +01:00
Dominik Brodowski 98e4c28b7e [PATCH] pcmcia: new suspend core
Move the suspend and resume methods out of the event handler, and into
special functions. Also use these functions for pre- and post-reset, as
almost all drivers already do, and the remaining ones can easily be
converted.

Bugfix to include/pcmcia/ds.c
Signed-off-by: Andrew Morton <akpm@osdl.org>

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2006-01-05 23:59:02 +01:00
Russell King a8d3584a2d [ARM] Remove clk_use()/clk_unuse()
It seems that clk_use() and clk_unuse() are additional complexity
which isn't required anymore.  Remove them from the clock framework
to avoid the additional confusion which they cause, and update all
ARM machine types except for OMAP.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-01-03 18:41:37 +00:00
Adrian Bunk 0b57ee9e55 [SPARC]: introduce a SPARC Kconfig symbol
Introduce a Kconfig symbol SPARC that is defined on both the sparc and
sparc64 architectures.

This symbol makes some dependencies more readable.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-12-22 23:09:54 -08:00
Kyungmin Park 27f4e08347 [PATCH] mtd onenand driver: use platform_device.h instead device.h
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-18 16:29:11 -08:00
Kyungmin Park 532a37cf8d [PATCH] mtd onenand driver: reduce stack usage
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-18 16:28:24 -08:00
Kyungmin Park 20ba89a361 [PATCH] mtd onenand driver: fix unlock problem in DDP 2005-12-18 16:28:23 -08:00
Kyungmin Park 37b1cc3910 [PATCH] mtd onenand driver: check correct manufacturer
This (and the three subsequent patches) is working well on OMAP H4 with
2.6.15-rc4 kernel and passes the LTP fs test.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-18 16:28:23 -08:00
Andrew Morton 3fe968f167 [PATCH] blkmtd: use clear_page_dirty()
SetPageDirty() and ClearPageDirty() are low-level thing which filesystems
shouldn't be using.  They bypass dirty page accounting.

Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-12 08:57:41 -08:00
Adrian Bunk 2b9175c174 [MTD] Make functions static, include header files with prototypes
This patch contains the following possible cleanups:
- every file should #include the headers containing the prototypes for
  it's global functions
- make needlessly global functions static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:54:58 +01:00
Richard Purdie ee2d49de3e [MTD] chips: make sharps driver usable again
Update the pre-CFI Sharp driver sharps.c so it compiles.  map_read32 /
map_write32 no longer exist in the kernel so the driver is totally broken
as it stands.  The replacement functions use different parameters resulting
in the other changes.

Change collie to use this driver until someone works out why the cfi driver
fails on that machine.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Tested-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:49:03 +01:00
Thomas Gleixner 72af3b2c5a [MTD] Remove bogus PQ2FADS driver
Remove disfunctional driver, which slipped through the review mechanism

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:46:16 +01:00
Luiz Capitulino e2602b347a [MTD] maps: sparse fixup
The patch below fixes the following sparse warning:

drivers/mtd/maps/nettel.c:482:27: warning: Using plain integer as NULL pointer

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:37:56 +01:00
Nicolas Pitre 8bc3b3804a [MTD] cfi_cmdset_0001: relax locking rules for multi hardware partition support
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:36:35 +01:00
David Woodhouse 7ac571f8d0 [MTD] Make some tables 'const' so they can live in .rodata
arjan: drivers/mtd/maps/sc520cdp.c:167: warning: par_table is never written to and should be declared 'const'
arjan: drivers/mtd/maps/pci.c:105: warning: mtd_pci_map is never written to and should be declared 'const'
arjan: mind fixing those up ?

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:33:50 +01:00
John Bowler 3c77354794 [MTD] maps/ixp4xx: half-word boundary and little-endian fixups
ixp4xx updates:
  - Handle reads that don't start on a half-word boundary.
  - Make it work when CPU is in little-endian mode.

Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: David Vrabel <dvrabel@arcom.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:29:37 +01:00
Todd Poynor 987d24018d [MTD] CFI: Use 16-bit access to autoselect/read device id data
Recent models of Intel/Sharp and Spansion CFI flash now have significant
bits in the upper byte of device ID codes, read via what Spansion calls
"autoselect" and Intel calls "read device identifier".  Currently these
values are truncated to the low 8 bits in the mtd data structures, as
all CFI read query info has previously been read one byte at a time.
Add a new method for reading 16-bit info, currently just manufacturer
and device codes; datasheets hint at future uses for upper bytes in
other fields.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:27:24 +01:00
Maciej W. Rozycki 3eb8ceac48 [MTD] devices/ms02-nv: phys/virt address fixups
Merge from linux-mips:
Use physical addresses at the interface level, letting drivers remap
them as appropriate.

Signed-off-by: Maciej W. Rozycki <macro@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 19:25:47 +01:00
Sean Young bc4117f876 [MTD] RFD_FTL: Use lanana assigned major device number
A major block device number is now assigned by lanana.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-29 16:52:26 +01:00
Linus Torvalds 3b762d321a Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Manual fixups to ARM ixp4xxx by hand.
2005-11-19 15:24:42 -08:00
Russell King 0c2e4b4ff3 [ARM] Drivers should not make use of architecture private __ioremap
__ioremap is an architecture private interface and must not be used
by drivers when the architecture independent interface will do just
as well.  Switch the ipaq drivers to use the correct interface.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-17 16:46:41 +00:00
Russell King 7d78c887a9 [DRIVER MODEL] Fix merge clashes with ARM ixp2000 / ixp4xx platforms
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-11-17 15:47:30 +00:00
Sean Young ef63d0049a [MTD] maps: Replace dependency on non existing config option
CONFIG_ELAN doesn't exist any more; CONFIG_X86_ELAN is too specific
so make ts-5500 memory map dependant on CONFIG_X86.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-13 19:30:44 +01:00
Linus Torvalds 5643f000c1 Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-11 09:24:26 -08:00
Russell King 3ae5eaec1d [DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-11-09 22:32:44 +00:00
Olaf Hering 733482e445 [PATCH] changing CONFIG_LOCALVERSION rebuilds too much, for no good reason
This patch removes almost all inclusions of linux/version.h.  The 3
#defines are unused in most of the touched files.

A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is
unfortunatly in linux/version.h.

There are also lots of #ifdef for long obsolete kernels, this was not
touched.  In a few places, the linux/version.h include was move to where
the LINUX_VERSION_CODE was used.

quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'`

search pattern:
/UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h

Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:55:57 -08:00
Andrew Morton 015953d706 [PATCH] mtd: onenand_base needs sched.h
drivers/mtd/onenand/onenand_base.c: In function `onenand_wait':
drivers/mtd/onenand/onenand_base.c:293: error: `jiffies' undeclared (first use in this function)
drivers/mtd/onenand/onenand_base.c:293: error: (Each undeclared identifier is reported only once
drivers/mtd/onenand/onenand_base.c:293: error: for each function it appears in.)
drivers/mtd/onenand/onenand_base.c:293: error: implicit declaration of function `msecs_to_jiffies'
drivers/mtd/onenand/onenand_base.c:294: error: implicit declaration of function `time_before'
drivers/mtd/onenand/onenand_base.c:301: error: implicit declaration of function `cond_resched'
drivers/mtd/onenand/onenand_base.c: In function `onenand_get_device':
drivers/mtd/onenand/onenand_base.c:522: error: implicit declaration of function `set_current_state'
drivers/mtd/onenand/onenand_base.c:522: error: `TASK_UNINTERRUPTIBLE' undeclared (first use in this function)
drivers/mtd/onenand/onenand_base.c:525: error: implicit declaration of function `schedule'
drivers/mtd/onenand/onenand_base.c: In function `onenand_release_device':
drivers/mtd/onenand/onenand_base.c:545: error: `TASK_UNINTERRUPTIBLE' undeclared (first use in this function)
drivers/mtd/onenand/onenand_base.c:545: error: `TASK_INTERRUPTIBLE' undeclared (first use in this function)

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:55:50 -08:00
Andrew Morton b80b5832ff [PATCH] mtd: rfd_ftl build fix
drivers/mtd/rfd_ftl.c: In function `find_free_block':
drivers/mtd/rfd_ftl.c:528: error: `jiffies' undeclared (first use in this function)
drivers/mtd/rfd_ftl.c:528: error: (Each undeclared identifier is reported only once
drivers/mtd/rfd_ftl.c:528: error: for each function it appears in.)

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09 07:55:50 -08:00
Linus Torvalds b3ce1debe2 Merge master.kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6
Some manual fixups for clashing kfree() cleanups etc.
2005-11-07 10:24:08 -08:00
Greg Ungerer 8766af935f [PATCH] check for failed kmalloc in inftlmount.c
The INFTL mount code contains a kmalloc() followed by a memset() without
handling a possible memory allocation failure.

Signed-off-by: <panagiotis.issaris@mech.kuleuven.ac.be>
Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 08:00:46 -08:00
Jesper Juhl fa671646f6 [PATCH] kfree cleanup: drivers/mtd
This is the drivers/mtd part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in drivers/mtd/.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:54:02 -08:00
Thomas Gleixner c2965f1129 [MTD] chips: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 15:25:34 +01:00
Thomas Gleixner d5c5e78af5 [MTD] OneNAND: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 15:11:28 +01:00
Thomas Gleixner 61b03bd7c3 [MTD] NAND: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 15:10:37 +01:00
Thomas Gleixner e5580fbe8a [MTD] devices: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 15:06:59 +01:00
Thomas Gleixner 69f34c98c1 [MTD] maps: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 15:01:58 +01:00
Thomas Gleixner 1f948b43f7 [MTD] chips: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 14:45:15 +01:00
Thomas Gleixner 97894cda57 [MTD] core: Clean up trailing white spaces
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 13:37:38 +01:00
Konstantin Baidarov b95f9609c7 [MTD] chips cfi_cmdset_0002: Prevent timeout race
We've noticed that sometimes "MTD do_write_buffer(): software timeout"
message was printed out when writing to a Fujitsu NOR flash.
It turned out that this was because of a race in the timeout handling
do_write_buffer(). A small timeout of (HZ / 1000) + 1 is used there, and
sometimes if the timer interrupt handling takes more than one or even two
jiffies (which is 1-2 ms with HZ == 1000) and that interrupt happens just
after chip_ready() call, the driver bails out from a ready polling loop
despite the chip has actually become ready while all those interrupts were
handled. To deal with this issue, extra check for chip ready is neccessary on
timeout expiration (and the checks should better be reordered).
As do_write_oneword() uses the same approach, it needs to also be changed.

Signed-off-by: Konstantin Baidarov <kbaidarov@ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 10:47:08 +01:00
Marian Balakowicz be30c10fd8 [MTD] maps: Add support for the "TQM834x" Boards
The following patch adds support for the TQ Systems  TQM834x  Boards.
Verified on TQM8349L.

This is a resubmit after integrating the suggested changes.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 10:46:22 +01:00
Lennert Buytenhek ea17629f3e [MTD] maps ixp2000: fix compile warnings in ixp2000 map driver
Fix two compile warnings that occur because of treating two
'unsigned long's as 'void *'s.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 10:44:15 +01:00
Thomas Gleixner 3096617434 [MTD] NAND Kconfig: Simplify dependencies
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 02:49:43 +01:00
Thomas Gleixner 3e17404918 [MTD] maps/plat-ram: Avoid gcc 4.0 warning
The assignement of a "const char *" to a "char *" variable
is emitting a warning with gcc 4.0. We cannot change
mtd->name to "const char *" as we have dynamic assignements
of the name. So casting is the correct solution here

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 02:28:05 +01:00
Todd Poynor 868801e561 [MTD] NAND: nand_write_ecc memory and OOB corruption
Nathan Roberts noticed the nand_write_ecc index into oobbuf goes out of
bounds when crossing an erase block boundary, causing incorrect OOB data
to be written and corrupting memory.  Reset the index to zero after
re-preparing oobbuf for a new erase block.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 02:24:31 +01:00
Vitaly Wool 49196f3332 [MTD] NAND nand_base: Fix shift for bad block check (16bit devices only)
In case of an odd offset, the result was shifted by 1 instead of 8

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 02:15:21 +01:00
Thomas Gleixner 46d0d0fb61 [MTD] OneNAND/Kconfig: Fix dependencies
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 01:14:05 +01:00
Thomas Gleixner f0250fd7c3 Revert "[PATCH] OneNAND: Add simulator"
This reverts 405c829f98 commit.
2005-11-07 01:11:04 +01:00
Sean Young 01ac742db3 [MTD] maps/Kconfig: Simplify and update dependencies
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 00:40:10 +01:00
Sean Young 28f462308e [MTD] maps/ts5500: Fix partition support. Code cleanup
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 00:32:01 +01:00
Thomas Gleixner 15fdc52f35 [MTD] Tidy up Tims include cleanup
While we are at it, reorder the includes and
remove the silly /* TASK */ comment

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 00:14:42 +01:00
David Vrabel 9090ed0b82 [MTD] maps/ixp4xx: kill some warnings
- Use map.virt instead of map.map_priv_1 since it has the correct type.
- Use readw/writew instead of dereferencing an ioremap'd cookie.
- Remove an unused variable.

Signed-off-by: David Vrabel <dvrabel@arcom.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-07 00:08:05 +01:00
Richard Purdie 87c146dc1a [MTD] NAND sharpsl.c: Add support for akita and borzoi models
The Sharp Zaurus akita and borzoi models are large page flash devices.
This patch adds support for them to the sharpsl MTD NAND driver but
keeps the oob layout and bad block positions compatible with the Sharp
Zaurus 2.4 kernel and ROM bootloader.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:34:39 +01:00
Nicolas Pitre 6f6ed056d2 [MTD] chips/cfi_cmdset_0001: fix for P30 cfi parsing
Change to the extended cfi table parsing for Intel NOR flash that uses
the info in the extended table to 'walk' the table rather than using
hard coding for various primary extended query table version numbers.

From: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:19:17 +01:00
Ben Dooks cfd320fbfc [MTD] NAND s3c2410.c: Fix timing calculation bugs
Spotted by basprog@mail.ru

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:15:54 +01:00
Ben Dooks d574504114 [MTD] NAND s3c2410.c: Fix missing dev parameter to dev_err
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:10:43 +01:00
Ben Dooks df2e162927 [MTD] maps/plat-ram.c: Initialize owner in device_driver struct
Added .owner initialisation to allow the
tracking of the device_driver owners when
built as a module

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:09:49 +01:00
Ben Dooks e0030b60ce [MTD] maps/bast-flash.c: Initialize owner in device_driver struct
Added owner to device driver field for tracking
when loaded as a module.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:08:38 +01:00
Ben Dooks 61a7275491 [MTD] NAND: s3c2410.c Initialize owner in device_driver struct
Added owner fields to the device_driver for tracking
ownership when built as a module

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:07:28 +01:00
Artem B. Bityutskiy 5cea5dadfe [MTD] mtdpart.c: Allow eraseblock size != power of 2
Don't assume eraseblock size is power of 2.
Dataflash can have aligned eraseblock size.

From: Peter Menzebach <pm-mtd@mw-itcon.de>
Acked-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 23:04:14 +01:00
Kyungmin Park 83a368380e [MTD] OneNAND: Enhanced support for DDP (Dual Densitiy Packages)
Add density mask for better support of DDP chips.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 22:59:48 +01:00
Kyungmin Park a41371eb6d [MTD] OneNAND: Power Management (PM) support
Add suspend/resume

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 22:42:28 +01:00
Kyungmin Park 87590e26ff [MTD] OneNAND: Add missing files
Simple bad block table source and header files

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 22:39:23 +01:00
Ben Dooks 0255fc1b08 [MTD] NAND: s3c2410 use dev_err() to report errors instead of printk()
Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 22:37:35 +01:00
Pete Popov ef6f0d1ffc [MTD] NAND: Alchemy board driver cleanup
- cleaned up the partitions and include files
- added more flexible CS and address detection and setup

Regression tested on db1200 and db1550.

Signed-off-by: Pete Popov <ppopov@pacbell.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 22:29:02 +01:00
Joern Engel b523b3bac3 [MTD] maps: Add support for MTX-1 Flash device
Add support for "4G Systems MTX-1 Flash device", better known as meshcube.

From: Bruno Randolf <bruno.randolf@4g-systems.biz>
Signed-off-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:58:57 +01:00
Vitaly Wool 962034f439 [MTD] NAND: Add suspend/resume functionality
The changes introduced allow to suspend/resume NAND flash.
A new state (FL_PM_SUSPENDED) is introduced, as well as
routines for mtd->suspend and mtd->resume to put the flash in
suspended state from software pov.

Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:43:45 +01:00
Todd Poynor 9c517e6c80 [MTD] maps: Add mapping driver for PQ2FADS boards.
From: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:40:38 +01:00
Kyungmin Park 1b01d9798d OneNAND: Remove OMAP platform driver
Now we can use the generic platform driver

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:35:12 +01:00
Kyungmin Park 68ee4b1c50 [MTD] OneNAND: Add generic platform driver
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:33:11 +01:00
David Vrabel e4c212efbd [MTD] maps/ixp4xx: remove platform specific bits
- Intel chip driver has a reboot notifier so no need to reset the chip here.
- Don't play with chip selects (platform code should do this if necessary).

Signed-off-by: David Vrabel <dvrabel@arcom.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:32:16 +01:00
Kyungmin Park 1501787675 [MTD] OneNAND: Remove experimental Kconfig dependency
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:25:42 +01:00
Kyungmin Park d36d63d404 [PATCH] OneNAND: Fix bug in write verify
- Remove unused block, page parameters
- Add constant instead of runtime value

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:24:51 +01:00
Kyungmin Park 405c829f98 [PATCH] OneNAND: Add simulator
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:23:10 +01:00
Kyungmin Park fcc31470c4 [PATCH] OneNAND: Update OMAP OneNAND mapping using device driver model
- Update OMAP OneNAND mapping file using device driver model
- Remove board specific macro and values.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:22:01 +01:00
Kyungmin Park cdc001305d [PATCH] OneNAND: Simple Bad Block handling support
Based on NAND memory bad block table code

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:20:53 +01:00
Kyungmin Park 52b0eea73d [PATCH] OneNAND: Sync. Burst Read support
Add OneNAND Sync. Burst Read support
Tested with OMAP platform

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:19:37 +01:00
Kyungmin Park cd5f6346bc [MTD] Add initial support for OneNAND flash chips
OneNAND is a new flash technology from Samsung with integrated SRAM
buffers and logic interface.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 21:17:24 +01:00
Thomas Gleixner d409466154 [MTD] NAND: Use correct mask for OOB size calculation
The bit mask used for oob size calculation was using 2 bits instead
of one. Fortunately the next bit has been 0 all the time.

Thanks to Nathan H. for pointing this out

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:22:32 +01:00
Thomas Gleixner 2c92d75532 [MTD] Remove deprecated power management functions
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:15:30 +01:00
David Woodhouse e21f6c02f7 [MTD] Missing check on kmalloc return in INFTL mount.
Signed-off-by: Youssef Hmamouche <hyoussef@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:14:49 +01:00
Nicolas Pitre e102d54abf [MTD] writev support for cfi-cmdset-0001
While this might be useful for all supported flash types, it is mandatory
for proper JFFS2 support with Sibley flash.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:12:48 +01:00
Nicolas Pitre 638d983840 {MTD] add support for Intel's "Sibley" flash
This updates the Primary Vendor-Specific Extended Query parsing to
version 1.4 in order to get the information about the Configurable
Programming Mode regions implemented in the Sibley flash, as well as
selecting the appropriate write command code.

This flash does not behave like traditional NOR flash when writing data.
While mtdblock should just work, further changes are needed for JFFS2 use.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:12:17 +01:00
Nicolas Pitre 4843653cab [MTD] cleanups to cfi_cmdset_0001
This includes improved error handling/reporting plus some other
message cleanups.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:10:19 +01:00
Sean Young e27a9960af [MTD] Add Resident Flash Disk (RFD) support
This type of flash translation layer (FTL) is used by the Embedded BIOS
by General Software. It is known as the Resident Flash Disk (RFD), see:

http://www.gensw.com/pages/prod/bios/rfd.htm

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-11-06 20:08:54 +01:00
Thomas Gleixner 2fc2991175 Merge branch 'master' of /home/tglx/work/mtd/git/linux-2.6.git/ 2005-11-06 15:36:37 +01:00
Linus Torvalds 4fd5f8267d Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Manual #include fixups for clashes - there may be some unnecessary
2005-10-31 07:32:56 -08:00
Tim Schmielau 4e57b68178 [PATCH] fix missing includes
I recently picked up my older work to remove unnecessary #includes of
sched.h, starting from a patch by Dave Jones to not include sched.h
from module.h. This reduces the number of indirect includes of sched.h
by ~300. Another ~400 pointless direct includes can be removed after
this disentangling (patch to follow later).
However, quite a few indirect includes need to be fixed up for this.

In order to feed the patches through -mm with as little disturbance as
possible, I've split out the fixes I accumulated up to now (complete for
i386 and x86_64, more archs to follow later) and post them before the real
patch.  This way this large part of the patch is kept simple with only
adding #includes, and all hunks are independent of each other.  So if any
hunk rejects or gets in the way of other patches, just drop it.  My scripts
will pick it up again in the next round.

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-30 17:37:32 -08:00
Russell King d052d1beff Create platform_device.h to contain all the platform device details.
Convert everyone who uses platform_bus_type to include
linux/platform_device.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-29 19:07:23 +01:00
Russell King 13bfb34c10 [ARM] Fix Assabet reboot with SA1100 MTD map driver
Unfortunately, some devices forgot to reset the flash on reboot.
Arrange for the map driver to suspend & resume the flash to
ensure that it is in a sane state before rebooting.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-29 16:14:08 +01:00
Russell King 14e66f767f [ARM] Allow MTD device name to be passed via platform data
Allow SA1100 devices to pass the name of the flash device to the
SA1100 map driver.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-29 16:08:31 +01:00
Russell King 822e5e7269 [ARM] Fix MTD device/partition destruction
We should not delete MTD partitions when we registered a MTD
device.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-29 16:03:24 +01:00
Russell King 0d2ef7d73e [ARM] Add support for init/exit methods in sa1100 MTD map driver
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-29 15:57:20 +01:00
Russell King 57725f0a94 [ARM] Rename 'data' to 'plat' in sa1100 MTD map driver
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-29 15:51:14 +01:00
Greg KH 6fbfddcb52 Merge ../bleed-2.6 2005-10-28 10:13:16 -07:00
Russell King 9480e307cd [PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level.  Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level.  However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.

Since this is obsolete infrastructure which is no longer necessary,
we can remove it.  Here's an (untested) patch to do exactly that.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 09:52:56 -07:00
Greg Kroah-Hartman 53f4654272 [PATCH] Driver Core: fix up all callers of class_device_create()
The previous patch adding the ability to nest struct class_device
changed the paramaters to the call class_device_create().  This patch
fixes up all in-kernel users of the function.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-10-28 09:52:52 -07:00
Russell King 674c045382 [ARM] 3/4: Remove asm/hardware.h from SA1100 io.h
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-28 14:25:28 +01:00
Linus Torvalds 1dd465cac8 Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-09-30 08:39:56 -07:00
Deepak Saxena 82810a906f [PATCH] Fix ixp4xx MTD driver module build
Missing ';' breaks module build.

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-29 08:55:13 -07:00
Russell King fc611a1a50 [ARM] Don't include mach-types.h unnecessarily
It's pointless to include mach-types.h if you're not going to use
anything from it.  These references were removed as a result of:

grep -lr 'asm/mach-types\.h' . | xargs grep -L 'machine_is_\|MACH_TYPE_\|MACHINE_START\|machine_type'

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-09-29 11:15:51 +01:00
Grant Coady 66c81f0059 [PATCH] DEBUG redefined in drivers/mtd/devices/docecc.c
Fix namespace clash:

drivers/mtd/devices/docecc.c:43:1: warning: "DEBUG" redefined
In file included from drivers/mtd/devices/docecc.c:40:
include/linux/mtd/mtd.h:219:1: warning: this is the location of the previous definition

Signed-off-by: Grant Coady <gcoady@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-22 22:17:34 -07:00
Richard Purdie 62052d42a5 [PATCH] MTD: Update SharpSL partition definitions
Add partition definitions for the new Sharp Zaurus models Spitz (SL-C3000),
Akita (SL-C1000) and Borzoi (SL-C3100)

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-17 11:49:58 -07:00
Greg Ungerer f6515db47e [PATCH] uclinux: remove use of mtd_put_device() in uclinux MTD map driver
We should not call mtd_put_device() in the uclinux MTD map driver.
Also consistently use phys/virt fields of maps map_info struct,
instead of mixing it with map_priv_1.

Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-11 20:43:46 -07:00
Jesper Juhl f9101210e7 [PATCH] vfree and kfree cleanup in drivers/
This patch does a full cleanup of 'NULL checks before vfree', and a partial
cleanup of calls to kfree for all of drivers/ - the kfree bit is partial in
that I only did the files that also had vfree calls in them.  The patch
also gets rid of some redundant (void *) casts of pointers being passed to
[vk]free, and a some tiny whitespace corrections also crept in.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-10 10:06:30 -07:00
Ingo Molnar 8446f1d391 [PATCH] detect soft lockups
This patch adds a new kernel debug feature: CONFIG_DETECT_SOFTLOCKUP.

When enabled then per-CPU watchdog threads are started, which try to run
once per second.  If they get delayed for more than 10 seconds then a
callback from the timer interrupt detects this condition and prints out a
warning message and a stack dump (once per lockup incident).  The feature
is otherwise non-intrusive, it doesnt try to unlock the box in any way, it
only gets the debug info out, automatically, and on all CPUs affected by
the lockup.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07 16:57:17 -07:00
Todd Poynor 8b491d7508 [MTD] mtdchar: Return EINVAL for bad seeks instead of fixing up to valid byte
mtdchar return -EINVAL for seek prior to offset 0 or to beyond the last
byte in the device/partition, similar to various other seek methods,
instead of fixing up to first or last byte.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-08-04 12:52:40 +02:00
Todd Poynor 1da2c9a638 [MTD] Pre-CFI Sharp chip driver: Some speedups and cleanups
Remove useless udelay(100) after status value already read.  Poll
for status OK with reduced udelay if not immediate OK status return.

Fix read and compare of 32-bit status value using 16-bit variable.

Include slab.h since kmalloc/kfree are called.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-08-04 12:52:09 +02:00
Todd Poynor 65a8de36b4 [MTD] mtd_blkdevs.c: Fix names when many devices/partitions are created
mtdblock (and other mtd modules that use the mtd_blkdevs interface
between the mtd translation layers and the linux block layer) handles
incorrectly more than 10 devices or 26 partitions in the names passed to
the generic disk layer.  This causes the device file names and other
info kept by the generic disk/block layers to have names such as
"mtdblock<".  Use integer formatting for device numbers; use "aa-az"
for partitions 27-52, "ba-bz" for 53-78...

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-08-04 12:51:18 +02:00
Todd Poynor 7ad2b7f595 [MTD] mtd_blkdevs.c: Remove DEVFS leftovers
Remove mtd_blkdevs refs to the no longer functional DEVFS filesystem.

Verified mtdblock continues to work fine via udev with these calls
removed.

Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2005-08-04 12:50:48 +02:00