* How to set a custom baud rate using 2.6 linux distro on MPC5200 based board?
@ 2005-02-15 21:33 Caruso, Nick
[not found] ` <712A2DEC228C7448978CBD7A7AD5B090592CE2@fever.wardrobe.irob ot.com>
0 siblings, 1 reply; 3+ messages in thread
From: Caruso, Nick @ 2005-02-15 21:33 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 897 bytes --]
I'm trying to set a custom baud rate (500KBaud, in case anyone cares) on one of the PSCs on a MPC5200 board.
The PSC is configured as a serial port and is visible and usable under the 2.6 kernel we're using.
I used to use the following code under 2.4 on an x86 board:
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.
I'm busy reading the driver sources but thought someone on the list might be able to help me out.
thanks!
--nick caruso
irobot corporation
intelligent vehicles
r-gator project
[-- Attachment #2: Type: text/html, Size: 1628 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: How to set a custom baud rate using 2.6 linux distro on MPC5200 based board?
@ 2005-02-16 21:39 Caruso, Nick
0 siblings, 0 replies; 3+ messages in thread
From: Caruso, Nick @ 2005-02-16 21:39 UTC (permalink / raw)
To: Eric N. Johnson (ACD), linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]
-----Original Message-----
From: linuxppc-embedded-bounces@ozlabs.org on behalf of Eric N. Johnson (ACD)
Sent: Tue 2/15/2005 6:55 PM
To: linuxppc-embedded@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
[-- Attachment #2: Type: text/html, Size: 2346 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-16 21:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-15 21:33 How to set a custom baud rate using 2.6 linux distro on MPC5200 based board? Caruso, Nick
[not found] ` <712A2DEC228C7448978CBD7A7AD5B090592CE2@fever.wardrobe.irob ot.com>
2005-02-15 23:55 ` Eric N. Johnson (ACD)
-- strict thread matches above, loose matches on Subject: below --
2005-02-16 21:39 Caruso, Nick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox