All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] serial ifdef mess
Date: Tue, 20 Sep 2011 00:40:03 -0400	[thread overview]
Message-ID: <201109200040.04589.vapier@gentoo.org> (raw)
In-Reply-To: <CALButCLRg0x1yKu530tVkY1JE=PR-PQaYsENsafwfNpoRgge7w@mail.gmail.com>

On Monday, September 19, 2011 21:07:48 Graeme Russ wrote:
> a) Use a particular serial driver directly - perfect if you have only one
>    serial port (or don't care about the others)

yes.  this is what we have today with !SERIAL_MULTI.  every serial driver 
implements serial_{init,puts,putc,tstc,getc,setbrg,set_baud}.  this code works 
for exactly one device and is extremely thin.  in the case of Blackfin UARTs, 
serial_putc() does two things: wait for the hardware FIFO to free up, and then 
writes the char to the hardware registers.  serial_tstc() is a bit test of a 
single hardware status register read.  you really can't get any simpler than 
this.

> b) Use the SERIAL_MULTI 'management layer' and 'register' each relavent
>    serial port on the board. The board will need to define a (probably
>    hard-coded) a default to handle I/O until the environment can be read
>    and the hardware initialised to actually make the serial ports
>    operational.

atm, SERIAL_MULTI provides support for "early" output by means of the 
default_serial_console() function.  but even this requires going through the 
.data section in order to lookup the func pointer to the device pointers.  
which means i dont think it works for the ports which do relocation on the 
fly.  but i dont know as i havent worked at that level with the relevant 
arches before.

> So in theory, we should be able to register an arbitrary number of serial
> ports, each with potentially different hardware and therefore different
> drivers.

this works today

> The board (or SoC) init function should be able to simply call
> serial_register() for each serial port with a name and info into how to
> talk to the hardware (hardware type, base address etc).

this is doable today, but the standard is to add all devices to 
common/serial.c:serial_initialize()

> The SERIAL_MULTI framework should then simply manage the list of serial
> devices and redirect I/O based on environment settings

which is what it does

one limitation of the current serial/stdio framework is that the serial multi 
core can only have one active device at a time.  the stdio core can have one 
per channel: stdin, stderr, stdout.  so this reminds me of the other goal: 
merge serial framework into stdio framework.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110920/cd5b4bad/attachment.pgp 

  parent reply	other threads:[~2011-09-20  4:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-18  5:17 [U-Boot] [PATCH] punt unused clean/distclean targets Mike Frysinger
2011-09-18  7:26 ` Wolfgang Denk
2011-09-18  8:22   ` Mike Frysinger
2011-09-18 13:08     ` Graeme Russ
2011-09-19  4:59       ` Mike Frysinger
2011-09-19  5:10         ` Marek Vasut
2011-09-19  5:30           ` Mike Frysinger
2011-09-19  6:57             ` Wolfgang Denk
2011-09-19  5:11         ` Graeme Russ
2011-09-19  5:32           ` Mike Frysinger
2011-09-19  6:54         ` Wolfgang Denk
2011-09-19 14:28           ` Mike Frysinger
2011-09-19 18:29           ` Scott Wood
2011-09-19 20:57       ` [U-Boot] serial ifdef mess Mike Frysinger
2011-09-20  0:41         ` Graeme Russ
2011-09-20  0:52           ` Mike Frysinger
2011-09-20  1:07             ` Graeme Russ
2011-09-20  4:28               ` Simon Glass
2011-09-20  4:44                 ` Mike Frysinger
2011-09-20  5:12                 ` Graeme Russ
2011-09-20  7:29                 ` Wolfgang Denk
2011-09-20  4:40               ` Mike Frysinger [this message]
2011-10-13 16:54 ` [U-Boot] [PATCH v2] punt unused clean/distclean targets Mike Frysinger
2011-10-15 20:20   ` Wolfgang Denk

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=201109200040.04589.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.