From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nishanth Menon Date: Sun, 11 Apr 2010 07:51:33 -0500 Subject: [U-Boot] [PATCH 12/26] [ns16550] Enable port-mapped access In-Reply-To: <1270989829-2711-13-git-send-email-graeme.russ@gmail.com> References: <1270989829-2711-1-git-send-email-graeme.russ@gmail.com> <1270989829-2711-13-git-send-email-graeme.russ@gmail.com> Message-ID: <4BC1C5D5.3050200@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/11/2010 07:43 AM, Graeme Russ wrote: > The x86 architecture exclusively uses Port-Mapped I/O (inb/outb) to access > the 16550 UARTs. This patch mimics how Linux selects between Memory-Mapped > and Port-Mapped I/O. This allows x86 boards to use CONFIG_SERIAL_MUTLI and > drop the custom serial port driver [...] > diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c > index b3bf10b..0e9beb7 100644 > --- a/drivers/serial/ns16550.c > +++ b/drivers/serial/ns16550.c > @@ -7,6 +7,8 @@ > #include > #include > #include > +#include > +#include > > #define UART_LCRVAL UART_LCR_8N1 /* 8 data, 1 stop, no parity */ > #define UART_MCRVAL (UART_MCR_DTR | \ > @@ -14,28 +16,35 @@ > #define UART_FCRVAL (UART_FCR_FIFO_EN | \ > UART_FCR_RXSR | \ > UART_FCR_TXSR) /* Clear& enable FIFOs */ > +#ifdef CONFIG_X86 > +#define serial_out(x,y) outb(x,(ulong)y) > +#define serial_in(y) inb((ulong)y) > +#else > +#define serial_out(x,y) writeb(x,y) > +#define serial_in(y) readb(y) > +#endif wont it be nice if we have: CONFIG_NS16550_PORT_MAPPED CONFIG_NS16550_MEMORY_MAPPED ? rather than being tied to x86? [..] Regards, Nishanth Menon