[U-Boot] [PATCH 1/8] imx25: Add new hardware registers
Benoît Thébaudeau
benoit.thebaudeau.dev at gmail.com
Sun May 18 23:42:52 CEST 2014
.Dear Thomas Diener,
On Thu, May 15, 2014 at 4:34 PM, <dietho at gmx.de> wrote:
> From: Thomas Diener <dietho at gmx.de>
>
> Signed-off-by: Thomas Diener <dietho at gmx.de>
[...]
> diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h b/arch/arm/include/asm/imx-common/iomux-v3.h
> index dec11a1..d71d676 100644
> --- a/arch/arm/include/asm/imx-common/iomux-v3.h
> +++ b/arch/arm/include/asm/imx-common/iomux-v3.h
> @@ -58,14 +58,18 @@ typedef u64 iomux_v3_cfg_t;
>
> #define MUX_MODE_SHIFT 36
> #define MUX_MODE_MASK ((iomux_v3_cfg_t)0x1f << MUX_MODE_SHIFT)
> +#define MUX_MODE_SION_SHIFT 40
> +#define MUX_MODE_SION_MASK ((iomux_v3_cfg_t)0x1 << MUX_MODE_SION_SHIFT)
> #define MUX_PAD_CTRL_SHIFT 41
> #define MUX_PAD_CTRL_MASK ((iomux_v3_cfg_t)0x3ffff << MUX_PAD_CTRL_SHIFT)
> #define MUX_SEL_INPUT_SHIFT 59
> #define MUX_SEL_INPUT_MASK ((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT)
>
> #define MUX_MODE_SION ((iomux_v3_cfg_t)IOMUX_CONFIG_SION << \
> - MUX_MODE_SHIFT)
> + MUX_MODE_SHIFT)
> #define MUX_PAD_CTRL(x) ((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
> +#define MUX_SEL_INPUT(x) ((iomux_v3_cfg_t)(x) << MUX_SEL_INPUT_SHIFT)
> +
>
> #define IOMUX_PAD(pad_ctrl_ofs, mux_ctrl_ofs, mux_mode, sel_input_ofs, \
> sel_input, pad_ctrl) \
> @@ -79,6 +83,13 @@ typedef u64 iomux_v3_cfg_t;
> #define NEW_PAD_CTRL(cfg, pad) (((cfg) & ~MUX_PAD_CTRL_MASK) | \
> MUX_PAD_CTRL(pad))
>
> +#define NEW_SEL_INPUT(cfg, input) (((cfg) & ~MUX_SEL_INPUT_MASK) | \
> + MUX_SEL_INPUT(input))
> +
> +#define SET_MODE_SION(cfg) (((cfg) | MUX_MODE_SION_MASK))
> +
> +#define CLEAR_MODE_SION(cfg) (((cfg) & ~MUX_MODE_SION_MASK))
> +
> #define __NA_ 0x000
> #define NO_MUX_I 0
> #define NO_PAD_I 0
If you need these additions, it just means that iomux-mx25.h is
broken, so please fix it and change nothing here.
For SION, the rules are:
- iomux-mx25.h should never set it, except for pin modes that can not
work without it. E.g., SION should not be set for
MX25_PAD_UPLL_BYPCLK__GPIO_3_16.
- If a board needs it for a pin, e.g. for an output GPIO that needs
to be sensed, then MUX_MODE_SION should be OR-ed to the pad used in
the initialization, e.g. "MX25_PAD_UPLL_BYPCLK__GPIO_3_16 |
MUX_MODE_SION".
For the input paths, a unique pad definition should exist in
iomux-mx25.h. E.g. MX25_PAD_CSI_D2__CSPI3_MOSI in iomux-mx25.h has
neither an input selection register nor an input path, which does not
make sense according to the reference manual, so this should just be
fixed. Your NEW_SEL_INPUT() in 6/8 would also fail here with the lack
of input selection register.
[...]
Best regards,
Benoît
More information about the U-Boot
mailing list