Commit Graph

301 Commits (6943f8af7d6583be57d67bba8b2644371f6a10ca)

Author SHA1 Message Date
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