From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752990AbaCXLW0 (ORCPT ); Mon, 24 Mar 2014 07:22:26 -0400 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:34419 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752719AbaCXLWY (ORCPT ); Mon, 24 Mar 2014 07:22:24 -0400 Date: Mon, 24 Mar 2014 11:22:03 +0000 From: Catalin Marinas To: Rob Herring Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" , Greg Kroah-Hartman , Jiri Slaby , Russell King , Will Deacon , "x86@kernel.org" , Arnd Bergmann , Rob Herring Subject: Re: [PATCH 4/8] tty/serial: add generic serial earlycon Message-ID: <20140324112203.GD3850@arm.com> References: <1395436128-11244-1-git-send-email-robherring2@gmail.com> <1395436128-11244-5-git-send-email-robherring2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395436128-11244-5-git-send-email-robherring2@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote: > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c > new file mode 100644 > index 0000000..241757a > --- /dev/null > +++ b/drivers/tty/serial/earlycon.c [...] > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size) > +{ > + void __iomem *base; > +#ifdef CONFIG_FIX_EARLYCON_MEM > + set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK); > + base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); > + base += paddr & ~PAGE_MASK; > +#else > + base = ioremap_nocache(paddr, size); > +#endif Just curious why not set_fixmap_io (and plain ioremap)? > +static int __init parse_options(struct earlycon_device *device, > + char *options) > +{ [...] > + if (port->mapbase) > + port->membase = earlycon_map(port->mapbase, 64); I would move the earlycon_map() call in setup_earlycon() (personal preference, parse_options() implies just parsing the options rather than having additional side-effects). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catalin Marinas Subject: Re: [PATCH 4/8] tty/serial: add generic serial earlycon Date: Mon, 24 Mar 2014 11:22:03 +0000 Message-ID: <20140324112203.GD3850@arm.com> References: <1395436128-11244-1-git-send-email-robherring2@gmail.com> <1395436128-11244-5-git-send-email-robherring2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from fw-tnat.austin.arm.com ([217.140.110.23]:34419 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752719AbaCXLWY (ORCPT ); Mon, 24 Mar 2014 07:22:24 -0400 Content-Disposition: inline In-Reply-To: <1395436128-11244-5-git-send-email-robherring2@gmail.com> Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: Rob Herring Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" , Greg Kroah-Hartman , Jiri Slaby , Russell King , Will Deacon , "x86@kernel.org" , Arnd Bergmann , Rob Herring On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote: > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c > new file mode 100644 > index 0000000..241757a > --- /dev/null > +++ b/drivers/tty/serial/earlycon.c [...] > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size) > +{ > + void __iomem *base; > +#ifdef CONFIG_FIX_EARLYCON_MEM > + set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK); > + base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); > + base += paddr & ~PAGE_MASK; > +#else > + base = ioremap_nocache(paddr, size); > +#endif Just curious why not set_fixmap_io (and plain ioremap)? > +static int __init parse_options(struct earlycon_device *device, > + char *options) > +{ [...] > + if (port->mapbase) > + port->membase = earlycon_map(port->mapbase, 64); I would move the earlycon_map() call in setup_earlycon() (personal preference, parse_options() implies just parsing the options rather than having additional side-effects). -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 From: catalin.marinas@arm.com (Catalin Marinas) Date: Mon, 24 Mar 2014 11:22:03 +0000 Subject: [PATCH 4/8] tty/serial: add generic serial earlycon In-Reply-To: <1395436128-11244-5-git-send-email-robherring2@gmail.com> References: <1395436128-11244-1-git-send-email-robherring2@gmail.com> <1395436128-11244-5-git-send-email-robherring2@gmail.com> Message-ID: <20140324112203.GD3850@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Mar 21, 2014 at 09:08:44PM +0000, Rob Herring wrote: > diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c > new file mode 100644 > index 0000000..241757a > --- /dev/null > +++ b/drivers/tty/serial/earlycon.c [...] > +static void __iomem * __init earlycon_map(unsigned long paddr, size_t size) > +{ > + void __iomem *base; > +#ifdef CONFIG_FIX_EARLYCON_MEM > + set_fixmap_nocache(FIX_EARLYCON_MEM_BASE, paddr & PAGE_MASK); > + base = (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); > + base += paddr & ~PAGE_MASK; > +#else > + base = ioremap_nocache(paddr, size); > +#endif Just curious why not set_fixmap_io (and plain ioremap)? > +static int __init parse_options(struct earlycon_device *device, > + char *options) > +{ [...] > + if (port->mapbase) > + port->membase = earlycon_map(port->mapbase, 64); I would move the earlycon_map() call in setup_earlycon() (personal preference, parse_options() implies just parsing the options rather than having additional side-effects). -- Catalin