From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Setup NS16550 specific parameters from platform code
Date: Wed, 13 Jul 2011 13:19:04 +0200 [thread overview]
Message-ID: <m2aaciwhqv.fsf@ohwell.denx.de> (raw)
In-Reply-To: <C82BA3053CFD354AACBD25EFBD2A4EC603F00825B3@dbde02.ent.ti.com> (Gururaja Hebbar's message of "Tue, 12 Jul 2011 17:39:00 +0530")
Hi Gururaja,
>
> For our upcoming SOC, we have a situation where in we need to
> configure UART console at runtime. Our SOC makes use of NS16550.
>
> I looked through the u-boot tree & found several references for doing the same.
>
> hebbar at linux- server:~/projects/u-boot-git$ gr NS16550_init *
> board/sheldon/simpc8313/simpc8313.c:145: NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
> board/ml2/serial.c:45: (void) NS16550_init (COM_PORTS[0], clock_divisor);
> board/ml2/serial.c:48: (void) NS16550_init (COM_PORTS[1], clock_divisor);
> board/MAI/AmigaOneG3SE/serial.c:157: NS16550_init (Com0, clock_divisor);
> board/MAI/AmigaOneG3SE/serial.c:244: NS16550_init (Com0, clock_divisor);
> board/freescale/mpc8313erdb/mpc8313erdb.c:138: NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
> board/freescale/mpc8315erdb/mpc8315erdb.c:239: NS16550_init((NS16550_t)(CONFIG_SYS_IMMR + 0x4500),
> board/bmw/serial.c:45: NS16550_init (CONFIG_CONS_INDEX - 1, clock_divisor);
> board/bmw/ns16550.c:16:volatile struct NS16550 *NS16550_init (int chan, int baud_divisor)
> board/mvblue/mvblue.c:45: NS16550_init (console, clock_divisor);
> board/Marvell/common/serial.c:101: (void) NS16550_init (0, clock_divisor);
> board/Marvell/common/serial.c:104: (void) NS16550_init (1, clock_divisor);
> board/Marvell/common/ns16550.c:20:volatile struct NS16550
> *NS16550_init (int chan, int baud_divisor)
> board/Marvell/common/ns16550.h:92:volatile struct NS16550 *
> NS16550_init(int chan, int baud_divisor);
> board/amirix/ap1000/serial.c:43: (void) NS16550_init (COM_PORTS[0], clock_divisor);
> board/evb64260/serial.c:103: (void)NS16550_init(COM_PORTS[0], clock_divisor);
> board/evb64260/serial.c:106: (void)NS16550_init(COM_PORTS[1], clock_divisor);
>
>
> I would like to know whether this approach is correct and whether this
> approach is still allowed in current u-boot.
We know that this situation is really, ahem, far from perfect but no one
took the time to rewrite that to use only common infrastructure.
> If not, what is the correct approach? I am also looking at
> CONFIG_SERIAL_MULTI.
We should strive to handle _all_ 16550 compatible parts with only one
driver. Actually this should be drivers/serial/ns16550.c. Please try
to fit this into your upcoming port. (Only recently we did indeed remove
some more duplicates of this code.)
Thanks (also in advance)
Detlev
--
There are two hard things in computer science: cache invalidation,
naming things, and off-by-one errors.
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
prev parent reply other threads:[~2011-07-13 11:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 12:09 [U-Boot] Setup NS16550 specific parameters from platform code Hebbar, Gururaja
2011-07-13 11:19 ` Detlev Zundel [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=m2aaciwhqv.fsf@ohwell.denx.de \
--to=dzu@denx.de \
--cc=u-boot@lists.denx.de \
/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