mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Teresa Gámez" <t.gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [RFC PATCH 2/2] AM33XX: pcm051: Create custom mux file
Date: Tue, 12 Mar 2013 15:04:13 +0100	[thread overview]
Message-ID: <1363097053-25784-2-git-send-email-t.gamez@phytec.de> (raw)
In-Reply-To: <1363097053-25784-1-git-send-email-t.gamez@phytec.de>

The pcm051 has no MMC WP pin. This pin is used for a gpio and
needs to be muxed different. Created a custom mux file for
this case.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/pcm051/Makefile |    2 +-
 arch/arm/boards/pcm051/board.c  |    4 +++-
 arch/arm/boards/pcm051/mux.c    |   20 ++++++++++++++++++++
 arch/arm/boards/pcm051/mux.h    |    2 ++
 4 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boards/pcm051/mux.c
 create mode 100644 arch/arm/boards/pcm051/mux.h

diff --git a/arch/arm/boards/pcm051/Makefile b/arch/arm/boards/pcm051/Makefile
index 092c31d..69d48e1 100644
--- a/arch/arm/boards/pcm051/Makefile
+++ b/arch/arm/boards/pcm051/Makefile
@@ -1,2 +1,2 @@
 lwl-y += lowlevel.o
-obj-y += board.o
+obj-y += board.o mux.o
diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index a38d844..8754ba5 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -27,6 +27,8 @@
 #include <mach/am33xx-mux.h>
 #include <mach/am33xx-silicon.h>
 
+#include "mux.h"
+
 /**
  * @brief UART serial port initialization
  * arch
@@ -52,7 +54,7 @@ mem_initcall(pcm051_mem_init);
 
 static int pcm051_devices_init(void)
 {
-	am33xx_enable_mmc0_pin_mux();
+	pcm051_enable_mmc0_pin_mux();
 
 	am33xx_add_mmc0(NULL);
 
diff --git a/arch/arm/boards/pcm051/mux.c b/arch/arm/boards/pcm051/mux.c
new file mode 100644
index 0000000..b8fb669
--- /dev/null
+++ b/arch/arm/boards/pcm051/mux.c
@@ -0,0 +1,20 @@
+#include <common.h>
+#include <config.h>
+#include <asm/io.h>
+#include <mach/am33xx-mux.h>
+
+static const struct module_pin_mux mmc0_pin_mux[] = {
+	{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT3 */
+	{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT2 */
+	{OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT1 */
+	{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_DAT0 */
+	{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CLK */
+	{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)},	/* MMC0_CMD */
+	{OFFSET(spi0_cs1), (MODE(5) | RXACTIVE | PULLUP_EN)},	/* MMC0_CD */
+	{-1},
+};
+
+void pcm051_enable_mmc0_pin_mux(void)
+{
+	configure_module_pin_mux(mmc0_pin_mux);
+}
diff --git a/arch/arm/boards/pcm051/mux.h b/arch/arm/boards/pcm051/mux.h
new file mode 100644
index 0000000..8113a84
--- /dev/null
+++ b/arch/arm/boards/pcm051/mux.h
@@ -0,0 +1,2 @@
+extern void pcm051_enable_mmc0_pin_mux(void);
+
-- 
1.7.0.4


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

  reply	other threads:[~2013-03-12 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 14:04 [RFC PATCH 1/2] AM33XX: Move muxing defines to header file Teresa Gámez
2013-03-12 14:04 ` Teresa Gámez [this message]
2013-03-14  7:30 ` Sascha Hauer
2013-03-14  9:35   ` Jan Lübbe
2013-03-15  7:23 ` Sascha Hauer

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=1363097053-25784-2-git-send-email-t.gamez@phytec.de \
    --to=t.gamez@phytec.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