This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Activating UART1

Hi all,

I'm working with a DM368 based custom board. I'm trying to get the UART1 working so that the dm368 can talk to a atmega168. UART0 is being used for debugging with PC.

I am under the impression that the UART1 is not set up at all and have to be done from scratch. 

According to the schematics I was given, UART_TXD is in GIO16 and UART_RXD is in GIO17. In the EVM, these pins are also used by EMAC, but I'm not using that here.

My work so far:

have modified in dm365.c:

MUX_CFG(DM365, UART1_TXD, 3,   15,    3,    3,  false)   // NOTE: in the schematics it was GIO16 and 17,
MUX_CFG(DM365, UART1_RXD, 3,   17,    3,    3,  false)   // but here it came as 15 and 17 default.

//MUX_CFG(DM365, UART1_RTS, 3, 23, 3, 1, false) //Commenting these out doesn't seem to make a difference
//MUX_CFG(DM365, UART1_CTS, 3, 21, 3, 1, false) //and there is no such thing for UART0

//MUX_CFG(DM365, EMAC_TX_EN, 3, 17, 3, 1, false)  //Assuming is it interfering with the UART1?
//MUX_CFG(DM365, EMAC_TX_CLK, 3, 15, 3, 1, false)

and added in serial.c:

    davinci_psc_config(DAVINCI_GPSC_ARMDOMAIN, 0, DAVINCI_LPSC_SPI, 0); //Not sure if this is important or not.

    davinci_cfg_reg(DM365_UART1_TXD);
    davinci_cfg_reg(DM365_UART1_RXD);

corrected the uart1 base address in serial.h:

#define DAVINCI_DM36X_UART1_BASE    (IO_PHYS + 0x106000) //it was an empty address before.

I didn't change the clock in dm365.c. It is already:

static struct clk uart1_clk = {
    .name        = "uart1",
    .parent        = &pll1_sysclk4,
    .lpsc        = DAVINCI_LPSC_UART1,
};

if i run cat /proc/tty/driver/serial, it shows:

serinfo:1.0 driver revision:
0: uart:16550A mmio:0x01C20000 irq:40 tx:10255 rx:264 RTS|CTS|DTR|DSR
1: uart:16550A mmio:0x01D06000 irq:41 tx:0 rx:0 brk:1 CTS|DSR

Note that DTR and RTS is not present like in UART0, so the bus may not be fully ready to communicate properly.

If I echo something in UART1, the TX and RX count increases (RX increases without pattern, could be atmega168 issue). There is also a new 'fe' field that shows up and increases its count.

The atmel is suppose to be fairly simple for setting up UART, so I wanted to make sure I got the dm365 right before I start with the Atmel.

Any help would be much appreciated.