Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbdDMNW6 (ORCPT ); Thu, 13 Apr 2017 09:22:58 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:7503 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751250AbdDMNWz (ORCPT ); Thu, 13 Apr 2017 09:22:55 -0400 Subject: Re: [PATCH v2] serial: 8250_early: Add earlycon support for Palmchip UART To: linux-serial , Greg Kroah-Hartman Cc: Marc Gonzalez , Peter Hurley , Russell King , Andreas Farber , Jean Delvare , Rob Herring , Mans Rullgard , Jiri Slaby , Masahiro Yamada , Vineet Gupta , Scott Wood , Robin Murphy , Thibaud Cornic , Linux ARM , LKML References: <7a016ff6-08fc-2811-92e0-7c4603fa8586@sigmadesigns.com> From: Mason Message-ID: <01ed348b-1057-9089-bca3-433c7d7f9881@free.fr> Date: Thu, 13 Apr 2017 15:22:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49 MIME-Version: 1.0 In-Reply-To: <7a016ff6-08fc-2811-92e0-7c4603fa8586@sigmadesigns.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1864 Lines: 53 On 10/04/2017 11:47, Marc Gonzalez wrote: > @@ -172,3 +179,20 @@ OF_EARLYCON_DECLARE(omap8250, "ti,omap3-uart", early_omap8250_setup); > OF_EARLYCON_DECLARE(omap8250, "ti,omap4-uart", early_omap8250_setup); > > #endif > + > +#ifdef CONFIG_SERIAL_8250_RT288X > + > +unsigned int au_serial_in(struct uart_port *p, int offset); > +void au_serial_out(struct uart_port *p, int offset, int value); Hmmm, I'm thinking that putting declarations in a .c file might not be a very popular decision... ? Would there be a header, shared by 8250_early.c and 8250_port.c where it might be appropriate to declare au_serial_in/out? > +static int __init early_au_setup(struct earlycon_device *dev, const char *opt) > +{ > + dev->port.serial_in = au_serial_in; > + dev->port.serial_out = au_serial_out; > + dev->port.iotype = UPIO_AU; > + dev->con->write = early_serial8250_write; > + return 0; > +} > +OF_EARLYCON_DECLARE(palmchip, "ralink,rt2880-uart", early_au_setup); > + > +#endif > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index 080d5a59d0a7..1f08d22d1a80 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -313,7 +313,7 @@ static const s8 au_io_out_map[8] = { > -1, /* UART_SCR (unmapped) */ > }; > > -static unsigned int au_serial_in(struct uart_port *p, int offset) > +unsigned int au_serial_in(struct uart_port *p, int offset) > { > if (offset >= ARRAY_SIZE(au_io_in_map)) > return UINT_MAX; > @@ -323,7 +323,7 @@ static unsigned int au_serial_in(struct uart_port *p, int offset) > return __raw_readl(p->membase + (offset << p->regshift)); > } > > -static void au_serial_out(struct uart_port *p, int offset, int value) > +void au_serial_out(struct uart_port *p, int offset, int value) > { > if (offset >= ARRAY_SIZE(au_io_out_map)) > return; >