Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1126990ybg; Thu, 4 Jun 2020 01:31:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwghnEL23U8SN4YEQK9Siw4wIaGhlAM4kTwEhhydukWDCxQTa6qyVuicJxJu+51tdsukUNI X-Received: by 2002:a50:f983:: with SMTP id q3mr3347710edn.259.1591259497609; Thu, 04 Jun 2020 01:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591259497; cv=none; d=google.com; s=arc-20160816; b=xg2mm4UQKUR4c3ZB2xFf4rZ4hucuxNhzXQe0jvDsoz2y1YeVMmOytwJECIgomOvu5+ f8nXUnSoYTFMEiMIMcJv+wQjaQ4Uxpif1nkQ0I+8YIPs7PUWmmkv4F3hAnEYGnOdS0ON ERm7YCQwVcmLRU1pf3P4+bkDM/RqyPrZBpPBkUrhHSELN9xGf6ErQM487wDSJZtTPrrf +uZgxVmABsWTsqHJmkz2dQf/aygt0B2hQw9cMcqsNBD4Kmb7Uul5Y9lOoqA0T1ZtB2+M 2F0AyKwkfr3Qzir3ZcDlUD3zFh6yiN8W9jEOSIiJH7jQG6jO4qmgxhCbN4OMLlgvSOx/ jXQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pYTZrpSKlWCZUeqd3ax0K9GSnrfHbHtF3YVJtTd8P+o=; b=vdD8TtTyVGlpXjg/6IMdVD+PnCjutNkn2n60A56sKLb1RxTtOP6njBRIFMdBphZa3c 6a33Gv/FRBezBUWuYWeF/47UbejvI8Ci9w2XndK2gYtAOQLxL9gHrbQgJZLeedphvKev tCY8NnOdrlQa9R3zGbfTN61uwGcIXk9LbdCJ0DcPYcVMEbX30QNAk13TWKJ/5ESeq+4F Fd/VTuuZhS43Creu4WOUGh3O1D+Q0tsu1WhO2jvH/FWBfVQmelr/X3U4FdIrN8tqWm4e yc3IisfWEq+ZT4rCFfqf4JcTFi5rykEm0mvC1AdFErvSzJzqGAr2MMiMNRtNk6uyEoHz S2Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@antmicro.com header.s=google header.b=K6ZtQpeA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si1119394ejs.720.2020.06.04.01.31.13; Thu, 04 Jun 2020 01:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@antmicro.com header.s=google header.b=K6ZtQpeA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727829AbgFDIZr (ORCPT + 99 others); Thu, 4 Jun 2020 04:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727768AbgFDIZq (ORCPT ); Thu, 4 Jun 2020 04:25:46 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762BAC03E96E for ; Thu, 4 Jun 2020 01:25:45 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id e11so132441ilr.4 for ; Thu, 04 Jun 2020 01:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antmicro.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pYTZrpSKlWCZUeqd3ax0K9GSnrfHbHtF3YVJtTd8P+o=; b=K6ZtQpeA/zQnn8J3gX+PNc1yI1bFeCE+1P458t4Ym1FDFiUe+2EPOQO6wVFD3IqJ13 rpydnvh5hcCjSNneskf4+dUoIHd66wJmJuwLLl2BUGqfmB2HRxhlIo6JiY2gO9bqjwSW F804EhlS9vEMkkZ4I88yB61a8drL/w5ihSeME= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pYTZrpSKlWCZUeqd3ax0K9GSnrfHbHtF3YVJtTd8P+o=; b=kwqNg685gUQ2wMC2xCECrYqip5bI+HyLAWkAs7ASfvsm8lIK9CjTT78czN7ud9umJZ U18Oq2Q0UsEpymYncUGVEt/Z0N+adP2CjBtts1loMILxWUH0NdKRGwtIzJthh9JPgVEo oUBUTJ1g4OQ7eAIdR4wFmVT6jlSOon0jsdiFQNxcxWnG2LpIG3On97zI/CiVrWXnJ1Vt yg7icc4CPuQpt2mnSC8zs6BZluvj3BKDwzBt3UoZH9kj+XpQDj06IwuE0rEDJFpMuAXM j5m0hR0sxn0yGxtaynmPo6zTpbS69JVlt+zNoTv+WzigBOxa/Gqf51QExWJjzPiZ1lGj 7fgg== X-Gm-Message-State: AOAM530FHXda/+SFuCY6p1UKFuSfw2imz1jYxrCfqv7sXvuuvXY7+Thw Z7f0JLTlVZaxUMb9UhZJpYwTExNHwW7wBF62NaT+4Q== X-Received: by 2002:a92:280b:: with SMTP id l11mr2866348ilf.179.1591259144636; Thu, 04 Jun 2020 01:25:44 -0700 (PDT) MIME-Version: 1.0 References: <20200527182545.3859622-0-mholenko@antmicro.com> <20200527182545.3859622-5-mholenko@antmicro.com> <20200604075716.GA358281@kroah.com> In-Reply-To: <20200604075716.GA358281@kroah.com> From: Mateusz Holenko Date: Thu, 4 Jun 2020 10:25:34 +0200 Message-ID: Subject: Re: [PATCH v6 5/5] drivers/tty/serial: add LiteUART driver To: Greg Kroah-Hartman Cc: Rob Herring , Mark Rutland , Jiri Slaby , devicetree , "open list:SERIAL DRIVERS" , Stafford Horne , Karol Gugala , Mauro Carvalho Chehab , "David S. Miller" , "Paul E. McKenney" , Filip Kokosinski , Pawel Czarnecki , Joel Stanley , Jonathan Cameron , Maxime Ripard , Shawn Guo , Heiko Stuebner , Sam Ravnborg , Icenowy Zheng , Laurent Pinchart , Linux Kernel Mailing List , "Gabriel L. Somlo" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 4, 2020 at 9:57 AM Greg Kroah-Hartman wrote: > > On Thu, Jun 04, 2020 at 09:16:25AM +0200, Mateusz Holenko wrote: > > On Wed, May 27, 2020 at 6:27 PM Mateusz Holenko = wrote: > > > > > > From: Filip Kokosinski > > > > > > This commit adds driver for the FPGA-based LiteUART serial controller > > > from LiteX SoC builder. > > > > > > The current implementation supports LiteUART configured > > > for 32 bit data width and 8 bit CSR bus width. > > > > > > It does not support IRQ. > > > > > > Signed-off-by: Filip Kokosinski > > > Signed-off-by: Mateusz Holenko > > > --- > > > > > > Notes: > > > Changes in v6: > > > - LiteUART ports now stored in xArray > > > - removed PORT_LITEUART > > > - fixed formatting > > > - removed some unnecessary defines > > > > > > No changes in v5. > > > > > > Changes in v4: > > > - fixed copyright header > > > - removed a wrong dependency on UARTLITE from Kconfig > > > - added a dependency on LITEX_SOC_CONTROLLER to LITEUART in Kconf= ig > > > > > > Changes in v3: > > > - aliases made optional > > > - used litex_get_reg/litex_set_reg functions instead of macros > > > - SERIAL_LITEUART_NR_PORTS renamed to SERIAL_LITEUART_MAX_PORTS > > > - PORT_LITEUART changed from 122 to 123 > > > - added dependency on LITEX_SOC_CONTROLLER > > > - patch number changed from 4 to 5 > > > > > > No changes in v2. > > > > > > MAINTAINERS | 1 + > > > drivers/tty/serial/Kconfig | 31 +++ > > > drivers/tty/serial/Makefile | 1 + > > > drivers/tty/serial/liteuart.c | 404 ++++++++++++++++++++++++++++++++= ++ > > > 4 files changed, 437 insertions(+) > > > create mode 100644 drivers/tty/serial/liteuart.c > > > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > > index 51d2d6a61fb0..d855fe807833 100644 > > > --- a/MAINTAINERS > > > +++ b/MAINTAINERS > > > @@ -9846,6 +9846,7 @@ M: Mateusz Holenko > > > S: Maintained > > > F: Documentation/devicetree/bindings/*/litex,*.yaml > > > F: drivers/soc/litex/litex_soc_ctrl.c > > > +F: drivers/tty/serial/liteuart.c > > > F: include/linux/litex.h > > > > > > LIVE PATCHING > > > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig > > > index adf9e80e7dc9..17aaf0afb27a 100644 > > > --- a/drivers/tty/serial/Kconfig > > > +++ b/drivers/tty/serial/Kconfig > > > @@ -1562,6 +1562,37 @@ config SERIAL_MILBEAUT_USIO_CONSOLE > > > receives all kernel messages and warnings and which allows = logins in > > > single user mode). > > > > > > +config SERIAL_LITEUART > > > + tristate "LiteUART serial port support" > > > + depends on HAS_IOMEM > > > + depends on OF || COMPILE_TEST > > > + depends on LITEX_SOC_CONTROLLER > > > + select SERIAL_CORE > > > + help > > > + This driver is for the FPGA-based LiteUART serial controlle= r from LiteX > > > + SoC builder. > > > + > > > + Say 'Y' here if you wish to use the LiteUART serial control= ler. > > > + Otherwise, say 'N'. > > > + > > > +config SERIAL_LITEUART_MAX_PORTS > > > + int "Maximum number of LiteUART ports" > > > + depends on SERIAL_LITEUART > > > + default "1" > > > + help > > > + Set this to the maximum number of serial ports you want the= driver > > > + to support. > > > + > > > +config SERIAL_LITEUART_CONSOLE > > > + bool "LiteUART serial port console support" > > > + depends on SERIAL_LITEUART=3Dy > > > + select SERIAL_CORE_CONSOLE > > > + help > > > + Say 'Y' here if you wish to use the FPGA-based LiteUART ser= ial controller > > > + from LiteX SoC builder as the system console (the system co= nsole is the > > > + device which receives all kernel messages and warnings and = which allows > > > + logins in single user mode). Otherwise, say 'N'. > > > + > > > endmenu > > > > > > config SERIAL_MCTRL_GPIO > > > diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefil= e > > > index d056ee6cca33..9f8ba419ff3b 100644 > > > --- a/drivers/tty/serial/Makefile > > > +++ b/drivers/tty/serial/Makefile > > > @@ -89,6 +89,7 @@ obj-$(CONFIG_SERIAL_OWL) +=3D owl-uart.o > > > obj-$(CONFIG_SERIAL_RDA) +=3D rda-uart.o > > > obj-$(CONFIG_SERIAL_MILBEAUT_USIO) +=3D milbeaut_usio.o > > > obj-$(CONFIG_SERIAL_SIFIVE) +=3D sifive.o > > > +obj-$(CONFIG_SERIAL_LITEUART) +=3D liteuart.o > > > > > > # GPIOLIB helpers for modem control lines > > > obj-$(CONFIG_SERIAL_MCTRL_GPIO) +=3D serial_mctrl_gpio.o > > > diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteu= art.c > > > new file mode 100644 > > > index 000000000000..22b7612c13ca > > > --- /dev/null > > > +++ b/drivers/tty/serial/liteuart.c > > > @@ -0,0 +1,404 @@ > > > +// SPDX-License-Identifier: GPL-2.0 > > > +/* > > > + * LiteUART serial controller (LiteX) Driver > > > + * > > > + * Copyright (C) 2019-2020 Antmicro > > > + */ > > > + > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > > kbuild test robot reported problems with this patch, namely: implicit > > declaration of function 'kzalloc' > > This is caused by the missing include directive. When I was testing it > > I must have missed the warning, but the compilation succeeded and the > > resulting binary worked fine on HW (LiteX/mor1kx platform). > > The fix is a simple one-liner, adding a new include: > > > > +#include > > > > Since this is a very small fix and does not modify the actual code of > > the driver I want to wait for more feedback on all patches in the > > series before resubmitting, in order to limit traffic on the list. > > Or should I generate the next version and resend the whole patchset > > with this single fix, as otherwise it won't be reviewed at all? > > Please fix up and resend. We can't do anything until after 5.8-rc1 is > out anyway... > > thanks, > > greg k-h Sure, thanks for the prompt response! Best, Mateusz Ho=C5=82enko --=20 Mateusz Holenko Antmicro Ltd | www.antmicro.com Roosevelta 22, 60-829 Poznan, Poland