Commit Graph

24 Commits (f110ef58e6c9bd562999247c5e8a5b8e722fbd11)

Author SHA1 Message Date
Pierre Ossman 55db890a83 mmc: Allow host drivers to specify max block count
Many controllers have an upper limit on the number of blocks that can be
transferred in one request. Allow the host drivers to specify this and make
sure we avoid hitting this limit.

Also change the max_sectors field to avoid confusion. This makes it map
less directly to the block layer limits, but as they didn't apply directly
on MMC cards anyway, this isn't a great loss.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04 20:54:10 +01:00
Pierre Ossman fe4a3c7a20 mmc: Allow host drivers to specify a max block size
Most controllers have an upper limit on the block size. Allow the host
drivers to specify this and make sure we avoid hitting this limit.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-02-04 20:54:10 +01:00
Philip Langdale 6f949909e8 mmc: Correct definition of R6
During development of SDHC support, it was discovered that the definition
for R6 was incorrect. This patch fixes that and patches the drivers that
do switch on the response type.

Signed-off-by: Philip Langdale <philipl@overt.org>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Pavel Pisa <ppisa@pikron.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-01-15 06:44:03 +01:00
Carlos Eduardo Aguiar 1b3b263184 omap: Update MMC response types
This patch is a fix in order to update MMC response types. This modification is
needed to allow SD card support on OMAP platforms.

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Yuha Yrjola <juha.yrjola@solidboot.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-01-15 06:39:00 +01:00
Kyungmin Park 3947a3907f ARM: OMAP: fix MMC workqueue changes
fix OMAP MMC workqueue in recent workqueue change

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-01-04 07:03:38 +01:00
Linus Torvalds cdb54fac35 Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/drzeus/mmc
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc: correct request error handling
  mmc: Flush block queue when removing card
  mmc: sdhci high speed support
  mmc: Support for high speed SD cards
  mmc: Fix mmc_delay() function
  mmc: Add support for mmc v4 wide-bus modes
  [PATCH] mmc: Add support for mmc v4 high speed mode
  trivial change for mmc/Kconfig: MMC_PXA does not mean only PXA255
  Make general code cleanups
  Add MMC_CAP_{MULTIWRITE,BYTEBLOCK} flags
  Platform device error handling cleanup
  Move register definitions away from the header file
  Change OMAP_MMC_{READ,WRITE} macros to use the host pointer
  Replace base with virt_base and phys_base
  mmc: constify mmc_host_ops vectors
  mmc: remove kernel_thread()
2006-12-02 08:29:04 -08:00
Juha Yrjola juha.yrjola c5cb431d27 Make general code cleanups
This patch is part of Juha Yrjola's and Komal Shah's earlier patch to
make general code cleanups

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by: Juha Yrjola <juha.yrjola <at> solidboot.com>
Signed-off-by: Komal Shah <komal_shah802003 <at> yahoo.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 18:02:03 +01:00
Tony Lindgren tony f4204fdf05 Add MMC_CAP_{MULTIWRITE,BYTEBLOCK} flags
This patch is part of Tony Lindgren's earlier patch to add
MMC_CAP_{MULTIWRITE,BYTEBLOCK} flags in omap.c

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by: Tony Lindgren <tony <at> atomide.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 18:01:44 +01:00
Juha Yrjola juha.yrjola 81ca70343f Platform device error handling cleanup
This patch is part of Juha Yrjola's earlier patch to add platform device
error handling and a BUG_ON to verify if host == NULL

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by: Juha Yrjola <juha.yrjola <at> solidboot.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 18:01:32 +01:00
Juha Yrjola juha.yrjola 0551f4df35 Move register definitions away from the header file
This patch is part of Juha Yrjola's earlier patch to move register
definitions away from the header file and the header file is removed.

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by: Juha Yrjola <juha.yrjola <at> solidboot.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 18:01:16 +01:00
Juha Yrjola juha.yrjola 3342ee8bfa Change OMAP_MMC_{READ,WRITE} macros to use the host pointer
This patch is part of Juha Yrjola's earlier patch to change
OMAP_MMC_{READ,WRITE} macros to use the host pointer

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by: Juha Yrjola <juha.yrjola <at> solidboot.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 18:00:34 +01:00
Juha Yrjola juha.yrjola 89783b1e44 Replace base with virt_base and phys_base
This patch is part of Juha Yrjola's earlier patch to replace base
with virt_base and phys_base

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by: Juha Yrjola <juha.yrjola <at> solidboot.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 18:00:11 +01:00
David Brownell ab7aefd0b3 mmc: constify mmc_host_ops vectors
Now that mmc_host_ops can be constified, update the various drivers
to constify those method tables and shrink the writable data segment.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2006-12-01 17:58:53 +01:00
Eric Sesterhenn d99c590985 BUG_ON conversion for drivers/mmc/omap.c
This patch converts a if () BUG(); construct to BUG_ON();
which occupies less space, uses unlikely and is safer when
BUG() is disabled.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-11-30 05:27:38 +01:00
David Howells 7d12e780e0 IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-05 15:10:12 +01:00
Russell King 42431acbac [MMC] MMC_CAP_BYTEBLOCK flag for non-log2 block sizes capable hosts
Some MMC hosts can only handle log2 block sizes.  Unfortunately,
the MMC password support needs to be able to send non-log2 block
sizes.  Provide a capability so that the MMC password support can
decide whether it should use this support or not.

