User manual

UDOO Starting manual (beta) Version 0.3
http://www.udoo.org/
31"
6. i.MX6 Pinmuxing
6.1. Introduction
i.MX6 processor provides a dedicated controller for pin-muxing options, named
IOMUX Controller(IOMUXC). The IOMUX Controller allows to the IC to share one pad
between several functional blocks. The sharing is done by multiplexing the pad
input/output signals.
Every module requires a specific pad setting (such as pull up, keeper, and so on),
and for each signal, there are up to 8 muxing options (called ALT modes). The pad
settings parameters are controlled by the IOMUXC.
In the Linux kernel, it is necessary to define a specific file for each platform. For
UDOO, it can be found in:
<KERNEL_ROOT>/arch/arm/mach_mx6/board_mx6_seco_UDOO.c
This file contains specific drivers initializations, like ethernet, hdmi, sd, and so on..
At the beginningof the function __init mx6_seco_UDOO_board_init(void), there is
the following code:
if (cpu_is_mx6q () ) {
mxc_iomux_v3_setup_multiple_pads (mx6qd_seco_UDOO_pads,
ARRAY_SIZE (mx6qd_seco_UDOO_pads) );
printk ( "\n>UDOO quad" ) ;
}
else if ( cpu_is_mx6dl () ) {
mxc_iomux_v3_setup_multiple_pads (mx6sdl_seco_UDOO_pads,
ARRAY_SIZE (mx6sdl_seco_UDOO_pads) );
printk ( "\n>UDOO dual " ) ;
}
It recognizes the UDOO version used, and load the necessary macros needed for it.
mx6qd_seco_UDOO_pads and mx6sdl_seco_UDOO_pads are two array of macros
defined in two header files, one for each processor type. Both .h files are included in
the .c file.
<KERNEL_ROOT>/arch/arm/mach_mx6/board_mx6qd_seco_UDOO.h (QUAD)
<KERNEL_ROOT>/arch/arm/mach_mx6/board_mx6sdl_seco_UDOO.h (DUAL)
mxc_iomux_v3_setup_multiple_pads reads the macros and set the correct bits
values in registers.
Each header file defines:
custom macros for some pins
GPIOs id number (i.MX6 pins are divided in banks and identified by id. To
make them visible by the OS it is necessary to give them a single id number.
IMX_GIPO_NR provide this function).
macro s array used for pinmuxing
an array containing the pins set as GPIOs that must be configured in output
mode with high value