linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Sergei Ianovich <ynvich@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Russell King <linux@arm.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	Grant Likely <grant.likely@linaro.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Arnd Bergmann <arnd@arndb.de>, Paul Bolle <pebolle@tiscali.nl>,
	Stefan Seyfried <seife+kernel@b1-systems.com>,
	James Cameron <quozl@laptop.org>,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH v4 12/21] serial: support for 16550A serial ports on LP-8x4x
Date: Wed, 16 Apr 2014 21:00:51 +0100	[thread overview]
Message-ID: <20140416210051.01bef49e@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <c4533da6-30bd-4ea4-9011-a7e3b7258e62@email.android.com>

On Wed, 16 Apr 2014 23:01:47 +0400
Sergei Ianovich <ynvich@gmail.com> wrote:

> One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> wrote:
> >> +	baud = uart_get_baud_rate(port, termios, old,
> >> +				  port->uartclk / 16 / 0xffff,
> >> +				  port->uartclk / 16);
> >> +	switch (baud) {
> >> +	case 2400:
> >> +		len |= 1;
> >> +		break;
> >> +	case 4800:
> >> +		len |= 2;
> >> +		break;
> >> +	case 19200:
> >> +		len |= 4;
> >> +		break;
> >> +	case 38400:
> >> +		len |= 5;
> >> +		break;
> >> +	case 57600:
> >> +		len |= 6;
> >> +		break;
> >> +	case 115200:
> >> +		len |= 7;
> >> +		break;
> >> +	case 9600:
> >> +	default:
> >> +		len |= 3;
> >> +		break;
> >> +	};
> >
> >Some explanation of this would be useful - eg why is it set to 7 for
> >115200 baud and 3 for 115201 baud ?
> 
> I am not related to the device vendor in any way, so please take my answers for what they are worth.
> 
> It seems that there is not enough pins to properly connect the chips to the memory bus and just you the standard 8250 UART driver. Instead, clock divisor is set using this register.
> 
> So, if you know you're asking for (115200) you get it. If you don't or guess (115201), you get the default 9600.

Thats not quite what the code actually implements though.

> This is a policy, it may not be the right way to write a driver, but it is cheap and it works.

If thats how the hardware works and only supports a few fixed rates then
fine, but for default: you need to actually update he baudrate in the
passed termios struct so that the userspace knows its request was not
matched.

Take a look how the standard 8250 termios does it.

Also looking at this and some of the other serial bits I see no
dependencies on the problematic DMA driver, so does that mean you've got
a set of pieces that can be submitted anyway while the DMA driver
discussion continues ?

Alan

  reply	other threads:[~2014-04-16 20:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1397668411-27162-7-git-send-email-ynvich@gmail.com>
     [not found] ` <1397668667-27328-1-git-send-email-ynvich@gmail.com>
2014-04-16 17:17   ` [PATCH v4 12/21] serial: support for 16550A serial ports on LP-8x4x Sergei Ianovich
2014-04-16 18:35     ` One Thousand Gnomes
2014-04-16 19:01       ` Sergei Ianovich
2014-04-16 20:00         ` One Thousand Gnomes [this message]
     [not found]           ` <20140416210051.01bef49e-mUKnrFFms3BCCTY1wZZT65JpZx93mCW/@public.gmane.org>
2014-04-16 20:32             ` Sergei Ianovich
     [not found]   ` <1397668667-27328-1-git-send-email-ynvich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-15 21:04     ` [PATCH v5] " Sergei Ianovich
2015-12-15 21:51       ` Arnd Bergmann
2015-12-16  8:04         ` Sergei Ianovich
2015-12-16 10:26           ` Arnd Bergmann
2015-12-19  8:11             ` Sergei Ianovich
2015-12-19 21:42         ` Sergei Ianovich
2015-12-17 14:50       ` Andy Shevchenko
     [not found]       ` <1450213494-21884-1-git-send-email-ynvich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-27 16:14         ` [PATCH v6] " Sergei Ianovich
     [not found]           ` <1456589675-25377-1-git-send-email-ynvich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-29 10:29             ` Andy Shevchenko
2016-02-29 13:03               ` Sergei Ianovich
     [not found]                 ` <1456750995.23036.87.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-29 14:45                   ` One Thousand Gnomes
2016-02-29 21:26           ` [PATCH v7] " Sergei Ianovich
     [not found]             ` <1456781209-11390-1-git-send-email-ynvich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-01 11:06               ` Andy Shevchenko
     [not found]                 ` <1456830401.13244.189.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-03-01 16:25                   ` Sergei Ianovich
2016-03-01 16:46                     ` Andy Shevchenko
     [not found]                       ` <1456850782.13244.208.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-03-01 17:14                         ` Sergei Ianovich
     [not found]                           ` <1456852472.23036.124.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-01 17:48                             ` Andy Shevchenko
2016-03-01 18:43                               ` One Thousand Gnomes
     [not found]                               ` <1456854532.13244.215.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-03-01 19:28                                 ` Sergei Ianovich
     [not found]                                   ` <1456860493.23036.133.camel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-01 19:53                                     ` One Thousand Gnomes
2016-03-01 19:54             ` [PATCH v8] " Sergei Ianovich
     [not found]               ` <1456862078-11795-1-git-send-email-ynvich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-01 20:08                 ` [PATCH v9] " Sergei Ianovich
     [not found]                   ` <1456862903-12392-1-git-send-email-ynvich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-01 20:23                     ` Andy Shevchenko
2016-03-01 21:25                   ` [PATCH v10] " Sergei Ianovich
2016-03-05  4:26                     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140416210051.01bef49e@alan.etchedpixels.co.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jslaby@suse.cz \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=pebolle@tiscali.nl \
    --cc=quozl@laptop.org \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --cc=seife+kernel@b1-systems.com \
    --cc=ynvich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).