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

Stephen Warren swarren at wwwdotorg.org
Tue Mar 24 16:21:02 CET 2015


On 03/24/2015 06:29 AM, Marcel Ziswiler wrote:
> From: Lucas Stach <dev at lynxeye.de>
>
> Even the 8-bit 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.

I would rather not touch ATC like this; see below.

> diff --git a/arch/arm/mach-tegra/tegra20/funcmux.c b/arch/arm/mach-tegra/tegra20/funcmux.c

Note that this will conflict with:

09f455dca749 ARM: tegra: collect SoC sources into mach-tegra

... which moved that file.

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

What if ATC is actually used for some purpose other than GMI? This will 
corrupt the pinmux for that pingroup, and prevent the other peripheral 
from working. For example, PERIPH_ID_SDMMC4/FUNCMUX_SDMMC4_ATC_ATD_8BIT 
actively uses ATC, and this change might break it if both are used 
together on one board.

The best approach is to simply not use funcmux at all, but rather 
program the entire pinmux from a table. That guarantees no conflicts. 
Boards using later SoCs take this approach.

Alternatively, have the board code (rather than funcmux) select some 
other value for ATC. This allows the board code to select the exact 
correct value for that pingroup once (thus avoiding multiple changes to 
the pinmux for that pingroup, which could cause glitches), and 
guarantees that the common code will never corrupt that setting.


More information about the U-Boot mailing list