From patchwork Fri Jan 26 17:27:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 767169 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2054.outbound.protection.outlook.com [40.107.7.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 374801D553; Fri, 26 Jan 2024 17:28:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290121; cv=fail; b=mcoxJdFyRWfEUfQnEGX9Qe4kFCfh9ACjcD4eURnMD7koJ0g5SaFK+jZ+1Ho9NluV5C9VsNSnD8zj6Wz27pylUj2vt2/wWGMPi/Cj9ZnTejzkl9r8aa9LF4mIt7SOMoUzkrzrwBYzaAt+CAItb4TG4q16ugpE1SHoA8L+1w8OCfQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290121; c=relaxed/simple; bh=IVMh64niZEfl6QXJoAoM3XsM/a5UZlHwxq+4aWfqMFY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=FRb0adk2bSAukPg9dlkZUud5ZDB5YC8P7oTyU76Apho+2BdxpZjgHNjj4xy5kaGZA9AYUJA9s5PuMJiaJN35zuPy88vFa6mpB2ShhyYzbZ3qT/uMfkc/BW5dSIfOeTc8mtg9LtnyEzw22xzTzaJ8Vtt7DcdhWB9/wzki/nWGso8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com; spf=pass smtp.mailfrom=theobroma-systems.com; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b=hAl7zSs1; arc=fail smtp.client-ip=40.107.7.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b="hAl7zSs1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+oLocA83A08YVuEDFL/s9BawvuBHLFpUuCe7DtRgbphdNLuC8AHVo6VvD4HuUjdWWomsmUvLzaNoPN9XAjHxeSAks6cspusTjVKgrtpmvmjcK+6JRXaoKsvjixWix4MrO7x1di7idKXvsov9j8G4DIMGMJSbgX6EPwWjp7NFzkPUUyfZgWUWcDv9Wh9XvisOw+wjE2pBS6LBKWWvb5c3vm+3KDOiNGZtiHjUR7ly6Bz/qO4yXvfX8IsnW4BOYkU3YK0JuOnYJy6ICUY6Jk8MjFzfCbdnNTX+sRm7p1N6R8EREe0osinovvqeCDGZYeXAG7A0YoEIs3ETNmNtuY6sA== 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=tqixvfKtPECeF4ubPvftK4PmEI+HUmvDEI7Qd1Vr3LE=; b=ALscU6DxdbzHFcgu3/Rs2OeXj7vdYMAbXQkRaqKMqkyNKlmErWOcniBVV98ae+Xs4dhNfj1Te6qkSPRiNuUz6taNOVVjePPznjEdhNLavUwfEJ2oWBvM9PHipIGscuwF+S7xl0Jup2luY0AkRxba3gwhG0YEUC8QHc8U2d6UPe4RwZbYaEpQ4bBbMRomhXLzjqs7zV+Q6MsIUFmSkNWKjHxSCFylf2lBVMJIfdQXUvU7+CTOwuouzZdsvCSdift6TqrJaaO2FDmAEeUIhwyeSm/9iXw4/D7znZYe/gMAPZjiGOy+jAt/vPTf8GggHs0tOXrXaWiuZOoEvo6S8oEf+A== 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=tqixvfKtPECeF4ubPvftK4PmEI+HUmvDEI7Qd1Vr3LE=; b=hAl7zSs1X2przdOOPNPPDPWFpRJ3c2Jzb4D3QGAwcUpFPXRfQjw9YdmZID0PQqV7xVEaq1cCDx8FGenomW6+InnmozB+ZFEaeX1dW2bs4WrtzAnHuEaBt7o28DFGoGFPciEESdkzTo5bVlPm/eMKLFc06amzDjAqbkEnchSm5RTKpy0EwZmYiIwSGm+VDuRbb4LCWiQfZv93UKHxIAHlZf/slN0REsb0VUB0+bfX0yUwtN4Mz6TrcyacjpssonlXSgXtJvRZtuxEnzWrvXFI/GkgKNIPtnOazqHdrhYnLesPhEXn85jn88FFaWX0SzPLHiDTrcaS0RZl5htbAqs8/Q== 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 DB9PR04MB9820.eurprd04.prod.outlook.com (2603:10a6:10:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 17:28:36 +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.7228.027; Fri, 26 Jan 2024 17:28:36 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 18:27:42 +0100 Subject: [PATCH v5 1/6] dt-bindings: serial: Add binding for rs485 receiver enable GPIO Message-Id: <20240126-dev-rx-enable-v5-1-5d934eda05ca@theobroma-systems.com> References: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Rob Herring , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@theobroma-systems.com, Heiko Stuebner , Farouk Bouabid X-Mailer: b4 0.12.3 X-ClientProxiedBy: VE1PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:802:a0::15) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f9c8eb7-398a-4276-fa57-08dc1e94393d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5o9E5LFBYRp95t9m+MgRzyehMWnaS7cXuWzboklvn/6UT9dHi9OiMvpI1AAZQegWmyNwAzcWZXTBSun4wD1U0Vh6GY72fuyFOIms1nkXFCEaLd6/+GM2ptC7JR4zTE3zWUotXvs3zvqLIC6wxjhDrzlU1SCGnCEv/t3uZxmKlwGWYRgL5j/CqOyElCZ++u7sLOPL5mHVJaA+2YToPeBGQRtmzWkCXk2Wf8bKT9bbvy1OTsxXcZNDbMWTufhvzMjBc3hdKoCqNiIuhwWvVp89hGLpbnp8+3Ty87PYnapWN3wLSQMmS4Xt+9MzRjadDgl0UGh7GfO5e7yMGiMOvD+h02Yd/iik1rjcFfDUi3k57hfhcskzIE8ckNbJjrczgMBt9XIKqdg5fDf6IVWCV6WhV5rpg1J2wxeweevI/SL1cveM1BqpnQYHTZqcxI7tDJv8ttordKOVRlqFAcKlUgbWb6W5+dVKmkZR0jxRdzk68rGDWIA67vIU25iREjwIaZeYSFG+2AmtEhwaSYARZn9whlI6BVt+8uxNj8kkvKkKkGriR/1mabn5SVb9PFfe0AbB9B5NPwN8vp8m54fpT2qMkWXjKOTOqCvjn8reFico9AB2ztoMTjzdT8XSqoQjnHh1 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)(346002)(39850400004)(136003)(376002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(66476007)(316002)(2906002)(110136005)(66946007)(86362001)(6666004)(38350700005)(52116002)(6512007)(38100700002)(6506007)(2616005)(41300700001)(26005)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Q/exBJh0Y91Rh3ysWRRpxEe/x7Y3?= =?utf-8?q?QNFytvXZe2ds7weia+cNb9iASvLfOx+DETWe9kmI731F3m9jK2k3pfTr9eklnxqLz?= =?utf-8?q?dViu5NWEt4AkPqbFKZysVhocvS6610ajch5m4WKfVxFUwEOuwzb59SG7Krot8AkQb?= =?utf-8?q?dyOeOH67S/VZUbgZmw41eNvtydCjuQbd0aWPCm+cypNkRsAq0zkP0iUAax3LXuziU?= =?utf-8?q?G4BqPYAeFNzUwcmuB+93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TaVx8H75/mgzo1L/VnUSB5I4PFf3V1W6Sv4u7T7xy+skuW0o3pXTXSq?= =?utf-8?q?eBlLY0EBSrRKq57ZATVqZsY6ofJwH9dcbBWhHcJ7JlIKc43c+h5QTNvqLFN1L8hUI?= =?utf-8?q?1bFBTcnGhaCqgCFucJezBOFYQkGMD2aJIl3o20uOnuD00ptflOTlY5UvA4q2bzQEp?= =?utf-8?q?heEjRewlhr6u9GbsAyh8LnpGNkFy7Few4qU7kdDoo83NuMfqKO3Ix+gTMLc+3eXia?= =?utf-8?q?//495WfTmkszhhLXmnY8/8q9h2GSm/4h7YR6A4YOOJvThGwXMH52gRli1uRzu1cDM?= =?utf-8?q?tNhNPqKSP9FQZpI9FFcK9tNafKbj9/BjpiJ1ELZk3Bt1yiKJ3qiV6Ws/9EX2EOv+s?= =?utf-8?q?5U9itNMzB6EUSHMQHH1GasVs6w2kp1d+hVjDAuKa3Hq9d5y7sh69yPXjJl2Bk6yO9?= =?utf-8?q?xskxUumZoAYwnZXI7vXBYGZ/cFFK9IrBPJcnTMSsYqMZtOkCSKUEdN8=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f9c8eb7-398a-4276-fa57-08dc1e94393d X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 17:28:34.7293 (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: D+CAngt6Nel6nWDlargf/bD+GlMe4HDHXyMY7YDkjknmsWsAZFpC8zUfJgo1VLsMq6d7k680zh/j6CQdiMGFnhPtCllKvjoWAUzRvvnAUIn/6zOcj7zcHHwONetX9EPI X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 From: Heiko Stuebner RS485 has two signals to control transmissions "driver enable" (DE) and "receiver enable" (RE). DE is already handled via the uarts RTS signal while the RE signal on most implementations doesn't get handled separately at all. As there still will be cases where this is needed though add a gpio property for declaring this signal pin. Signed-off-by: Heiko Stuebner Signed-off-by: Farouk Bouabid --- Documentation/devicetree/bindings/serial/rs485.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/rs485.yaml b/Documentation/devicetree/bindings/serial/rs485.yaml index 9418fd66a8e9..b64577036b5c 100644 --- a/Documentation/devicetree/bindings/serial/rs485.yaml +++ b/Documentation/devicetree/bindings/serial/rs485.yaml @@ -51,6 +51,10 @@ properties: description: enables the receiving of data even while sending data. $ref: /schemas/types.yaml#/definitions/flag + rs485-rx-enable-gpios: + description: GPIO to handle a separate RS485 receive enable signal + maxItems: 1 + rs485-term-gpios: description: GPIO pin to enable RS485 bus termination. maxItems: 1 From patchwork Fri Jan 26 17:27:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 766789 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2072.outbound.protection.outlook.com [40.107.7.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F0D020B03; Fri, 26 Jan 2024 17:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290127; cv=fail; b=p0HMCRguNyaLjmOG63bDouHd4uOHiDhR6NJN1PMd7DZVpos5bzte5rOBwrG4jtLI62ZzqUasT6u1CDU9YPb6i8MOdbq5UYAZiLiOOJlR8r5jQIk1GWoaxm//wiCbBgNlvaIMLtOCd9TSZhJnTKMym1bME7fKtuavMxaaGtF53Uw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290127; c=relaxed/simple; bh=l1d13ELTWhBx9r7ZyCx38tmaecvefmaXOs1Rj89aQOU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=o6j3QXQ658SNpByaWnN2y+beiYbQRgYtAdV+yU7J19hetCkUagM0ZTRx9mKYZygaaZt6aibzcXp6z6EJiiqS6Rtc4S8FJoo46S8mDKQCMRBOivxs+g1kH6PpQpabCnRDWAszxHQjBEOo1qAZXb4YzyQMHBca5ycFp7Wy92UVaQs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com; spf=pass smtp.mailfrom=theobroma-systems.com; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b=ADp6R7XP; arc=fail smtp.client-ip=40.107.7.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b="ADp6R7XP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edYu0sIv44RobElJq9+LJs3LFvIVuuc4YJF2UX5cvt7Sm+pkmK6e3/2LagO58TPYYqruaGPFprRzFG95UzmAonZMcWmPg066i1dbZFX+xJJq5bAB6Ivd7mXTKqr6l6XfThAkYpBpjI9nTXeOTUcWT5hUgtPmYZjgsTjodUU60I21AbQodyUyM5k+DgFM0MH1cMZpUpn9bMpINlkTXVxBmCzx0HN5pqblxMBn3eHIbR5yDqEu7J7s1/kE00FwSY9EJtNlS/sCy9Vn97huxJuUejPzKIprLiq2dsZoj3VtGLsTusXR6aKTVqgJ7MoFrQ+a3proX2sDmaM5aV4pLLSJIg== 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=P56s9wl03DY+fLo6EIOde11v+SFMSsCN3B9R9xRY4w0=; b=WtIQE3xnvm0XFAHxeoU2RxJvyScFozhSmbfSt5/TI7D61j1nwEgU9OK68qHU1eQdB58WI3u5QU3v5OAzsvXbsY6sW/2NKwLuFJH83z2rBkGfWNT2SAc3MmvkR6pRkd1UC5W2XYXR/VmitiBAXk2UJomoxPwj98DKpheUrn5lidzl5iwUYVtwuG50FdLkSuwQw3oAVsRRmFr8EZiMeypIECa9138WVlzh64VrLGDb/m2J1dexz52IQIh6cLpkzn7IU2zYqPMoVcUeO6bdwuNTRL/d7kXgjqqppYDI1drO6qZzj4H/rXwah8KsOK+ENKXOB8l1jb3aAdFHLpx45i+7Ww== 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=P56s9wl03DY+fLo6EIOde11v+SFMSsCN3B9R9xRY4w0=; b=ADp6R7XPUymzz4Q8gIdVNi+8yYplwWXQhlwQfglwtbJE6tIA4vXbJIXRUfSWcplx8pAUe89rPJCMtLIXkLJkaWJnCk8EMBWan27EktAqp5J9BNhrWHRJVDvFoMMhDsAhNdGPyS3yHrNWQqSwyy13xW3wEmJcwjPPOPdgYFJsqAflLWvkaOZuYrXS8EHgDJWa1M1Lri7MCKiqQvNFvCu+0BwePwraHBpAPJyH4XtF5Do7ZMQriOyDNalxOAOYwXQXnESuKJsEzpPsf1YWpciBBCs5SgUb2MnicDumBD4JwOKNZG7x3zlvKgwWxZVqoEp4YSWFmnybYNFQX5bx/3wkBQ== 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 DB9PR04MB9820.eurprd04.prod.outlook.com (2603:10a6:10:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 17:28:36 +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.7228.027; Fri, 26 Jan 2024 17:28:36 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 18:27:43 +0100 Subject: [PATCH v5 2/6] serial: 8250: Support separate rs485 rx-enable GPIO Message-Id: <20240126-dev-rx-enable-v5-2-5d934eda05ca@theobroma-systems.com> References: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Rob Herring , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@theobroma-systems.com, Heiko Stuebner , Farouk Bouabid X-Mailer: b4 0.12.3 X-ClientProxiedBy: VE1PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:802:a0::15) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: 7fb270f3-4e58-4a2d-3af1-08dc1e9439af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uyr7kRpOo2+s/HUqozm8zOo99oKW5pm7EO8utB3lOy7xcqnpuv2uC//f+kmE2728hYCeKvSq7Zl5M9g4EOVy9f93hX5snVQLedxo7fk79JYsCdjrtp0KoShsPA5ePMShBy16u33jOxhSnOv8vq/S3uCR7a7LPioq73O1FUUF6RoZVV//D9vD1gSnXc0hCJYguMpD8nnjPPSV9yR/JwFLinV2Sx/lF7IheaoJC6ykXwePGU+r0RqBf+NYkGcMjMyYal7wfsiZvDz2Kb06CWZXnQI/3pDdmTNpm+eP5EC75p6Q7ZzSX8BZjRjqIWX5i7ysUoSDjpVLcEndYeBips96GnQcB5DUXa/qOJHrd7uxwKBZXzp1IrR3Drh2wKcUN4UjNgjZNXfCvafAKpdu/jNK1EWXyUvSU1iGoQf7YDT38ljXPIUJ+RP5pYK8Kjeq8H1VwZv9nT0mMf/wLNpw5vvL+oFN3Ne3I+oPnQ6cijeega+XPzjds8YAvhr/xmmHDxTGzxUk0Obs+/nwNxH6NnAu8elhnq/g+VZ8fzzP40P4PiJnJ5r9SZBYiWytukFmTLPwjvTv0JV4OR2AhxQjq4AYxnUpaTnVMuDwPrzeZ247a2Z53r3XqkuyeibfudYhY0R6 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)(346002)(39850400004)(136003)(376002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(66476007)(316002)(2906002)(110136005)(66946007)(86362001)(6666004)(38350700005)(52116002)(6512007)(38100700002)(83380400001)(6506007)(2616005)(41300700001)(26005)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2Mzp/683RpymEeDzD8tnZkATg2fM?= =?utf-8?q?FZe9w6NOEFu+ceCzkhnWwXP/YFXGggOQIywBHurmapNNXPykxhHdu6YaDiCkTURWH?= =?utf-8?q?uJlWjmWDCIBNjII5HHafzDeGXfYW4GJyzszEHy3Jl6qDwH5MZup8aAX3Em3U/sQTB?= =?utf-8?q?WsBTz8ajD/59nD+1TwTIE6mqbJbhzLR70ugNxWS1useZtSw4zVO9x9Dt0OMd5igUG?= =?utf-8?q?qF+Ri9W+8WZw11UiZqoqqpl1plF2/GgY3fVMoc0Eavp+ZtkKgDdwpcCX92QE4Kh+m?= =?utf-8?q?SOOtPg9lQ45Je78cYRUC9og8VIMnyBze6zGeHArpNHZuli40cGlDJ26axOPVpX/7d?= =?utf-8?q?KAbSC16ENktex5T4e9B3z8H2TS9e1HGJkdDYyVaudB5WhKUaf8l/r7M1MiAjLyjMs?= =?utf-8?q?AtLOzp5ce02O9P0U0nz60NqsCY0dp7aGylPyNLNZiFbTKEkegqht0rBsJT9so2gwv?= =?utf-8?q?teyAQVDArcJhjGAmOblP0U4mJIoPEEk/GtGXDEmIAx0WxwtfAdqcXlUUFNx5UWyVR?= =?utf-8?q?n4ferhtNjuZzuGz45ROz7Ums8AEK21h+K4WkB2LioYgWob6VcEHp04InGYQoJBNmA?= =?utf-8?q?iDWX//0q2i9TxPXogEpyuSuhWBg9335mg0/JJcEeWvdDZatAhqa8N3AZHw5+A2OaP?= =?utf-8?q?dUzLq7vdMal0Rw874V5lVFcAD2Ku1tBD+elH5ch6fsBz/rUDWnehS5p5j2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X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fb270f3-4e58-4a2d-3af1-08dc1e9439af X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 17:28:35.4406 (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: 9F+Id2AURCQke3YY6C8vaNSt1m/OfO8inVXITehemhIK2ekpJun3/MKslgDfLt5TgetdfA/KN7Y/P+3Qzt3btlzvNPamfhDQ+gQzfjgcnyhxo9JT7w5sZTOv/YqI+GIz X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 From: Heiko Stuebner The RE signal is used to control the duplex mode of transmissions, aka receiving data while sending in full duplex mode, while stopping receiving data in half-duplex mode. On a number of boards the !RE signal is tied to ground so reception is always enabled except if the UART allows disabling the receiver. This can be taken advantage of to implement half-duplex mode - like done on 8250_bcm2835aux. Another solution is to tie !RE to RTS always forcing half-duplex mode. And finally there is the option to control the RE signal separately, like done here by introducing a new rs485-specific gpio that can be set depending on the RX_DURING_TX setting in the common em485 callbacks. Signed-off-by: Heiko Stuebner Signed-off-by: Farouk Bouabid --- drivers/tty/serial/8250/8250_port.c | 7 ++++++- drivers/tty/serial/serial_core.c | 7 +++++++ include/linux/serial_core.h | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 8ca061d3bbb9..54d8f809b81e 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1402,6 +1402,7 @@ static void serial8250_stop_rx(struct uart_port *port) void serial8250_em485_stop_tx(struct uart_8250_port *p) { unsigned char mcr = serial8250_in_MCR(p); + struct uart_port *port = &p->port; /* Port locked to synchronize UART_IER access against the console. */ lockdep_assert_held_once(&p->port.lock); @@ -1418,6 +1419,7 @@ void serial8250_em485_stop_tx(struct uart_8250_port *p) * Enable previously disabled RX interrupts. */ if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) { + gpiod_set_value(port->rs485_re_gpio, 1); serial8250_clear_and_reinit_fifos(p); p->ier |= UART_IER_RLSI | UART_IER_RDI; @@ -1567,9 +1569,12 @@ static inline void __start_tx(struct uart_port *port) void serial8250_em485_start_tx(struct uart_8250_port *up) { unsigned char mcr = serial8250_in_MCR(up); + struct uart_port *port = &up->port; - if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX)) + if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX)) { + gpiod_set_value(port->rs485_re_gpio, 0); serial8250_stop_rx(&up->port); + } if (up->port.rs485.flags & SER_RS485_RTS_ON_SEND) mcr |= UART_MCR_RTS; diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index b56ed8c376b2..8067d20c5275 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3663,6 +3663,13 @@ int uart_get_rs485_mode(struct uart_port *port) if (port->rs485_rx_during_tx_gpio) port->rs485_supported.flags |= SER_RS485_RX_DURING_TX; + port->rs485_re_gpio = devm_gpiod_get_optional(dev, "rs485-rx-enable", GPIOD_OUT_HIGH); + if (IS_ERR(port->rs485_re_gpio)) { + ret = PTR_ERR(port->rs485_re_gpio); + port->rs485_re_gpio = NULL; + return dev_err_probe(dev, ret, "Cannot get rs485-rx-enable-gpios\n"); + } + return 0; } EXPORT_SYMBOL_GPL(uart_get_rs485_mode); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 536b2581d3e2..364583203a24 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -584,6 +584,7 @@ struct uart_port { struct serial_rs485 rs485_supported; /* Supported mask for serial_rs485 */ struct gpio_desc *rs485_term_gpio; /* enable RS485 bus termination */ struct gpio_desc *rs485_rx_during_tx_gpio; /* Output GPIO that sets the state of RS485 RX during TX */ + struct gpio_desc *rs485_re_gpio; /* gpio RS485 receive enable */ struct serial_iso7816 iso7816; void *private_data; /* generic platform data pointer */ }; From patchwork Fri Jan 26 17:27:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 767168 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2054.outbound.protection.outlook.com [40.107.7.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F48B208C0; Fri, 26 Jan 2024 17:28:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290126; cv=fail; b=lKBm9LfochdCRVVD59GupFr5uej791Zt4G0QYew7jP1ZFu+v4o7FWg8q9R3RSYcREx0vf4FokCu9CYSa1UsI6mmmeVDSSVo0j5L/JDowLHkmlxJBB29c96rfmAP2hWfW5ljToD7TCUDib8qhhL7YJYGCjDWLUKuHiUnIs/BympY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290126; c=relaxed/simple; bh=bU8QzIIAEmLwIHySXLaVymY4yS06nq9pd0KTDM18h3M=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=nh98flohODleQrVgqFa2ck6iWfhr9fF9yCCA+DlvRUhFJpRqlKOCgX3/Z6WFkz0FFKPgvFzdGpX3IIzBATc9PwXpGZOSVsu3WbujhI+55eNqtkG0zkCSk9FTptKISp8/ZG5eFmPdS+upmmgv/c5wSaTFa2ER7Ca+tNF4Vz499sU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com; spf=pass smtp.mailfrom=theobroma-systems.com; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b=LXXSImBb; arc=fail smtp.client-ip=40.107.7.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b="LXXSImBb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O/XWUTVnGXM8fkCyYKfMx3EI0DXgTnt0indLa3kHSZCpsSiOW6oA+gY9aOvTt3uABrq1/yjPEELXWjgJfW2Db5fh9rE6KHM6BDS3/mFmC258iGXWJJRECtiFMQCTYi9R2TX5/XQHFeSEpFGvsCzfVjNo+SYnwI1PRS7wTH6P2vfe6xAgYhl4Q8epmmbOWeYxeRMEoAmpL01a/bC55Z2XvgchtOe6ThQskLaciFXJalZS+RwlU8Z4PgLSx1APecfihzDegg5rYq4cIcvfQRRJQDC9dBMzL2VMcJ/wlka1kqTHAGPz/QbSYz3Y+gSCrg4q8d4KfeA86FWckGEFty0QOA== 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=Wb46A5LLYS4lPodtjzqkEpywdweV2Ij7mTZrNtpcHr8=; b=Q4JhFCNOzH0egUqrOZG+xJqmD6XqW13DMyfMeb0QDDgowgKPLmePMjMFTssOhMW1WZ/pa+FF0tza2hqiDWOx7jO0gtWZg2jHgpdGGHPWiAJHtBGTR08SRTk+M/CeaIOrHRotcee9qqPAIw6xoF+9YbBfPyMGqHn6YdRf4QMuRrAl00AS/XO6sOyNPiYJMDLVsDl/Ips40zKrT7MG86LKmm6HmeMuJwhE1buzuQeByDzew237gt7brhCft2PsyGuqG51wcV1T9+DP27RZZt5h19RcbP4hVj3KFfLquZ5gp4B/oS5H8/sI/MTHY1XJlXGPiXkktLTPaut7kffmoiiZSw== 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=Wb46A5LLYS4lPodtjzqkEpywdweV2Ij7mTZrNtpcHr8=; b=LXXSImBbBh3Rl+kbiyZr4VbxpAIwgJCN+uXKjzLTuLJNIeh/Ri3F+QTK02UKzphvOTU8S8u5s+vThDBgQ6is7UqvBbAKHgIlOKEJMT0DG2A4ZpJ74bkygJOnfnPZDQ1UOfwb4pLo/bcwNNuVFQDci3wm+fLTUxaJAJ3Qz0wDIgST7idzOcSr6nNuIRpYaBMnP67/wtpJXnhd37WH41V2jioGiPbhgpE0KGGrt43IQ0CJDZZugR4KqWF5BSi4q5rdcfGQxIfIu6jAmdHDyccKrkN83qAmGQgxEV7Af90DM6nnB9CaHv6J/hlkHmz/PrATNN9GsFcRUAKHiRMqp0e7Kw== 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 DB9PR04MB9820.eurprd04.prod.outlook.com (2603:10a6:10:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 17:28:36 +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.7228.027; Fri, 26 Jan 2024 17:28:36 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 18:27:44 +0100 Subject: [PATCH v5 3/6] dt-bindings: serial: add binding for rs485 rx-enable state when rs485 is disabled Message-Id: <20240126-dev-rx-enable-v5-3-5d934eda05ca@theobroma-systems.com> References: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Rob Herring , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@theobroma-systems.com, Farouk Bouabid X-Mailer: b4 0.12.3 X-ClientProxiedBy: VE1PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:802:a0::15) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: b466c037-1544-4b2c-fb7f-08dc1e9439ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P0isZ+qFcu1OXMAuorUI6IbCuDe7YsNZQQqGx+wzcLJcggDWwqLvFBJpMh41fenSz8nFdNrE94kcNFasCpIL+mxGVomi//1ZuYnObenKWfP0Wq5AmUY3DykEs2W4aha/4CPFg60RvXsUeQkz5cMyFypRSOp3DkK0h6ImfiEuYacyw+yp6pY94NbFqJSD8lhsIp9mdA7Cq3u26BSBgrqZj5sjdQzEsjdRKQheTmB5faoBHtk2PJIySlNudpScikS/QFOmQ0RHNMhx4v9tzxJHmr93I6b9Cyf/LZnk6+2LG8M6SYEc8WwgqFcyye8uPNdKk0UQszS6HpmeKoTzNrRm8/UJ02WOnzvU+2zY4DASHIOvb7fHKSWt6sx6MoZQOp5Da+41JAS+BoaRjQ+6XsqO5x1Do7WxmjTqO8vzGa4jKkR2528BSWFJVpDWhZTMIYp+DzsTNHvh/99kVEh7nNbJRPiBOpBb1wRqxZFMVd8nqqjNkbfWetY2ThQdkdmYsI7F4CBXlkjph6O5rz2FTOp0IkFiJ/vuldEDZbBSOgU9HYCOF88sGhOnv+Vdt0zzJRY8QUMxm4jB3tyN/bEMlmc9VpaeppjVIbKKwTThb0axwLI6awFxe+0AYZEyxc3UDRUD 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)(346002)(39850400004)(136003)(376002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(66476007)(316002)(2906002)(110136005)(66946007)(86362001)(6666004)(38350700005)(52116002)(6512007)(38100700002)(83380400001)(6506007)(2616005)(41300700001)(26005)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?VlEft33cfsEb/ZW3W7B9pN5YdfgT?= =?utf-8?q?Z9SVmuDL8wUOA6yOKLoBhIHoc1464abcJZMD2WIWIe77Ixs3o6ugeCdcMU87xHBM6?= =?ut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dxL2xhfLtmHKZSr31kAqTAot4JI9gt0Nky0WA7UzlMy171y11iKRZaFO9NWcT?= =?utf-8?q?fw7gUf+EpMo+ZbryF+V1+LhkC3qrwD9Be2W+Oes8vBul2s1hcB+f1FWZGOdIQMeQF?= =?utf-8?q?PpsYS7hK7XEiV72ak11A6YZjhv6UsWaOvfHdH/U0YaI2qATMvyOIK6O7yBFNO6mQP?= =?utf-8?q?Sa+/+yIBW8Kq9HPQ8CVF748tiSq2N9B9liIx3oTI9/xV1e/x9EzdoiHFdW4O7+lBN?= =?utf-8?q?61/JakHCEDggW8iqu2pIFIIRTofoWg1SVre4+oBpxsxeWfqWUvm3KTqHO9RXHZqXH?= =?utf-8?q?tEYNLH3/hq8zvlvkiIa6PkdVyMRMinIOKKK7kRYW6HyFEuoQUud1kn5zq6wHYQrRt?= =?utf-8?q?uS+CVhwzNpD1d3mAb3cNoxSscNqTY3wVX0JGqEMkJeFljWq8ALrndL23MatmAVk4E?= =?utf-8?q?ZltUeP2Iw9qwH2tpWPrV5GNG1FmVdcUtKaFMtYqHpNgi97f86LKZcUiE0Kj4pQKgH?= =?utf-8?q?swO1oMhtRivL6ontBnkjL0jZfeC3XyEWXYUT4rV9QYvqdI2lYoc34CQkuW1ldnzYf?= =?utf-8?q?EdJPHTf4LvZsz+Up6i7hTsGyy1No19xBgWiVhu04/wd0wokRlV2o59w=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: b466c037-1544-4b2c-fb7f-08dc1e9439ee X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 17:28:35.6552 (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: gbiBoWmkXLfXnlwJODFn/Dnp7Pi9Jh5rGwkEotyIribKFu9Swr0HAjyfmZxUVUCMi7sP747yZAMs9UHT/tkrT8uSCca+S7m15Lvz6ZwyrxRaSU4z41nDXMUJ8TTWjs6n X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 RS485 can have a receiver-enable gpio (rx-enable-gpios). When rs485 is enabled, this gpio, if provided, must be driven active while receiving. However when RS485 is disabled this gpio should not have an undefined state. In that case, as DE and RE pins can be connected both to this gpio, if its state is not properly defined, can cause unexpected transceiver behavior. This binding depend on rx-enable-gpios to be implemented. Signed-off-by: Farouk Bouabid --- Documentation/devicetree/bindings/serial/rs485.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/rs485.yaml b/Documentation/devicetree/bindings/serial/rs485.yaml index b64577036b5c..4c79dfaaf460 100644 --- a/Documentation/devicetree/bindings/serial/rs485.yaml +++ b/Documentation/devicetree/bindings/serial/rs485.yaml @@ -55,6 +55,11 @@ properties: description: GPIO to handle a separate RS485 receive enable signal maxItems: 1 + rs485-rx-enable-inactive-when-rs485-disabled: + description: rx-enable GPIO is not active when RS485 is disabled. If missing, active-state + is assumed. + $ref: /schemas/types.yaml#/definitions/flag + rs485-term-gpios: description: GPIO pin to enable RS485 bus termination. maxItems: 1 From patchwork Fri Jan 26 17:27:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 767167 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2054.outbound.protection.outlook.com [40.107.7.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E1DA20B34; Fri, 26 Jan 2024 17:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290128; cv=fail; b=izgo9P/2aRMCpmfn+aKX0gHhFqpX+I0USUVqUq5LAzS3+2NZXDX3lRQjIbEpQ3hOYkFpTU2MEYWSqe4DMz6y5b0Ndx7GHvrwj8c3eee5oLQlBIJ633eZsLOdhQVWqPMRoujCfjZiSwF6Hr1mUCKp+G2OluwDibCZh8pM1g1/Bt0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290128; c=relaxed/simple; bh=gQQH//f+vjvcV1BTOIw+1BNw+SB4UGsB6T8Ukg/QAoY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=XiKV3lQdZAkWAJcCWrvJLM31EvqNXnNnQ9lEXWqSnTvz5XV0cQqXsTvYdHuC8n8mcPk4jp4ri/a/ULLcYSvknXGNEDI6WOIeNM+5PkahYLKnY7fX771vSoA1N4ra6OUiKvpveGKNugMB8DHMcI4hp1CJ8LiFdptsvjDAbcXxv5M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com; spf=pass smtp.mailfrom=theobroma-systems.com; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b=HNzWbr8C; arc=fail smtp.client-ip=40.107.7.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b="HNzWbr8C" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GRVN94Vw9339URPIliIaCmMj7oGHPnrcY3AzEwuQQTjJN3tDFNgFsx77TBseLCIquHQqU/azttB3yg4O8yITG7/qVSL3KqPz//i4PObgj76V9JlWHcV8/xwVZifVMLbdkasRijw9/2QOH1O33pW2qA4G2rTiWk2bD2tr8qCNcHProUzKgYEAB0okUig5b3JamQglyYAqkoJEynrYamONGmBuNN9iXYcxaelQwBARHhqpS0Je5OFuTNapIVRsF1zpD2L9472GnpxHkJqQ6kzaqpvRfXnj75qeBxgCrBeNBqS6DsklLm53rBhm6HWon833+nfVUWNGLWfN1FctTUcJWg== 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=S3D13ylB0RrpOulRlqk3gxsVJgIMce4Ga9Ejbqk3QrY=; b=ZJXdOuIP2X+KKagaZT88SgS3VD5IiOgISbvrcADBaP3qpFcPzdUTCZ7Nz50iimQ7DE4QS2oXJxdlZq/WfksCdZ8Ys0MHWAP/IdXvCMQpAvaHHbpzna6+ja1WZUQj+p2p49IC0I43etdzL9v1nLjiT4WGRuLy9bW4LjP0HYfGczJG/qWWgZonpqaHb9Kp2g/Bu4jyu2IWS43Zl/YutSRqjlFCyUUxL/+Y1LHujfDmjeAPcjOn4NOSg8zFgtJWA8fo/yp2jky0RpdMLR+a0RUXcjN3aAvpv5PXPJeFB1/e4T7Y+yf7yC/GUXVLRqjXIrW3evBuNyyVxIqoMxgmB3crRA== 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=S3D13ylB0RrpOulRlqk3gxsVJgIMce4Ga9Ejbqk3QrY=; b=HNzWbr8C1Q6f1ZhC+lfUfyV/SUdGmm5WJNWm5atRvMd1dr1scx55W0DvUxrmUkYNitihUATkNe9CyTRfUc4dXLsfRt35QfFbcfFhXDeYuWfCkGTXZWByUAejRxZ/QEdAl2JnjA8uDEI623Md0HCvpTjqHsVJM8mnROzY0z7VEP2N5IOqfUwUAQ0l+9fI6p4jzHDcwJjZQBaX3nmE476eCgs5pP73YEqozVNUCjRnq2X/hAcAD7jykWXbCsz7f89X17HP5Rb9neEa2sZM1ZyAeZHrBgGzfT7PSbuNg9J+SNDLQZlHBKyLF7zvQbyq7eQUx7uzudZumaVXvswwZ7Ligw== 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 DB9PR04MB9820.eurprd04.prod.outlook.com (2603:10a6:10:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 17:28:37 +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.7228.027; Fri, 26 Jan 2024 17:28:37 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 18:27:45 +0100 Subject: [PATCH v5 4/6] serial: 8250: set rx-enable gpio state when rs485 is disabled Message-Id: <20240126-dev-rx-enable-v5-4-5d934eda05ca@theobroma-systems.com> References: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Rob Herring , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@theobroma-systems.com, Farouk Bouabid X-Mailer: b4 0.12.3 X-ClientProxiedBy: VE1PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:802:a0::15) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: 304068e2-a041-46b0-d5d1-08dc1e943a44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EQr4VWAF/W7dDyMfAk/JQ42oPwHA+wJL6h9ynoxuHuHNrZK34wtXtbQ3gFcaTucjnyCDknWR7zPG+ifntJ2nZDsQ5/3CkIHxoFs/P2Iu/dcmnOIaDzRk2CP0Ix/JlCkuiUuc2jCjXP48anJvaqcctKz0ztLotMcQ9/pxkVIXX9bLKwV/wjayw0AAi/EY7eO4g3PyTSslM0+GdovI64+eBOkYOeOZ8njbkOpdPaNU7utkIoryGngRpfrRqrXwQEd+kXB8CRYsjDHl67YdKoI8t/spm7LwFOwGVQPsstyhT90teKi4is7rxoDWbbM5mxNUxHgzXH50DYlt6I3/WQsaHc6v8D99qf5L2XY/PUn2CC0XZ7/cDGcbNCw5W+kBtsR2OA4/LCkYnaetRrapCETqe8B5muE/fwzWfkdXgTNkepq0pBR3xxn7+DqOUE/sv0rYyRCSn/BTnrTyM0m7NAKHRr7qw6epx53zB8YJ1PdQMC5ApdBmHPyr/vBqh0o+R+1jeUhSQPWkYL8A3VhWNNmFBq1z1OU28yLHHho82jNYpNCpvuI2vbG9qxEEDY3BC/r4cueuahT0tY/JOScXwtPgzVvdrVxB6qC20qXFsOiSlwgO2d8d/8Zh+lKj/O90xGsF 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)(346002)(39850400004)(136003)(376002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(66476007)(316002)(2906002)(110136005)(66946007)(86362001)(6666004)(38350700005)(52116002)(6512007)(38100700002)(83380400001)(6506007)(2616005)(41300700001)(26005)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?bK9EehCCW4/tltVXleE8todqNU3/?= =?utf-8?q?bUJaoy8T2jgdchYag7xom4biXp3NFZdno+o5RJ+3tq0y0UX8zkvl+QiNdnbAQ0tsS?= =?utf-8?q?h1ahDfiRfWxGhmuLzoVELwB7jshdIib6iq1fmRdtQYQR4O+7GgIHD4lyL3K3/j8zG?= =?utf-8?q?V/Jig6FIzBg3Zrg9rg9Lq4XTLtUA8Zx7j5lAJlhCPn716O41LIcNVUFrkH95/Em+D?= =?utf-8?q?JM2sXMXBl26m8VYHnnsoF9cNRyNDi9J+4oQgjnNhB0aB3PUU0mBWSf0HIHdBrwnOK?= =?utf-8?q?9M3dt0BIJ+vGNmz1ENl8qRjtWQctGqOnnIpoX/tDskVJbKJToEKPdNiEZYnpxQu/N?= =?utf-8?q?X/Lf7yef4cZfYTOxvUcCXp4c2xTEZTfE5LAkkCvy81BGmkbcEBhdd9rSih9h+/LBz?= =?utf-8?q?pS8mncTvHVn+u8uqYbuCm+W2zNokT4q8Gvt6riGUl7nC25ljgEKTbgdYbBxG1IiG3?= =?utf-8?q?5Vyw7/5VlSz5n/iLFMM3SXU4b6FUXyOM6F/MIRbt5CDzUnK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/2yiVs5r4?= =?utf-8?q?mWQ2OwgzXg/nCFgp0SetOMBAwXakvh3f9eCO6/X5uLdLMXthpq+Lba61r7k75mzAN?= =?utf-8?q?IFLet8z1JUMLvRWR1GsLGQTo4Ja2NeWjsfL0AimzoWedpxEqacYenBCnJ+CvnI5nZ?= =?utf-8?q?o5kDLESryVX0Ob2nbq1wf7mePryGNR2OSj9E76MgDagUlVgqzlGblEo=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 304068e2-a041-46b0-d5d1-08dc1e943a44 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 17:28:36.2306 (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: svuCXIXvdO8RLh0wz1RLk+l8SHeqGUJ0lyzbJ3/mS8V9tShn+ziAKvmiYVFWvvXRvtog6mOwWdA6Bcc1N0D6vhoLgIasNcDLdg0WQnOVftg6YA6kfoYvT3JlC3ZM9hRc X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 Add the possibility to de-activate rx-enable gpio when rs485 is disabled. This defines the state of RE or DE/RE signal when em485 is disabled. Signed-off-by: Farouk Bouabid --- drivers/tty/serial/8250/8250_port.c | 4 ++++ drivers/tty/serial/serial_core.c | 6 +++++- include/linux/serial_core.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 54d8f809b81e..fbd0212d2397 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -582,12 +582,16 @@ static int serial8250_em485_init(struct uart_8250_port *p) */ void serial8250_em485_destroy(struct uart_8250_port *p) { + struct uart_port *port = &p->port; + if (!p->em485) return; hrtimer_cancel(&p->em485->start_tx_timer); hrtimer_cancel(&p->em485->stop_tx_timer); + gpiod_set_value(port->rs485_re_gpio, !port->rs485_re_gpio_inactive_when_rs485_disabled); + kfree(p->em485); p->em485 = NULL; } diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 8067d20c5275..abcba88dd5a7 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3663,7 +3663,11 @@ int uart_get_rs485_mode(struct uart_port *port) if (port->rs485_rx_during_tx_gpio) port->rs485_supported.flags |= SER_RS485_RX_DURING_TX; - port->rs485_re_gpio = devm_gpiod_get_optional(dev, "rs485-rx-enable", GPIOD_OUT_HIGH); + port->rs485_re_gpio_inactive_when_rs485_disabled = device_property_read_bool(dev, + "rs485-rx-enable-inactive-when-rs485-disabled"); + + port->rs485_re_gpio = devm_gpiod_get_optional(dev, "rs485-rx-enable", + port->rs485_re_gpio_inactive_when_rs485_disabled ? GPIOD_OUT_LOW : GPIOD_OUT_HIGH); if (IS_ERR(port->rs485_re_gpio)) { ret = PTR_ERR(port->rs485_re_gpio); port->rs485_re_gpio = NULL; diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 364583203a24..fa5a92b56360 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -585,6 +585,7 @@ struct uart_port { struct gpio_desc *rs485_term_gpio; /* enable RS485 bus termination */ struct gpio_desc *rs485_rx_during_tx_gpio; /* Output GPIO that sets the state of RS485 RX during TX */ struct gpio_desc *rs485_re_gpio; /* gpio RS485 receive enable */ + bool rs485_re_gpio_inactive_when_rs485_disabled; struct serial_iso7816 iso7816; void *private_data; /* generic platform data pointer */ }; From patchwork Fri Jan 26 17:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 766788 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2072.outbound.protection.outlook.com [40.107.7.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D575620DD7; Fri, 26 Jan 2024 17:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290129; cv=fail; b=Y83FwdEAoHKsZeIl3WP/74e1mez+cqBTXdknPGjnNDlWyXdxrf0LbJGOeRZ3lZ0sNTo6kh5jmaj4EDj5BLUfc1FWg0SSzjzlrZ/covKzTNjRZXNBdRiISPavyid2wrbegsakeuL5DAGmieiljqy3GheK2iaia+77BI++lIrVEWg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290129; c=relaxed/simple; bh=SlcPbM60WlKzEnTHdZgAM18nuAzy5MTJKsX4lGwwL0Y=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=SxAkrStz9oRbl3xU5MQ7X5j6Dx/WE4hlHmhBcYq0928jUIwj8v3C5QJfXBm9ldPHt6QZ4W6sIojcttlO78ZoaW/iErK9vZobKg/IZYubMnSZTlNqHpsVkAPhVS3MKc+pczI2X9tsg2RDm8DPmf3c+smpCQLpjf+MhVgtSGH21Dg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com; spf=pass smtp.mailfrom=theobroma-systems.com; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b=KZu1LqGh; arc=fail smtp.client-ip=40.107.7.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b="KZu1LqGh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c4PJfOL8syYwVaOOtf90ddGCyWx06lP0du2T2BtffzeQLJFqFv1ElEOkyd1BTlSVkrt9VTrNRKYOZDn0H4s/0g+VHHgQsn0+C2wxTASvEapm/2CuXG1OCAc2lOWyJHTU5Y42DWhL2JelPq+JY6jdQsywUSuTwV1x2S4pH0Vl2i9i9CgExe6JYhFG5eqAt3tHQlwa+UQYpA6K1f975oFa0ItxlW1NepevFl89xPOxm8VxB4E/X8q65AlwlPPjEPcR7loIpF9mUGQ6/9/fuzzYXE1LmOej518YQOdTVbhvojsSwQAuADeNkMTIw9efoNEwLdFi8mWZT+Y1RFH8t2kP8g== 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=dh9xD3qkAnT4zDfH45UENOftyY6lM3S9XnELbSMrfDE=; b=lxyP8SMaStnFyGAMjsn8ADQP6VQeo5gbYeYXYVcEX1umtLnqU7CRHOmlxvA4q9/ZPPGlN8xQTHGzgDtNSvp7Lfucf2o6PIWkOG6ZpY+qcR74fZJcmWnRBgge+hR33bgp52sY+qVoY4O+UBzlGSIbExYgb1/Q4FJEfHizj6g8uSbSrIecu5Dh7V7c5JSfT1tqRsFazzjeRHzABossXd8GEfhkASLsLzFbY8iuAsG9TZ45gO2xmexDopNeU/XvQaIpgDCmyKc35XHH5sAndlIiqcWuNuj/nm/5Mv4SjOfO0tWU/KCiu6AGPPHsIm+s4nVZH/OUwYXMh6bTxeBGsLgTzA== 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=dh9xD3qkAnT4zDfH45UENOftyY6lM3S9XnELbSMrfDE=; b=KZu1LqGh8+qInNNL81pOkUxVMksZ9nX09qMBDPyQXQ8p3/YYhuovCNEtNiCe7hXdleNtq3DGoYgK0BsFXG0JwxLOqoCdQ/XKBfDgpNeQZqRw66QvB0NAQtWtBkwBYaBCunoOgz4KI99hSaxAazzY37n2O6521Jk6S+1adANEp8Fra6P+/WHod+iaNh9+Gn83KybYwI3//jzuP3FsqUwHsDDafuEkQ0+rtxaLYhzf/ERYeCzSfe27AsPwFXOTPDPAGvJmJL6hFL/JmaswQLIS8bsN0DsqtWkdKvKaop2IFEzIDIz23gKtGF43kjNMrHCbaw45GYXGGc52MzIM0F+fhw== 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 DB9PR04MB9820.eurprd04.prod.outlook.com (2603:10a6:10:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 17:28:37 +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.7228.027; Fri, 26 Jan 2024 17:28:37 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 18:27:46 +0100 Subject: [PATCH v5 5/6] arm64: dts: rockchip: rk3399-puma-haikou: add rs485 support on uart2 Message-Id: <20240126-dev-rx-enable-v5-5-5d934eda05ca@theobroma-systems.com> References: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Rob Herring , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@theobroma-systems.com, Farouk Bouabid X-Mailer: b4 0.12.3 X-ClientProxiedBy: VE1PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:802:a0::15) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: 35e969dc-7779-449f-0453-08dc1e943a75 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yhiJ4mEDdHH0FL1sWUhWScgkQtBBT3jR/OCLENTIPV8ofMEk7arVnUeVnulNkLjMPNsV5rB3f/mEV4Vu5I9+MdXa/mPscQJpd6eC/XsiSuQJoQx6tTcmqnud3QASjfq35SgVcFbrlZYSFQv/uVxiQ1RzrZSGgq8G4yu9AVDg2CSABcUi5+uNtyBsYsvluxE7dUGt76S/5W07xzhqeIDWMQwWZJw1stjqbBEhWtF1nzEzAIsN5Ut2svHExnLzFS6vWW90XkkDNLmwl8BDQfJaVIgT72OcmwTLIOi/tYd3OlbxEYzb1/5VkreONFg1khSEhL8Y+Y23lRso+oEXgHL1AEIRlbzjkFmNrxMp868ZjBQi+VovCBM5zdg2AK7oJLJQY/l+tgGLNRRWKmjKEJN9BdjrUOcYZW90pIT/TMAny1WXSTOsfbzQd5TrVr9ovzVVTILf07pHn2nzuFjW0CqVXFHcDliFVhPyIvRQeqv7YiRUpo7W01rM+MNIR6cn6XgK+w1CPA6NH95myzFnrC2GUEJVOOYZx+8YbSSUozfPF1p5an7vFNs1Gpw1H/x6PRHKHyfazMZC5pILMC9EfFSga+tCoLeHc5Xfkw6B+M1Y9BU= 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)(346002)(39850400004)(136003)(376002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(66476007)(316002)(2906002)(110136005)(66946007)(86362001)(6666004)(38350700005)(52116002)(6512007)(38100700002)(83380400001)(6506007)(2616005)(41300700001)(26005)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?+iea5wYjl13hsEWp71Xq8ShTAiNB?= =?utf-8?q?0thooXwGqyzx9se00lp5ocfJnnb9ql5qdeNH6I2C220HXZgLfk6g+hH+u6ASIECHL?= =?utf-8?q?MonqsMBStrkDit4pWH+FroUz14E858ATNSU44wRllr/y/eiB4Q31D53TnE48Jpb5i?= =?utf-8?q?xf8hLAk5xNUPYyPOqau5e7vNOZUBmi751aWPI+k1TDJouEMDCBFgM27usFCqTJv3+?= =?utf-8?q?Xh8AIosFi06gMTBTToVHvo2mh0A0JIBRd5Z223C3McfKZlRkkppiSOO+8k2dvmJBf?= =?utf-8?q?E5purty/Hw1x+Zvb1tID0tlpInSz0niw9seabfM0LhgSB4nXbMzbkU3QvhNmCEfb6?= =?utf-8?q?P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9saK8rCxioNynQWnRqIy7t1ab7jhTmWppszoVOBwvu5CGVOl?= =?utf-8?q?y/kn+Ev/ys5WMJC0Cmyg5Qm9Z4OwrlaIj/akXgQvc9HN17SRg2CSRDjRLcHd5Iml5?= =?utf-8?q?GLjj6J5AdyBixTHrZ+jVFOmDQJ0KcApVybBy5Ckul1Kaj6G2m7PKnxP2x+QXUqgJV?= =?utf-8?q?O+GZTm1g1G2WxVBCEILMsD58CBvmpJcUq/lvJm5tEfikJmeRTiEHj3qBTl5HsplY/?= =?utf-8?q?x8PaI63Z5ABLKq0CzFgIE/olC0h9vjZoH/8INxbrDJ0JqgYdKjEZXloFe1oA+aNGp?= =?utf-8?q?abEnCZDJR4Uv24Zzxe4UxX8zUKOCUL+cwU0jgurXmqBhszYm56NHJ3M=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35e969dc-7779-449f-0453-08dc1e943a75 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 17:28:36.5372 (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: G/UjRLORkzuuOoS9afUVC8Pwrv4yTWeJhyppC/9XsqRYFs3hwy1pG+H3JiGWrYOVCI+yGxQbyWPxIR2kV1cRjZlzEpW9zM61p/dTWE5Iy8NSvVOGkPLkQnS0FTMQckPw X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 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 uart2 using ioctl, DE/RE are both connected to GPIO2_C3 which is the RTS signal for uart0. Which means GPIO2_C3 is implemented as rs485 rx-enable gpio. In full-duplex mode (em485 is disabled), DE is connected to GPIO2_C3 and RE is grounded (enabled). This requires rx-enable gpio to be inactive to enable DE as well. Signed-off-by: Farouk Bouabid --- arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts index 18a98c4648ea..576024c745ed 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts @@ -273,11 +273,13 @@ &u2phy0_host { &uart0 { pinctrl-names = "default"; - pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; + pinctrl-0 = <&uart0_xfer>; status = "okay"; }; &uart2 { + rs485-rx-enable-gpios = <&gpio2 RK_PC3 GPIO_ACTIVE_LOW>; + rs485-rx-enable-inactive-when-rs485-disabled; status = "okay"; }; From patchwork Fri Jan 26 17:27:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 767166 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2054.outbound.protection.outlook.com [40.107.7.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C77210E9; Fri, 26 Jan 2024 17:28:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290130; cv=fail; b=Nhjp8WLvTzKRUuYAMB0sln9TTkhemnGVpMC1LabJzIFFYrj5H4D1rUfGMRaCiGFEfUnWFOEAQdmP2ahQpFx/ATlxJwRUVKQ043Evm35cEY+VbIAawL4BmKBJVrzqxCfjeHP+Oh4Cy1I65nV7W+pYiJuT0+CJ9Td4EZ7p9sk+nIQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290130; c=relaxed/simple; bh=L1LBo3EmHljy0N4wo6uS24KfxGyxhrOe9FDDZAXSSXY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=G5ZsmaNRGXodVmggBPxhT1oAGvCRlKVcB5zyCD+D8a9ykUYtKNTpJnRAOVgdMzZpkndotEExPqIlyHbq5PTcUmLl0FEDmK9gczq7fAMPkY8RLkjrntpDT7VSZCDtdEn7yJa92qhF09ro4lsOjo/UL+9nZd9xhmEe1MiXGQ2zGGw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com; spf=pass smtp.mailfrom=theobroma-systems.com; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b=EiBOgBfK; arc=fail smtp.client-ip=40.107.7.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=theobroma-systems.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=theobroma-systems.com header.i=@theobroma-systems.com header.b="EiBOgBfK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FrUKs2Evl1EOoStGT/WME1ENJui4K+Czo5huJOL2dY9z2+UBbtpXHZzUu5pZC8LWm1B+9vQt3y9MyHS46HGu2x36jFobwA8kWZna7hsiZR1caggBmDbgHhZ/mqWbpV3ZpZkEARrIML2D4suZr4UWPD+IGCq1ef4zN8IAu4yxPm9Fqn/ORFFNNHvavapGwL1xhClH/tmM1z5wUIv7cl2pcGmbWHmw4NwQFZV+A4cTIHYFabBM/tnAJWwRl73DziaCt4aopwEG5SXhA/hXX6xPcEz97KZggLiTBm18E2oCgqo6p9931oRJt4ZRTxTLA6SFrI89mjV7cZNjqJXW4DiUYQ== 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=+Avz5e+3EBr62BuVXgj6UPnkpZs3MvAqOK/jqvWr25w=; b=SU4c9vNuZKVQ1kzXTtfCA+fi3uSGgTVcCY9dPPMYVmvnc41vpuDfiWUDr3axiv2KuWkxffnnkr6IQ56zlurM1NC02sr6e29FZlLYmsMMDNqpeH4bEebQSv9YtsAaFxHdR/zI2B/qAbXJH2fj64gLYOkDBhheQIazos3wR5exjobq/r63ZxlsWMTJT8qLudTuzeSPcd6HNwgRmup3SEhleBlwYqlD1VZVQRUYdZQ2SPpT/3njYsJdzezindqxb3q/8Q2jODCqNRAun/wQ2au3OGBZJg400oENGAdSquQlKD2y1JVrxx351nsvXciVlqa44mTBnFDOYVvOhWnbyHNzLQ== 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=+Avz5e+3EBr62BuVXgj6UPnkpZs3MvAqOK/jqvWr25w=; b=EiBOgBfKe/PJdG8uguasjkjWvIxrYp7QHgnbIgkLyAofUB5DC2H3hoxHUnlBKOUWCOCJWxICzMQP8pp808v1TfCpiAtvWjCuIXAr1DYrgQU+kbQHb7TdEhlgZ9227j8dYYR0J1dxjTnTNF9Cw+Z0CKRIW/QPlygVPzEQie3sq2G1eGtRqrSSz82V1Tvj0a7qBQGL1IQXg/gD0hODy/FamFThrAeqksld5c3eFQCGPOGvwSLbluehPhz5Y7kyy3XXbKKcNpxi++rs4GTKjWWHzuf8cV989xzestpEJhbOCMrRSR8RwIa7z62Df5FnM1S57cZ52tPuqPJWs3Zhv5u5UA== 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 DB9PR04MB9820.eurprd04.prod.outlook.com (2603:10a6:10:4c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 17:28:39 +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.7228.027; Fri, 26 Jan 2024 17:28:39 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 18:27:47 +0100 Subject: [PATCH v5 6/6] arm64: dts: rockchip: px30-ringneck-haikou: add rs485 support on uart5 Message-Id: <20240126-dev-rx-enable-v5-6-5d934eda05ca@theobroma-systems.com> References: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Rob Herring , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, quentin.schulz@theobroma-systems.com, Farouk Bouabid X-Mailer: b4 0.12.3 X-ClientProxiedBy: VE1PR03CA0003.eurprd03.prod.outlook.com (2603:10a6:802:a0::15) To VE1PR04MB6382.eurprd04.prod.outlook.com (2603:10a6:803:122::31) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: d10bcd99-afe3-4ea2-52b6-08dc1e943a9b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mLOZa+bqNQZDXsnsyT5nqNR+6+QLkE2EmvKR2TwAQvPhqQuwUXzgVCGo/D6EPxjmokrTNSDzPow9gYxSOjC7wkco6tnyvfiGH7CwbzOME4C+oTY2isDMoKiUEbvSYaVCgBTMmIhZH556nsblQhWiFb02LeaEy3EztCpJ2h96zCU0yaSm7+C33NhnUNet3Yuv4Ufb+l9rN6kSxXo7v+47z6+i4Bs44MlbnWRUPZsEgR4M3GHQ/gwkyLISz/zYPhrPSsgQ4jwrAwSoTk4NI6AlYaHgYo+BJbsdpnRmBSTyYgJU6BT2EaaqzMT4Nb/aBL8A3LqL9V/nUSwjq9TNpeV8FYqwJgLOs96baj5YhsiFm6VPuGOBXw2Wjif4CXh/Ber55pE3AVoZmz8ecr10cljUKBr0D6peTnxAa5KWXj70UzH3t4G7HzpAoULsG3LqMC8gCdJhpQwegzM3ueSv5JIcT8trw0OYugPJTAQG/8Lg1QTkc2hI6SCr8zFXdUtlB9E47FTKHaczB2dwL/lvpjvCyTsZdO7kt2kZ+f0KTPjpKGm0gZe1GQw+uFDl5hpjKJimre2CR5R+4Ah1XQmxQ/hxIB77tKt0cvzDIvtgMsRhHBQ1dh5CzOFIf1oYeXdaEGLa 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)(346002)(39850400004)(136003)(376002)(366004)(396003)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(66476007)(316002)(2906002)(110136005)(66946007)(86362001)(6666004)(38350700005)(52116002)(6512007)(38100700002)(83380400001)(6506007)(2616005)(41300700001)(26005)(107886003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?fxTjRRgzy65wYazDRVhZl1bNzprF?= =?utf-8?q?kdUuo4pEcacqavjjIaiIpGGePkK/Ftjp8IiL2JWEQmKamTmWwg/BY/5cgYAyDDkiO?= =?utf-8?q?2z1gfhluspEbvS0uG7GeKd7RtDGKnoMFkf9spVFujSoDL3iFlWVP0+m9kD4MKe8vY?= =?utf-8?q?2vm7LHUEwscsntb09DDHeWKXNDLL5CQq8hSxZAIQ/hpMhSpafYQuwoqqd0VH+zVP7?= =?utf-8?q?rTK6UEEhloLM7lj007lCJDB62WbV29r9eqCJI3rBNeCO+QJXhRx/Iu6dk6mLn/m37?= =?utf-8?q?e9K10nuCL6nQbDa97YzKhQzGeapJdyBcbmJfx/M9IMvo3liNQeJyg5tFYaX0kWjdi?= =?utf-8?q?xTfaI+BERFU2sG1CiKk4r340VLG57RDx4ZhICngQdX2+6YpbqVd6rowGZwzLHqDRP?= =?utf-8?q?Foia5UGyhQ1WWN5dhZ6S8nz0mN6Nyuy0ALS7HnaAEbnBrus+B7qUZpPILCcF8saTT?= =?utf-8?q?TDm0uL1S/2q+dismQh4lMvsyLecBJazk8ylIEPhsj1K6dH63jcBX3h32DL3511gtr?= =?utf-8?q?w84i6ZpZNkrg0Z4QknFqMs1tuolt3Dt+cEKmb1rdeQBGiZMwZ25HHAlacTyjRNxv5?= =?utf-8?q?qta2X4vRF+QezaAbK1YlXPvnJYszqQi2HRvRwoFLFCAYI27l1n1yxXjN+tmr00xmm?= =?utf-8?q?7eetpHMWSaoxbGZNAWsIjGOxY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3HvNP+obD6Sl0fYSttUD30=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: d10bcd99-afe3-4ea2-52b6-08dc1e943a9b X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6382.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 17:28:36.7887 (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: uM0XNXV4kW2jJyzuqY0Wo5PbZbEWS7COw9VbfGS+OSfsRy+zwLdhH7rl9WB7rfYN5yeD7IV/3zbdd4newnrixiExlu87DX/X/3FJs4dv6004xpuA4VN1mDI4rnoioQys X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 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 GPIO0_B5 which is the RTS signal for uart5. Which means GPIO0_B5 is implemented as rs485 rx-enable gpio. In full-duplex mode (em485 is disabled), DE is connected to GPIO0_B5 and RE is grounded (active). This requires rx-enable gpio to be inactive to enable DE as well. Signed-off-by: Farouk Bouabid --- arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts b/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts index 16798eb77077..369a6518a487 100644 --- a/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts +++ b/arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts @@ -227,6 +227,8 @@ &uart0 { &uart5 { pinctrl-0 = <&uart5_xfer>; + rs485-rx-enable-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>; + rs485-rx-enable-inactive-when-rs485-disabled; status = "okay"; };