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.

Problem with UART1 Transmit on DM6467

Hi all,

I try to use UART1 on DM6467

After some hacks, we have the following in booting messages

 ************************************************************************************

Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
Registering platform device 'serial8250'. Parent at platform
ttyS0 at MMIO 0x1c20000 (irq = 40) is a ST16654
ttyS1 at MMIO 0x1c20400 (irq = 41) is a ST16650V2
************************************************************************************

After login, I got the following when checking some status as suggested

#stty -a < /dev/tts/1
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

# cat /proc/tty/driver/serial

serinfo:1.0 driver revision:
0: uart:ST16654 port:00000000 irq:40 tx:2299 rx:33 RTS|DTR|RI
1: uart:ST16650V2 port:00000000 irq:41 tx:0 rx:0 CTS|DSR

************************************************************************************

when I do a "echo 55aa > /dev/tts/1",get a shell command prompt:

"serial8250: too much work for irq41"

and no data was transmitted.

Any ideas? Thanks

  • Another customer had a smiliar issue a while back and it turned out to be the MDR1 register setting was incorrect.  Can you check this register to ensure it is set appropriately?

  • Thank you very much for your advice,uart1 is enable after the MDR1 has been setted,but it can not be send but received, I have tryed many methods to settle this question,like setting the uart1 register and checking the rx/tx pin multiplexing,but the question still can not be settled.Have you ever come up this this question?What can I do? Thanks.

  • Hi,

     

    I got the same problem with UART1 transmitt !!

    Is there any solution for this?

     where to modify the MDR1 register ? which file? which function?

     

    Thanks,

     

    Tai Chang

  • The uart1/uart2 are disabled in default,they are enable after setting MDR1.MODE_SELECT. Please read the file named  "TMS320DM646x DMSoC Universal Asynchronous Receiver/Transmitter (UART)" to find out MDR1 register addr and function.

    download:

    http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=spruer6d&fileType=pdf

  • Hi Sephrioth ,

    Thanks for reply,

    I found the MDR1 in p71 of datasheet, but I can not figure out the Offset Address (hex): 8h x S mean.

    What is the "8-bit aligned addresses" mean in page 38 ??

     Update:

    I find the piece code on internet and add below in board_init()

     ptr_ier          = (volatile int *)IO_ADDRESS(DAVINCI_UART1_BASE+0x4);
     *ptr_ier         = 0x0; //disable int
     
     ptr_pgmgt = (volatile int *) IO_ADDRESS(DAVINCI_UART1_BASE+0x20); //Mode Definition Register 1 (MDR1)
     *ptr_pgmgt = 0x00; ////set to UART 16x mode.

     ptr_ier          = (volatile int *)IO_ADDRESS(DM644X_UART2_BASE+0x4);
     *ptr_ier         = 0x0; //disable int
     
     ptr_pgmgt = (volatile int *) IO_ADDRESS(DM644X_UART2_BASE+0x20);
     *ptr_pgmgt = 0x00;

    BUT, still with errors:

    root@10.32.62.100:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:ST16654 port:00000000 irq:40 tx:1882 rx:34 RTS|CTS|DTR
    1: uart:ST16654 port:00000000 irq:41 tx:0 rx:0 DSR
    2: uart:ST16654 port:00000000 irq:42 tx:0 rx:0 DSR
    root@10.32.62.100:~#
    root@10.32.62.100:~# echo a5 > /dev/tts/1
    serial8250: too much work for irq41     [:'(]
    root@10.32.62.100:~#

     

     

     

     

    Thanks

     

    Tai

     

  • Hi Chang, It seems the uart1 haven't been enabled,I get the same result just as  you did. You can put your code into the function named "serial8250_startup" in the file of "/driver/serial/8250.c".

    I am sorry that I don't know what does "8-bit aligned addresses"mean, anybody knows?[:P]

  • I have tryed many ways to set uart1, but it still can not be send but received.
    Have anyone ever come up this problem?

  • Hi Sephrioth ,

    when I execute ↓

    root@10.32.62.100:~# echo a5 > /dev/tts/1
    serial8250: too much work for irq41

    The console stop here .... do we have the same symptom?

    Then I execute  ↓

    root@10.32.62.100:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:ST16654 port:00000000 irq:40 tx:6437 rx:148 RTS|CTS|DTR
    1: uart:ST16650V2 port:00000000 irq:41 tx:4 rx:0 DSR
    2: uart:ST16650V2 port:00000000 irq:42 tx:0 rx:0 DSR

    The UART1 tx port sent 4 bytes data out..is it right?

     

    Tai

  • Yes, I got the same problem in the beginning.

     Add the code in "serial8250_startup" your problem can be solved:

        if(up->port.type == PORT_16650V2)
        {
            unsigned int tmp;
            tmp = readl(up->port.membase+(8 * 4));
            tmp &= ~(0x7);
            writel(tmp,(up->port.membase+(8 * 4)));
        }

  • Hi,

    Do you modify the "board_init()" in file "board-dm6467-evm.c" ?

    I add the code you gave in "serial8250_startup()", but the "up->port.type" is always "ST16654"  during boot up.

    I "echo a6 > /dev/tts/1" then the "serial8250_startup()"  will be called once and execute the code you gave to me.

    BUT that still have the same error "serial8250: too much work for irq41" !!!!!

     

    what happen ?   [:'(]

  • I just modify the function named "serial8250_startup", what is your montavista kernel version?

  • linux-2.6.10_mvl401_LSP_01_30_00_082

  •  Add the code in "serial8250_startup" your problem can be solved:

        if(up->port.type == PORT_16650V2)
        {
            unsigned int tmp;
            tmp = readl(up->port.membase+(8 * 4));
            tmp &= ~(0x7);
            writel(tmp,(up->port.membase+(8 * 4)));
        }

    I do as the above ,and now I can only receive the data as you said before. Have you solved this problem?

  • DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec
    Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a ST16654
    serial8250.0: ttyS1 at MMIO map 0x1c20400 mem 0xfbc20400 (irq = 41) is a ST16650V2
    serial8250 serial8250.0: unable to register port at index 2 (IO0 MEM80000 IRQ262144): -22
    serial8250 serial8250.0: unable to register port at index 3 (IO4 MEM2000bfff IRQ-1070044028): -28
    serial8250 serial8250.0: unable to register port at index 4 (IOc06a7f80 MEM420807ff IRQ-1070044028): -28

    Why IRQ is negative number?

     

  • Hi,

    Does anyone can send data through UART1 of DM6467?

    I still can't solve it.

  • This will only work if PINMUX1 is configured correctly (i.e. disable TSIF).  Then do the following.

    Using MVL 5.0, in the file board-dm6467-evm.c:

    - in the function board_init, add

      davinci_psc_config(DAVINCI_DPSC_ARMDOMAIN, DAVINCI_DM646X_LPSC_UART1);

    - in the function dm646x_setup_pinmux, add

      case DAVINCI_DM646X_LPSC_UART1:

        /* power up UART1 data */

        val = davinci_readl(DAVINCI_VDD3P3V_PWDN);

        davinci_writel(val & 0xFFFFFFBF, DAVINCI_VDD3P3V_PWDN);

        /* select UART 16x  mode */

        val = davinci_readl(DAVINCI_UART1_BASE + 0x20);

        davinci_writel(val & 0xFFFFFFF8, DAVINCI_UART1_BASE + 0x20);

        /* generate THR interrupt */

        val = davinci_readl(DAVINCI_UART_BASE + 0x40);

        davinci_write(val | 0x00000008, DAVINCI_UART_BASE + 0x40);

        break;