public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Enable port-mapped access to 16550 UART
Date: Wed, 28 Oct 2009 17:13:41 +0100	[thread overview]
Message-ID: <m2ljiv339m.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1256347676-14216-1-git-send-email-graeme.russ@gmail.com> (Graeme Russ's message of "Sat, 24 Oct 2009 12:27:56 +1100")

Hello Graeme,

> This patch does two things:
>   - Changes default behaviour to use proper memory accessors
>   - Allows port-mapped access (using inb/outb) for the x86 architecture
>
> Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
> ---
>  drivers/serial/ns16550.c |   69 ++++++++++++++++++++++++++--------------------
>  1 files changed, 39 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> index 2fcc8c3..c41ca0d 100644
> --- a/drivers/serial/ns16550.c
> +++ b/drivers/serial/ns16550.c
> @@ -6,6 +6,8 @@
>  
>  #include <config.h>
>  #include <ns16550.h>
> +#include <linux/types.h>
> +#include <asm/io.h>
>  
>  #define UART_LCRVAL UART_LCR_8N1		/* 8 data, 1 stop, no parity */
>  #define UART_MCRVAL (UART_MCR_DTR | \
> @@ -13,28 +15,35 @@
>  #define UART_FCRVAL (UART_FCR_FIFO_EN |	\
>  		     UART_FCR_RXSR |	\
>  		     UART_FCR_TXSR)		/* Clear & enable FIFOs */
> +#ifdef CONFIG_X86
> +#define uart_writeb(x,y)	outb(x,(ulong)y)
> +#define uart_readb(y)		inb((ulong)y)
> +#else
> +#define uart_writeb(x,y) writeb(x,y)
> +#define uart_readb(y) readb(y)
> +#endif

Why do you need a specific variant for X86 instead of implementing
writeb and readb correctly in the first place?

If this was in place, all the accessors should only switch to using
readb/writeb and from looking at it, this should not brak e.g. PowerPC
boards with weird register layouts.

When you post a patch with only these changes, I'll test it on a few of
the usual suspects on PowerPC.

Cheers
  Detlev

-- 
More than any other time in history, mankind faces a crossroads.  One
path leads  to despair  and utter  hopelessness.   The other to total
extinction.  Let us pray, we have the wisdom to choose correctly.
                                        -- Woody Allen
--
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

  parent reply	other threads:[~2009-10-28 16:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-24  1:27 [U-Boot] [PATCH] Enable port-mapped access to 16550 UART Graeme Russ
2009-10-27 21:11 ` [U-Boot] [PING][PATCH] " Graeme Russ
2009-10-28 16:13 ` Detlev Zundel [this message]
2009-10-28 21:18   ` [U-Boot] [PATCH] " Graeme Russ
2009-10-29 15:42     ` Detlev Zundel
2009-10-29 20:48       ` Graeme Russ
2009-11-02 13:46         ` Detlev Zundel

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=m2ljiv339m.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