[PATCH 3/3] ARM: mmp: support mmc on pxa910 dkb board

Jun Nie njun at marvell.com
Wed Apr 20 21:32:07 EDT 2011


Signed-off-by: Jun Nie <njun at marvell.com>
---
 arch/arm/mach-mmp/include/mach/mfp-pxa910.h |   12 ++++++++++
 arch/arm/mach-mmp/ttc_dkb.c                 |   31 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
index d1150ab..45f97cd 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa910.h
@@ -159,6 +159,18 @@
 #define MMC1_CD_MMC1_CD		MFP_CFG_DRV(MMC1_CD, AF0, MEDIUM)
 #define MMC1_WP_MMC1_WP		MFP_CFG_DRV(MMC1_WP, AF0, MEDIUM)

+/* MMC2 */
+#define MMC2_DAT3_GPIO_33       MFP_CFG_DRV(GPIO33, AF1, MEDIUM)
+#define MMC2_DAT3_GPIO_34       MFP_CFG_DRV(GPIO34, AF1, MEDIUM)
+#define MMC2_DAT3_GPIO_35       MFP_CFG_DRV(GPIO35, AF1, MEDIUM)
+#define MMC2_DAT3_GPIO_36       MFP_CFG_DRV(GPIO36, AF1, MEDIUM)
+#define MMC2_DAT3_GPIO_37       MFP_CFG_DRV(GPIO37, AF1, MEDIUM)
+#define MMC2_DAT2_GPIO_38       MFP_CFG_DRV(GPIO38, AF1, MEDIUM)
+#define MMC2_DAT1_GPIO_39       MFP_CFG_DRV(GPIO39, AF1, MEDIUM)
+#define MMC2_DAT0_GPIO_40       MFP_CFG_DRV(GPIO40, AF1, MEDIUM)
+#define MMC2_CMD_GPIO_41        MFP_CFG_DRV(GPIO41, AF1, MEDIUM)
+#define MMC2_CLK_GPIO_42        MFP_CFG_DRV(GPIO42, AF1, VERY_SLOW)
+
 /* PWM */
 #define GPIO27_PWM3_AF2		MFP_CFG(GPIO27, AF2)
 #define GPIO51_PWM2_OUT		MFP_CFG(GPIO51, AF2)
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index 473e0bc..01be50f 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -17,6 +17,8 @@
 #include <linux/interrupt.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
+#include <linux/mmc/sdhci.h>
+#include <linux/err.h>

 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -60,6 +62,24 @@ static unsigned long ttc_dkb_pin_config[] __initdata = {
 	DF_REn_DF_REn,
 	DF_RDY0_DF_RDY0,

+	/*sdh MMC0*/
+	MMC1_DAT3_MMC1_DAT3,
+	MMC1_DAT2_MMC1_DAT2,
+	MMC1_DAT1_MMC1_DAT1,
+	MMC1_DAT0_MMC1_DAT0,
+	MMC1_CMD_MMC1_CMD,
+	MMC1_CLK_MMC1_CLK,
+	MMC1_CD_MMC1_CD | MFP_PULL_HIGH,
+	MMC1_WP_MMC1_WP,
+
+	/*sdh MMC1*/
+	MMC2_DAT3_GPIO_37,
+	MMC2_DAT2_GPIO_38,
+	MMC2_DAT1_GPIO_39,
+	MMC2_DAT0_GPIO_40,
+	MMC2_CMD_GPIO_41,
+	MMC2_CLK_GPIO_42,
+
 	/* 2V8 SD/MMC regulator */
 	GPIO15_GPIO,
 };
@@ -149,12 +169,23 @@ static struct platform_device dkb_mmc_2v8_device = {
 	},
 };

+/* MMC0 controller for SD-MMC */
+static struct sdhci_pxa_platdata pxa910_sdh_platdata_mmc0 = {
+	.quirks                 = SDHCI_QUIRK_BROKEN_ADMA,
+};
+/* MMC1 controller for SDIO */
+static struct sdhci_pxa_platdata pxa910_sdh_platdata_mmc1 = {
+	.quirks                 = SDHCI_QUIRK_BROKEN_ADMA,
+};
+
 static void __init ttc_dkb_init(void)
 {
 	mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));

 	/* on-chip devices */
 	pxa910_add_uart(1);
+	pxa910_add_sdhost(0, &pxa910_sdh_platdata_mmc0);
+	pxa910_add_sdhost(1, &pxa910_sdh_platdata_mmc1);

 	/* off-chip devices */
 	platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
-- 
1.7.0.4

--20cf307d0418edff4f04a1640fb6
Content-Type: text/x-diff; charset=US-ASCII; 
	name="0003-ARM-mmp-support-mmc-on-pxa910-dkb-board.patch"
Content-Disposition: attachment; 
	filename="0003-ARM-mmp-support-mmc-on-pxa910-dkb-board.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gmr15dhm0

RnJvbSA3NTllNjVlYjI0N2U1OWFmNGRlYmQ3YTdkMjU4ZmFkMGU4NThkMzZmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBKdW4gTmllIDxuanVuQG1hcnZlbGwuY29tPgpEYXRlOiBUaHUs
IDIxIEFwciAyMDExIDA5OjMyOjA3ICswODAwClN1YmplY3Q6IFtQQVRDSCAzLzNdIEFSTTogbW1w
OiBzdXBwb3J0IG1tYyBvbiBweGE5MTAgZGtiIGJvYXJkCgpTaWduZWQtb2ZmLWJ5OiBKdW4gTmll
IDxuanVuQG1hcnZlbGwuY29tPgotLS0KIGFyY2gvYXJtL21hY2gtbW1wL2luY2x1ZGUvbWFjaC9t
ZnAtcHhhOTEwLmggfCAgIDEyICsrKysrKysrKysKIGFyY2gvYXJtL21hY2gtbW1wL3R0Y19ka2Iu
YyAgICAgICAgICAgICAgICAgfCAgIDMxICsrKysrKysrKysrKysrKysrKysrKysrKysrKwogMiBm
aWxlcyBjaGFuZ2VkLCA0MyBpbnNlcnRpb25zKCspLCAwIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdp
dCBhL2FyY2gvYXJtL21hY2gtbW1wL2luY2x1ZGUvbWFjaC9tZnAtcHhhOTEwLmggYi9hcmNoL2Fy
bS9tYWNoLW1tcC9pbmNsdWRlL21hY2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