From: Ian Campbell Subject: Re: [PATCH V2 2/2] xen: arm: implement early prink for 8250 uart Date: Wed, 3 Jul 2013 14:44:38 +0100 Message-ID: <1372859078.27768.261.camel@zakaz.uk.xensource.com> References: <1372770714-1657-1-git-send-email-bjzhang@suse.com> <1372770714-1657-3-git-send-email-bjzhang@suse.com> <1372849795.27768.214.camel@zakaz.uk.xensource.com> <51D499CE0200003000058D01@soto.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51D499CE0200003000058D01@soto.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Bamvor Jian Zhang Cc: baozich@gmail.com, andre.przywara@calxeda.com, xen-devel@lists.xen.org, julien.grall@linaro.org, Stefano.Stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2013-07-03 at 07:38 -0600, Bamvor Jian Zhang wrote: > Hi, Ian > > >>>Wrote "Ian Campbell "> On Tue > > On Tue, 2013-07-02 at 21:11 +0800, Bamvor Jian Zhang wrote: > > > diff --git a/xen/arch/arm/arm32/debug-8250.inc b/xen/arch/arm/arm32/debug-8250.inc > > > new file mode 100644 > > > index 0000000..c11357d > > > --- /dev/null > > > +++ b/xen/arch/arm/arm32/debug-8250.inc > > > @@ -0,0 +1,48 @@ > > > +/* > > > + * xen/arch/arm/arm32/debug-8250.inc > > > + * > > > + * 8250 specific debug code > > > + * > > > + * Bamvor Jian Zhang > > > + * Copyright (c) 2013 SUSE > > > + * > > > + * This program is free software; you can redistribute it and/or modify > > > + * it under the terms of the GNU General Public License as published by > > > + * the Free Software Foundation; either version 2 of the License, or > > > + * (at your option) any later version. > > > + * > > > + * This program is distributed in the hope that it will be useful, > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > + * GNU General Public License for more details. > > > + */ > > > + > > > + > > > +#define UART_TX (0x00<<2) /* Out: Transmit buffer */ > > > +#define UART_LSR (0x05<<2) /* In: Line Status Register */ > > > > Is the shift 2 on Baozi's platform too? Perhaps this could be a #define > > provided in the same style as EARLY_UART_BASE_ADDRESS or via some other > > means? > > > > The definitions themselves duplicate those in > > xen/drivers/char/ns16550.c, perhaps we could refactor those into a > > suitable header? > yes. it should be. meanwhile considering the shift bit and other things. > i am not sure how to merge the headers until i got the ns16550 actual used by > arm SOC. I think move the definitions as is from ns16550.c but add a UART_ prefix. Leave the shift in this code. Eventually ns16550 will need to learn about shifts (and perhaps io vs memory mapped io). Ian.