public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC
@ 2012-01-11 22:42 Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 1/7] tegra: Adjust funcmux config test to permit expansion Simon Glass
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

This series expands funcmux_select() to support configs other than 0, and
to name each config option.

This permits introduction of I2C and MMC support in the funcmux.

Changes in v2:
- Add enum to select from available funcmux configs
- Remove funcmux_select() option parameter
- Use config enum to select funcmux
- Fix SDMMC4 config 0 to remove unwanted ATB pin group

Simon Glass (7):
  tegra: Adjust funcmux config test to permit expansion
  tegra: Add enum to select from available funcmux configs
  tegra: Add I2C support to funcmux
  tegra: Add SDMMC support to funcmux
  tegra: Use funcmux for MMC on tamonten
  tegra: Use funcmux for MMC on harmony
  tegra: Use funcmux for MMC on seaboard

 arch/arm/cpu/armv7/tegra2/board.c          |    2 +-
 arch/arm/cpu/armv7/tegra2/funcmux.c        |  139 +++++++++++++++++++++++++---
 arch/arm/include/asm/arch-tegra2/funcmux.h |   30 ++++++-
 board/avionic-design/common/tamonten.c     |   10 +--
 board/nvidia/harmony/harmony.c             |   19 +---
 board/nvidia/seaboard/seaboard.c           |   21 +----
 6 files changed, 166 insertions(+), 55 deletions(-)

-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 1/7] tegra: Adjust funcmux config test to permit expansion
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 2/7] tegra: Add enum to select from available funcmux configs Simon Glass
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

We want to support config options other than zero, so move the test to the
end to allow intermediate code to OK such a config.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/cpu/armv7/tegra2/funcmux.c        |   35 +++++++++++++++++----------
 arch/arm/include/asm/arch-tegra2/funcmux.h |    3 ++
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 0878f51..0f03b9f 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -26,27 +26,30 @@
 
 int funcmux_select(enum periph_id id, int config)
 {
-	if (config != 0) {
-		debug("%s: invalid config %d for periph_id %d", __func__,
-		      config, id);
-		return -1;
-	}
+	int bad_config = config != 0;
+
 	switch (id) {
 	case PERIPH_ID_UART1:
-		pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
-		pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
-		pinmux_tristate_disable(PINGRP_IRRX);
-		pinmux_tristate_disable(PINGRP_IRTX);
+		if (config == 0) {
+			pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
+			pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
+			pinmux_tristate_disable(PINGRP_IRRX);
+			pinmux_tristate_disable(PINGRP_IRTX);
+		}
 		break;
 
 	case PERIPH_ID_UART2:
-		pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
-		pinmux_tristate_disable(PINGRP_UAD);
+		if (config == 0) {
+			pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
+			pinmux_tristate_disable(PINGRP_UAD);
+		}
 		break;
 
 	case PERIPH_ID_UART4:
-		pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
-		pinmux_tristate_disable(PINGRP_GMC);
+		if (config == 0) {
+			pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
+			pinmux_tristate_disable(PINGRP_GMC);
+		}
 		break;
 
 	default:
@@ -54,5 +57,11 @@ int funcmux_select(enum periph_id id, int config)
 		return -1;
 	}
 
+	if (bad_config) {
+		debug("%s: invalid config %d for periph_id %d", __func__,
+		      config, id);
+		return -1;
+	}
+
 	return 0;
 }
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h b/arch/arm/include/asm/arch-tegra2/funcmux.h
index 2d724a2..d4f9cfb 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -32,6 +32,9 @@
  * The basic config is 0, and higher numbers indicate different
  * pinmux settings to bring the peripheral out on other pins,
  *
+ * This function also disables tristate for the function's pins,
+ * so that they operate in normal mode.
+ *
  * @param id		Peripheral id
  * @param config	Configuration to use (generally 0)
  * @return 0 if ok, -1 on error (e.g. incorrect id or config)
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 2/7] tegra: Add enum to select from available funcmux configs
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 1/7] tegra: Adjust funcmux config test to permit expansion Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 3/7] tegra: Add I2C support to funcmux Simon Glass
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

