Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6507795ybh; Thu, 8 Aug 2019 01:10:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4BcFBi6nVr2t+0sgZSvsL6rfV7Mre63mKqohyvXq/KzYrlZKNAEzUojTHPoa5LVrdav6d X-Received: by 2002:a17:90a:a00d:: with SMTP id q13mr2727385pjp.80.1565251804754; Thu, 08 Aug 2019 01:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565251804; cv=none; d=google.com; s=arc-20160816; b=MeCmDiXWsfJcMaKeBaEDx2FyD/t+PAkYmkr0j/JdnLgZCl6/PSvMubMg0rQeljHl1p A7eU28Nb7h0ViAcFUCCL8NX9oRyCfQa1SKpmSmP/eRO/EPxifGJ86C1LnLBNnc67bidv fCfhTnknhZYmfA0STAKF0/FaQfmCDbyadst8yztY7UWxeSUMAuDH/3CQ6IJiIPVcb86h S3WxAQ3/D0F2bsqy46lVAY4StmJ+V++n6HEk2s70Yawinw7T90YY/HdwJosPdWc0fkvb ALparOlhbW5fuvOKVBOT2PvIDCbZ4aPU3z45+2gbCDH6Uy1JoMXOQbLEbACvmgs2BQIM tLKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JGtBg/3YKVukkbPAXdyI6N8WwrFL+o/GQ99jMu31+o8=; b=02UsFJOwwHVXNEPL3jvYFA44UrMIOJ5H8ZHWQNQTD8z1Pvvu/njYrvPuy+5wMfuD7y uAkz95HnfDMxK84E+T36bS+erZ+ZOQcGvaargtJ7xXpi1dH97clJzaETa9lcxUNmRoSy YsIy5Nyo+GQCfzrdDxANMMWbx/pbnZVPJc8EMBku3gIlfWJExBYOTK3ibWw5m0HqJMem NVEc0q4F/n04DYJigu4NX5EJOsoRXzaDkS1m6BIflZaxifjD8MuJSZaqDSo/eJKJl1UJ qGkkx3wQN8ETJfWmamHHBY1K29i/Lqaew2YrpYJUGdzFWVVntr9mHOZfN1HDDjTQLc4Z eyKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BOa6iG5S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si56241899pfb.132.2019.08.08.01.09.48; Thu, 08 Aug 2019 01:10:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BOa6iG5S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731950AbfHHIIk (ORCPT + 99 others); Thu, 8 Aug 2019 04:08:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:39312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731658AbfHHIIk (ORCPT ); Thu, 8 Aug 2019 04:08:40 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 987222187F; Thu, 8 Aug 2019 08:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565251719; bh=LEJBdGF3+zKiZ/gDRK/GSLC+1nib/flq+adxh2DDplc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BOa6iG5SmZfPC3g1w7HTtZx+ntqjy7vtMoKRrOB40Y1IAJadxT/a1qUH7M1hcWNN7 W8qiRDWZYvufdHdGDu+qM1d8a1ZVlDor3TTEdzdRnqhOaZb7tBU7wRwv+eqaHSlT7g lxSTZpDBXTzZEgo0HCx0IGQcI53ACbHG1ptXyEHE= Date: Thu, 8 Aug 2019 09:08:33 +0100 From: Will Deacon To: Stefan-gabriel Mirea Cc: "corbet@lwn.net" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "gregkh@linuxfoundation.org" , "catalin.marinas@arm.com" , "shawnguo@kernel.org" , Leo Li , "jslaby@suse.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-serial@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Cosmin Stefan Stoica , Larisa Ileana Grigore Subject: Re: [PATCH 5/6] tty: serial: Add linflexuart driver for S32V234 Message-ID: <20190808080832.nleult5bknmzr3ze@willie-the-truck> References: <20190802194702.30249-1-stefan-gabriel.mirea@nxp.com> <20190802194702.30249-6-stefan-gabriel.mirea@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190802194702.30249-6-stefan-gabriel.mirea@nxp.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 02, 2019 at 07:47:23PM +0000, Stefan-gabriel Mirea wrote: > Introduce support for LINFlex driver, based on: > - the version of Freescale LPUART driver after commit b3e3bf2ef2c7 ("Merge > 4.0-rc7 into tty-next"); > - commit abf1e0a98083 ("tty: serial: fsl_lpuart: lock port on console > write"). > In this basic version, the driver can be tested using initramfs and relies > on the clocks and pin muxing set up by U-Boot. > > Remarks concerning the earlycon support: > > - LinFlexD does not allow character transmissions in the INIT mode (see > section 47.4.2.1 in the reference manual[1]). Therefore, a mutual > exclusion between the first linflex_setup_watermark/linflex_set_termios > executions and linflex_earlycon_putchar was employed and the characters > normally sent to earlycon during initialization are kept in a buffer and > sent afterwards. > > - Empirically, character transmission is also forbidden within the last 1-2 > ms before entering the INIT mode, so we use an explicit timeout > (PREINIT_DELAY) between linflex_earlycon_putchar and the first call to > linflex_setup_watermark. > > - U-Boot currently uses the UART FIFO mode, while this driver makes the > transition to the buffer mode. Therefore, the earlycon putchar function > matches the U-Boot behavior before initializations and the Linux behavior > after. > > [1] https://www.nxp.com/webapp/Download?colCode=S32V234RM > > Signed-off-by: Stoica Cosmin-Stefan > Signed-off-by: Adrian.Nitu > Signed-off-by: Larisa Grigore > Signed-off-by: Ana Nedelcu > Signed-off-by: Mihaela Martinas > Signed-off-by: Matthew Nunez > [stefan-gabriel.mirea@nxp.com: Reduced for upstreaming and implemented > earlycon support] > Signed-off-by: Stefan-Gabriel Mirea > --- > .../admin-guide/kernel-parameters.txt | 6 + > drivers/tty/serial/Kconfig | 15 + > drivers/tty/serial/Makefile | 1 + > drivers/tty/serial/fsl_linflexuart.c | 956 ++++++++++++++++++ > include/uapi/linux/serial_core.h | 3 + > 5 files changed, 981 insertions(+) > create mode 100644 drivers/tty/serial/fsl_linflexuart.c > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 46b826fcb5ad..4d545732aadc 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -1090,6 +1090,12 @@ > the framebuffer, pass the 'ram' option so that it is > mapped with the correct attributes. > > + linflex, > + Use early console provided by Freescale LinFlex UART > + serial driver for NXP S32V234 SoCs. A valid base > + address must be provided, and the serial port must > + already be setup and configured. Why isn't earlycon= sufficient for this? Will