[U-Boot] [PATCH] tegra: pinmux: fix FUNCMUX_NDFLASH_KBC_8_BIT

Stephen Warren swarren at wwwdotorg.org
Tue Jan 22 17:24:31 CET 2013


On 01/21/2013 05:20 PM, Lucas Stach wrote:
> Even the 8bit case needs KBCB configured, as pin D7 is located in this
> pingroup. Also pingroup ATC seems to come out of reset with config set
> to NAND, so we need to explictly configure some other function to this
> group in order to avoid clashing settings.

> diff --git a/arch/arm/cpu/tegra20-common/funcmux.c b/arch/arm/cpu/tegra20-common/funcmux.c

> @@ -266,17 +266,25 @@ int funcmux_select(enum periph_id id, int config)
>  			break;
>  		case FUNCMUX_NDFLASH_KBC_8_BIT:
...
> +			/*
> +			 * configure pingroup ATC to something unrelated to
> +			 * avoid ATC overriding KBC
> +			 */
> +			pinmux_set_func(PINGRP_ATC, PMUX_FUNC_GMI);
> +

This gets a bit dangerous; what if pingroup ATC was already configured
for some function other than NAND or GMI? This code will then break that
setting. I would suggest one of the following alternatives:

1) Use the new pinmux_avoid_func() function implemented in the patch
that I just sent.

2) Move Tegra20 over to the new board-wide pinmux style that Tegra30
uses, where the entire pinmux is initialized in one shot. This will
completely avoid any kind of uninitialized pinmux settings, and to some
extent is the only sensible thing to do on a device like Tegra which has
the potential for conflicts like this patch tries to avoid.



More information about the U-Boot mailing list