public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Cory Maccarrone <darkstar6262@gmail.com>
Cc: linux-mmc@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH v2] mmc-omap: Add support for 16-bit and 32-bit registers
Date: Sun, 22 Nov 2009 12:20:52 -0800	[thread overview]
Message-ID: <20091122202051.GC4860@atomide.com> (raw)
In-Reply-To: <1258918484.31123.7.camel@runt>

Hi,

* Cory Maccarrone <darkstar6262@gmail.com> [091122 11:34]:
> The omap850 and omap730 use 16-bit registers instead of 32-bit, requiring
> a modification of the register addresses in the mmc-omap driver.
> 
> Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
> Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
> ---
>  drivers/mmc/host/omap.c |   56 ++++++++++++++++++++++++----------------------
>  1 files changed, 29 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
> index 5f970e2..892400b 100644
> --- a/drivers/mmc/host/omap.c
> +++ b/drivers/mmc/host/omap.c
> @@ -2,7 +2,7 @@
>   *  linux/drivers/mmc/host/omap.c
>   *
>   *  Copyright (C) 2004 Nokia Corporation
> - *  Written by Tuukka Tikkanen and Juha Yrjölä<juha.yrjola@nokia.com>
> + *  Written by Tuukka Tikkanen and Juha Yrjᅵlᅵ<juha.yrjola@nokia.com>
>   *  Misc hacks here and there by Tony Lindgren <tony@atomide.com>
>   *  Other hacks (DMA, SD, etc) by David Brownell
>   *
> @@ -37,31 +37,33 @@
>  #include <plat/mux.h>
>  #include <plat/fpga.h>
>  
> -#define	OMAP_MMC_REG_CMD	0x00
> -#define	OMAP_MMC_REG_ARGL	0x04
> -#define	OMAP_MMC_REG_ARGH	0x08
> -#define	OMAP_MMC_REG_CON	0x0c
> -#define	OMAP_MMC_REG_STAT	0x10
> -#define	OMAP_MMC_REG_IE		0x14
> -#define	OMAP_MMC_REG_CTO	0x18
> -#define	OMAP_MMC_REG_DTO	0x1c
> -#define	OMAP_MMC_REG_DATA	0x20
> -#define	OMAP_MMC_REG_BLEN	0x24
> -#define	OMAP_MMC_REG_NBLK	0x28
> -#define	OMAP_MMC_REG_BUF	0x2c
> -#define OMAP_MMC_REG_SDIO	0x34
> -#define	OMAP_MMC_REG_REV	0x3c
> -#define	OMAP_MMC_REG_RSP0	0x40
> -#define	OMAP_MMC_REG_RSP1	0x44
> -#define	OMAP_MMC_REG_RSP2	0x48
> -#define	OMAP_MMC_REG_RSP3	0x4c
> -#define	OMAP_MMC_REG_RSP4	0x50
> -#define	OMAP_MMC_REG_RSP5	0x54
> -#define	OMAP_MMC_REG_RSP6	0x58
> -#define	OMAP_MMC_REG_RSP7	0x5c
> -#define	OMAP_MMC_REG_IOSR	0x60
> -#define	OMAP_MMC_REG_SYSC	0x64
> -#define	OMAP_MMC_REG_SYSS	0x68
> +#define	OMAP_MMC_REGISTER_SIZE		(cpu_is_omap7xx() ? 2 : 4)
> +

You need to set the register shift dynamically during init as cpu_is_omap7xx
is not static if multiple omaps are compiled in.

Then maybe set functions for omap_mmc_read/write that shift the registers?

> +#define	OMAP_MMC_REG_CMD		(0x00*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_ARGL		(0x01*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_ARGH		(0x02*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_CON		(0x03*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_STAT		(0x04*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_IE			(0x05*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_CTO		(0x06*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_DTO		(0x07*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_DATA		(0x08*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_BLEN		(0x09*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_NBLK		(0x0a*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_BUF		(0x0b*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_SDIO		(0x0d*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_REV		(0x0f*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP0		(0x10*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP1		(0x11*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP2		(0x12*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP3		(0x13*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP4		(0x14*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP5		(0x15*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP6		(0x16*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_RSP7		(0x17*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_IOSR		(0x18*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_SYSC		(0x19*OMAP_MMC_REGISTER_SIZE)
> +#define	OMAP_MMC_REG_SYSS		(0x1a*OMAP_MMC_REGISTER_SIZE)
>  
>  #define	OMAP_MMC_STAT_CARD_ERR		(1 << 14)
>  #define	OMAP_MMC_STAT_CARD_IRQ		(1 << 13)
> @@ -1619,4 +1621,4 @@ module_exit(mmc_omap_exit);
>  MODULE_DESCRIPTION("OMAP Multimedia Card driver");
>  MODULE_LICENSE("GPL");
>  MODULE_ALIAS("platform:" DRIVER_NAME);
> -MODULE_AUTHOR("Juha Yrjölä");
> +MODULE_AUTHOR("Juha Yrjᅵlᅵ");

This change should be left out.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-11-22 20:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 19:34 [PATCH v2] mmc-omap: Add support for 16-bit and 32-bit registers Cory Maccarrone
2009-11-22 20:20 ` Tony Lindgren [this message]
2009-11-22 20:29   ` Cory Maccarrone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091122202051.GC4860@atomide.com \
    --to=tony@atomide.com \
    --cc=darkstar6262@gmail.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox