From patchwork Fri Feb 3 10:23:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93166 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525519qgi; Fri, 3 Feb 2017 02:25:00 -0800 (PST) X-Received: by 10.99.141.67 with SMTP id z64mr16740000pgd.18.1486117500715; Fri, 03 Feb 2017 02:25:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u79si25118067pfa.27.2017.02.03.02.25.00; Fri, 03 Feb 2017 02:25:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbdBCKY7 (ORCPT + 2 others); Fri, 3 Feb 2017 05:24:59 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38351 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752961AbdBCKX0 (ORCPT ); Fri, 3 Feb 2017 05:23:26 -0500 Received: by mail-wm0-f50.google.com with SMTP id r141so20571291wmg.1 for ; Fri, 03 Feb 2017 02:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hlKrZUbdZb3ODtd0dth/ItQyMint0+JkHFNCQC/C7kc=; b=Ol07+nrVoeQLRexh/W6cVm6b1DtSt6eYH0U5VlKLxAZr/cW/rEJCI4rF+NIG+tWin7 uC4J1VjKWBOPI1DIv+dBjuTBBc2jwAEjIl6Qg+dDGVarqmDbjs5MEk/0q3mlQQh5E8GV Q2NFpOqZqz1fsLQuHqqo5AYAHrtUOFr2vMQso= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hlKrZUbdZb3ODtd0dth/ItQyMint0+JkHFNCQC/C7kc=; b=Hc84SgwrNtoYzYQj6pNaUWHAZq2TDMSS2/2JMUJg/Oj0FecilZA6cZ07cpu4CutqyB khz+8msK7BDRZKhPs/zTwcq66fLl08SOz1tMwOVVh8NqOAYss7uzf9HDUqG4PbNMHZ+9 pqqju6/I9XabC43fbHJAAYqzPU1emcMPvaCMxYl0Zz2fMN+w8vEqid9afwtk+JxzrV+h p1KvV66AIJQfyRHdhklmFNj7Q2dMPG8u0ByGqprjSjJ4pvD6KiFLxHEOZgeXl9bI484Y YT3hnYcUgDEqVQiS/bNA36EZFTca3F+0PhPG5nCZHcQwdLPmmFvH41ypiloFpGA00v9v sDEA== X-Gm-Message-State: AIkVDXLIUe1TvVX4u9XoyvdUPb6c7j+YZumRsOEsmjUL6GBV9f2MnXdsCZojaydKDeQXRJKd X-Received: by 10.223.155.140 with SMTP id d12mr11115488wrc.143.1486117404376; Fri, 03 Feb 2017 02:23:24 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:23 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, Lee Jones Subject: [PATCH v4 01/10] serial: st-asc: Ignore the parity error bit if 8-bit mode is enabled Date: Fri, 3 Feb 2017 10:23:10 +0000 Message-Id: <20170203102319.23489-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The datasheet states: "If the MODE field selects an 8-bit frame then this [parity error] bit is undefined. Software should ignore this bit when reading 8-bit frames." Acked-by: Peter Griffin Signed-off-by: Lee Jones --- drivers/tty/serial/st-asc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 379e5bd..69e6232 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -287,9 +287,19 @@ static void asc_transmit_chars(struct uart_port *port) static void asc_receive_chars(struct uart_port *port) { struct tty_port *tport = &port->state->port; - unsigned long status; + unsigned long status, mode; unsigned long c = 0; char flag; + bool ignore_pe = false; + + /* + * Datasheet states: If the MODE field selects an 8-bit frame then + * this [parity error] bit is undefined. Software should ignore this + * bit when reading 8-bit frames. + */ + mode = asc_in(port, ASC_CTL) & ASC_CTL_MODE_MSK; + if (mode == ASC_CTL_MODE_8BIT || mode == ASC_CTL_MODE_8BIT_PAR) + ignore_pe = true; if (port->irq_wake) pm_wakeup_event(tport->tty->dev, 0); @@ -299,8 +309,8 @@ static void asc_receive_chars(struct uart_port *port) flag = TTY_NORMAL; port->icount.rx++; - if ((c & (ASC_RXBUF_FE | ASC_RXBUF_PE)) || - status & ASC_STA_OE) { + if (status & ASC_STA_OE || c & ASC_RXBUF_FE || + (c & ASC_RXBUF_PE && !ignore_pe)) { if (c & ASC_RXBUF_FE) { if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) { From patchwork Fri Feb 3 10:23:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93163 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525252qgi; Fri, 3 Feb 2017 02:24:08 -0800 (PST) X-Received: by 10.84.214.16 with SMTP id h16mr20001175pli.11.1486117448720; Fri, 03 Feb 2017 02:24:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si25103580plj.322.2017.02.03.02.24.08; Fri, 03 Feb 2017 02:24:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbdBCKYD (ORCPT + 2 others); Fri, 3 Feb 2017 05:24:03 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:37077 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbdBCKXg (ORCPT ); Fri, 3 Feb 2017 05:23:36 -0500 Received: by mail-wm0-f48.google.com with SMTP id v77so20724839wmv.0 for ; Fri, 03 Feb 2017 02:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xdkEE828yd/wirBTvr7QLBPIEAyxa6Wq0O1S1iIsAp0=; b=fINIZqZ+Uk45Ed3OM+wAmYrDF0iVqoDYLXKQAVziBiV9K0O0xtG8fEauhJiF4NMsF3 j+s/n8eVozbXZAtQyjlsxDBXkVFEjtrtJHS/D/QNawVAa2QQJrPk4h/fXT6l4fYQj+hd X6E6ALUTKBL991lgMeFMRlCrz+3z8xeWy+wj8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xdkEE828yd/wirBTvr7QLBPIEAyxa6Wq0O1S1iIsAp0=; b=BXPocVX6K4P1+sgmBEEo0X/VNOCYs1TEhvklBSxR1dOl3+MJW/3duDlC21jb2toVl0 S24xxEV2ydRxKZ0S1/OiuFrmKqLVonrhsVrLyN0xMmyghW5MKyNBaD8uZtD120oTT6gx OdT3pvDAsvQdwuS92UsnDsiaFFk/f+lhiirafEq6dr0xVvx//SRXpYJNokXmOufEwZMS OjnEtlDxVe+igA6SeQcmNMV2pSc4YVLm0FqDRH13Zf/dDwT/YTXSV3MpYs3JVzudyDR7 iP6uDEN0Q+bGzb7nrd4hdYwuvcI55tYQYfKkGp0i9giSLxJzBmLV5lVbnDwxVWQu/ReV +FoQ== X-Gm-Message-State: AIkVDXIGEqBcoEutug8tQeuVYA0Agqa1xyLz6O4XhPTH4dNN15bnCmIGdNpV6eouDuJisbY4 X-Received: by 10.223.136.85 with SMTP id e21mr11437204wre.28.1486117409951; Fri, 03 Feb 2017 02:23:29 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:29 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, Lee Jones Subject: [PATCH v4 06/10] dt-bindings: serial: Update 'uart-has-rtscts' description Date: Fri, 3 Feb 2017 10:23:15 +0000 Message-Id: <20170203102319.23489-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 'uart-has-rtscts' property and 'rts-gpios|cts-gpios' are normally mutually exclusive, however it is possible for some drivers to have a dynamic approach, meaning that both properties can be relevant. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- Documentation/devicetree/bindings/serial/serial.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Rob Herring diff --git a/Documentation/devicetree/bindings/serial/serial.txt b/Documentation/devicetree/bindings/serial/serial.txt index fd970f7..b542a0e 100644 --- a/Documentation/devicetree/bindings/serial/serial.txt +++ b/Documentation/devicetree/bindings/serial/serial.txt @@ -23,7 +23,8 @@ Optional properties: they are available for use (wired and enabled by pinmux configuration). This depends on both the UART hardware and the board wiring. Note that this property is mutually-exclusive with "cts-gpios" and - "rts-gpios" above. + "rts-gpios" above, unless support is provided to switch between modes + dynamically. Examples: From patchwork Fri Feb 3 10:23:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 93164 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp525250qgi; Fri, 3 Feb 2017 02:24:08 -0800 (PST) X-Received: by 10.99.1.87 with SMTP id 84mr16925801pgb.142.1486117448515; Fri, 03 Feb 2017 02:24:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si25103580plj.322.2017.02.03.02.24.08; Fri, 03 Feb 2017 02:24:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbdBCKXh (ORCPT + 2 others); Fri, 3 Feb 2017 05:23:37 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37134 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205AbdBCKXf (ORCPT ); Fri, 3 Feb 2017 05:23:35 -0500 Received: by mail-wm0-f51.google.com with SMTP id v77so20727450wmv.0 for ; Fri, 03 Feb 2017 02:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=78yBkeLDfMuAcy9poD5KwEvzQ2kBAyb70NbLA7P0dh4=; b=iySvfqoclDIv0Rf+oWSlSZvyIkNYTSZ2Qlv5d93/4Le1e/H03nQzBE4KfqFzCucm+0 qoxgWSmCcKiUHWKT2Z2Nsy17f93ksHas9iAVhJjFikptvYK1u6Y11D7sqz0w/0u1iiKC DyenmAuakYqutqgp9996o4+bP2uTu0y7Qq29M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=78yBkeLDfMuAcy9poD5KwEvzQ2kBAyb70NbLA7P0dh4=; b=FlYjiHa52d5gQnn/hvIGAzRNw9qo9B4QJFuCUbGU+mfrav9rpjI7EduE2IXYCyoMDM G8WcoRJfFui6ifqeruvvDmmm4AAxMVkhYVZpe8ktzMi0FO6tLBhPVy/1YF3YiB4ZD/1L yMJ7dajFMhLn80/8OPM7reZEmy0H1ofujyxWRspgx7UJkCqJDTGv1E3QSJEDGnipSij5 NncKLlGC7fr2F2V+Jzk9Q3tmHGpJmErmhbxgnAHjkcvbDyIDTIKPs7FwASICprzngIjx 6C9ZO8nA7KqJGXb6CRLyyU64WZQpiHgp1Nwg9pGrSz68m65+yXM0qOtA2MXekOUVoMrD ZGqA== X-Gm-Message-State: AIkVDXLEDu7VlMY2eigFOch0QT4IkmIbeaL5zQRPC5BuKQS6B2Vvy3OYuEKrt7meTntwBhnk X-Received: by 10.223.169.115 with SMTP id u106mr11716405wrc.54.1486117414109; Fri, 03 Feb 2017 02:23:34 -0800 (PST) Received: from dell.Home ([2a02:c7d:1faf:e900:a188:db10:388f:f973]) by smtp.gmail.com with ESMTPSA id z90sm44668100wrc.24.2017.02.03.02.23.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 02:23:33 -0800 (PST) From: Lee Jones To: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@stlinux.com, patrice.chotard@st.com, Lee Jones Subject: [PATCH v4 10/10] ARM: dts: STiH410-b2260: Enable HW flow-control Date: Fri, 3 Feb 2017 10:23:19 +0000 Message-Id: <20170203102319.23489-11-lee.jones@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170203102319.23489-1-lee.jones@linaro.org> References: <20170203102319.23489-1-lee.jones@linaro.org> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Hardware flow-control capability must be specified at a platform level in order to inform the ASC driver that the platform is capable (i.e. are the lines wired up, etc). STiH4{07,10} devices are indeed capable, so let's provide the property. Acked-by: Peter Griffin Signed-off-by: Lee Jones --- arch/arm/boot/dts/stih410-b2260.dts | 1 + 1 file changed, 1 insertion(+) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/stih410-b2260.dts b/arch/arm/boot/dts/stih410-b2260.dts index cbcbcb4..93c14d1 100644 --- a/arch/arm/boot/dts/stih410-b2260.dts +++ b/arch/arm/boot/dts/stih410-b2260.dts @@ -66,6 +66,7 @@ pinctrl-0 = <&pinctrl_serial0_hw_flowctrl>; pinctrl-1 = <&pinctrl_serial0>; rts-gpios = <&pio17 3 GPIO_ACTIVE_LOW>; + uart-has-rtscts; status = "okay"; };