Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp272282ybg; Wed, 18 Mar 2020 22:42:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtm12DraB2jqUnAU3cZS1TKW9oVQFZOTNZn4sczD6mgTlToV2oOiu8jH7Okh/CD7VemsP7s X-Received: by 2002:aca:ea05:: with SMTP id i5mr1191528oih.162.1584596523935; Wed, 18 Mar 2020 22:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584596523; cv=none; d=google.com; s=arc-20160816; b=rMTIXzMJQRdl/EjF8XpN9Ubm7J+rWUCWzUec9eptVpXHFVLTZv16gENgOSySfk2mWf Bz5eWFbjl7KSd4AanCHKyqRpP7+sq9Zd8CCPzTcLUPdSlL7Tje5NWpRLizMtMHxo+qdx zcBKmdKffd4iFCXO9yZJ7gypOOwD1KAyMRHKE2Ph6KCZFXY4Kh8lS1xuFmTdjhuxf6Uh HLrWDTRZtLqbnqm5egdDHGBqqa4Kp4Bli9c4UKX/J9obNTF57FK13QDz721OxDTQE9/B NOyi2EBP2pQE5xpsulJoCdSYWV7GhrLp0Pc1BQRLWiBxlypxhzJIVAWYcHy+l+mYlpw0 xlrA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tyUavGEog4AaMbiyr7NzQi+auPUWyG+/QoEcMjsLqUo=; b=SSu53TzmKySp9rC6sIzgonhb33HCsfkv7vFV5cDLv3zgxiOR+6M2A+ic0T+BnBD6pa Q+mWR0ceYxaqj2Ii8NFwY3x0TPXeoaPQJ/Hh+Atovodtn7rAi/wp+rb+ex/xd73JdtM2 V4FHhUmGeh3GI2/zGbrypjR/YibunmiR4qcRMG7K52StWFeYfmqPcMJuF+1Hv1C2P3aS DVpoVZDuV5oCuPiHe3R9GNdrLHpumVGxTT1lYy1ZoHQijsDGOC+6mRQcJYhwfYMK9lqA 7KxcNlQaVxI43VLKDwKbwlfgy6LoCZj+4afkVJ4+FW9gIAS37KqU7fVEOlqZltATDw5a 31kg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si579016oig.108.2020.03.18.22.41.51; Wed, 18 Mar 2020 22:42:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbgCSFkh (ORCPT + 99 others); Thu, 19 Mar 2020 01:40:37 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:32963 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbgCSFkh (ORCPT ); Thu, 19 Mar 2020 01:40:37 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id D53B7100B0350; Thu, 19 Mar 2020 06:40:34 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 66B0F22429; Thu, 19 Mar 2020 06:40:34 +0100 (CET) Date: Thu, 19 Mar 2020 06:40:34 +0100 From: Lukas Wunner To: Heiko =?iso-8859-1?Q?St=FCbner?= Cc: Andy Shevchenko , gregkh@linuxfoundation.org, jslaby@suse.com, matwey.kornilov@gmail.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/7] serial: 8250: Add rs485 emulation to 8250_dw Message-ID: <20200319054034.dyq7yydqi6yg7jhf@wunner.de> References: <20200318142640.982763-1-heiko@sntech.de> <20200318144320.GL1922688@smile.fi.intel.com> <20200318153754.dctd4q7e2fodeqsw@wunner.de> <5640842.EtOnNDtpGh@diego> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5640842.EtOnNDtpGh@diego> 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 Wed, Mar 18, 2020 at 07:49:08PM +0100, Heiko St?bner wrote: > Looking at tty-next I notice that you're right. When I started working > on this I only found the stuff from 2018 I linked to but didn't imagine > that in that exact moment someone else would also work on that area. There are some more patches in the pipeline for the next cycle to add support for an rs485 bus termination GPIO. They're on the tip of this branch: https://github.com/RevolutionPi/linux/commits/revpi-4.19 Just so you know in advance and duplicate work is avoided. > > The DTR-for-RE thing seems a bit nonstandard, I'm not sure if this is > > eligible for mainline or if it's something that should be kept in your > > downstream tree. But no harm in submitting it to the list. > > I'm fine either way - maybe I also get a pointer on what may be a better > approach ;-) > > At least DTR as "Data Terminal Ready" did sound somewhat matching for > the "Receive Enable" of RS485 (and it's also the only other output pin > in the mctrl gpio list). Some UARTs allow disabling the receiver, this can be taken advantage of to implement half-duplex mode. It's what I did in 8250_bcm2835aux.c. On the Revolution Pi devices, !RE is usually connected to ground, so reception is always enabled and it cannot be disabled in software except by turning off the UART receiver. There are also boards out there which connect !RE to RTS. Then only half-duplex mode is supported by the hardware and there's no way for software to work around it. Thanks, Lukas