Patchwork [U-Boot] tegra: add funcmux entry for NAND attached to KBC

login
register
mail settings
Submitter Lucas Stach
Date Sept. 27, 2012, 11:04 p.m.
Message ID <1348787067-12672-1-git-send-email-dev@lynxeye.de>
Download mbox | patch
Permalink /patch/187529/
State Accepted
Delegated to: Tom Warren
Headers show

Comments

Lucas Stach - Sept. 27, 2012, 11:04 p.m.
Secondary config for the Flash attachment.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/cpu/tegra20-common/funcmux.c       | 19 ++++++++++++++++++-
 arch/arm/include/asm/arch-tegra20/funcmux.h |  1 +
 2 Dateien geändert, 19 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
Stephen Warren - Sept. 27, 2012, 11:15 p.m.
On 09/27/2012 05:04 PM, Lucas Stach wrote:
> Secondary config for the Flash attachment.

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

Patch

diff --git a/arch/arm/cpu/tegra20-common/funcmux.c b/arch/arm/cpu/tegra20-common/funcmux.c
index b2129ad..00b8029 100644
--- a/arch/arm/cpu/tegra20-common/funcmux.c
+++ b/arch/arm/cpu/tegra20-common/funcmux.c
@@ -235,9 +235,26 @@  int funcmux_select(enum periph_id id, int config)
 		break;
 
 	case PERIPH_ID_NDFLASH:
-		if (config == FUNCMUX_NDFLASH_ATC) {
+		switch (config) {
+		case FUNCMUX_NDFLASH_ATC:
 			pinmux_set_func(PINGRP_ATC, PMUX_FUNC_NAND);
 			pinmux_tristate_disable(PINGRP_ATC);
+			break;
+		case FUNCMUX_NDFLASH_KBC_8_BIT:
+			pinmux_set_func(PINGRP_KBCA, PMUX_FUNC_NAND);
+			pinmux_set_func(PINGRP_KBCC, PMUX_FUNC_NAND);
+			pinmux_set_func(PINGRP_KBCD, PMUX_FUNC_NAND);
+			pinmux_set_func(PINGRP_KBCE, PMUX_FUNC_NAND);
+			pinmux_set_func(PINGRP_KBCF, PMUX_FUNC_NAND);
+
+			pinmux_tristate_disable(PINGRP_KBCA);
+			pinmux_tristate_disable(PINGRP_KBCC);
+			pinmux_tristate_disable(PINGRP_KBCD);
+			pinmux_tristate_disable(PINGRP_KBCE);
+			pinmux_tristate_disable(PINGRP_KBCF);
+
+			bad_config = 0;
+			break;
 		}
 		break;
 
diff --git a/arch/arm/include/asm/arch-tegra20/funcmux.h b/arch/arm/include/asm/arch-tegra20/funcmux.h
index bd511db..c986b93 100644
--- a/arch/arm/include/asm/arch-tegra20/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra20/funcmux.h
@@ -60,6 +60,7 @@  enum {
 
 	/* NAND flags */
 	FUNCMUX_NDFLASH_ATC = 0,
+	FUNCMUX_NDFLASH_KBC_8_BIT,
 };
 
 /**