[PATCH] sdhci: Add support PXA168, PXA910, and MMP2 controllers
Philip Rakity
prakity at marvell.com
Mon Dec 20 00:21:03 EST 2010
Add ability to select controller based on CPU model
Platform flags taken from arch/mach-mmp/ files for board design
(brownstone, jasper, aspenite etc)
quirks for platform behavior defined in specific platform files
hooks for silicon issues added
code added to print platform specific registers
Signed-off-by: Mark F. Brown <markb at marvell.com>
Signed-off-by: Philip Rakity <prakity at marvell.com>
Tested-by: Philip Rakity <prakity at marvell.com>
Tested-by: Mark F. Brown <markb at marvell.com>
---
drivers/mmc/host/Kconfig | 42 +++++-
drivers/mmc/host/Makefile | 5 +-
drivers/mmc/host/sdhci-mmp2.c | 245 +++++++++++++++++++++++++++++
drivers/mmc/host/sdhci-pxa.c | 87 +++++------
drivers/mmc/host/sdhci-pxa.h | 65 ++++++++
drivers/mmc/host/sdhci-pxa168.c | 322 +++++++++++++++++++++++++++++++++++=
++++
drivers/mmc/host/sdhci-pxa910.c | 271 ++++++++++++++++++++++++++++++++
7 files changed, 984 insertions(+), 53 deletions(-)
create mode 100644 drivers/mmc/host/sdhci-mmp2.c
create mode 100644 drivers/mmc/host/sdhci-pxa.h
create mode 100644 drivers/mmc/host/sdhci-pxa168.c
create mode 100644 drivers/mmc/host/sdhci-pxa910.c
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index d42fe49..d9eddbd 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -166,18 +166,52 @@ config MMC_SDHCI_S3C
If unsure, say N.
+
+config MMC_SDHCI_PXA_CORE
+ tristate
+ help
+ This is silent Kconfig symbol that is selected by the drivers tha=
t
+ need PXA driver base support
+
+
config MMC_SDHCI_PXA
- tristate "Marvell PXA168/PXA910/MMP2 SD Host Controller support"
- depends on ARCH_PXA || ARCH_MMP
+ tristate "Marvell MMP2 SD Host Controller support"
+ depends on CPU_MMP2
+ select MMC_SDHCI
+ select MMC_SDHCI_PXA_CORE
+ help
+ This selects the Marvell(R) MMP2 SD Host Controller.
+ If you have a MMP2 platform with SD Host Controller
+ and a card slot, say Y or M here.
+
+ If unsure, say N.
+
+config MMC_SDHCI_PXA9xx
+ tristate "Marvell PXA9xx SD Host Controller support"
+ depends on CPU_PXA910
select MMC_SDHCI
+ select MMC_SDHCI_PXA_CORE
+ help
+ This selects the Marvell(R) PXA910 SD Host Controller.
+ If you have a PXA910 platform with SD Host Controller
+ and a card slot, say Y or M here.
+
+ If unsure, say N.
+
+config MMC_SDHCI_PXA168
+ tristate "Marvell PXA168 SD Host Controller support"
+ depends on CPU_PXA168
+ select MMC_SDHCI
+ select MMC_SDHCI_PXA_CORE
select MMC_SDHCI_IO_ACCESSORS
help
- This selects the Marvell(R) PXA168/PXA910/MMP2 SD Host Controller=
.
- If you have a PXA168/PXA910/MMP2 platform with SD Host Controller
+ This selects the Marvell(R) PXA168 SD Host Controller.
+ If you have a PXA168 platform with SD Host Controller
and a card slot, say Y or M here.
If unsure, say N.
+
config MMC_SDHCI_SPEAR
tristate "SDHCI support on ST SPEAr platform"
depends on MMC_SDHCI && PLAT_SPEAR
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index d91364d..1de1c77 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -8,7 +8,10 @@ obj-$(CONFIG_MMC_IMX) +=3D imxmmc.o
obj-$(CONFIG_MMC_MXC) +=3D mxcmmc.o
obj-$(CONFIG_MMC_SDHCI) +=3D sdhci.o
obj-$(CONFIG_MMC_SDHCI_PCI) +=3D sdhci-pci.o
-obj-$(CONFIG_MMC_SDHCI_PXA) +=3D sdhci-pxa.o
+obj-$(CONFIG_MMC_SDHCI_PXA_CORE) +=3D sdhci-pxa.o
+obj-$(CONFIG_MMC_SDHCI_PXA) +=3D sdhci-mmp2.o
+obj-$(CONFIG_MMC_SDHCI_PXA168) +=3D sdhci-pxa168.o
+obj-$(CONFIG_MMC_SDHCI_PXA9xx) +=3D sdhci-pxa910.o
obj-$(CONFIG_MMC_SDHCI_S3C) +=3D sdhci-s3c.o
obj-$(CONFIG_MMC_SDHCI_SPEAR) +=3D sdhci-spear.o
obj-$(CONFIG_MMC_WBSD) +=3D wbsd.o
diff --git a/drivers/mmc/host/sdhci-mmp2.c b/drivers/mmc/host/sdhci-mmp2.c
new file mode 100644
index 0000000..6824177
--- /dev/null
+++ b/drivers/mmc/host/sdhci-mmp2.c
@@ -0,0 +1,245 @@
+/*************************************************************************=
*
+ *
+ * Copyright (c) 2009, 2010 Marvell International Ltd.
+ * Philip Rakity <prakity at marvell.com>
+ * Mark F. Brown <markb at marvell.com>
+ *
+ * This file is part of GNU program.
+ *
+ * GNU program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * GNU program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Genera=
l
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program.
+ *
+ * If not, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ *************************************************************************=
/
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mmc/host.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <plat/sdhci.h>
+#include "sdhci-pxa.h"
+#include "sdhci.h"
+
+#define DEBUG
+
+#define DRIVER_NAME "sdhci-mmp2"
+
+#define HOST_CTRL_2 0x3E
+#define ASYNC_INT_EN (1 << 14)
+
+#define SD_CFG_FIFO_PARAM 0x100
+#define SDCFG_GEN_PAD_CLK_ON (1<<6)
+
+#define SD_CLOCK_AND_BURST_SIZE_SETUP 0x10A
+#define SDCLK_DELAY_MASK 0x1F
+#define SDCLK_SEL_MASK 0x1
+#define SDCLK_DELAY_SHIFT 9
+#define SDCLK_SEL_SHIFT 8
+
+#define SD_CE_ATA_2 0x10E
+#define SDCE_MISC_INT (1<<2)
+#define SDCE_MISC_INT_EN (1<<1)
+
+#define DISABLE_CLOCK_GATING 0
+
+
+static int platform_mmp2_probe(struct sdhci_host *host);
+
+/*
+ * MMC spec calls for the host to send 74 clocks to the card
+ * during initialization, right after voltage stabilization.
+ * the pxa168 controller has no easy way to generate those clocks.
+ * create the clocks manually right here.
+ */
+static void generate_initial_74_clocks(struct sdhci_host *host, u8 power_m=
ode)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+ u16 tmp;
+ int count;
+
+ if (pxa->power_mode =3D=3D MMC_POWER_UP
+ && power_mode =3D=3D MMC_POWER_ON) {
+
+ pr_debug("%s:%s ENTER: slot->power_mode =3D %d,"
+ "ios->power_mode =3D %d\n",
+ __func__,
+ mmc_hostname(host->mmc),
+ pxa->power_mode,
+ power_mode);
+
+ /* set we want notice of when 74 clocks are sent */
+ tmp =3D readw(host->ioaddr + SD_CE_ATA_2);
+ tmp |=3D SDCE_MISC_INT_EN;
+ writew(tmp, host->ioaddr + SD_CE_ATA_2);
+
+ /* start sending the 74 clocks */
+ tmp =3D readw(host->ioaddr + SD_CFG_FIFO_PARAM);
+ tmp |=3D SDCFG_GEN_PAD_CLK_ON;
+ writew(tmp, host->ioaddr + SD_CFG_FIFO_PARAM);
+
+ /* slowest speed is about 100KHz or 10usec per clock */
+ udelay(740);
+ count =3D 0;
+#define MAX_WAIT_COUNT 5
+ while (count++ < MAX_WAIT_COUNT) {
+ if ((readw(host->ioaddr + SD_CE_ATA_2)
+ & SDCE_MISC_INT) =3D=3D 0)
+ break;
+ udelay(10);
+ }
+
+ if (count =3D=3D MAX_WAIT_COUNT)
+ printk(KERN_WARNING"%s: %s: 74 clock interrupt "
+ "not cleared\n",
+ __func__, mmc_hostname(host->mmc));
+ /* clear the interrupt bit if posted */
+ tmp =3D readw(host->ioaddr + SD_CE_ATA_2);
+ tmp |=3D SDCE_MISC_INT;
+ writew(tmp, host->ioaddr + SD_CE_ATA_2);
+ }
+ pxa->power_mode =3D power_mode;
+}
+
+static void set_clock_and_burst_size(struct sdhci_host *host)
+{
+ u16 tmp;
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ pr_debug("%s:%s: adjust =3D %d\n",
+ __func__, mmc_hostname(host->mmc), pxa->pdata->adjust_clock=
s);
+
+ if (pxa->pdata->adjust_clocks) {
+ tmp =3D readw(host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP)=
;
+ pr_debug("%s:%s: (B) SD_CLOCK_AND_BURST =3D %04X, "
+ "delay =3D %d, sel =3D %d\n",
+ __func__, mmc_hostname(host->mmc), tmp,
+ pxa->pdata->clk_delay, pxa->pdata->clk_select);
+ tmp &=3D ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT);
+ tmp &=3D ~(SDCLK_SEL_MASK << SDCLK_SEL_SHIFT);
+ tmp |=3D (pxa->pdata->clk_delay & SDCLK_DELAY_MASK) <<
+ SDCLK_DELAY_SHIFT;
+ tmp |=3D (pxa->pdata->clk_select & SDCLK_SEL_MASK) <<
+ SDCLK_SEL_SHIFT;
+ writew(tmp, host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP);
+ pr_debug("%s:%s: (A) SD_CLOCK_AND_BURST_SIZE_SETUP =3D %04X=
\n",
+ __func__, mmc_hostname(host->mmc), tmp);
+ }
+}
+
+static void programFIFO(struct sdhci_host *host, int enable)
+{
+ unsigned short tmp;
+
+ tmp =3D readw(host->ioaddr + HOST_CTRL_2);
+
+ if (enable)
+ tmp |=3D ASYNC_INT_EN;
+ else
+ tmp &=3D ~ASYNC_INT_EN;
+
+ writew(tmp, host->ioaddr + HOST_CTRL_2);
+}
+
+static void platform_reset_exit(struct sdhci_host *host, u8 mask)
+{
+ if (mask =3D=3D SDHCI_RESET_ALL) {
+ /* reset private registers */
+ programFIFO(host, DISABLE_CLOCK_GATING);
+ set_clock_and_burst_size(host);
+ }
+}
+
+
+#ifdef CONFIG_MMC_CLKGATE
+static void platform_hw_clk_gate(struct sdhci_host *host)
+{
+ int enable;
+
+ enable =3D host->mmc->clk_gated;
+ programFIFO(host, enable);
+}
+#endif
+
+static unsigned int get_f_max_clock(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ pr_debug("%s:%s f_max =3D %d\n",
+ __func__, mmc_hostname(host->mmc),
+ pxa->pdata->max_speed);
+
+ return pxa->pdata->max_speed;
+}
+
+struct sdhci_pxa_data sdhci_platform_data =3D {
+ .ops =3D {
+ .platform_reset_exit =3D platform_reset_exit,
+ .platform_send_init_74_clocks =3D generate_initial_74_clock=
s,
+ .get_f_max_clock =3D NULL,
+#ifdef CONFIG_MMC_CLKGATE
+ .platform_hw_clk_gate =3D platform_hw_clk_gate,
+#endif
+ },
+#ifdef CONFIG_MMC_CLKGATE
+ .mmc_caps =3D MMC_CAP_HW_CLOCK_GATING | MMC_CAP_BUS_WIDTH_TEST,
+#else
+ .mmc_caps =3D MMC_CAP_BUS_WIDTH_TEST,
+#endif
+ .platform_probe =3D platform_mmp2_probe,
+ .quirks =3D 0,
+};
+EXPORT_SYMBOL_GPL(sdhci_platform_data);
+
+static int platform_mmp2_probe(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+ struct sdhci_pxa_platdata *pdata =3D pxa->pdata;
+ struct sdhci_ops *p_ops;
+
+ host->quirks |=3D sdhci_platform_data.quirks;
+ host->mmc->caps |=3D sdhci_platform_data.mmc_caps;
+
+ /* If slot design supports 8 bit data, indicate this to MMC. */
+ if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)
+ host->mmc->caps |=3D MMC_CAP_8_BIT_DATA;
+
+ if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
+ host->mmc->caps |=3D MMC_CAP_NONREMOVABLE;
+ host->quirks |=3D SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ }
+
+ /*
+ * we cannot directly copy our operations into host->ops
+ * since it is read only. So we do this indirectly.
+ */
+ p_ops =3D kmalloc(sizeof(struct sdhci_ops), GFP_KERNEL);
+ if (!p_ops) {
+ printk(KERN_ERR "no memory");
+ return -ENOMEM;
+ }
+
+ memcpy((void *)p_ops, (void *)&sdhci_platform_data.ops,
+ sizeof(struct sdhci_ops));
+
+ if (pxa->pdata->max_speed)
+ p_ops->get_f_max_clock =3D get_f_max_clock;
+
+ memcpy((void *)host->ops, (void *)p_ops, sizeof(struct sdhci_ops));
+ kfree(p_ops);
+ return 0;
+}
diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index 1a58c7b..5a02777 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -1,42 +1,46 @@
-/* linux/drivers/mmc/host/sdhci-pxa.c
+/*************************************************************************=
*
*
- * Copyright (C) 2010 Marvell International Ltd.
+ * Copyright (c) 2009, 2010 Marvell International Ltd.
* Zhangfei Gao <zhangfei.gao at marvell.com>
* Kevin Wang <dwang4 at marvell.com>
* Mingwei Wang <mwwang at marvell.com>
* Philip Rakity <prakity at marvell.com>
* Mark Brown <markb at marvell.com>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-/* Supports:
- * SDHCI support for MMP2/PXA910/PXA168
+ * This file is part of GNU program.
+ *
+ * GNU program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * GNU program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Genera=
l
+ * Public License for more details.
*
- * Refer to sdhci-s3c.c.
- */
+ * You should have received a copy of the GNU General Public License along
+ * with this program.
+ *
+ * If not, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ *************************************************************************=
/
+#include <linux/module.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/mmc/host.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/err.h>
+#include <linux/slab.h>
#include <plat/sdhci.h>
#include "sdhci.h"
+#include "sdhci-pxa.h"
+#include <mach/cputype.h>
#define DRIVER_NAME "sdhci-pxa"
-struct sdhci_pxa {
- struct sdhci_host *host;
- struct sdhci_pxa_platdata *pdata;
- struct clk *clk;
- struct resource *res;
-
- u8 clk_enable;
-};
/*************************************************************************=
****\
* =
*
@@ -53,17 +57,6 @@ static void enable_clock(struct sdhci_host *host)
}
}
-static unsigned int get_f_max_clock(struct sdhci_host *host)
-{
- struct sdhci_pxa *pxa =3D sdhci_priv(host);
-
- return pxa->pdata->max_speed;
-}
-
-static struct sdhci_ops sdhci_pxa_ops =3D {
- .get_f_max_clock =3D NULL,
-};
-
/*************************************************************************=
****\
* =
*
* Device probing/removal =
*
@@ -125,29 +118,24 @@ static int __devinit sdhci_pxa_probe(struct platform_=
device *pdev)
}
host->hw_name =3D "MMC";
- host->ops =3D &sdhci_pxa_ops;
- host->irq =3D irq;
- host->quirks =3D SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_BROKEN_TIMEO=
UT_VAL;
-
- /* enable mmc bus width testing */
- host->mmc->caps |=3D MMC_CAP_BUS_WIDTH_TEST;
-
- /* If slot design supports 8 bit data, indicate this to MMC. */
- if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)
- host->mmc->caps |=3D MMC_CAP_8_BIT_DATA;
-
- if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
- host->mmc->caps |=3D MMC_CAP_NONREMOVABLE;
- host->quirks |=3D SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ host->ops =3D kmalloc(sizeof(struct sdhci_ops), GFP_KERNEL);
+ if (!host->ops) {
+ dev_err(&pdev->dev, "no memory for host->ops\n");
+ ret =3D -ENOMEM;
+ goto out;
}
+ host->irq =3D irq;
+ host->quirks =3D SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+
/* do not rely on u-boot to enable the clocks */
enable_clock(host);
- if (pxa->pdata->max_speed)
- sdhci_pxa_ops.get_f_max_clock =3D get_f_max_clock;
- else
- sdhci_pxa_ops.get_f_max_clock =3D NULL;
+ if (sdhci_platform_data.platform_probe) {
+ ret =3D sdhci_platform_data.platform_probe(host);
+ if (ret)
+ goto out;
+ }
ret =3D sdhci_add_host(host);
if (ret) {
@@ -161,6 +149,7 @@ static int __devinit sdhci_pxa_probe(struct platform_de=
vice *pdev)
out:
if (host) {
clk_put(pxa->clk);
+ kfree(host->ops);
if (host->ioaddr)
iounmap(host->ioaddr);
if (pxa->res)
@@ -193,6 +182,7 @@ static int __devexit sdhci_pxa_remove(struct platform_d=
evice *pdev)
resource_size(pxa->res));
clk_put(pxa->clk);
+ kfree(host->ops);
sdhci_free_host(host);
platform_set_drvdata(pdev, NULL);
}
@@ -251,4 +241,5 @@ module_exit(sdhci_pxa_exit);
MODULE_DESCRIPTION("SDH controller driver for PXA168/PXA910/MMP2");
MODULE_AUTHOR("Zhangfei Gao <zhangfei.gao at marvell.com>");
+MODULE_AUTHOR("Philp Rakity <prakity at marvell.com>");
MODULE_LICENSE("GPL v2");
diff --git a/drivers/mmc/host/sdhci-pxa.h b/drivers/mmc/host/sdhci-pxa.h
new file mode 100644
index 0000000..4161fc1
--- /dev/null
+++ b/drivers/mmc/host/sdhci-pxa.h
@@ -0,0 +1,65 @@
+/*************************************************************************=
*
+ *
+ * Copyright (c) 2009, 2010 Marvell International Ltd.
+ * Philip Rakity <prakity at marvell.com>
+ * Mark F. Brown <markb at marvell.com>
+ *
+ * This file is part of GNU program.
+ *
+ * GNU program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * GNU program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Genera=
l
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program.
+ *
+ * If not, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ *************************************************************************=
/
+
+/* Supports:
+ * SDHCI support for MMP2/PXA910/PXA168
+ *
+ * Refer to sdhci-s3c.c.
+ */
+
+#ifndef __SDHCI_PXA_H
+#define __SDHCI_PXA_H
+
+#include <linux/types.h>
+#include "sdhci.h"
+
+struct sdhci_pxa {
+ struct sdhci_host *host;
+ struct sdhci_pxa_platdata *pdata;
+ struct clk *clk;
+ struct resource *res;
+
+ u32 delay_in_ms;
+ u32 delay_in_us;
+ u32 delay_in_ns;
+
+ u8 clk_enable;
+ u8 power_mode;
+};
+
+struct sdhci_pxa_data {
+ struct sdhci_ops ops;
+ unsigned int quirks;
+ unsigned int mmc_caps;
+ int (*platform_probe) (struct sdhci_host *host);
+};
+
+extern struct sdhci_pxa_data sdhci_platform_data;
+extern void sdhci_free_host(struct sdhci_host *host);
+extern void sdhci_remove_host(struct sdhci_host *host, int dead);
+extern struct sdhci_host *sdhci_alloc_host(struct device *dev,
+ size_t priv_size);
+
+#endif /* __SDHCI_PXA_H */
diff --git a/drivers/mmc/host/sdhci-pxa168.c b/drivers/mmc/host/sdhci-pxa16=
8.c
new file mode 100644
index 0000000..8f85d65
--- /dev/null
+++ b/drivers/mmc/host/sdhci-pxa168.c
@@ -0,0 +1,322 @@
+/*************************************************************************=
*
+ *
+ * Copyright (c) 2009, 2010 Marvell International Ltd.
+ * Philip Rakity <prakity at marvell.com>
+ * Mark F. Brown <markb at marvell.com>
+ *
+ * This file is part of GNU program.
+ *
+ * GNU program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * GNU program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Genera=
l
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program.
+ *
+ * If not, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ *************************************************************************=
/
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mmc/host.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <plat/sdhci.h>
+#include "sdhci-pxa.h"
+#include "sdhci.h"
+
+#define DRIVER_NAME "sdhci-pxa168"
+
+#define SD_FIFO_PARAM 0xE0
+#define DIS_PAD_SD_CLK_GATE (1<<10) /* Turn on/off Dynamic Clock Gating=
*/
+
+#define SD_CLOCK_AND_BURST_SIZE_SETUP 0xE6
+#define SDCLK_DELAY_MASK 0xF
+#define SDCLK_SEL_MASK 0x3
+#define SDCLK_DELAY_SHIFT 10
+#define SDCLK_SEL_SHIFT 8
+
+#define SD_CE_ATA_2 0xEA
+#define SDCE_MMC_WIDTH (1<<8)
+#define SDCE_MMC_CARD (1<<12)
+
+#define DISABLE_CLOCK_GATING 0
+
+static int platform_pxa168_probe(struct sdhci_host *host);
+
+/*
+ * MMC spec calls for the host to send 74 clocks to the card
+ * during initialization, right after voltage stabilization.
+ * the pxa168 controller has no easy way to generate those clocks.
+ * create the clocks manually right here.
+ */
+#if 0
+static void generate_init_clocks(struct sdhci_host *host, u8 power_mode)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+ struct pfn_cfg *cfg =3D pxa->pdata->pfn_table;
+ mfp_cfg_t clk_pin;
+ int i;
+
+
+ if (cfg =3D=3D NULL) {
+ DBG("Cannot generate init clocks!\n");
+ return;
+ }
+
+ if (pxa->power_mode =3D=3D MMC_POWER_UP
+ && power_mode =3D=3D MMC_POWER_ON) {
+
+ DBG("%s: ENTER %s: power_mode =3D %d, ios_.power_mode =3D %=
d\n",
+ __func__,
+ mmc_hostname(host->mmc),
+ pxa->power_mode,
+ power_mode);
+ /* CMD/CLK pin to gpio mode. */
+ mfp_config(pfn_lookup(cfg, PFN_GPIO, PIN_MMC_CMD), 1);
+ mfp_config(pfn_lookup(cfg, PFN_GPIO, PIN_MMC_CLK), 1);
+
+ /* ensure at least 1/2 period stable to prevent runt pulse.=
*/
+ udelay(3);
+
+ clk_pin =3D *(pfn_lookup(cfg, PFN_GPIO, PIN_MMC_CLK));
+ if (gpio_request(MFP_PIN(clk_pin), "MMC_CLK")) {
+ printk(KERN_ERR "Cannot obtain MMC_CLK GPIO %ld\n",
+ MFP_PIN(clk_pin));
+ goto err;
+ }
+
+ DBG("Generating init clocks on pins CLK %ld\n",
+ MFP_PIN(clk_pin));
+
+ for (i =3D 0; i < INIT_CLOCKS; i++) {
+ gpio_direction_output(MFP_PIN(clk_pin), 0); /* low =
*/
+ udelay(3);
+ gpio_direction_output(MFP_PIN(clk_pin), 1); /* high=
*/
+ udelay(3);
+ }
+
+ gpio_free(MFP_PIN(clk_pin));
+ }
+
+err:
+ pxa->power_mode =3D power_mode;
+
+ /* CMD/CLK pin back MMC mode. */
+ mfp_config(pfn_lookup(cfg, PFN_FN, PIN_MMC_CMD), 1);
+ mfp_config(pfn_lookup(cfg, PFN_FN, PIN_MMC_CLK), 1);
+}
+#endif
+
+/*
+ * we cannot talk to controller for 8 bus cycles according to sdio spec
+ * at lowest speed this is 100,000 HZ per cycle or 800,000 cycles
+ * which is quite a LONG TIME on a fast cpu -- so delay if needed
+ */
+static void platform_specific_delay(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ mdelay(pxa->delay_in_ms);
+ udelay(pxa->delay_in_us);
+ ndelay(pxa->delay_in_ns);
+}
+
+static void set_clock(struct sdhci_host *host, unsigned int clock)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ if (clock !=3D 0) {
+ pxa->delay_in_ns =3D (1000000000/clock);
+
+ /* need to delay 12 clocks for 8787/8786 */
+ /* need to delay 8 clocks for controller -- so just use 12 =
*/
+
+ pxa->delay_in_ns =3D pxa->delay_in_ns * 12;
+
+ pxa->delay_in_ms =3D pxa->delay_in_ns / 1000000;
+ pxa->delay_in_ns =3D pxa->delay_in_ns % 1000000;
+ pxa->delay_in_us =3D pxa->delay_in_ns / 1000;
+ pxa->delay_in_ns =3D pxa->delay_in_ns % 1000;
+ } else {
+ pxa->delay_in_ns =3D 0;
+ pxa->delay_in_us =3D 0;
+ pxa->delay_in_ms =3D 0;
+ }
+}
+
+static void set_clock_and_burst_size(struct sdhci_host *host)
+{
+ u16 tmp;
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ if (pxa->pdata->adjust_clocks) {
+ tmp =3D readw(host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP)=
;
+ pr_debug("%s:%s: (B) SD_CLOCK_AND_BURST =3D %04X"
+ ", delay =3D %d, sel =3D %d\n",
+ __func__, mmc_hostname(host->mmc), tmp,
+ pxa->pdata->clk_delay, pxa->pdata->clk_select);
+ tmp &=3D ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT);
+ tmp &=3D ~(SDCLK_SEL_MASK << SDCLK_SEL_SHIFT);
+ tmp |=3D (pxa->pdata->clk_delay & SDCLK_DELAY_MASK) <<
+ SDCLK_DELAY_SHIFT;
+ tmp |=3D (pxa->pdata->clk_select & SDCLK_SEL_MASK) <<
+ SDCLK_SEL_SHIFT;
+ writew(tmp, host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP);
+ pr_debug("%s:%s: (A) SD_CLOCK_AND_BURST =3D %04X\n",
+ __func__, mmc_hostname(host->mmc), tmp);
+ }
+}
+
+static void programFIFO(struct sdhci_host *host, int enable)
+{
+ unsigned short tmp;
+
+ tmp =3D readw(host->ioaddr + SD_FIFO_PARAM);
+ if (enable)
+ tmp &=3D ~DIS_PAD_SD_CLK_GATE;
+ else
+ tmp |=3D DIS_PAD_SD_CLK_GATE;
+ writew(tmp, host->ioaddr + SD_FIFO_PARAM);
+}
+
+static void platform_reset_enter(struct sdhci_host *host, u8 mask)
+{
+ /* Before RESET_DATA we need to wait at least 10 sd cycles */
+ if (mask =3D=3D SDHCI_RESET_DATA)
+ platform_specific_delay(host);
+}
+
+
+static void platform_reset_exit(struct sdhci_host *host, u8 mask)
+{
+ if (mask =3D=3D SDHCI_RESET_ALL) {
+ /* reset private registers */
+ programFIFO(host, DISABLE_CLOCK_GATING);
+ set_clock_and_burst_size(host);
+ }
+}
+
+
+#ifdef CONFIG_MMC_CLKGATE
+static void platform_hw_clk_gate(struct sdhci_host *host)
+{
+ int enable;
+
+ enable =3D host->mmc->clk_gated;
+ programFIFO(host, enable);
+}
+#endif
+
+static unsigned int get_max_clock(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ pr_debug("%s:%s clk_get_rate =3D %lu\n",
+ __func__, mmc_hostname(host->mmc),
+ clk_get_rate(pxa->clk));
+
+ return clk_get_rate(pxa->clk);
+}
+
+static unsigned int get_f_max_clock(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ pr_debug("%s:%s f_max =3D %d\n",
+ __func__, mmc_hostname(host->mmc),
+ pxa->pdata->max_speed);
+
+ return pxa->pdata->max_speed;
+}
+
+static int platform_supports_8_bit(struct sdhci_host *host, int width)
+{
+ u16 tmp;
+
+ tmp =3D readw(host->ioaddr + SD_CE_ATA_2);
+ tmp |=3D SDCE_MMC_CARD | SDCE_MMC_WIDTH;
+ writew(tmp, host->ioaddr + SD_CE_ATA_2);
+
+ tmp =3D readw(host->ioaddr + SD_CE_ATA_2);
+ if (width !=3D 8)
+ tmp &=3D ~(SDCE_MMC_CARD | SDCE_MMC_WIDTH);
+ else
+ tmp |=3D SDCE_MMC_CARD | SDCE_MMC_WIDTH;
+ writew(tmp, host->ioaddr + SD_CE_ATA_2);
+ return 0;
+}
+
+struct sdhci_pxa_data sdhci_platform_data =3D {
+ .ops =3D {
+ .platform_reset_enter =3D platform_reset_enter,
+ .platform_reset_exit =3D platform_reset_exit,
+ .get_max_clock =3D get_max_clock,
+ .set_clock =3D set_clock,
+ .platform_specific_delay =3D platform_specific_delay,
+ .platform_send_init_74_clocks =3D NULL,
+ .get_f_max_clock =3D NULL,
+ .platform_8bit_width =3D NULL,
+#ifdef CONFIG_MMC_CLKGATE
+ .platform_hw_clk_gate =3D platform_hw_clk_gate,
+#endif
+ },
+#ifdef CONFIG_MMC_CLKGATE
+ .mmc_caps =3D MMC_CAP_HW_CLOCK_GATING | MMC_CAP_BUS_WIDTH_TEST,
+#else
+ .mmc_caps =3D MMC_CAP_BUS_WIDTH_TEST,
+#endif
+ .platform_probe =3D platform_pxa168_probe,
+ .quirks =3D SDHCI_QUIRK_32BIT_DMA_ADDR | SDHCI_QUIRK_32BIT_DMA_SIZE
+ | SDHCI_QUIRK_NO_BUSY_IRQ | SDHCI_QUIRK_CAP_CLOCK_BASE_BROK=
EN,
+};
+EXPORT_SYMBOL_GPL(sdhci_platform_data);
+
+static int platform_pxa168_probe(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+ struct sdhci_pxa_platdata *pdata =3D pxa->pdata;
+ struct sdhci_ops *p_ops;
+
+ host->quirks |=3D sdhci_platform_data.quirks;
+ host->mmc->caps |=3D sdhci_platform_data.mmc_caps;
+
+ /*
+ * we cannot directly copy our operations into host->ops
+ * since it is read only. So we do this indirectly.
+ */
+ p_ops =3D kmalloc(sizeof(struct sdhci_ops), GFP_KERNEL);
+ if (!p_ops)
+ return -ENOMEM;
+
+ memcpy((void *)p_ops, (void *)&sdhci_platform_data.ops,
+ sizeof(struct sdhci_ops));
+
+ /* If slot design supports 8 bit data, indicate this to MMC. */
+ if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT) {
+ host->mmc->caps |=3D MMC_CAP_8_BIT_DATA;
+ p_ops->platform_8bit_width =3D platform_supports_8_bit;
+ }
+
+ if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
+ host->mmc->caps |=3D MMC_CAP_NONREMOVABLE;
+ host->quirks |=3D SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ }
+
+ if (pxa->pdata->max_speed)
+ p_ops->get_f_max_clock =3D get_f_max_clock;
+
+ memcpy((void *)host->ops, (void *)p_ops, sizeof(struct sdhci_ops));
+ kfree(p_ops);
+ return 0;
+}
diff --git a/drivers/mmc/host/sdhci-pxa910.c b/drivers/mmc/host/sdhci-pxa91=
0.c
new file mode 100644
index 0000000..282a1e0
--- /dev/null
+++ b/drivers/mmc/host/sdhci-pxa910.c
@@ -0,0 +1,271 @@
+/*************************************************************************=
*
+ *
+ * Copyright (c) 2009, 2010 Marvell International Ltd.
+ * Philip Rakity <prakity at marvell.com>
+ * Mark F. Brown <markb at marvell.com>
+ *
+ * This file is part of GNU program.
+ *
+ * GNU program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * GNU program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Genera=
l
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program.
+ *
+ * If not, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+ *
+ *************************************************************************=
/
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/mmc/host.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <plat/sdhci.h>
+#include "sdhci-pxa.h"
+#include "sdhci.h"
+
+#define DRIVER_NAME "sdhci-pxa910"
+
+#define SD_FIFO_PARAM 0xE0
+#define DIS_PAD_SD_CLK_GATE (1<<10) /* Turn on/off Dynamic Clock Gating=
*/
+
+#define SD_CLOCK_AND_BURST_SIZE_SETUP 0xE6
+#define SDCLK_DELAY_MASK 0xF
+#define SDCLK_SEL_MASK 0x3
+#define SDCLK_DELAY_SHIFT 10
+#define SDCLK_SEL_SHIFT 8
+
+#define SD_CE_ATA_2 0xEA
+#define SDCE_MMC_WIDTH (1<<8)
+#define SDCE_MMC_CARD (1<<12)
+
+#define DISABLE_CLOCK_GATING 0
+
+static int platform_pxa910_probe(struct sdhci_host *host);
+
+/*
+ * MMC spec calls for the host to send 74 clocks to the card
+ * during initialization, right after voltage stabilization.
+ * the pxa168 controller has no easy way to generate those clocks.
+ * create the clocks manually right here.
+ */
+#if 0
+static void generate_init_clocks(struct sdhci_host *host, u8 power_mode)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+ struct pfn_cfg *cfg =3D pxa->pdata->pfn_table;
+ mfp_cfg_t clk_pin;
+ int i;
+
+
+ if (cfg =3D=3D NULL) {
+ DBG("Cannot generate init clocks!\n");
+ return;
+ }
+
+ if (pxa->power_mode =3D=3D MMC_POWER_UP
+ && power_mode =3D=3D MMC_POWER_ON) {
+
+ DBG("%s: ENTER %s: power_mode =3D %d, ios_.power_mode =3D %=
d\n",
+ __func__,
+ mmc_hostname(host->mmc),
+ pxa->power_mode,
+ power_mode);
+ /* CMD/CLK pin to gpio mode. */
+ mfp_config(pfn_lookup(cfg, PFN_GPIO, PIN_MMC_CMD), 1);
+ mfp_config(pfn_lookup(cfg, PFN_GPIO, PIN_MMC_CLK), 1);
+
+ /* ensure at least 1/2 period stable to prevent runt pulse.=
*/
+ udelay(3);
+
+ clk_pin =3D *(pfn_lookup(cfg, PFN_GPIO, PIN_MMC_CLK));
+ if (gpio_request(MFP_PIN(clk_pin), "MMC_CLK")) {
+ printk(KERN_ERR "Cannot obtain MMC_CLK GPIO %ld\n",
+ MFP_PIN(clk_pin));
+ goto err;
+ }
+
+ DBG("Generate 74 clocks on pins CLK %ld\n", MFP_PIN(clk_pin=
));
+
+ for (i =3D 0; i < INIT_CLOCKS; i++) {
+ gpio_direction_output(MFP_PIN(clk_pin), 0); /* low =
*/
+ udelay(3);
+ gpio_direction_output(MFP_PIN(clk_pin), 1); /* high=
*/
+ udelay(3);
+ }
+
+ gpio_free(MFP_PIN(clk_pin));
+ }
+
+err:
+ pxa->power_mode =3D power_mode;
+
+ /* CMD/CLK pin back MMC mode. */
+ mfp_config(pfn_lookup(cfg, PFN_FN, PIN_MMC_CMD), 1);
+ mfp_config(pfn_lookup(cfg, PFN_FN, PIN_MMC_CLK), 1);
+}
+#endif
+
+static void set_clock_and_burst_size(struct sdhci_host *host)
+{
+ u16 tmp;
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ if (pxa->pdata->adjust_clocks) {
+ tmp =3D readw(host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP)=
;
+ pr_debug("%s:%s: (B) SD_CLOCK_AND_BURST =3D %04X, "
+ "delay =3D %d, sel =3D %d\n",
+ __func__, mmc_hostname(host->mmc), tmp,
+ pxa->pdata->clk_delay, pxa->pdata->clk_select);
+ tmp &=3D ~(SDCLK_DELAY_MASK << SDCLK_DELAY_SHIFT);
+ tmp &=3D ~(SDCLK_SEL_MASK << SDCLK_SEL_SHIFT);
+ tmp |=3D (pxa->pdata->clk_delay & SDCLK_DELAY_MASK) <<
+ SDCLK_DELAY_SHIFT;
+ tmp |=3D (pxa->pdata->clk_select & SDCLK_SEL_MASK) <<
+ SDCLK_SEL_SHIFT;
+ writew(tmp, host->ioaddr + SD_CLOCK_AND_BURST_SIZE_SETUP);
+ pr_debug("%s:%s: (A) SD_CLOCK_AND_BURST =3D %04X\n",
+ __func__, mmc_hostname(host->mmc), tmp);
+ }
+}
+
+static void programFIFO(struct sdhci_host *host, int enable)
+{
+ unsigned short tmp;
+
+ tmp =3D readw(host->ioaddr + SD_FIFO_PARAM);
+ if (enable)
+ tmp &=3D ~DIS_PAD_SD_CLK_GATE;
+ else
+ tmp |=3D DIS_PAD_SD_CLK_GATE;
+ writew(tmp, host->ioaddr + SD_FIFO_PARAM);
+}
+
+static void platform_reset_exit(struct sdhci_host *host, u8 mask)
+{
+ if (mask =3D=3D SDHCI_RESET_ALL) {
+ programFIFO(host, DISABLE_CLOCK_GATING);
+ set_clock_and_burst_size(host);
+ }
+}
+
+#ifdef CONFIG_MMC_CLKGATE
+static void platform_hw_clk_gate(struct sdhci_host *host)
+{
+ int enable;
+
+ enable =3D host->mmc->clk_gated;
+ programFIFO(host, enable);
+}
+#endif
+
+static unsigned int get_max_clock(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ pr_debug("%s:%s clk_get_rate =3D %lu\n",
+ __func__, mmc_hostname(host->mmc),
+ clk_get_rate(pxa->clk));
+
+ return clk_get_rate(pxa->clk);
+}
+
+static unsigned int get_f_max_clock(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+
+ pr_debug("%s:%s f_max =3D %d\n",
+ __func__, mmc_hostname(host->mmc),
+ pxa->pdata->max_speed);
+
+ return pxa->pdata->max_speed;
+}
+
+static int platform_supports_8_bit(struct sdhci_host *host, int width)
+{
+ u16 tmp;
+
+ tmp =3D readw(host->ioaddr + SD_CE_ATA_2);
+ tmp |=3D SDCE_MMC_CARD | SDCE_MMC_WIDTH;
+ writew(tmp, host->ioaddr + SD_CE_ATA_2);
+
+ tmp =3D readw(host->ioaddr + SD_CE_ATA_2);
+ if (width !=3D 8)
+ tmp &=3D ~(SDCE_MMC_CARD | SDCE_MMC_WIDTH);
+ else
+ tmp |=3D SDCE_MMC_CARD | SDCE_MMC_WIDTH;
+ writew(tmp, host->ioaddr + SD_CE_ATA_2);
+ return 0;
+}
+
+struct sdhci_pxa_data sdhci_platform_data =3D {
+ .ops =3D {
+ .platform_reset_exit =3D platform_reset_exit,
+ .get_max_clock =3D get_max_clock,
+ .platform_send_init_74_clocks =3D NULL,
+ .get_f_max_clock =3D NULL,
+ .platform_8bit_width =3D NULL,
+#ifdef CONFIG_MMC_CLKGATE
+ .platform_hw_clk_gate =3D platform_hw_clk_gate,
+#endif
+ },
+#ifdef CONFIG_MMC_CLKGATE
+ .mmc_caps =3D MMC_CAP_HW_CLOCK_GATING | MMC_CAP_BUS_WIDTH_TEST,
+#else
+ .mmc_caps =3D MMC_CAP_BUS_WIDTH_TEST,
+#endif
+ .platform_probe =3D platform_pxa910_probe,
+ .quirks =3D SDHCI_QUIRK_32BIT_DMA_ADDR | SDHCI_QUIRK_32BIT_DMA_SIZE
+ | SDHCI_QUIRK_NO_BUSY_IRQ | SDHCI_QUIRK_CAP_CLOCK_BASE_BROK=
EN,
+};
+EXPORT_SYMBOL_GPL(sdhci_platform_data);
+
+static int platform_pxa910_probe(struct sdhci_host *host)
+{
+ struct sdhci_pxa *pxa =3D sdhci_priv(host);
+ struct sdhci_pxa_platdata *pdata =3D pxa->pdata;
+ struct sdhci_ops *p_ops;
+
+ host->quirks |=3D sdhci_platform_data.quirks;
+ host->mmc->caps |=3D sdhci_platform_data.mmc_caps;
+
+ /*
+ * we cannot directly copy our operations into host->ops
+ * since it is read only. So we do this indirectly.
+ */
+ p_ops =3D kmalloc(sizeof(struct sdhci_ops), GFP_KERNEL);
+ if (!p_ops)
+ return -ENOMEM;
+
+ memcpy((void *)p_ops, (void *)&sdhci_platform_data.ops,
+ sizeof(struct sdhci_ops));
+
+ /* If slot design supports 8 bit data, indicate this to MMC. */
+ if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT) {
+ host->mmc->caps |=3D MMC_CAP_8_BIT_DATA;
+ p_ops->platform_8bit_width =3D platform_supports_8_bit;
+ }
+
+ if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
+ host->mmc->caps |=3D MMC_CAP_NONREMOVABLE;
+ host->quirks |=3D SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ }
+
+ if (pxa->pdata->max_speed)
+ p_ops->get_f_max_clock =3D get_f_max_clock;
+
+ memcpy((void *)host->ops, (void *)p_ops, sizeof(struct sdhci_ops));
+ kfree(p_ops);
+ return 0;
+}
--
1.6.0.4
--_002_501F2432789549DC9A47824868A4769Bmarvellcom_
Content-Type: application/octet-stream;
name="0016-sdhci-Add-support-PXA168-PXA910-and-MMP2-controll.patch"
Content-Description: 0016-sdhci-Add-support-PXA168-PXA910-and-MMP2-controll.patch
Content-Disposition: attachment;
filename="0016-sdhci-Add-support-PXA168-PXA910-and-MMP2-controll.patch";
size=35334; creation-date="Tue, 21 Dec 2010 23:10:17 GMT";
modification-date="Tue, 21 Dec 2010 23:10:17 GMT"
Content-Transfer-Encoding: base64
RnJvbSBkMDk0MWFlNzA2OWUxNmM5MDZiNzgxNDFlNDY3ODM5ZTRiZTEyNTA0IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXAgUmFraXR5IDxwcmFraXR5QG1hcnZlbGwuY29tPgpE
YXRlOiBTdW4sIDE5IERlYyAyMDEwIDIxOjIxOjAzIC0wODAwClN1YmplY3Q6IFtQQVRDSF0gc2Ro
Y2k6IEFkZCBzdXBwb3J0IFBYQTE2OCwgUFhBOTEwLCBhbmQgTU1QMiBjb250cm9sbGVycwoKQWRk
IGFiaWxpdHkgdG8gc2VsZWN0IGNvbnRyb2xsZXIgYmFzZWQgb24gQ1BVIG1vZGVsClBsYXRmb3Jt
IGZsYWdzIHRha2VuIGZyb20gYXJjaC9tYWNoLW1tcC8gZmlsZXMgZm9yIGJvYXJkIGRlc2lnbgoo
YnJvd25zdG9uZSwgamFzcGVyLCBhc3Blbml0ZSBldGMpCnF1aXJrcyBmb3IgcGxhdGZvcm0gYmVo
YXZpb3IgZGVmaW5lZCBpbiBzcGVjaWZpYyBwbGF0Zm9ybSBmaWxlcwpob29rcyBmb3Igc2lsaWNv
biBpc3N1ZXMgYWRkZWQKY29kZSBhZGRlZCB0byBwcmludCBwbGF0Zm9ybSBzcGVjaWZpYyByZWdp
c3RlcnMKClNpZ25lZC1vZmYtYnk6I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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAq
CkBAIC01MywxNyArNTcsNiBAQCBzdGF0aWMgdm9pZCBlbmFibGVfY2xvY2soc3RydWN0IHNkaGNp
X2hvc3QgKmhvc3QpCiAJfQogfQogCi1zdGF0aWMgdW5zaWduZWQgaW50IGdldF9mX21heF9jbG9j
ayhzdHJ1Y3Qgc2RoY2lfaG9zdCAqaG9zdCkKLXsKLQlzdHJ1Y3Qgc2RoY2lfcHhhICpweGEgPSBz
ZGhjaV9wcml2KGhvc3QpOwotCi0JcmV0dXJuIHB4YS0+cGRhdGEtPm1heF9zcGVlZDsKLX0KLQot
c3RhdGljIHN0cnVjdCBzZGhjaV9vcHMgc2RoY2lfcHhhX29wcyA9IHsKLQkuZ2V0X2ZfbWF4X2Ns
b2NrID0gTlVMTCwKLX07Ci0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq
KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKlwKICAqICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgKgogICogRGV2aWNlIHByb2JpbmcvcmVtb3ZhbCAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCkBAIC0xMjUsMjkgKzExOCwyNCBAQCBzdGF0
aWMgaW50IF9fZGV2aW5pdCBzZGhjaV9weGFfcHJvYmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAq
cGRldikKIAl9CiAKIAlob3N0LT5od19uYW1lID0gIk1NQyI7Ci0JaG9zdC0+b3BzID0gJnNkaGNp
X3B4YV9vcHM7Ci0JaG9zdC0+aXJxID0gaXJxOwotCWhvc3QtPnF1aXJrcyA9IFNESENJX1FVSVJL
X0JST0tFTl9BRE1BIHwgU0RIQ0lfUVVJUktfQlJPS0VOX1RJTUVPVVRfVkFMOwotCi0JLyog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
YXRmb3JtXzhiaXRfd2lkdGggPSBwbGF0Zm9ybV9zdXBwb3J0c184X2JpdDsKKwl9CisKKwlpZiAo
cGRhdGEtPmZsYWdzICYgUFhBX0ZMQUdfQ0FSRF9QRVJNQU5FTlQpIHsKKwkJaG9zdC0+bW1jLT5j
YXBzIHw9IE1NQ19DQVBfTk9OUkVNT1ZBQkxFOworCQlob3N0LT5xdWlya3MgfD0gU0RIQ0lfUVVJ
UktfQlJPS0VOX0NBUkRfREVURUNUSU9OOworCX0KKworCWlmIChweGEtPnBkYXRhLT5tYXhfc3Bl
ZWQpCisJCXBfb3BzLT5nZXRfZl9tYXhfY2xvY2sgPSBnZXRfZl9tYXhfY2xvY2s7CisKKwltZW1j
cHkoKHZvaWQgKilob3N0LT5vcHMsICh2b2lkICopcF9vcHMsIHNpemVvZihzdHJ1Y3Qgc2RoY2lf
b3BzKSk7CisJa2ZyZWUocF9vcHMpOworCXJldHVybiAwOworfQotLSAKMS42LjAuNAoK
--_002_501F2432789549DC9A47824868A4769Bmarvellcom_--
More information about the linux-arm-kernel
mailing list