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: 13532964 Return-Path: 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 2916AC47DDB for ; Fri, 26 Jan 2024 17:29:43 +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=RsfJClCRoJW0m37GlT7Q0/wrGAVCt6sCCKPt4JAquew=; b=FvIlV9alcMsekndk1oXc9uyoqM BuTysrhcTgTpNr/aBUx9sTJyzxifd0lwLr6k2L3SRJ2l+amIBpRjHj5kESDo+SqaIiKoOynqvd3Se qVWU28bi54wbbnrxqPh7cKkDXl/EtOwRLaX+IQSSXO1QYmvX0egDy13yKrdzzGPpZrQjl5gqV8QI0 SXH57zJDQSPOLqe4RwP/Fn8BZj74W0eQZ1PahZeoardo3QlKGEa3Tady2G+1HH0mW/l9b8D7Lhy3n verhTITWoNfjFXpmMR0gGNPtSgYRB1ODAZZ0n6bdX3viKK1DUCdobmR11rHBcUStx3Rm8W2fovtyL 2FF3eX5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ1L-00000004tgR-0QrR; Fri, 26 Jan 2024 17:29:39 +0000 Received: from mail-he1eur04on20600.outbound.protection.outlook.com ([2a01:111:f403:260f::600] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTQ0Y-00000004t5z-0M27; Fri, 26 Jan 2024 17:28:52 +0000 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) 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?e9K10nuC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XnsMu81QqRatedCa4Giw1BfdROB+D5fY5r0z4bElxS?= =?utf-8?q?eie5c+q1CjXZAekWCuL8o9h5VfzB/qmft0rpGttC//4kl+l7LpQecvDT6BKOD3Z56?= =?utf-8?q?dcGO0QHsjY1eW5sMjjGfSuYbRWEGyi9Bq+aQ1fIRjboS/T5KydZImH+x9pRqgUphP?= =?utf-8?q?WOo/IW/RP/plRSbK4PQmMNxlcs7zgteQ2Zg3YOoxuCisxtuRqWhdKx0EVpdKQ8/dK?= =?utf-8?q?RagBTdd/RTc1eoY7LomPXBZdTMNUTXUohvFqrcGbkq4VkpVYq7z+S0Wq/m0qiaZSw?= =?utf-8?q?vsEJSuk3JYA6jgm2QGodRy0b6zd1B/hySM2yHqwQtgbzqOPFvBmkNa+jyV2L3JB+q?= =?utf-8?q?jlSnC8yDVE41vEhjqj3Jz91sXUMpUnH+k3HvNP+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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240126_092850_551256_D9A5B4B1 X-CRM114-Status: GOOD ( 11.11 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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"; };