grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Matthias Lange <matthias.lange@kernkonzept.com>
Subject: Re: 8250 memory mapped UART
Date: Mon, 27 Mar 2017 14:31:42 -0400	[thread overview]
Message-ID: <20170327183141.GA11218@csclub.uwaterloo.ca> (raw)
In-Reply-To: <CAOifn+2mny_M=enWVN0d3huUi=qdu0Wbx2yfVzH+uGnyL3d=sw@mail.gmail.com>

On Mon, Mar 27, 2017 at 11:29:48PM +0530, Gailu Singh wrote:
> Can you please let me know how following three values are calculated in
> your patch. I am trying to understand how do I change it for my board.
> 
>       port->board.base_baud = 4000000;
>       port->board.port_offset = 0x200;
>       port->board.base_offset = 0x1000;

I would think this means:

The configuration registers for the ports starts at the PCI base address
of the device + 0x1000, and then each additional port is 0x200 above that
(so port 2 would be at 0x1200 above the base address).

A base_baud of 4000000 would normally mean the UART is fed from a 64MHz
clock source.  Pretty sure every uart I have used, the base_baud was
1/16th of the clock input (except some cases on the AM57xx where it
uses 1/13th as far as I recall.  It's a bit odd sometimes).

Many PC boards in the past have used either 1.8432MHz or sometimes
14.7456 MHz, since that gives you perfect 115200 for the first one,
and 921600 for the second one, as well as all integer divisions of those.
After all with a base_baud of 4000000, a UART that only does integer
divisions would give you 117647 when you ask for 115200, which is
generally close enough.  Of course some newer designs allow fractional
divisions and can hence generate rather good results even with a non
ideal input clock.

-- 
Len Sorensen


      reply	other threads:[~2017-03-27 18:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  5:53 8250 memory mapped UART Gailu Singh
2017-03-01  6:15 ` Fwd: " Gailu Singh
2017-03-01  7:00   ` Andrei Borzenkov
2017-03-01  9:38     ` Matthias Lange
2017-03-01  9:51       ` Gailu Singh
2017-03-01  9:57         ` Gailu Singh
2017-03-01 10:32           ` Gailu Singh
2017-03-01 10:57             ` Matthias Lange
2017-03-01 11:04               ` Gailu Singh
2017-03-03 12:03                 ` Gailu Singh
2017-03-03 13:41                   ` Matthias Lange
2017-03-03 14:07                     ` Gailu Singh
2017-03-24 17:29                     ` Gailu Singh
2017-03-27 17:59                       ` Gailu Singh
2017-03-27 18:31                         ` Lennart Sorensen [this message]

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=20170327183141.GA11218@csclub.uwaterloo.ca \
    --to=lsorense@csclub.uwaterloo.ca \
    --cc=grub-devel@gnu.org \
    --cc=matthias.lange@kernkonzept.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).