MX6X:
CSI0_DAT10 ---->UART1_TXD
CSI0_DAT11 ----> UART1_RXD
UART modification in uboot
File: R13.2\uboot-imx\include\configs\mx6q_arm2.h
(注意:不同的板子对应不同的型号)
From
#define CONFIG_MXC_UART
#define CONFIG_UART_BASE_ADDR UART4_BASE_ADDR
To
#define CONFIG_MXC_UART
#define CONFIG_UART_BASE_ADDR UART1_BASE_ADDR
File:R13.2\uboot-imx\board\freescale\mx6q_arm2\mx6q_arm2.c
(注意:通常这个地方需要改的,查看对应手册看io口)
From
/* UART4 TXD */
mxc_iomux_v3_setup_pad(MX6Q_PAD_KEY_COL0__UART4_TXD);
/* UART4 RXD */
mxc_iomux_v3_setup_pad(MX6Q_PAD_KEY_ROW0__UART4_RXD);
To
/* UART1 TXD */
mxc_iomux_v3_setup_pad(MX6Q_PAD_CSI0_DAT10__UART1_TXD);
/* UART1 RXD */
mxc_iomux_v3_setup_pad(MX6Q_PAD_CSI0_DAT11__UART1_RXD);
UART modification in Kernel
File: R13.2\kernel_imx\arch\arm\mach-mx6\board-mx6q_arm2.h
(注意:通常这个地方是需要改的,查看对应的手册看io口)
Form
/* UART4 for debug */
MX6Q_PAD_KEY_COL0__UART4_TXD,
MX6Q_PAD_KEY_ROW0__UART4_RXD,
To
/* UART1 for debug */
MX6Q_PAD_CSI0_DAT10__UART1_TXD,
MX6Q_PAD_CSI0_DAT11__UART1_RXD,
File: R13.2\kernel_imx\arch\arm\mach-mx6\board-mx6q_arm2.c
From
static inline void mx6_arm2_init_uart(void)
{
imx6q_add_imx_uart(3, NULL);
imx6q_add_imx_uart(1, &mx6_arm2_uart1_data);
}
To
static inline void mx6_arm2_init_uart(void)
{
imx6q_add_imx_uart(0, NULL);
imx6q_add_imx_uart(1, &mx6_arm2_uart1_data);
}
File: R13.2\kernel_imx\arch\arm\mach-mx6\board-mx6q_arm2.c
From
static void __init mx6_timer_init(void)
{
struct clk *uart_clk;
#ifdef CONFIG_LOCAL_TIMERS
twd_base = ioremap(LOCAL_TWD_ADDR, SZ_256);
BUG_ON(!twd_base);
#endif
mx6_clocks_init(32768, 24000000, 0, 0);
uart_clk = clk_get_sys("imx-uart.0", NULL);
early_console_setup(UART4_BASE_ADDR, uart_clk);
}
To
static void __init mx6_timer_init(void)
{
struct clk *uart_clk;
#ifdef CONFIG_LOCAL_TIMERS
twd_base = ioremap(LOCAL_TWD_ADDR, SZ_256);
BUG_ON(!twd_base);
#endif
mx6_clocks_init(32768, 24000000, 0, 0);
uart_clk = clk_get_sys("imx-uart.0", NULL);
early_console_setup(UART1_BASE_ADDR, uart_clk);
}
File: R13.2\kernel_imx\arch\arm\plat-mxc\include\mach\uncompress.h
(注意:对应板子的型号来搞,并不是一定根据里面的去搞)
From
case MACH_TYPE_MX6Q_ARM2:
uart_base = MX6Q_UART4_BASE_ADDR;
break;
case MACH_TYPE_MX6Q_SABRELITE:
uart_base = MX6Q_UART2_BASE_ADDR;
break;
case MACH_TYPE_MX6Q_SABRESD:
uart_base = MX6Q_UART1_BASE_ADDR;
break;
case MACH_TYPE_MX6Q_SABREAUTO:
uart_base = MX6Q_UART4_BASE_ADDR;
break;
default:
break;
To
case MACH_TYPE_MX6Q_ARM2:
uart_base = MX6Q_UART1_BASE_ADDR;
break;
case MACH_TYPE_MX6Q_SABRELITE:
uart_base = MX6Q_UART2_BASE_ADDR;
break;
case MACH_TYPE_MX6Q_SABRESD:
uart_base = MX6Q_UART1_BASE_ADDR;
break;
case MACH_TYPE_MX6Q_SABREAUTO:
uart_base = MX6Q_UART4_BASE_ADDR;
break;
default:
break