Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp654447rdb; Fri, 26 Jan 2024 07:00:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGMx1cdceJA5O7eThSNDfjoIQyc+Hjt/GNCv2DlZNWaYulHBSVaa5DVq50bSJJJ3zl0/bDu X-Received: by 2002:a05:6402:34c6:b0:55c:71e7:4b1f with SMTP id w6-20020a05640234c600b0055c71e74b1fmr1069076edc.2.1706281211405; Fri, 26 Jan 2024 07:00:11 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v24-20020a50a458000000b0055a52f6f955si744950edb.38.2024.01.26.07.00.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 07:00:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@theobroma-systems.com header.s=selector1 header.b="NW/Rzc/v"; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-40236-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40236-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=theobroma-systems.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 06E071F22B1A for ; Fri, 26 Jan 2024 15:00:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 927111DFE4; Fri, 26 Jan 2024 14:58:37 +0000 (UTC) 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" 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 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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-kernel@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?B?MXR3cWI0ZjRxNU0xTmswamRFSTkxWEpvVC93U2I0d2QzMWh2NzBPTjhoTklV?= =?utf-8?B?bkY3Z0h5VlBubnMzWmF2KzVHUEQ2TFc2VHpBU1Q1a2lRN1ZpM1VuYVB0Mk83?= =?utf-8?B?WXVYYkl3ZDVvdXl1RTJNTW1nd1VLQ3pxNStBakJ3YW12L05vaStOUDZpS2VV?= =?utf-8?B?eEJiWjl4YXIzRTJMTzAwNHNhYVM2NU1YRFlVUFhFYmJEN2k2NmhzTUx4SUpv?= =?utf-8?B?dTFSRkxKY1JBTmZ2UXNBa3dYTEFNQnM4QUZxdGs3R09mS1BPZ1hCUyt5TEUw?= =?utf-8?B?b3U0aHF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a3NnL2hEUGgwVXBiZmp4bktj?= =?utf-8?B?cU1SaFlmaXRtV1lGVVZRT3E1eDhHeDQxWlFlcmNEQVhZUE9sKzdqN0hqbnRX?= =?utf-8?Q?3dcRZ9kCRdIMAorSbmRkIvw=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"; }; -- 2.34.1