Message ID | 20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-40432-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp27258dyb; Fri, 26 Jan 2024 09:29:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGJP+ys1h4C/L4JpklaSqFDds381n3i/hmv0dFbTN07mpjeMt79DAM/cuZOqVh26iTKvrTx X-Received: by 2002:a05:600c:2281:b0:40e:4672:5227 with SMTP id 1-20020a05600c228100b0040e46725227mr99889wmf.96.1706290179007; Fri, 26 Jan 2024 09:29:39 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s5-20020a170906bc4500b00a312b3e20bdsi820418ejv.691.2024.01.26.09.29.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 09:29:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40432-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@theobroma-systems.com header.s=selector1 header.b=DqOCkTAT; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-40432-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40432-ouuuleilei=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 410871F25D2C for <ouuuleilei@gmail.com>; Fri, 26 Jan 2024 17:29:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CDAC20DE1; Fri, 26 Jan 2024 17:28:48 +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="DqOCkTAT" 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 F3D6D20310; Fri, 26 Jan 2024 17:28:41 +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=1706290123; cv=fail; b=YXMgIcGBYFnj+eATIHFoSn9UxNqr2Q/RiAKUhkYuuDL5kNYDSpAawY2zPf5jOVk82PRMF6Yk/IpSjwergp4qSHZx+EPXOsff1vLC0Z5/Vfusq74EcdunkX1/jSUVDWjtIk0Tjm1lBE2lIwVA9ktdVfGUbXuepTP8SeDZMTIb7uQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290123; c=relaxed/simple; bh=NRrgh+Y9FIMseBhbOBZyhEbQUd5QdnX7T6VYG5vpoOo=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=BQUpGXe4s0di7VLO1dvKwXG2qPxVNX5G8OXEROVWvjNAdxLyGU/GVvfwAYDqyXfjHxBax5uc6KonFiZWxo83KRiG34KqL1ILZwix0QfZUNu1s+wUZT6mnXNu67jJ7GG/3OJalS17+Wi9Y4V63JbFC4Rack+vzMiZ31+dH16icdU= 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=DqOCkTAT; 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HN6fy3Rp9fOOkOrqNREq14ptydzsnXtAj8xD3NNg16gnfrlcYz0phBf3SzhHDlQY5+f1Gf5oCf0lNGRb2H6j6LJm4eb9+nFvIi5j40nBFCB9+dLk6u7CB+n7ltV6nhyNnNmd0DXrx/8QxiEYmi+D6QFXnusYVCDRGdZn9xlGxBO0oGRPTH7ScGnB0oNlY0h3ibp05dJqEWUV19C8A4OisavraPVjczCNHBjQ3/c2AWoLormf58uvMYhkyXPdHUqKPTVCsUySAcZXOY8lXSnr7d2sj+pANTir1cOcFhf85odly4CIn+8f2gftwTXiGItD2wO97k8QggtbDk7F3q/9kg== 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=parlSHQK5YZjdQ16b5JzjP0e9/POUszZXm2OhL0Vmzc=; b=GsOcDvQjFWdKm6cQjaisK9FBuT5cX4PIeOVVRY10UFIrhSKntvG7N0ARQXm3tcUfqA2CkPsSOEmKLHzpOCWT8cm8+vnOsGDmECSZVIRYEVOUOQ37cZsdPGh0jMHwVOewWsWWf/XkDObdQm90w0mBitAiR2XGPB1pKNgq/vgtxpB+4jfLXOLlHnruaQh33shDUtV2NyiRb/PvIKglr5/mWO8kCJHKfFIoKN566LlYx1jK0f2luttMX2RebduoeP8TGoRRKOrkg0PdLqbqd7N58WfhSQzMPQyG+MjskCfxsVp2wAPPppGH4BmsQk+7U+sBFzcTUJKkPOD/Z7NQnXhfTw== 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=parlSHQK5YZjdQ16b5JzjP0e9/POUszZXm2OhL0Vmzc=; b=DqOCkTAT1CZl/ekaB4Rs2sNQf9Xg/bJViyBAbO3bpvj8VZM1JTcgtAG+fADyU1GVJq/huaWUqjymaHw2xI0HT3+SzOKOU8OJtoj7esZdvexdC9Kj1gPzET4wq41WIINS4vLPgl4NkBKN5fSvCDWPCBk91vAO82b2WwWVrjqLM27Wl7bpOhFRY2p4UZI41Ji4shrXzyixsxnW3sXWIjWyLMCxbMuHcrYU7GtNmPVSdY/h99Sm2FsKARRtINvdB2lpWmZ67YQlt7SKZPr93eBGtPad24oZW0XqHyXD1b0jNknVWj0WKq4+BfPlH8D3K7pJCi9ScldDyox3no+zzzpHuA== 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:35 +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:34 +0000 From: Farouk Bouabid <farouk.bouabid@theobroma-systems.com> Subject: [PATCH v5 0/6] serial: 8250: Add support for rs485 half/full duplex on puma/ringneck-haikou Date: Fri, 26 Jan 2024 18:27:41 +0100 Message-Id: <20240126-dev-rx-enable-v5-0-5d934eda05ca@theobroma-systems.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAI3rs2UC/53PwYrDIBDG8VcpnmvRiSZmT/seSw/GGRuhiYsGa Sl599oeloVuetjjNzA/+N9YphQos4/djSUqIYc416H3O+ZGO5+IB6ybgQAlJGiOVHi6cJrtcCa OxkiDg+8cGFZ/vhP5cHl6X8e6x5CXmK5PvsjHdUsqkguuW4POWuvAwecyUhxSnCzP17zQlA8uT uyhFvVWUlXyTQ/eSaW8NBvS/qeq/UtoFCC2NCiU/f8Epa31Cvu2AfOuRv+ueZF0lUQnhKROIjS b0rqud4hupgXOAQAA To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Heiko Stuebner <heiko@sntech.de> Cc: Rob Herring <robh@kernel.org>, 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 <heiko.stuebner@cherry.de>, Farouk Bouabid <farouk.bouabid@theobroma-systems.com> 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-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6382:EE_|DB9PR04MB9820:EE_ X-MS-Office365-Filtering-Correlation-Id: acdd3803-7402-4637-e53f-08dc1e943910 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SM/N5GSqYRTKTHjb+Gc5QmzGhw9R+T8EduscFf9ITmS4febcckg1iEqcRuzHz9XWIIZVVpl5HzXf7BxwkpAi0yiml71zqQmvi5tMvWS1ZGbQOe341ot5OVjLJwdDL+/O+SHG2p70/83cUrzmXVmQF2h+48dT/yHevvOQNtXKmF0AEWNehC5VhqyxFy6/XUVXp31PP6COtxtOa4+nPLuoHFo3PcYoCnXbyuHdQ5R/LxUwtpvxLB9gp0w4lf4A2WZdG0GR+2mFcqIiBesFJxDI7hukiMhGp5ly+EmUxV2ocvTo7vcr6Xl59dc38Kz1mVYQqC31Qsos0bLjKx608rZhG8Yr9AvWtHldQWgv9XZNUQGIsCH43SuedzAfcU26msgxPlsQ2QSW+TKWRA2Es3ydXRH00HtyadbQPNBeQZAY4/8/CwWA5Gqt2eI/vX179hQDfowFYHAms8nqPi1EUCFOYP0/a6hW6vce5pxBOUeLPR7h1v+T0aIkeGzeEUOd6qUfAYViuoVYSlxLhYkfHwEF+kV3p2NuAgD1nJFNVzY33fAscpBfJpZDZ68Bc06vcYDJiIIef5GF7azTcZArJSaWF2nt7xdIpzCNpnJEgazOkNm3sGofQCZOZt1fxfL5hU2tyel/03mZQsXNENkbMp7zvw== 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)(230273577357003)(230922051799003)(230173577357003)(64100799003)(186009)(1800799012)(451199024)(36756003)(478600001)(8676002)(4326008)(7416002)(8936002)(66556008)(54906003)(5660300002)(6486002)(44832011)(966005)(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?SYG6Q21991Ga+eSw1s9ZLtd5khCk?= =?utf-8?q?36DYwZBxb6jC133luij47dBVAT0lnU6jmBDwjWSbET295pQifWVEE6/Csg95LWpYB?= =?utf-8?q?IjW6DAQ+sS+dskxrrkQiYzBGUFh0MB+hLypRQMiWwjnsalYGFl9ABPRXSz3fPtWeI?= =?utf-8?q?w2cIRsl4qJ8hySHQ1+dprv7ue+rBzc6GDWlqQMQVnEHPcgkzfFA+EMj6+/PBjmVKw?= =?utf-8?q?efprYgsbSBnv3y+0t1IB1OjUoIKXAtlg7HPJ1JyjlxBF5R2sNxsnJddgpCiQROXp0?= =?utf-8?q?aaVVV/4dLcXuzwjacbMx7CU9vFjN8qjnRjSJjQAJrSJ6XdLis3rEJ6ic/wLudgIXy?= =?utf-8?q?EAgpLJUQnYtTOAImsRnMqR4CJrlPP9CFAcxK+Jtxk3epqxJMJnpxIRtX+LHqEBeyQ?= =?utf-8?q?u4pk0G+ENfEv2bsn8Dh5g01p3zesfdLCTbloxo3v/8p2/8P3C0pzdg1yvMtJcgqzj?= =?utf-8?q?INrg3ZvG9jaFahySNr3Is/UiJFuACkCbVg3R4RNdJ3tJiZrsPsb+prbsmxD/Wdw15?= =?utf-8?q?g0pUzoqukEoAJzMLXUOrdOPsxoVugLzPiembsVN6kAkK8dOmRPOPM1Jdd570nBmMZ?= =?utf-8?q?aRo8np0mwMeD5XTvq9mXUIyqs2G/1i1Vl1GN5dbUN/QOo+0k/JPpYZjTin3x06Q6c?= =?utf-8?q?lXPq0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q?zAt2rZh3AkO1TxC0YRo9d5J43Md/Z4t0GpXgn5MSPh37VL9X2xDZH8k=3D?= X-OriginatorOrg: theobroma-systems.com X-MS-Exchange-CrossTenant-Network-Message-Id: acdd3803-7402-4637-e53f-08dc1e943910 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.2700 (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: WSe4Lkdte9WQccOXkUjtutcWYxVu0ilDiyWffXLVNnCaV3c/vug6YeLY0ZWb4VKLM3AW3v6UCnJbQD+cnHWTWJl2zAvcf4/Q9UPn9xe7Nkxf2tixY6J55WkxZc3fbZYQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9820 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789165456873452217 X-GMAIL-MSGID: 1789174930736218871 |
Series |
serial: 8250: Add support for rs485 half/full duplex on puma/ringneck-haikou
|
|
Message
Farouk Bouabid
Jan. 26, 2024, 5:27 p.m. UTC
This series tries to revive the work of Heiko Stuebner from 2020 On the boards that we are using (ringneck/puma-haikou) a hardware switch can set the rs485 transceiver into half or full duplex mode. In half-duplex mode the DE/RE signal of the rs485 transceiver is not connected to an RTS signal whose control is already handled in the rs485 emulation (start/stop callbacks), but rather to a gpio. And since enabling the receiver requires setting this gpio active we need to do that in em485 while receiving and disable it while sending to enable the driver mode. In full-duplex mode RE is grounded and separated from DE. Meanwhile the rx-enable gpio remains connected to the DE pin. In this case the receiver-enable gpio should be disabled to enable driver mode in parallel to the enabled receiver. This patch-series adds support for controlling the receiver mode using a gpio in em485 for half-duplex mode while allowing users to keep using the full-duplex feature if em485 is disabled. Changes in v5: - set port->rs485_re_gpio in "serial: 8250: Support separate rs485 rx-enable GPIO" - Link to v4: https://lore.kernel.org/r/20240126-dev-rx-enable-v4-0-45aaf4d96328@theobroma-systems.com Changes in v4: - define the state of rx-enable gpio when em485 is disabled - add rs485 half/full duplex support to ringneck/puma-haikou - use dev_err_probe instead of dev_err if error is -EPROBE_DEFER Changes from the 2020 submission include: - external gpio for optional receiver-enable handling - Link to v3: https://lore.kernel.org/all/20200517215610.2131618-1-heiko@sntech.de/ --- Farouk Bouabid (4): dt-bindings: serial: add binding for rs485 rx-enable state when rs485 is disabled serial: 8250: set rx-enable gpio state when rs485 is disabled arm64: dts: rockchip: rk3399-puma-haikou: add rs485 support on uart2 arm64: dts: rockchip: px30-ringneck-haikou: add rs485 support on uart5 Heiko Stuebner (2): dt-bindings: serial: Add binding for rs485 receiver enable GPIO serial: 8250: Support separate rs485 rx-enable GPIO Documentation/devicetree/bindings/serial/rs485.yaml | 9 +++++++++ arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts | 2 ++ arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 4 +++- drivers/tty/serial/8250/8250_port.c | 11 ++++++++++- drivers/tty/serial/serial_core.c | 11 +++++++++++ include/linux/serial_core.h | 2 ++ 6 files changed, 37 insertions(+), 2 deletions(-) --- base-commit: 5ebe731c2a586b379103f736cd498bcca3cf1ea9 change-id: 20240125-dev-rx-enable-d8818dbf7c28 Best regards,