[U-Boot] [PATCH V2 06/13] ARM: tegra: pinctrl: remove duplication

Simon Glass sjg at chromium.org
Tue Mar 25 03:23:34 CET 2014


Hi Stephen,

On 21 March 2014 11:28, Stephen Warren <swarren at wwwdotorg.org> wrote:
> From: Stephen Warren <swarren at nvidia.com>
>
> Much of arch/arm/cpu/tegra*-common/pinmux.c is identical. Remove the
> duplication by creating pinmux-common.c for all the identical code.
>
> This leaves:
> * arch/arm/include/asm/arch-tegra*/pinmux.h defining only the names of
>   the various pins/pin groups, drive groups, and mux functions.
> * arch/arm/cpu/tegra*-common/pinmux.c containing only the lookup table
>   stating which pin groups support which mux functions.
>
> The code in pinmux-common.c is semantically identical to that in the
> various original pinmux.c, but had some consistency and cleanup fixes
> applied during migration.
>
> I removed the definition of struct pmux_tri_ctlr, since this is different
> between SoCs (especially Tegra20 vs all others), and it's much simpler to
> deal with this via the new REG/MUX_REG/... defines. spl.c, warmboot.c,
> and warmboot_avp.c needed updates due to this, since they previously
> hijacked this struct to encode the location of some non-pinmux registers.
> Now, that code simply calculates these register addresses directly using
> simple and obvious math. I like this method better irrespective of the
> pinmux code cleanup anyway.
>
> Signed-off-by: Stephen Warren <swarren at nvidia.com>

Acked-by: Simon Glass <sjg at chromium.org>

IMO it would be better for the #defines to go in the relevant header
(e.g. T20/T30) rather than having #ifdef TEGRA20 in this file. But OK.

Regards,
Simon


More information about the U-Boot mailing list