mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] boards: mx23evk: add MMC support
Date: Tue,  3 Jan 2012 15:27:36 +0100	[thread overview]
Message-ID: <1325600856-3020-1-git-send-email-w.sang@pengutronix.de> (raw)

Using SSP1 since this is the default configuration.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 arch/arm/boards/freescale-mx23-evk/mx23-evk.c |   31 +++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
index 47f6769..20d49fd 100644
--- a/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
+++ b/arch/arm/boards/freescale-mx23-evk/mx23-evk.c
@@ -1,5 +1,6 @@
 /*
  * (C) Copyright 2010 Juergen Beisert - Pengutronix
+ * (C) Copyright 2011 Wolfram Sang - Pengutronix
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -21,9 +22,28 @@
 #include <init.h>
 #include <gpio.h>
 #include <environment.h>
+#include <mci.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
 #include <mach/imx-regs.h>
+#include <mach/clock.h>
+#include <mach/mci.h>
+
+static struct mxs_mci_platform_data mci_pdata = {
+	.caps = MMC_MODE_4BIT,
+	.voltages = MMC_VDD_32_33 | MMC_VDD_33_34,	/* fixed to 3.3 V */
+};
+
+static const uint32_t pad_setup[] = {
+	/* SD card interface */
+	SSP1_DATA0 | PULLUP(1),
+	SSP1_DATA1 | PULLUP(1),
+	SSP1_DATA2 | PULLUP(1),
+	SSP1_DATA3 | PULLUP(1),
+	SSP1_SCK,
+	SSP1_CMD | PULLUP(1),
+	SSP1_DETECT | PULLUP(1),
+};
 
 static int mx23_evk_mem_init(void)
 {
@@ -35,9 +55,20 @@ mem_initcall(mx23_evk_mem_init);
 
 static int mx23_evk_devices_init(void)
 {
+	int i;
+
+	/* initizalize gpios */
+	for (i = 0; i < ARRAY_SIZE(pad_setup); i++)
+		imx_gpio_mode(pad_setup[i]);
+
 	armlinux_set_bootparams((void*)IMX_MEMORY_BASE + 0x100);
 	armlinux_set_architecture(MACH_TYPE_MX23EVK);
 
+	imx_set_ioclk(480000000); /* enable IOCLK to run at the PLL frequency */
+	imx_set_sspclk(0, 100000000, 1);
+	add_generic_device("mxs_mci", 0, NULL, IMX_SSP1_BASE, 0,
+			   IORESOURCE_MEM, &mci_pdata);
+
 	return 0;
 }
 
-- 
1.7.7.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

                 reply	other threads:[~2012-01-03 14:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1325600856-3020-1-git-send-email-w.sang@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=barebox@lists.infradead.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