We want to give a name to each available funcmux config. For now we just
use the pin group names (even through it is verbose) since there seems
to be nothing better.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Add enum to select from available funcmux configs

 arch/arm/cpu/armv7/tegra2/board.c          |    2 +-
 arch/arm/cpu/armv7/tegra2/funcmux.c        |    9 +++++----
 arch/arm/include/asm/arch-tegra2/funcmux.h |   12 +++++++++++-
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c
index ea06570..5f296ab 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -120,7 +120,7 @@ static void setup_uarts(int uart_ids)
 		if (uart_ids & (1 << i)) {
 			enum periph_id id = id_for_uart[i];
 
-			funcmux_select(id, 0);
+			funcmux_select(id, FUNCMUX_DEFAULT);
 			clock_ll_start_uart(id);
 		}
 	}
diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 0f03b9f..4706788 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -22,15 +22,16 @@
 /* Tegra2 high-level function multiplexing */
 #include <common.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 
 int funcmux_select(enum periph_id id, int config)
 {
-	int bad_config = config != 0;
+	int bad_config = config != FUNCMUX_DEFAULT;
 
 	switch (id) {
 	case PERIPH_ID_UART1:
-		if (config == 0) {
+		if (config == FUNCMUX_UART1_IRRX_IRTX) {
 			pinmux_set_func(PINGRP_IRRX, PMUX_FUNC_UARTA);
 			pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
 			pinmux_tristate_disable(PINGRP_IRRX);
@@ -39,14 +40,14 @@ int funcmux_select(enum periph_id id, int config)
 		break;
 
 	case PERIPH_ID_UART2:
-		if (config == 0) {
+		if (config == FUNCMUX_UART2_IRDA) {
 			pinmux_set_func(PINGRP_UAD, PMUX_FUNC_IRDA);
 			pinmux_tristate_disable(PINGRP_UAD);
 		}
 		break;
 
 	case PERIPH_ID_UART4:
-		if (config == 0) {
+		if (config == FUNCMUX_UART4_GMC) {
 			pinmux_set_func(PINGRP_GMC, PMUX_FUNC_UARTD);
 			pinmux_tristate_disable(PINGRP_GMC);
 		}
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h b/arch/arm/include/asm/arch-tegra2/funcmux.h
index d4f9cfb..791f301 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -24,6 +24,16 @@
 #ifndef __FUNCMUX_H
 #define __FUNCMUX_H
 
+/* Configs supported by the func mux */
+enum {
+	FUNCMUX_DEFAULT = 0,	/* default config */
+
+	/* UART configs */
+	FUNCMUX_UART1_IRRX_IRTX = 0,
+	FUNCMUX_UART2_IRDA = 0,
+	FUNCMUX_UART4_GMC = 0,
+};
+
 /**
  * Select a config for a particular peripheral.
  *
@@ -36,7 +46,7 @@
  * so that they operate in normal mode.
  *
  * @param id		Peripheral id
- * @param config	Configuration to use (generally 0)
+ * @param config	Configuration to use (FUNCMUX_...), 0 for default
  * @return 0 if ok, -1 on error (e.g. incorrect id or config)
  */
 int funcmux_select(enum periph_id id, int config);
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 3/7] tegra: Add I2C support to funcmux
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 1/7] tegra: Adjust funcmux config test to permit expansion Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 2/7] tegra: Add enum to select from available funcmux configs Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 4/7] tegra: Add SDMMC " Simon Glass
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

Add support to funcmux for selecting I2C functions and programming
the pinmux appropriately.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 arch/arm/cpu/armv7/tegra2/funcmux.c        |   40 ++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-tegra2/funcmux.h |    7 +++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 4706788..6df9378 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -53,6 +53,46 @@ int funcmux_select(enum periph_id id, int config)
 		}
 		break;
 
+	case PERIPH_ID_DVC_I2C:
+		/* there is only one selection, pinmux_config is ignored */
+		if (config == FUNCMUX_DVC_I2CP) {
+			pinmux_set_func(PINGRP_I2CP, PMUX_FUNC_I2C);
+			pinmux_tristate_disable(PINGRP_I2CP);
+		}
+		break;
+
+	case PERIPH_ID_I2C1:
+		/* support pinmux_config of 0 for now, */
+		if (config == FUNCMUX_I2C1_RM) {
+			pinmux_set_func(PINGRP_RM, PMUX_FUNC_I2C);
+			pinmux_tristate_disable(PINGRP_RM);
+		}
+		break;
+	case PERIPH_ID_I2C2: /* I2C2 */
+		switch (config) {
+		case FUNCMUX_I2C2_DDC:	/* DDC pin group, select I2C2 */
+			pinmux_set_func(PINGRP_DDC, PMUX_FUNC_I2C2);
+			/* PTA to HDMI */
+			pinmux_set_func(PINGRP_PTA, PMUX_FUNC_HDMI);
+			pinmux_tristate_disable(PINGRP_DDC);
+			break;
+		case FUNCMUX_I2C2_PTA:	/* PTA pin group, select I2C2 */
+			pinmux_set_func(PINGRP_PTA, PMUX_FUNC_I2C2);
+			/* set DDC_SEL to RSVDx (RSVD2 works for now) */
+			pinmux_set_func(PINGRP_DDC, PMUX_FUNC_RSVD2);
+			pinmux_tristate_disable(PINGRP_PTA);
+			bad_config = 0;
+			break;
+		}
+		break;
+	case PERIPH_ID_I2C3: /* I2C3 */
+		/* support pinmux_config of 0 for now */
+		if (config == FUNCMUX_I2C3_DTF) {
+			pinmux_set_func(PINGRP_DTF, PMUX_FUNC_I2C3);
+			pinmux_tristate_disable(PINGRP_DTF);
+		}
+		break;
+
 	default:
 		debug("%s: invalid periph_id %d", __func__, id);
 		return -1;
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h b/arch/arm/include/asm/arch-tegra2/funcmux.h
index 791f301..d184523 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -32,6 +32,13 @@ enum {
 	FUNCMUX_UART1_IRRX_IRTX = 0,
 	FUNCMUX_UART2_IRDA = 0,
 	FUNCMUX_UART4_GMC = 0,
+
+	/* I2C configs */
+	FUNCMUX_DVC_I2CP = 0,
+	FUNCMUX_I2C1_RM = 0,
+	FUNCMUX_I2C2_DDC = 0,
+	FUNCMUX_I2C2_PTA,
+	FUNCMUX_I2C3_DTF = 0,
 };
 
 /**
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 4/7] tegra: Add SDMMC support to funcmux
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
                   ` (2 preceding siblings ...)
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 3/7] tegra: Add I2C support to funcmux Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 5/7] tegra: Use funcmux for MMC on tamonten Simon Glass
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

This adds support for SDMMC ports to the funcmux. Only one
option is supported: FUNCMUXO_SDMMC_8BIT which selects an 8-bit
wide SDIO interface where available.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Fix SDMMC4 config 0 to remove unwanted ATB pin group
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 arch/arm/cpu/armv7/tegra2/funcmux.c        |   63 ++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-tegra2/funcmux.h |    8 ++++
 2 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 6df9378..73950d0 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -93,6 +93,69 @@ int funcmux_select(enum periph_id id, int config)
 		}
 		break;
 
+	case PERIPH_ID_SDMMC2:
+		if (config == FUNCMUX_SDMMC2_DTA_DTD_8BIT) {
+			pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
+			pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
+
+			pinmux_tristate_disable(PINGRP_DTA);
+			pinmux_tristate_disable(PINGRP_DTD);
+		}
+		break;
+
+	case PERIPH_ID_SDMMC3:
+		switch (config) {
+		case FUNCMUX_SDMMC3_SDB_SLXA_8BIT:
+			pinmux_set_func(PINGRP_SLXA, PMUX_FUNC_SDIO3);
+			pinmux_set_func(PINGRP_SLXC, PMUX_FUNC_SDIO3);
+			pinmux_set_func(PINGRP_SLXD, PMUX_FUNC_SDIO3);
+			pinmux_set_func(PINGRP_SLXK, PMUX_FUNC_SDIO3);
+
+			pinmux_tristate_disable(PINGRP_SLXA);
+			pinmux_tristate_disable(PINGRP_SLXC);
+			pinmux_tristate_disable(PINGRP_SLXD);
+			pinmux_tristate_disable(PINGRP_SLXK);
+			/* fall through */
+
+		case FUNCMUX_SDMMC3_SDB_4BIT:
+			pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
+			pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
+			pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
+
+			pinmux_tristate_disable(PINGRP_SDB);
+			pinmux_tristate_disable(PINGRP_SDC);
+			pinmux_tristate_disable(PINGRP_SDD);
+			bad_config = 0;
+			break;
+		}
+		break;
+
+	case PERIPH_ID_SDMMC4:
+		switch (config) {
+		case FUNCMUX_SDMMC4_ATC_ATD_8BIT:
+			pinmux_set_func(PINGRP_ATC, PMUX_FUNC_SDIO4);
+			pinmux_set_func(PINGRP_ATD, PMUX_FUNC_SDIO4);
+
+			pinmux_tristate_disable(PINGRP_ATC);
+			pinmux_tristate_disable(PINGRP_ATD);
+			break;
+
+		case FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT:
+			pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+			pinmux_tristate_disable(PINGRP_GME);
+			/* fall through */
+
+		case FUNCMUX_SDMMC4_ATB_GMA_4_BIT:
+			pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+			pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+
+			pinmux_tristate_disable(PINGRP_ATB);
+			pinmux_tristate_disable(PINGRP_GMA);
+			bad_config = 0;
+			break;
+		}
+		break;
+
 	default:
 		debug("%s: invalid periph_id %d", __func__, id);
 		return -1;
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h b/arch/arm/include/asm/arch-tegra2/funcmux.h
index d184523..ae73c72 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -39,6 +39,14 @@ enum {
 	FUNCMUX_I2C2_DDC = 0,
 	FUNCMUX_I2C2_PTA,
 	FUNCMUX_I2C3_DTF = 0,
+
+	/* SDMMC configs */
+	FUNCMUX_SDMMC2_DTA_DTD_8BIT = 0,
+	FUNCMUX_SDMMC3_SDB_4BIT = 0,
+	FUNCMUX_SDMMC3_SDB_SLXA_8BIT,
+	FUNCMUX_SDMMC4_ATC_ATD_8BIT = 0,
+	FUNCMUX_SDMMC4_ATB_GMA_4_BIT,
+	FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT,
 };
 
 /**
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 5/7] tegra: Use funcmux for MMC on tamonten
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
                   ` (3 preceding siblings ...)
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 4/7] tegra: Add SDMMC " Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 6/7] tegra: Use funcmux for MMC on harmony Simon Glass
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

Use the new funcmux_select() feature to set up the MMC pin mux.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 board/avionic-design/common/tamonten.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c
index 97e59fb..f23b657 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -32,6 +32,7 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/clk_rst.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/uart.h>
 #include <asm/arch/mmc.h>
@@ -63,14 +64,7 @@ int timer_init(void)
  */
 static void pin_mux_mmc(void)
 {
-	/* SDMMC4: config 3, x8 on 2nd set of pins */
-	pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-	pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-	pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-	pinmux_tristate_disable(PINGRP_ATB);
-	pinmux_tristate_disable(PINGRP_GMA);
-	pinmux_tristate_disable(PINGRP_GME);
+	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
 }
 #endif
 
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 6/7] tegra: Use funcmux for MMC on harmony
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
                   ` (4 preceding siblings ...)
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 5/7] tegra: Use funcmux for MMC on tamonten Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 7/7] tegra: Use funcmux for MMC on seaboard Simon Glass
  2012-01-11 23:46 ` [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Stephen Warren
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

Use the new funcmux_select() feature to set up the MMC pin mux.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 board/nvidia/harmony/harmony.c |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index d5e147d..8f8e7bf 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/tegra2.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/mmc.h>
 #include <asm/gpio.h>
@@ -46,27 +48,14 @@ void gpio_config_uart(void)
  */
 static void pin_mux_mmc(void)
 {
-	/* SDMMC4: config 3, x8 on 2nd set of pins */
-	pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-	pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-	pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-	pinmux_tristate_disable(PINGRP_ATB);
-	pinmux_tristate_disable(PINGRP_GMA);
-	pinmux_tristate_disable(PINGRP_GME);
+	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
+	funcmux_select(PERIPH_ID_SDMMC2, FUNCMUX_SDMMC2_DTA_DTD_8BIT);
 
 	/* For power GPIO PI6 */
 	pinmux_tristate_disable(PINGRP_ATA);
 	/* For CD GPIO PH2 */
 	pinmux_tristate_disable(PINGRP_ATD);
 
-	/* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
-	pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
-	pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
-
-	pinmux_tristate_disable(PINGRP_DTA);
-	pinmux_tristate_disable(PINGRP_DTD);
-
 	/* For power GPIO PT3 */
 	pinmux_tristate_disable(PINGRP_DTB);
 	/* For CD GPIO PI5 */
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 7/7] tegra: Use funcmux for MMC on seaboard
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
                   ` (5 preceding siblings ...)
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 6/7] tegra: Use funcmux for MMC on harmony Simon Glass
@ 2012-01-11 22:42 ` Simon Glass
  2012-01-11 23:46 ` [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Stephen Warren
  7 siblings, 0 replies; 9+ messages in thread
From: Simon Glass @ 2012-01-11 22:42 UTC (permalink / raw)
  To: u-boot

Use the new funcmux_select() feature to set up the MMC pin mux.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Remove funcmux_select() option parameter
- Use config enum to select funcmux

 board/nvidia/seaboard/seaboard.c |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 56acd61..9ab6825 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -24,6 +24,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/tegra2.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/mmc.h>
 #include <asm/gpio.h>
@@ -59,23 +61,8 @@ void gpio_config_uart(void)
  */
 static void pin_mux_mmc(void)
 {
-	/* SDMMC4: config 3, x8 on 2nd set of pins */
-	pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
-	pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
-	pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
-
-	pinmux_tristate_disable(PINGRP_ATB);
-	pinmux_tristate_disable(PINGRP_GMA);
-	pinmux_tristate_disable(PINGRP_GME);
-
-	/* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
-	pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
-	pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
-	pinmux_set_func(PINGRP_SDD, PMUX_FUNC_SDIO3);
-
-	pinmux_tristate_disable(PINGRP_SDC);
-	pinmux_tristate_disable(PINGRP_SDD);
-	pinmux_tristate_disable(PINGRP_SDB);
+	funcmux_select(PERIPH_ID_SDMMC4, FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT);
+	funcmux_select(PERIPH_ID_SDMMC3, FUNCMUX_SDMMC3_SDB_4BIT);
 
 	/* For power GPIO PI6 */
 	pinmux_tristate_disable(PINGRP_ATA);
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC
  2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
                   ` (6 preceding siblings ...)
  2012-01-11 22:42 ` [U-Boot] [PATCH v2 7/7] tegra: Use funcmux for MMC on seaboard Simon Glass
@ 2012-01-11 23:46 ` Stephen Warren
  7 siblings, 0 replies; 9+ messages in thread
From: Stephen Warren @ 2012-01-11 23:46 UTC (permalink / raw)
  To: u-boot

On 01/11/2012 03:42 PM, Simon Glass wrote:
> This series expands funcmux_select() to support configs other than 0, and
> to name each config option.
> 
> This permits introduction of I2C and MMC support in the funcmux.

The series,

Acked-by: Stephen Warren <swarren@nvidia.com>

-- 
nvpublic

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-01-11 23:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 22:42 [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 1/7] tegra: Adjust funcmux config test to permit expansion Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 2/7] tegra: Add enum to select from available funcmux configs Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 3/7] tegra: Add I2C support to funcmux Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 4/7] tegra: Add SDMMC " Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 5/7] tegra: Use funcmux for MMC on tamonten Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 6/7] tegra: Use funcmux for MMC on harmony Simon Glass
2012-01-11 22:42 ` [U-Boot] [PATCH v2 7/7] tegra: Use funcmux for MMC on seaboard Simon Glass
2012-01-11 23:46 ` [U-Boot] [PATCH v2 0/7] tegra: Enhance funcmux to support I2C and MMC Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox