[U-Boot] [PATCH 3/6] tegra: Add a function mux feature

Mike Frysinger vapier at gentoo.org
Thu Nov 24 00:36:37 CET 2011


On Wednesday 23 November 2011 17:59:05 Simon Glass wrote:
> --- /dev/null
> +++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
>
> +void funcmux_select(enum periph_id id, int func)
> +{
> +	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);
> +		break;
> +
> +	case PERIPH_ID_UART2:
> +		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);
> +		break;
> +
> +	default:
> +		debug("%s: invalid periph_id %d", __func__, id);
> +		break;
> +	}
> +}

i don't know anything about the tegra pinmux details, but the way we setup the 
defines in the Blackfin code was to encode all of the bits.  thus we didn't need 
to switch() on any of the id's, we just unpacked the values at runtime with 
bitshifts/masks.

> --- /dev/null
> +++ b/arch/arm/include/asm/arch-tegra2/funcmux.h

needs ifdef protection against multiple inclusion
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111123/66625749/attachment.pgp>


More information about the U-Boot mailing list