I'm testing a AM3874 board with DS-5 IDE tool(similar to CCS).
Through DS-5, f/w are downloaded to internal ram(ox40300000). Currently, following boot mode is used.
BTMODE[4:0] 1st 2nd 3rd
11010 XIP(Mux0) UART SPI
With XIP boot mode, if boot image exists at Nor Flash, then system boots from flash successfully.
At this case, when we connect DS-5 debugger and execute uart0 program, we can’t see no output. uart0 doesn’t work.
But If boot image doesn’t exists at Flash, boot loader starts UART boot .
In this case, when we execute uart0 program, we can see “CCCCCCCC” through UART0.
That is, symptom is that UART0 works fine only when a board boots from UART0.
What’s wrong?
Followings are code for UART0.
/* UARTs */
__raw_writel(0x2, CM_ALWON_UART_0_CLKCTRL);
while(__raw_readl(CM_ALWON_UART_0_CLKCTRL) != 0x2);
/* UART softreset */
regVal = __raw_readl(UART_SYSCFG);
regVal |= 0x2;
__raw_writel(regVal, UART_SYSCFG);
while ((__raw_readl(UART_SYSSTS) & 0x1) != 0x1);
/* Disable smart idle */
regVal = __raw_readl(UART_SYSCFG);
regVal |= (1 << 3);
__raw_writel(regVal, UART_SYSCFG);
/* Baud Rate Setting */
regVal = __raw_readl(UART_LCR);
regVal |= 0x80;
__raw_writel(regVal, UART_LCR);
__raw_writel(0x1a, UART_DLL);
__raw_writel(0x00, UART_DLH);
regVal = __raw_readl(UART_LCR);
regVal &= (~0x00000080);
__raw_writel(regVal, UART_LCR);
regVal = __raw_readl(UART_LCR);
regVal |= 0x03;
__raw_writel(regVal, UART_LCR);
regVal = __raw_readl(UART_FCR);
regVal |= 0x01;
__raw_writel(regVal, UART_FCR);
__raw_writel(0, UART_MDR);