Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755042AbbEPJRi (ORCPT ); Sat, 16 May 2015 05:17:38 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:36673 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934854AbbEPJRd (ORCPT ); Sat, 16 May 2015 05:17:33 -0400 MIME-Version: 1.0 In-Reply-To: <1431692764-17576-1-git-send-email-yamada.masahiro@socionext.com> References: <1431692764-17576-1-git-send-email-yamada.masahiro@socionext.com> Date: Sat, 16 May 2015 11:17:31 +0200 Message-ID: Subject: Re: [PATCH] serial: 8250_uniphier: add UniPhier serial driver From: Matthias Brugger To: Masahiro Yamada Cc: linux-serial@vger.kernel.org, Sebastian Andrzej Siewior , Jiri Slaby , Peter Hurley , Alan Cox , "linux-kernel@vger.kernel.org" , Andy Shevchenko , John Crispin , Ricardo Ribalda Delgado , Greg Kroah-Hartman , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2995 Lines: 82 2015-05-15 14:26 GMT+02:00 Masahiro Yamada : > Add the driver for on-chip UART used on UniPhier SoCs. > The register map of this hardware is similar to that of 8250 > (but the address for FCR, LCR is different), so it should go > into drivers/tty/serial/8250 directory. > > Signed-off-by: Masahiro Yamada > --- > > drivers/tty/serial/8250/8250_uniphier.c | 243 ++++++++++++++++++++++++++++++++ > drivers/tty/serial/8250/Kconfig | 7 + > drivers/tty/serial/8250/Makefile | 1 + > 3 files changed, 251 insertions(+) > create mode 100644 drivers/tty/serial/8250/8250_uniphier.c > > diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c > new file mode 100644 > index 0000000..f108d81 > --- /dev/null > +++ b/drivers/tty/serial/8250/8250_uniphier.c > @@ -0,0 +1,243 @@ > +/* > + * Copyright (C) 2015 Masahiro Yamada > + * > + * 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. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include "8250.h" > + > +/* > + * Most (but not all) of UniPhier UART devices have 64-depth FIFO. > + * Set this value if "fifo-size" property is missing from the device tree node. > + */ > +#define UNIPHIER_UART_DEFAULT_FIFO_SIZE 64 > + > +#define UNIPHIER_UART_CHAR_FCR 3 /* Character / FIFO Control Register */ > +#define UNIPHIER_UART_LCR_MCR 4 /* Line/Modem Control Register */ > +#define UNIPHIER_UART_DLR 9 /* Divisor Latch Register */ > + > +/* > + * The register map is slightly different from that of 8250. > + * IO callbacks must be overridden for correct access to FCR, LCR, and MCR. > + */ > +static unsigned int uniphier_serial_in(struct uart_port *p, int offset) > +{ > + int valshift = 0; > + > + switch (offset) { > + case UART_LCR: > + valshift = 8; Please use a define for the value. Something like UNIPHIER_UART_LCR_SHIFT maybe. Cheers, Matthias -- motzblog.wordpress.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/