Re: [PATCH 2/5] mmc: tmio_mmc: add bus_shift support

From: pHilipp Zabel
Date: Tue May 26 2009 - 16:17:21 EST


On Mon, May 25, 2009 at 9:27 PM, Philipp Zabel <philipp.zabel@xxxxxxxxx> wrote:
> Some ASIC3 devices in the wild are connected with the address bus shifted
> by one line, so that its 16-bit registers appear 32-bit aligned in host
> memory space.

This patch has to be amended:

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 245de05..8223977 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -495,7 +495,8 @@ static int tmio_mmc_resume(struct platform_device *dev)

/* Enable the MMC/SD Control registers */
sd_config_write16(host, CNF_CMD, SDCREN);
- sd_config_write32(host, CNF_CTL_BASE, dev->resource[0].start & 0xfffe);
+ sd_config_write32(host, CNF_CTL_BASE,
+ (dev->resource[0].start >> host->bus_shift) & 0xfffe);

/* Tell the MFD core we are ready to be enabled */
if (cell->enable) {
@@ -566,7 +567,8 @@ static int __devinit tmio_mmc_probe(struct
platform_device *dev)

/* Enable the MMC/SD Control registers */
sd_config_write16(host, CNF_CMD, SDCREN);
- sd_config_write32(host, CNF_CTL_BASE, dev->resource[0].start & 0xfffe);
+ sd_config_write32(host, CNF_CTL_BASE,
+ (dev->resource[0].start >> host->bus_shift) & 0xfffe);

/* Tell the MFD core we are ready to be enabled */
if (cell->enable) {

The resources have to be shifted back when configuring the SD control
register space.

regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/