User`s guide
i.MX53 System Development User’s Guide, Rev. 1
Freescale Semiconductor 14-1
Chapter 14
Registering a New UART Driver
Because Linux already has a UART driver for the i.MX53, configure the UART pads on the IOMUX
registers. This chapter explains how to configure the UART pads, enable the UART driver, and test that
the UART was set up correctly.
14.1 Configuring UART Pads on IOMUX
The IOMUX register must be set up correctly before the UART function can be used. This section provides
example code to show how to do this.
Pads are configured using the file linux/arch/arm/mach-mx5/<platform>.c, with <platform> replaced by
the appropriate platform file name (see Section 14.4, “File Names and Locations,” for the platform file
names). For example, the machine layer file used on the i.MX53 reference boards are
linux/arch/arm/mach-mx5/mx53_<reference board name>.c.
The iomux-mx53.h file contains the definitions for all i.MX53 pads. Configure the UART pads as follows:
/* UART3 */
#define MX53_PAD_ATA_CS_0__UART3_TXD IOMUX_PAD(0x61C, 0x29C, 4, 0x0, 0, MX53_UART_PAD_CTRL)
#define MX53_PAD_ATA_CS_1__UART3_RXD IOMUX_PAD(0x620, 0x2A0, 4, 0x888, 3, MX53_UART_PAD_CTRL)
The structures for configuring the pads are contained in the mx53_<reference board name>.c file. Update
them so that they match the configured pads’ definition as shown above. The code below shows the
non-updated structures:
static struct pad_desc mx53common_pads[] = {
…
…
…
MX53_PAD_ATA_CS_0__UART3_TXD,
MX53_PAD_ATA_CS_1__UART3_RXD,
…
…
…
};
Use the following function to set up the pads on the init function mx53_<reference board name>_io_init
(found in the
mx53_<reference board name>.c file).
mxc_iomux_v3_setup_multiple_pads(mx53common_pads, ARRAY_SIZE(mx53common_pads));
The UART driver is now implemented and needs to be enabled.