將uboot的除錯串列埠和核心到除錯串列埠由COM1改為COM2
一:UBOOT
1、修改uboot-imx\board\freescale\mx51_bbg裡的mx51_bbg.c檔案,改成需要的設定:
static void setup_uart(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);
mxc_iomux_set_input(MUX_IN_UART2_IPP_UART_RXD_MUX_SELECT_INPUT, INPUT_CTL_PATH2);
// mxc_request_iomux(MX51_PIN_UART1_RTS, IOMUX_CONFIG_ALT0);
// mxc_iomux_set_pad(MX51_PIN_UART1_RTS, pad);
// mxc_request_iomux(MX51_PIN_UART1_CTS, IOMUX_CONFIG_ALT0);
// mxc_iomux_set_pad(MX51_PIN_UART1_CTS, pad);
/* enable GPIO1_9 for CLK0 and GPIO1_8 for CLK02 */
writel(0x00000004, 0x73fa83e8);
writel(0x00000004, 0x73fa83ec);
}
2、修改uboot-imx\include\configs裡的mx51_bbg_android.h檔案,#define CONFIG_UART_BASE_ADDR UART2_BASE_ADDR ,改為串列埠2的地址,重新編譯就可以了。
二:修改核心除錯串列埠
1、核心解壓輸出資訊,核心解壓時使用的串列埠驅動是獨立於UBOOT或核心的串列埠驅動的,解壓時輸出的列印資訊的相關的程式碼在kernel_imx/arch/arm/plat-mxc/include/mach/uncompress.h內。這裡的串列埠輸出程式碼很簡單,只是往資料暫存器寫資料,並沒有對串列埠進行相關的配置,所以這裡串列埠的正常輸出需要依賴UBOOT對串列埠的正確配置。
#define MX51_UART1_BASE_ADDR 0x73fbc000
uart_base = MX51_UART1_BASE_ADDR;
改為需要到串列埠地址就可以裡!
2:修改uboot-imx\include\configs裡的mx51_bbg_android.h檔案
#define CONFIG_EXTRA_ENV_SETTINGS \
"netdev=eth0\0" \
"ethprime=FEC0\0" \
"ethaddr=00:04:9f:00:ea:d3\0" \
"bootfile=uImage\0" \
"loadaddr=0x90800000\0" \
"rd_loadaddr=0x90D00000\0" \
"bootargs=console=ttymxc1
"console=mxcuart,0x73fc0000,115200n8" \ 增加這一句。
"di1_primary gpu_nommu gpu_memory=32M calibration\0" \
"bootcmd_SD=mmc read 0 ${loadaddr} 0x800 0x2000;" \
"mmc read 0 ${rd_loadaddr} 0x3000 0x300\0" \
"bootcmd=run bootcmd_SD; bootm ${loadaddr} ${rd_loadaddr}\0" \