[RFC PATCH 2/2] AM33XX: pcm051: Create custom mux file

Teresa Gámez t.gamez at phytec.de
Tue Mar 12 10:04:13 EDT 2013


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 at 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




More information about the barebox mailing list