RE: [PATCH] tty/serial: add support for Xilinx PS UART

From: John Linn
Date: Wed Apr 20 2011 - 09:43:52 EST


> -----Original Message-----
> From: Alan Cox [mailto:alan@xxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, April 20, 2011 3:25 AM
> To: John Linn
> Cc: linux-kernel@xxxxxxxxxxxxxxx; linux-serial@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] tty/serial: add support for Xilinx PS UART
>
> > > > + /* Min baud rate = 6bps and Max Baud Rate is 10Mbps for
> 100Mhz
> > > clk */
> > > > + baud = uart_get_baud_rate(port, termios, old, 0,
460800);
> > > > + xuartps_set_baud_rate(port, baud);
> > >
> > > So why pass 460800 ?
> >
> > Seems like 115200 is better number.
>
> Well if it can do 10Mbit why not pass 10Mbit as the upper limit ?

The only reason would be because we don't test it, but yes that could be
done.

>
> > > And set the baud rate (see 8250.c for an example). Note that the
> > helper
> > > functions know about mapping slight errors so if you are asked for
> > 9600
> > > and the hardware does 9575 it will report B9600 as you'd expect
not
> do
> > > something crazy.
> > >
> >
> > Sorry I didn't follow what you meant above. The h/w is a bit
> different
> > with it's
> > baud rate settings due to 2 different dividers.
>
> After you've worked out what baud rate you actually set do
>
> /* Don't rewrite B0 */
> if (tty_termios_baud_rate(termios))
> tty_termios_encode_baud_rate(termios, baud, baud);
>
>
> which will ensure that the termios reflects the actual rate.

Thanks for clarifying, I'll look at that.

-- John

>
> Alan


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/