CPU model: mx515
CPU core: arm cortexa8
MX51 uboot changed the Console
Freescale uboot_imx uses uart1 as the console by default. Our project uart2 communicates with the microcontroller.
To facilitate debugging and test uart2, I use uart2 as the console to exclude uart2 code settings.
The method is as follows:
1. Set uart2 in the configuration file
Feilong @ feilong-desktop :~ /Uboot-IMX $ SVN diff include/configs/mx51_vdphone.h
Index: Include/configs/mx51_vdphone.h
========================================================== ======================================
--- Include/configs/mx51_vdphone.h
(Revision 184)
++ Include/configs/mx51_vdphone.h
(Working copy)
-68,7 + 68,8 @@
* Hardware drivers
*/
# Define config_mx51_uart
1
-# Define config_mx51_uart1
1
+ // # Define config_mx51_uart1
1
+ # Define config_mx51_uart2
1
@-118, 7 + 119,7 @@
/* Allow to overwrite serial and ethaddr */
# Define config_env_overwrite
-# Define config_cons_index
1
+ # Define config_cons_index
2
# Define config_baudrate
115200
# Define config_sys_baudrate_table
{9600,192 00, 38400,576 00, 115200}
2. Configure the uart2 pin in uart2 mode in the Board initialization file.
Feilong @ feilong-desktop :~ /Uboot-IMX $ SVN diff board/Freescale/mx51_bbg/mx51_bbg.c
Index: Board/Freescale/mx51_bbg/mx51_bbg.c
========================================================== ======================================
--- Board/Freescale/mx51_bbg/mx51_bbg.c
(Revision 136)
++ Board/Freescale/mx51_bbg/mx51_bbg.c
(Working copy)
@-238,6 + 238,20 @@
Writel (0x00000004, 0x73fa83ec );
}
+ Static void setup_uart2 (void)
+ {
+
Unsigned int pad = pad_ctl_hys_enable | pad_ctl_pke_enable |
+
Pad_ctl_pue_pull | pad_ctl_drv_high;
+
Mxc_request_iomux (mx51_pin_uart2_rxd, iomux_config_alt0 );
+
Mxc_iomux_set_pad (mx51_pin_uart2_rxd, pad | pad_ctl_sre_fast );
+
Mxc_request_iomux (mx51_pin_uart2_txd, iomux_config_alt0 );
+
Mxc_iomux_set_pad (mx51_pin_uart2_txd, pad | pad_ctl_sre_fast );
+
/* Enable gpio00009 for clk0 and gpio00008 for clk02 */
+
Writel (0x00000004, 0x73fa83e8 );
+
Writel (0x00000004, 0x73fa83ec );
+}
+
+
Void setup_nfc (void)
{
/* Enable NFC iomux */
@-, 6 + @@
GD-> BD-> bi_boot_params = phys_sdram_1 + 0x100;
Setup_uart ();
+
Setup_uart2 ();
Setup_nfc ();
Setup_expio ();
Setup_fec ();
Feilong @ feilong-desktop :~ /Uboot-IMX $