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.

ioctl TIOCSSERIAL fails with dm814x EZSDK

Hi,

All of our products have serial port interfaces for user configuration, which can themselves be changed (e.g. baud rate).  On our previous AM33xx-based projects, we were able to change serial port parameters on-the-fly using ioctl(TIOCSSERIAL) - port type, port num, baud rate, base divisor, and so on.  But when I tried running the same code on DM814x (EZSDK 5.05.02.00), I get a failure.  I traced the problem to uart_set_info() in drivers/serial/serial_core.c, which in turn calls this function in drivers/serial/omap-serial.c:

static int
serial_omap_verify_port(struct uart_port *port, struct serial_struct *ser)
{
        /* we don't want the core code to modify any port params */
        dev_dbg(port->dev, "serial_omap_verify_port+\n");
        return -EINVAL;
}
It appears that any attempt to set parameters will always fail, regardless of the actual values.  
So .. is TIOCSSERIAL supposed to be supported?  If not, how should OMAP UART device properties be changed on-the-fly?
Thanks,
Dan -
  • Hello Dan,

    I will try to check this or to involve someone.

    I will let you know, when I have something.

    Best Regards,

    Margarita

  • Hello,


    are there any news on how custom baudrates can be set using the ioctl command TIOCSSERIAL? I also need to set custom baudrates (on an AM335) and as it looks like the code in serial.c also returns -1 so that the setting of the baudrate will fail.

    static int
    serial_omap_verify_port(struct uart_port *port, struct serial_struct *ser)
    {
        /* we don't want the core code to modify any port params */
        dev_dbg(port->dev, "serial_omap_verify_port+\n");
        return -EINVAL;
    }


    Thanks a lot in advance for your reply on this!

    Best Regards,

    Thomas

  • Thomas,

    TI did not express interest in supporting dynamic baud rate changes of any kind, much less of custom rates.  However, the attached changes were sufficient for DM814x.

    Good luck.

    custom_baud.patch.doc
  • Daniel,

    thanks for the info and providing the changes! I will give it a try.

    I am bit wondering, because especially for UART based automotive communication protocols such as KWP2000 and ISO9141 custom baudrates are required and even the capability to change those dynmaically. Therefore I am surprised that TI does not support this kind of feature.

    ... maybe a TI expert can post info regarding the reason not to support any dynamic baudrate change nor any custom baudrates and if there are any plans for the future to do so (e.g. for AM335 and others).

    Regards,

    Thomas

  • Hello Daniel,

    good news, the patch also works with the AM335! I set the baudrate to a custom baudrate resulting in a custom divisor and mesured the correct bit time.

    Thanks a lot for providing the patch!

    Regards,

    Thomas