How to set a custom baud rate using 2.6 linux distro on MPC5200 based board?

Caruso, Nick ncaruso at irobot.com
Thu Feb 17 08:39:15 EST 2005


-----Original Message-----
From: linuxppc-embedded-bounces at ozlabs.org on behalf of Eric N. Johnson (ACD)
Sent: Tue 2/15/2005 6:55 PM
To: linuxppc-embedded at ozlabs.org
Subject: Re: How to set a custom baud rate using 2.6 linux distro on MPC5200 based board?
 

>I'm trying to set a custom baud rate (500KBaud, in case anyone cares) on 
>one of the PSCs on a MPC5200 board.
[snip]
>   serial_info.flags = ASYNC_SPD_CUST | ASYNC_LOW_LATENCY;
>    serial_info.custom_divisor = 48;  // clock on FTDI chip / 48 == 500KB
>
>    if ( ioctl(tty_fd, TIOCSSERIAL, &serial_info ) < 0) {
>      perror("config_serial_port: ioctl TIOCSSERIAL");
>      return(-1);
>    }
>
>This compiled fine under the ppc cross-dev tools we have but it fails with 
>an "invalid argument" error when run on the ppc board.

It looks like this code was written for an FTDI serial port.  The FTDI is a 
USB to Serial converter that handles baud rate generation very differently 
from a standard UART.
_______________________________________________

Yes, it was originally written for a USB-to-serial adapter.  However it is my belief that the clock divisor thing works with any serial device, including so-called 16550 devices. 

I think there may be a problem where TIOCSSERIAL doesn't work for the MPC5200 PSC uart code.  It seems that if I get the ports' attributes with TIOCGSERIAL and immediately set the same values on the same port I get an error return from the ioctl call.  I'm talking with our BSP vendor about this.

    best regards, 

      Nick Caruso
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20050216/982fad72/attachment.htm 


More information about the Linuxppc-embedded mailing list