Message ID | 20240208-dev-rx-enable-v6-1-39e68e17a339@theobroma-systems.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CDA7C48260 for <linux-arm-kernel@archiver.kernel.org>; Thu, 8 Feb 2024 15:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ktl8FKHeJzVj8effg7LMUF3ezyNomHmTxYYKxb0XnPs=; b=eJ35D1R3GqLBfZUkrOtsRTlboC 5DMF21LBp7sl1KhR7bSVlMpEZT6pDFZM/gchTTkN7mT0sxFo1zRpZKZc/Q294ziKNgWM8fChwigqU PQy4o2czx3d8ejzgYqhbNjdxJg4HBLGsXvFUrJqlsDt92s5CCylLhRdTzwpWGR3NDTpqTnUusM6S8 RVHP4C615CGC9/8/RsHC55ADZU4qE3dlmwz2RRNZNR4s5b5dXRD+71eIq0Aq+V+wDWEYlVeOcOIND ao9JESRA8/f4XNC7Kib0/p9mmY+PGnZN6g4Dprw1HzlO/1+MVxr1q+W1Fdf61fiGQHFBFCUXnq7CJ W7ZUfqkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY6Wj-0000000EBpF-49kX; Thu, 08 Feb 2024 15:41:25 +0000 Received: from mail-he1eur04on20700.outbound.protection.outlook.com ([2a01:111:f403:260f::700] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY6Wg-0000000EBl5-3790; Thu, 08 Feb 2024 15:41:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BSMvHQCIXTFGDIYe6InldKYaKmb9fkTFXefA0UdBnI17DREi1Iw3HAvNpfsLqV5HGmOuQgtCnAX7OnFZ5V9W/7LwmUAjxeiWqzmBqrICy2tTMqUaZVjyd8TLtBUzqdq4WHPSR9QU5aofCnE5RXFeaz6iTeLURHE2H/+BaFHFV/3NDdc/cNdM23sesk+FDRF1LExgXVD+oEEruj4UREJEdZP0C6KpEKvp1zJ7YTA0DuH4ARQXgvzoUplVd/grmdU1xVdIa6v5ahmm30GxOOCYqdS6ZxunaMjB9IoIgk+xUfHtop9IemLhXg6xiZp9jDFtbGZfJPUGOX/VGtH9ge9qSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OzXnL9EaqOhySjspSDKiz3Z7Qph5Q6lMd4LriNQ2V4M=; b=eB94oncInzXhzpqEavnv4B6Py8VqPUbIMezJNwh0OclcIsOpSuMkuxd8TLA3/rU+7T5MIEWebfWO/kyFCheN3cGeJOfrAwX35DHdEmwkeG0O6r3qhImfXvIT50T5pBxJttschvywA/aRju5NmdzaDnxwVKUXWpyFT6/v8HdmNBn2PLNRqgpMdzMu/da3wgA26OcHwVfHBLrpbJTUQlAemCPLMSY7riH73Q91Kluq14RIL04d8XVD0walzGyaZZ9sCeGbpVBDGkQX/dULMY8tT7tepbtpVX1TySqrfn1CMEJe1hIk0g2Isv10smjFb41s86PcvzRVE+w1iN5sn3do2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=theobroma-systems.com; dmarc=pass action=none header.from=theobroma-systems.com; dkim=pass header.d=theobroma-systems.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=theobroma-systems.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OzXnL9EaqOhySjspSDKiz3Z7Qph5Q6lMd4LriNQ2V4M=; b=jLErUgXVmAsZJWzgI5D/RuafZX0iKrtHe5Ob66ifWCEbKqyV+lD8F+tTi7N4yEVwg1kLdJNbrFqGlTpsDIaZXDdDpNDbQiCWLd0K/F21kiQG9Hobl5oBlNSoIoFvEFZT0sFIIopXw3IPuf+bvf61+34H5Z4C4h8CCOpMvmW0tXaQI0hq/zL0yG13UR9K28uSd7sFa/yIW5ZESKAtVXROjU4rJW8evfsIf+Ihj07b/5Fehj/YfGdGqVJcCpTq02f6CJew9JgDa42nq7SbWMmy77cUUKjCe0LZCpvGJfQWVkRntrd2CWtZcxMIqYE1u2GzZkwfjaob0HvYu4oRZhFuTg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=theobroma-systems.com; Received: from VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) by AS8PR04MB7621.eurprd04.prod.outlook.com (2603:10a6:20b:299::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39; Thu, 8 Feb 2024 15:41:00 +0000 Received: from VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::d4b1:cea8:7085:ec50]) by VE1PR04MB6382.eurprd04.prod.outlook.com ([fe80::d4b1:cea8:7085:ec50%4]) with mapi id 15.20.7249.035; Thu, 8 Feb 2024 15:41:00 +0000 From: Farouk Bouabid <farouk.bouabid@theobroma-systems.com> Date: Thu, 08 Feb 2024 16:39:55 +0100 Subject: [PATCH v6 1/2] arm64: dts: rockchip: rk3399-puma-haikou: add rs485 support on uart2 Message-Id: <20240208-dev-rx-enable-v6-1-39e68e17a339@theobroma-systems.com> References: <20240208-dev-rx-enable-v6-0-39e68e17a339@theobroma-systems.com> In-Reply-To: <20240208-dev-rx-enable-v6-0-39e68e17a339@theobroma-systems.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Heiko Stuebner <heiko@sntech.de> Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, quentin.schulz@theobroma-systems.com, Farouk Bouabid <farouk.bouabid@theobroma-systems.com> X-Mailer: b4 0.12.3 X-ClientProxiedBy: VI1PR06CA0208.eurprd06.prod.outlook.com (2603:10a6:802:2c::29) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|AS8PR04MB7621:EE_ X-MS-Office365-Filtering-Correlation-Id: a9a1b9a0-9922-47cf-2fce-08dc28bc591b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ofeklTURX/27lXqLCh+J/1raBQw2srg87Rtn3QrNWZGbr8HSZILt+H6lhyeo5QVIzW2U9qAFBXlGfHbP7lRKVFJDdflTc3CtNRVeoMSvvAwIdufHhZOaDj8KF42DRlat2fS1VtaSeZnU7zCZOHhtjOGIiOuS4T0FCtuXpMkTi1LGWpcvwDXIHbxsrAEET2TWIVoVXX9DwC+YHyndTeJxA7hEO2L3u+A9IEyRFeBwOcYdx9rc4EoXb5D19D+IikMv3HPl8AlWjAqK110EkmlRrfBtjXt2eYzYJpOUAyjucC3hdvHtZqUCUkQtQNEhunUmuYoqjoQWLmTYQxvtQOFDRA6Uzvyp9cW5Ru2WypPqRRd7W6JMpH938ZzjL1rXOtsiNPi1hYVz6NqCYIsdttaCmztvfnZaiMF25a8a8xYuIBPjYtCc8IdrjNkQ0yIKM766NVnReF7tLWt21MMMErklVaXD439L3DF+M26FY855gSRu4hB3bvA6MichE+oEpt1ieyVJLayw/NnHRI+4i5YxuNWfEN4xFsmD7S5Bb9QJMjOz+jY0+c/lLbYOdCq9Iprm3CO2Q9qimqrrJ5YDZpKiU1+t3aPtipE6+BxCUD+4Lnh5J3BTTt5/Fet4bKknro4a X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6382.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(39850400004)(396003)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(107886003)(86362001)(2616005)(26005)(6486002)(44832011)(478600001)(5660300002)(2906002)(38350700005)(110136005)(66476007)(66556008)(316002)(66946007)(8936002)(4326008)(36756003)(6512007)(8676002)(6666004)(6506007)(52116002)(38100700002)(41300700001)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2YRGipNQi/K9qv2lWP/eTPJQSv3C?= =?utf-8?q?fpjTpQXe08loBomXJIGSyWbQWt6XCRQ2F4LJ+thEPWoQIBVhi7dmaJ1RzuHXEZpPR?= =?utf-8?q?Iat+48uvrKz+lnoWlqVR+FScnU0KmEhPGrC7CJ23+c5XtfPgLzC0R2ZJtT8sYP4UY?= =?utf-8?q?M/adlzSDohvjqmf2jtUudPUVOUyn6n18qbqe5cNqeowPOIDIdW/9Bj8m3KWfxM4nW?= =?utf-8?q?qWxWTYR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0k0b3vgEEPm/CZQLBn5U+v73JmJhDX7H6mimsPIzl4Yv5QmijK19?= =?utf-8?q?d+8qkgwv8TthR7u0l9rRaCjLt2BK4VgeTTdY4d35u7esCyOn7PrBVid7TykZYCON7?= =?utf-8?q?Xrdq5yYVd4doMAQH73C6FBW/2QzZcrQOxaz9uCjxNrIWnOA9+dTgEVsx3trtOzTZl?= =?utf-8?q?NWT0EreIjixzvxSMxEO4KU8OrEJLGLqCGIZcIT7nN3sBo0/KXi+L54HWBz8Fl2Esd?= =?utf-8?q?XDSR/ZV6RXj3YyqV/Xk1Xyl7HfzvUBXDSw17s1Hf0eZNDuvU8PWVdSgzz17PAbkiI?= =?utf-8?q?L1R3cuE81urVrKImNBoYkCxJQXmMsMSefqq27T1L6PQ5mtryW9Q+oI80Ht1BE611v?= =?utf-8?q?mlkP+QeHbIOE6d3g/VlDKpWaLVDU6nHURlu4JPWrZq3WNtxqkDvvBpJ6FzfojxyA5?= =?utf-8?q?icQRlauDhf0FtgwXCcwATENEzTGOLwbUoR58FPFVc+TPSw+XT6i+HFA=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9a1b9a0-9922-47cf-2fce-08dc28bc591b X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 15:40:59.4801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5e0e1b52-21b5-4e7b-83bb-514ec460677e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zGOBUwM7a+bInfRM7tQb3mRZjeWpy7ObxAV3kl0RYjGizA98qAYVwn/mC0GU3ibuqxYSVV3UcaIApM6a24v/jYhSNHn04EXhuXWfDNXs3dm4n4XrRHcdjuF10/txsSWT X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7621 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_074122_814089_87C50DF1 X-CRM114-Status: GOOD ( 12.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
serial: 8250: Add support for rs485 half/full duplex on puma/ringneck-haikou
|
expand
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts index 18a98c4648ea..2c3984a880af 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts @@ -273,11 +273,12 @@ &u2phy0_host { &uart0 { pinctrl-names = "default"; - pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; + pinctrl-0 = <&uart0_xfer>; status = "okay"; }; &uart2 { + rts-gpios = <&gpio2 RK_PC3 GPIO_ACTIVE_HIGH>; status = "okay"; };
A hardware switch can set the rs485 transceiver into half or full duplex mode. Switching to the half-duplex mode requires the user to enable em485 on uart5 using ioctl, DE/RE are both connected to GPIO2_C3 which is the RTS signal for uart0. Implement GPIO2_C3 as rts-gpios with RTS_ON_SEND option enabled (default) so that driver mode gets enabled while sending (RTS high) and receiver mode gets enabled while not sending (RTS low). In full-duplex mode (em485 is disabled), DE is connected to GPIO2_C3 and RE is grounded (enabled). Since GPIO2_C3 is implemented as rts-gpios, the driver mode gets enabled whenever we want to send something and RE is not affected (always enabled) in this case by the state of RTS. Signed-off-by: Farouk Bouabid <farouk.bouabid@theobroma-systems.com> --- arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)