From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zipcode.az.mvista.com (unknown [65.200.49.156]) by ozlabs.org (Postfix) with ESMTP id DAF43DDD09 for ; Tue, 13 Mar 2007 11:03:47 +1100 (EST) Date: Mon, 12 Mar 2007 17:04:21 -0700 From: "Mark A. Greer" To: "Mark A. Greer" , Scott Wood , linuxppc-dev@ozlabs.org, paulus@samba.org Subject: Re: [PATCH 16/19] bootwrapper: Add xlate_reg(), and use it to find serial registers. Message-ID: <20070313000421.GA8930@mag.az.mvista.com> References: <20070312204202.GP28545@ld0162-tx32.am.freescale.net> <20070312230148.GG31268@mag.az.mvista.com> <20070312232925.GA29506@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20070312232925.GA29506@localhost.localdomain> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, Mar 13, 2007 at 10:29:25AM +1100, David Gibson wrote: > On Mon, Mar 12, 2007 at 04:01:48PM -0700, Mark A. Greer wrote: > > On Mon, Mar 12, 2007 at 02:42:02PM -0600, Scott Wood wrote: > > > > > diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c > > > index 1ffe72e..cce7a11 100644 > > > --- a/arch/powerpc/boot/ns16550.c > > > +++ b/arch/powerpc/boot/ns16550.c > > > @@ -55,10 +55,15 @@ static u8 ns16550_tstc(void) > > > int ns16550_console_init(void *devp, struct serial_console_data *scdp) > > > { > > > int n; > > > + unsigned long reg_phys; > > > > > > n = getprop(devp, "virtual-reg", ®_base, sizeof(reg_base)); > > > - if (n != sizeof(reg_base)) > > > - return -1; > > > + if (n != sizeof(reg_base)) { > > > + if (!xlate_reg(devp, 0, ®_phys, NULL)) > > > + return -1; > > > + > > > + reg_base = (void *)reg_phys; > > > + } > > > > NACK. > > > > 'virtual-reg' _is_ the fully translated virtual address. > > Its simply the virtual address that maps to the fully translated > > physical addr in the 'reg' property. > > > > Even if it wasn't, 'ranges' only work for physical/'reg' properties > > and can't be used for a virtual one--you'd have to make a parellel > > 'ranges' thingy for 'virtual-reg'. > > I think you're misreading, Mark. The patch only attempts to translate > the reg if the virtual-reg property is *not* valid. Oops. :) Acked-by: Mark A. Greer