The unfortunate side effect of this host limitation is that any
MMC card protected by a password which is not a log2 block size
can not be accessed on a host which only allows a log2 block size.

This change just adds the flag.  The MMC password support code
needs updating to use it (if and when it is finally submitted.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-09-24 10:44:09 +01:00
Linus Torvalds a8c4c20dfa Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (44 commits)
  [ARM] 3541/2: workaround for PXA27x erratum E7
  [ARM] nommu: provide a way for correct control register value selection
  [ARM] 3705/1: add supersection support to ioremap()
  [ARM] 3707/1: iwmmxt: use the generic thread notifier infrastructure
  [ARM] 3706/2: ep93xx: add cirrus logic edb9315a support
  [ARM] 3704/1: format IOP Kconfig with tabs, create more consistency
  [ARM] 3703/1: Add help description for ARCH_EP80219
  [ARM] 3678/1: MMC: Make OMAP MMC work
  [ARM] 3677/1: OMAP: Update H2 defconfig
  [ARM] 3676/1: ARM: OMAP: Fix dmtimers and timer32k to compile on OMAP1
  [ARM] Add section support to ioremap
  [ARM] Fix sa11x0 SDRAM selection
  [ARM] Set bit 4 on section mappings correctly depending on CPU
  [ARM] 3666/1: TRIZEPS4 [1/5] core
  ARM: OMAP: Multiplexing for 24xx GPMC wait pin monitoring
  ARM: OMAP: Fix SRAM to use MT_MEMORY instead of MT_DEVICE
  ARM: OMAP: Update dmtimers
  ARM: OMAP: Make clock variables static
  ARM: OMAP: Fix GPMC compilation when DEBUG is defined
  ARM: OMAP: Mux updates for external DMA and GPIO
  ...
2006-07-02 15:04:12 -07:00
Thomas Gleixner dace145374 [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-02 13:58:50 -07:00
Tony Lindgren ce9c1a8388 [ARM] 3678/1: MMC: Make OMAP MMC work
Patch from Tony Lindgren

This patch makes OMAP MMC work again:

- Fix compile errors
- Do not ioremap base as it is already statically mapped
- Clean-up platform device handling
- Fix compile warnings

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-07-01 19:56:44 +01:00
Jörn Engel 6ab3d5624e Remove obsolete #include <linux/config.h>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-30 19:25:36 +02:00
Tony Lindgren 7ff879dbcd ARM: OMAP: Fix DMA channel irq handling for omap24xx
- DMA CSR register is cleared by reading on omap1, but on
  omap2 it is cleard by writing to it.

- DMA TOUT interrupt does not exist on omap24xx, rename it

- Add SECURE and MISALIGNED errors by default for omap24xx

- Add defines for external DMA request lines

Signed-off-by: Tony Lindgren <tony@atomide.com>
2006-06-26 16:16:15 -07:00
Russell King a3fd4a1b9c [MMC] Convert all hosts except mmci to use data->blksz
The MMC specification allows non-power of two block sizes.  As such,
we should not pass the log2 block size to host drivers, but instead
pass the byte size.

However, ARM MMCI can only work with log2 block size, so continue to
pass both the log2 block size and byte block size.  This means that
for the moment, the byte block size must remain a power of two, but
this is the first stage of removing this restriction for other hosts.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-06-19 13:05:08 +01:00
Russell King c65631781e [MMC] Pass -DDEBUG on compiler command line if MMC_DEBUG selected
Rather than each driver test MMC_DEBUG itself, and define DEBUG,
pass it in via the makefile instead.

Fix drivers to use pr_debug() where appropriate, and avoid defining
a DEBUG() macro.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-03-29 09:30:20 +01:00
Carlos Aguiar 730c9b7e66 [MMC] Add OMAP MMC host driver
Adds OMAP MMC driver.

Signed-off-by: Juha Yrjölä <juha.yrjola@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Carlos Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-03-29 09:21:00 +01:00