From patchwork Fri Jan 26 14:55:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Farouk Bouabid X-Patchwork-Id: 767172 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2040.outbound.protection.outlook.com [40.107.22.40]) (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 7FD4A1CA9A; Fri, 26 Jan 2024 14:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706281116; cv=fail; b=M8bC8pByDr4aoh9J7m6ZUS2BSfJ/d06DCf7G24NmWpIFaO+XdZIqvgdfw1ELR4EMIgSq4kVs6xD12OYswPxFxP6E/3tSm6AkFGlAa3GCsSty1sYq+E2d2LUR4cMz//PMi+dpZZjywkd8EAjjb0YOJbgi17qgNOVQLbsCFuaXdDM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706281116; c=relaxed/simple; bh=L1LBo3EmHljy0N4wo6uS24KfxGyxhrOe9FDDZAXSSXY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=HcDZLZ/oVnLKvOoW0yjCZJNHvxFirntes9IwEABc9hVBa3rqrWWWUctWvF5q0eX0ZfAKoYwk3JAWaGl2XMlLVT/sFGwgp50eMtXVyn6o34m0vwdkFn67DccUmVBGcGoxUgNaW2MOZfAv0bJk3yaOVaHtyBPzeHKu4CljvU35ztk= 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=NW/Rzc/v; arc=fail smtp.client-ip=40.107.22.40 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="NW/Rzc/v" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEZV7cXC2JLpj6SdV3H2Dg6dkr2w1IpE+59odzv2Vg9VWHiEAvkAVd4zKHEC1BEnuPGbJtB759Bn1r2nPSFVfh7Pxr+lLhZOAp2MQnyGHkAZvRSXuLztpOMUZXZgb0fyKBT7L08KEmBQ5n2+/maPJkLbQch66YDKLnAYvBVgwbNWdCz7FBf6i69ueSjZ1JATY+YrGJBLXC3Fz+yGKqpmHslZlrHCfbJgEBdmXpRvExsF5A6L9OJOwIy5Iq2kHXLgRi00ZQobQdDlOb23CWt4m7i4dDZYqnv4nx9gT30errzgscqeE04xJ9pNVwZ/4rIZQv9LuKj8v3xukgAWmXUzxg== 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=N0dTU1WSOo4LVAXO9M5U++homUxYWk0+pn87MpCtnGDuwcs/n6t7AiIp8h2tZ7yeON6Zw/XMTYnyH+TjPmbGpceZFQ0vAcgYNFMcne1vypSDpbCRvm99BN2n+brpkeErIoKPXzgd33ttDJcr4BRAIp6Ga7edq5v/PpAahMKtEMR4TygP2qPrVpBLz/sl1OnoCaXdUs3nnBy+tSdJfFWr/IOSjV61XztxbejR1oVqqfDusc8Dj3Utt7NR4DkYhULOcxt7B295LcGIWfWZqjN3e9vtwTTQhT66zOOYFYL49LjxpjjdgxaDNymqmvpkU1VGm0aeLv5ov10P0FC5b/RAUQ== 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=NW/Rzc/vjPiobwyC3PDI2BMv0ymC+h2Xr11AdKhv0tJRMfRdyOz1+4yMX0cDmogaUwKABQjI12iwb1pbdvhLuQsMMoKVYWvY0aa78Z3tQIVjkLsiko5aS83yg3zyuYfXwIRDnwzXqDgaw2FMy6J1HL617JDBH2SDfSfky9UwIfG07Es09tJSZbSaCBeRbIAmzPnM7BMwwmB78e0mOH087UE3Ysk1U46TV3a9zgX9yaH5L3evNUw+kHVg4tnRIoOGPIIgds63KN87T9wZFrYzY30dGIxDHAGZN8NKzbUtgASPFzqwWqcNDdyz89Iepaz05jJaQZ6euK0W8fQUmqtmfg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=theobroma-systems.com; Received: from AM0PR04MB6371.eurprd04.prod.outlook.com (2603:10a6:208:178::19) by GVXPR04MB9735.eurprd04.prod.outlook.com (2603:10a6:150:118::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Fri, 26 Jan 2024 14:58:27 +0000 Received: from AM0PR04MB6371.eurprd04.prod.outlook.com ([fe80::e130:6c40:23e5:9a8f]) by AM0PR04MB6371.eurprd04.prod.outlook.com ([fe80::e130:6c40:23e5:9a8f%5]) with mapi id 15.20.7228.022; Fri, 26 Jan 2024 14:58:27 +0000 From: Farouk Bouabid Date: Fri, 26 Jan 2024 15:55:15 +0100 Subject: [PATCH v4 6/6] arm64: dts: rockchip: px30-ringneck-haikou: add rs485 support on uart5 Message-Id: <20240126-dev-rx-enable-v4-6-45aaf4d96328@theobroma-systems.com> References: <20240126-dev-rx-enable-v4-0-45aaf4d96328@theobroma-systems.com> In-Reply-To: <20240126-dev-rx-enable-v4-0-45aaf4d96328@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: VI1PR06CA0114.eurprd06.prod.outlook.com (2603:10a6:803:8c::43) To AM0PR04MB6371.eurprd04.prod.outlook.com (2603:10a6:208:178::19) 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: AM0PR04MB6371:EE_|GVXPR04MB9735:EE_ X-MS-Office365-Filtering-Correlation-Id: 402d2297-329a-4ce6-3f6e-08dc1e7f4076 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B2EHdQFhHVfIHVDeEtrMVG5Mn3scCo7JXD7IeFOHBW++LNmM0+tNyCZEl0eo1babFhMwJ6cw3K/fjfxSlka7CWj9eRlNJe3kJrXy4+dcg23n/F7m9Csl667rUOSQ/jSefDULzUDedzvUjIBAicW0LpPoyKpW6JqgbXtqFmqmsZcYVxVn9H/jtltxwYQ66r7v7Z40co3DFy2Z1VxJ+xBzYv+/EN3ct7SUsTe1ARdHvZV3sp0eD0fhA/pPNN/3pxsHM7pmN0yniaZpmEvHhhHPDE6gn/M88vuNHY+KD88cyNwKJTBFensfObIELiTdYw1H2969FcGnHsci2wVRlRzRIPDrYaDomY4Z0Z6tsCkwrMiORDb1aFuyv+HEU0vw9S3mTDVRFeboORzYSTgDfNFk7gqGVtJSulRx/FWjwuuHeArOVQy6n1+g3+au7y+Zc1sFEOyobVzChUSNkYVSiBzqGd14e0ynU305nbjsz2t0xVKeyjXsVYtZBughapBUvFMco52qNSTAzEfiUsNinCVkOJjXwRA5oBuJHdg+MQnWKz64flQtwfbHbkEGqJqw+B/AqIOfB+YlsBSlY930SCVoNoIhyD3KiOs068NB3uP0PE5pYxmBQgWKx/hURQUtLTbf X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB6371.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(346002)(136003)(39850400004)(376002)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(66476007)(54906003)(66556008)(86362001)(478600001)(38100700002)(6486002)(6506007)(36756003)(38350700005)(41300700001)(52116002)(4326008)(8676002)(8936002)(26005)(2616005)(316002)(5660300002)(66946007)(6512007)(6666004)(7416002)(2906002)(44832011)(83380400001)(107886003)(110136005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?1twqb4f4q5M1Nk0jdEI91XJoT/wS?= =?utf-8?q?b4wd31hv70ON8hNIUnF7gHyVPnns3Zav+5GPD6LW6TzAST5kiQ7Vi3UnaPt2O7YuX?= =?utf-8?q?bIwd5ouyuE2MMmgwUKCzq5+AjBwamv/Noi+NP6iKeUxBbZ9xar3E2LO004saaS65M?= =?utf-8?q?XDYUPXEbbD7i66hsMLxIJou1RFLJcRANfvQsAkwXLAMBs8AFqtk7GOfKPOgXBS+yL?= =?utf-8?q?E0ou4hqKqKt0oz1or+1MgJVbuW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Jn6yL/Gk1ptVxIFrTjlYmc+oo9h5v0OVTNGiGtNk6V?= =?utf-8?q?gr8aPdINaUZjcyR8l9ryn+nQje7YmCBZSFWvv+BF6mVXRHPStUzL1sBR3/DAdpLEX?= =?utf-8?q?wa7//4a/Ii+e/JVs49AfMt2FrsERaWRARXR7U7w/r0oWBxHTGjwuiJHrg/V7c7a4d?= =?utf-8?q?UvTnBxBc9fcRUfArmmOxPtCxj9OgE6DII28GqOQVUMQfuItXxCzEB6BIsAB2/ihxW?= =?utf-8?q?5T8nkVikYzp1HeEGiIqI8CwixKwJwNB07yQvStYXeiT7BZklaiDKcNc9FxUQjvEuO?= =?utf-8?q?n/Xq8+vLuDj5JTNJRuvIPWKpZZCEfql4fobXr1So4hTaaH3f6hcGgN0vLeHHmIPW0?= =?utf-8?q?s5eP+jEdC24HiLtlpJicz7+VHY8TTpEwiqksg/hDPh0UpbfjxnKcqMRhYfitmWYFU?= =?utf-8?q?VQOq5x8Gx41ZQercDAXYPOl+7j7HjntW3dcRZ9kCRdIMAorSbmRkIvw=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 402d2297-329a-4ce6-3f6e-08dc1e7f4076 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6371.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 14:58:27.1648 (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: XNSD3WHet0GRzBjZHYALvtbaUjYUVkP/uXjs6KuaQuv9S9gHNsPKQharQKbZscxLrQN+lMp3l3hf4rX/9hmeTwHQqVl6fQ1DAmFZEHTdpXQRTle+YO7ZGehzVypmgKxt X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9735 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"; };