From patchwork Fri Jun 7 11:43:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crescent CY Hsieh X-Patchwork-Id: 802555 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2116.outbound.protection.outlook.com [40.107.215.116]) (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 35C1A611E; Fri, 7 Jun 2024 11:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.116 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760633; cv=fail; b=ZWfceUmS/fHDEf+3CHmuL1RFLxwdVUD+MTOUKQfkKTs1ermiLtkDun+ehKpPuyaFQgkFvxEBRep6Tkc5gVRrVkZ2WyyQGqCHx6lIFZR7Xl+l9dbz/TvxB0+gskTSDLGHBUFAPm9YvnhIaF8nn7k/VfGb7rnTyzbWZWjbtQlueCQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760633; c=relaxed/simple; bh=1igrwFt6ytDlgszlF9K1/i71Tqkrho05Bhva59vy6cg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=k2rxD3dqBIJKpuDvrouktaWbFi6xNWqWOOII0Ti7yv2hl048N6kVKkheVfJe8pISxvUCzsHQbf/lRSvuOkI+lmpIDBGCPWbAI7JBVcePUHIkSiD7P3/GCV3jK0XSKvyUWiWQ9yYlHVXUJ0sq9x3jmWqb8Bpv05JdxBQCv0xvrUg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com; spf=pass smtp.mailfrom=moxa.com; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b=QLpW62LC; arc=fail smtp.client-ip=40.107.215.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=moxa.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="QLpW62LC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EEPwxC2cnMQ+9UPXlYPeCLS3/r5XEwe4ZPpK1jahbrEKuGI2WU0X/c4azsHpBVyz/DsKdL5oGx7k4d2tiQxLXSyzQUozQM5btvzKYqXuIHbYL/bxc4atH4/QS51Ou42gnFl00VBjBQoaMrAj0dbuPrBSEHF7GPwC011TF8y9IgWSITzbX0p/UMjy7qyWLGAR6GINY4S0Gw15ImZk6Wglz8iH5fzAOGdItoBnuGOAa0kyurKVvuxGttRBqkEN9aJ8Imu5LdNzcKL1zgTqkHVVdhz7rxk/RjfojKAB+IOC2KUZfobxebj+zOVUCiSbqnDurqQYf0eWeqdt9m0CuTERlw== 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=BsJK0HI7UA6YRyAT/LLGCLSXKg+kizIppe4YaZr3tAQ=; b=hVpzx6ecIISyOCj/PieosAaW40xf+gcYuDUJkDsxuY0+knU/butL1dHYno3+EdopogGoO1iSivZpTUIAijStUmLlQtrqQxCgIRkO+B4dYAd5r/iRhqmTO9WBBMNKE/W4BPD8M2DQxk5/QnrHNfuxkP/+ljCEACOZHyqkbL0MXwj3Np6+barjxyR7ZEVOaChRZ/iYqDUuWRc9v/aeq6dPNG2xhtf5pJhIYMWvPNXz+duDRhHwl4wk7VnFChM4BVHxj7tboszvySSr/kKJI7z5bZ7UW2KETex1Y6n25YiQxNMfBQoFwke9NRJhSudxpCAgEZ8wL0UVJxzGB8cyR9mtLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BsJK0HI7UA6YRyAT/LLGCLSXKg+kizIppe4YaZr3tAQ=; b=QLpW62LC14cpkTIsCR21ZX51woSuticKCFpPKwUKT3EtR1h3YoArHrzha7Di9P82DRPWBHytbSSCqreb4ccp2R7sNji+9sMnQxPiiPECJLagiLpkp2VeBAtA4y64I+N8bm50RJ0prNjYh9tSZ8goAjkg8N8k6QhWiRblVm1iot4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=moxa.com; Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) by SEZPR01MB5588.apcprd01.prod.exchangelabs.com (2603:1096:101:12f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 11:43:47 +0000 Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817]) by PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817%5]) with mapi id 15.20.7633.033; Fri, 7 Jun 2024 11:43:47 +0000 From: Crescent Hsieh To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent Hsieh Subject: [PATCH 1/6] tty: serial: 8250: Fix the amount of ports doesn't match the device Date: Fri, 7 Jun 2024 19:43:31 +0800 Message-Id: <20240607114336.4496-2-crescentcy.hsieh@moxa.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> X-ClientProxiedBy: TYCP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::12) To PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) 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: PUZPR01MB5405:EE_|SEZPR01MB5588:EE_ X-MS-Office365-Filtering-Correlation-Id: 46277a71-6139-4222-dffb-08dc86e7175c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: R56pBnWuQbsFYeeWBvws2HTKfeVxKLqDsLkKlw38iT3plgdmnkQVHFzIoPXwT9QhjFe+eCK+fOf2fiBpkMgfRQo5bLBSJrNWnh+rctPbSxbSGMuLXP0jHeRnRKFoSVb3vfKiP/ZIS7+a3vRAhXW3yK6/Ta31z2Q4pMRqaJrjGGKo8++lqPmgG9Xk3Ey6qWmLyg1V88OKItQCH9gnJqo+4j0GJwPlx5/KLNUG5ST6qd8ax1tjW8QU86XnPs63xpSknLPApIrYy/SpefgZralbnCoAPM+uY0vBF7tP9uqeDmL+uERXHeaFwBzarWehO6Ah3PBJomEbYIe4qercfb4xeejl3lmYMxzthe8rmwZwR9o8edVVwFGXXq1FZ76Dwo+vQjcM4TfrdFs6qNynte0YEa6QIGngd/Icnbfi0C4QygfJpUQIFtWgMiTCxEkkzGPT8P1VTx+4SdGKpuF9+Vqhq/FWSY94yCD+CxDNovwrVuM6Ydxg0mpTLQGKOzBKCQM7c3KeKh390oQRoHQyGYprPUuNt1QOxYZx3dPW5WM4r96WzBpiI0Z9qitwA4Na0g5XZtAA2ENZWgbZQ0RA2mb5Mir5LHrDfrYLLarZbWMs7JJEL6pEEyYuiXuOp+HEBIwBMjI2zzObiRMwThn2gwOPS29BV5dmOfvauBB5ypxGIO1XwDO2YV9dPTsQK5VhCuvVT6Zczr/tPx4paOncRgZ5qFx7KwUIg/LSIK4tJ6VWg64drwDdtUytUVccgWyZxR0GO8KEqgnFAgS2dHAFMJOM8Dzfoat11FmG2oMgCTMMlCCeRBcbxwhYkQ7TkfpziVosJUahi/akBzPgNVzGNI8nksUlj6PKwvNK68YRyi9tGnCp/qGV72RpjS6QV2vp7iqLKipPf2Q7nQTzi08KyzVHKgfKoYFtIKXNKZ/wnQJfAeqySP/iq/OftZln9MiGuzcG0e4qjMUa4UfpF/+wHzY2x21bv/lqeU65uy0M9saLUltAbc1BkkQwRXNbFunMJTwpz3MF8frWVCeZip0tVCMnHmfZLb6gXcSwLJXl8NBRrhSuVvVNVLDi4JU+rWUzB3K2jcyVM86wGDkjcCdFts2HF6fZZsFvZieKa3fRc7RpPrJwJjM9omwfAueiW3zqNgWjjataydkaQYUZd9bsEbmmM+HxY9WjkYPqUT+GfA4dIT2iELvV1vjvnjJwCTJ2ILctKTKxZodN0ju3P6fjpVVXhMRXyVUbLaRFaJTkerl56FKQCWMS+v/pTl935JfG2x9Kh239gGeB1P9+MJpRhzg2CMgwV4yYiXKuMNaNdjX0Vg4EVkhTx3DFvL9BXxcFKHh5aH2KTqWL5+kGPdAcnTV+a0eLln3bcKRkaRz9/7lwLgI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR01MB5405.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oPUe7fpOKwu6TrXWVAs+7QM0IBzLejU0WTJOZ9pWP16ZQC7f7V5LPbDbD4IqrbfAvwfNKWrYy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mExIu103mDV34x7BWjLQfm3797ltsoqe8vs7jBENwpqO0tdjTp0VBun4j+gb4tP+3Jbds8lKIAUYxWVOBB+6yNMcYHHPTnEwDE9uzTn91CGLid9msngYqLoX6AL9zsPVp+MV7p5+CPZ3us/HMa3rOZzaLm/lSfmDVsRELh6cU5oRH1EZQgCobH8KL+aJtY2Mo1xvl12iCjsEkvDplyG281vQT97kMXPsHcNuUYrHoYW7BXU88IKVFKhDMdVf9IdPUikXr2y4uF/ijduogR4N7+A+75YSuMakdG6mierGfB8r/kc/ATN+kNBb311RmY5ldeBFr5LoQrFkh6SLbduYsCwuihQxxBPtA6BVuNSIM3rYDTla9pD1hp10EOV/57RKZ8YGJwaLsY+N4t0bIi6SJ8n7hgrLBD8U495TDGMdxE0Du656suM36wmvAG59vxpSDCErCKwcHlSwZ2UKv3PrE5w== X-OriginatorOrg: moxa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46277a71-6139-4222-dffb-08dc86e7175c X-MS-Exchange-CrossTenant-AuthSource: PUZPR01MB5405.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 11:43:46.9729 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wnE0UcKqchKAGyeBKdqronT+miRbOkDP7JROQJ9qYhmRUtftWTtA5yNNiBNUep5DZMWpB2fGx05Z+QVtP0BiXks2e+5pdi6OYGa8fYLVmrM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR01MB5588 Normally, the amount of ports is written at the third digit of device ID of Moxa PCI boards, for example: `0x1121` indicates a 2 ports device. However, `CP116E_A_A` and `CP116E_A_B` are two exceptions, which has 8 ports but the third digit of device ID is `6`. This patch fixes the issue above by adding checks. Signed-off-by: Crescent Hsieh --- drivers/tty/serial/8250/8250_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 40af74b55933..4e88ee07e548 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -2041,6 +2041,10 @@ static int pci_moxa_init(struct pci_dev *dev) unsigned int num_ports = (device & 0x00F0) >> 4, i; u8 val, init_mode = MOXA_RS232; + if (device == PCI_DEVICE_ID_MOXA_CP116E_A_A || + device == PCI_DEVICE_ID_MOXA_CP116E_A_B) + num_ports = 8; + if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) { init_mode = MOXA_RS422; } From patchwork Fri Jun 7 11:43:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crescent CY Hsieh X-Patchwork-Id: 802554 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2091.outbound.protection.outlook.com [40.107.215.91]) (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 89E1619007B; Fri, 7 Jun 2024 11:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760637; cv=fail; b=abFXj5Iy0v+gq9A/FNBKCuh8u6gony5b2YYxwZdxazITvAl7YStfbYHCywzNB6pAiXU0e5ejylJqU/80Qq0+oqylMO7+BEY+QFoW1GCv3x74ZH/9TmusRLaLi4RYk/vb1VlLpLZ3ZMjGC9k9HU4J1Yi5rY6mXn3WDtFN4JF+wv4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760637; c=relaxed/simple; bh=Sh79cRi7op3wQC+cZ1Vey1+gugWkRf9F67JuE7hsT6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=S0KcOaRvyPr4DuQ4H1kKu+F9pDpCsfx+1BxNjfbjx8tWT0ahwo4L/J/cKdxnTTUdFBXpt5qCRYoxMgrzKcjXrlal/T9dpasj1RB58hutnVoPofcbsU/pFeneVQbjI6L2cWKFaYi1EsShoSVWBT2wUgUsFCH5Ew97/AQkLzpmH4U= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com; spf=pass smtp.mailfrom=moxa.com; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b=D0HRITug; arc=fail smtp.client-ip=40.107.215.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=moxa.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="D0HRITug" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B1VMJEROiIZNamhnUKA1PUGFcK5xAuB+DB0sDwrDYgQ1jZg7sLaAz6K0pgNmQrwEj2nvPHLlQwSU+EzEDkAMraWOfG06ollg/sMCcA+qqAHaVYhRVmjMXJBEDze7SKFLXp70eKvKVACJzMfvG2kDNZmh8deMWwGhc3z8ahgcXMYVKCnokbM28TWhnfAM7r5Y0hEJjKt0+wOXv9yZ6b+NlpN3TRR9XchAvZYHcil6WuQmnFRyjdCwr29i/QpfrDOKKDsgfx+pcW1vimDIXs8cfDbP4zXIOuYwh0s5uQCxmSrgTuTj18ilZjWDrZB8mP5gTzGiFFPp3MH0BArVKYXUPg== 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=w9jYIZd6J4J6wHuNAfjkJ7A7kKGyyvXVTPYPQBLh2mE=; b=WzdYl49JE/EWL2WSF06tlIvdrFLPp80i4Co0oiUaEZ29uWPHQ6ICpHPinxWqwWDkEMJaqnDKvjsULnSpuLG+N4dZqS7/vr7i9mljFyAzfloDZ8Tl7fG3SBff14tT5VlUJ61zSOiCaxiUrr9J6l2jVVxd4huNnVMpRTMYqA0wpocd1aZwxg+5xJynMgYUZZUEEXZm1GlU+GswWg0ql+jx/li4J0u8cguJTZhDA4l6e7F8CJ2uweNsR6qJvEyz73IIqZAy9mF9HtWGi2ywFWP1caBOHdnkUD3mjHgwmP/mLyPV0I8JCia5Dzu0+Z7/BdnNFvEjPurfzoB6ZIi35TJY3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w9jYIZd6J4J6wHuNAfjkJ7A7kKGyyvXVTPYPQBLh2mE=; b=D0HRITugFnKOchCGMnPamTzUW+eetDs91Ye6fSJ4+kZQDIUMuit80ldXtW20tXMwoBJ/+C4Ubk2IOtpmnEuf1WahkGh6DxsddTXkXTQfOFfaGoXOi7wBi9EntLGg+XD1lvxztw0cUjeavgVHg2kFFvi6ZUPkwXMfcEPPh84iAic= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=moxa.com; Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) by SEZPR01MB5588.apcprd01.prod.exchangelabs.com (2603:1096:101:12f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 11:43:47 +0000 Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817]) by PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817%5]) with mapi id 15.20.7633.033; Fri, 7 Jun 2024 11:43:47 +0000 From: Crescent Hsieh To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent Hsieh Subject: [PATCH 2/6] tty: serial: 8250: Add 2 ports PCI configuration for 921600 BAR 2 Date: Fri, 7 Jun 2024 19:43:32 +0800 Message-Id: <20240607114336.4496-3-crescentcy.hsieh@moxa.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> X-ClientProxiedBy: TYCP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::12) To PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) 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: PUZPR01MB5405:EE_|SEZPR01MB5588:EE_ X-MS-Office365-Filtering-Correlation-Id: 89e4c943-9d21-4228-64a0-08dc86e717d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: Eyce/Fn9Timetgzokosmh5idohF94gSTf4Fg9mOYYZONylMmsgyk4a6a6wYwqTIHdb3j0XvKxKTUSimkssr5U+Mr+bNH1NSmkcakbgihtdbDKTvglYwtHO1KaUg1g7EZa3SALyqi59BI6ENGGuJQEYZLIsPIBeMVgdNVbB95DizOgQv/FQyXdFirvkoP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rinnsADOIVwezTncxLy8KR7T4OpOq5szVfNyBpkEzU1fcxj+FbKHnYZIebR8BuINXEnTVurVX+7YZ9FxyRPbbio9DZIU2h67f1dH7Wd5LiLeb4DgOwjt51bCQo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR01MB5405.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JDLGy8n9L2HNJq2bwVMNI94Ix5KHiR7Y2wgpbzayL/KAItNB2b+6obKXKuYcLlssBhCt5Jq8jKG+WImlP40COL+/P1yv0drkh6H9KdglBcD+rQraMPMM3OEl9btx0nlQAzg/0OreAfHV5TNBq7GkfP55YiAAhnCjGrSt2hiZwHz5Pd5CXc3+/BTJvDCVYqlpWuBVEzoZINhADGTW0MimqOmU4B9XwyWM4VkbvYTH7eDglk2IIo6fszWGU9xedmUTYCHtAtELAepQf4TnRdPCrswc27tQMzAvOXnttTBsYdTFUe7W1dhbnnrcAzwX6zWxOoasjWITXIL4inb+b9sZzzF0hKFOGATs5XJSWohie+2Wf1GeXwXx/598fMvbpDbE8NYTLfjoN4fzusnNcbrg6mnp0eSYb/LOCOZVWBkyZ/kn9Q34EbtWZe8SKsZNORuB3B9lnwpoEPuHRSD9PA2bgLzl3Xi/HlgX80VnEWQMzidNGXoffxGUF9GZUuSh3bqzQYt2OYVuEEMD0e9q5mlVmcBgFCtG1vxudv/eMwKZwvmmm5j641y9JjMjlu4azmz0ZbVZsQDzf8djNAhxJMETgCoduTJkEHoXXRUwI4l/XaTOvVbIhUXO/9f37tSUVquVNm9lF2vtGzFKAC4OQ52/uUUO6rrl0sfoSEishXltVXNeoDgsvpK2+OQd/Q1MKbo/TC41sp3QlUUZBg5RZiyJNAmyRCBM25+C9eLGL4B4gdTZLpzvOohkKYPj2OvmGFM43MmDfFcNQ7vL41wK2st5wZ6BOkINDp26QBRg1kqQlcXssXCwbxfSsI0GiFJgdDMW2t0VwmO1CPJGtSxQ35QVfjXFqC4ITji4Vf+pgDd3q3KkhE45u4vj9zzkPFztv4Tnd6dh5D/dRveqMWGsCldNZ5ZhykPSKKDbgLuBSCFLk2axsHZaJPQ83HUb5ZUCUSffXz+2Qg3I2QTs+h7FJPo/ISz08S1cD2l689/1extEuF8evXTaMO4rgkV53+gSRctG8Xn6/6I0XDDdZ1goX8sjRBiL2068hucJonLxbhZZij9eioyNJZERiiigGDk0w8vn3ElB8siBQKc1fFugrhB46X3yB9jP9wNk5wsAsoYrZ9GHFjxgIZWx0Vet4FvXzNO9iSANQ5VBaB/09MW606Yl5OLRk1lii0UEL0c5p8ujcLWeUCrBQakRVKL3o3WYF+FYlmWaDh7Vmrl6+DmoPKqCSm6Qp8wGNzFKslix21SBd9KOxUf1UThsUX6F6UbcC07cxU6GFKeLoOgSE61tH4IMlRMYwFOepYF+2mckldAqBFEUp8sWvZYiKfK7dU6wAQkgxPDZ1EVOSIOqPFJe12vkE+bSV3t9+rahW0NkYUFA1q9LTdzxquP09qWFsEmRtCyn/ISIweBKQp6wn2PNYOzuX6D/jnWrslcqTtDcKX/ZTMtUGdzejF/KjLyMcKvE736CX0z6eK+AGIy3flnaU+gSqMQTGTHFjX0YtinQ09U356BIEtX4jlcpG7hR7FHn6ge4i5Qwwe7NPY3Hx9GddARwlSaOlmxGPY0QK2FzaI3wpVMM1De+9GkjsbsqsyUnDMr69c1RFUttfR02OZN14/81Sg== X-OriginatorOrg: moxa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89e4c943-9d21-4228-64a0-08dc86e717d1 X-MS-Exchange-CrossTenant-AuthSource: PUZPR01MB5405.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 11:43:47.6776 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D+JDLc2yLDshGvzS0GDx5qy8rjvLMmQrd5ndEYWc+Saeek0A9pk1kgh3bxt2aPwLn+gUKau9ytKmlIvyuL1zBbqcbUAZfj2M1Er+Bp3ACZE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR01MB5588 In PCI configuration table, there are 1, 4, 8 ports for 921600 BAR 2 except 2 ports. This patch adds 2 ports PCI configuration for 921600 BAR 2. Signed-off-by: Crescent Hsieh --- drivers/tty/serial/8250/8250_pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 4e88ee07e548..4964cb9ccaa0 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -3043,6 +3043,7 @@ enum pci_board_num_t { pbn_b2_16_460800, pbn_b2_1_921600, + pbn_b2_2_921600, pbn_b2_4_921600, pbn_b2_8_921600, @@ -3462,6 +3463,12 @@ static struct pciserial_board pci_boards[] = { .base_baud = 921600, .uart_offset = 8, }, + [pbn_b2_2_921600] = { + .flags = FL_BASE2, + .num_ports = 2, + .base_baud = 921600, + .uart_offset = 8, + }, [pbn_b2_4_921600] = { .flags = FL_BASE2, .num_ports = 4, From patchwork Fri Jun 7 11:43:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crescent CY Hsieh X-Patchwork-Id: 802796 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2116.outbound.protection.outlook.com [40.107.215.116]) (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 6ABFB18FDD9; Fri, 7 Jun 2024 11:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.116 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760638; cv=fail; b=dq6GATE+Iup8xiFwTmtTZHXhjxC69eYprc0saYyA8Ixx3GX7Y0B341f1ey9WxWFMo0LW4Izguz+mJ85GDpk72EX45K/51LB4qvkiBUsBSyxxOeiG7HdngK35ZnbrPDQab64qBq0Iz6fU5+tz82x5gsenGc8m+0mPIZ6NXhX3Vrw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760638; c=relaxed/simple; bh=n9UWOos5KpeToKB6HEjEiIT/TAL3eM9lq6+qHv/Zrvs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QBMyKGB5R8tJ8Y5tjlTmcYpwHExyzKXDPjnmjLFDvLGmGPJolZPlaEtDfBuLTK0h/L3A4keAx7U7bEGmyf7OL0fa1AvqL28AykZ6Z/ix3fTNrNGkMpbgZjfKG9tCEVWrdi2GAiHF+z4aExq4oZk92i96yX2WTHMhGz/vQjlAK4w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com; spf=pass smtp.mailfrom=moxa.com; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b=Skni0FXl; arc=fail smtp.client-ip=40.107.215.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=moxa.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="Skni0FXl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXv3CtGak2j7YP21DXG3j1vC/t0CVp5HCaIHIgKUnavg4jRVnXTBu5cbmlpa4C5s7NoNGG/vsqVK7+6Yb5Wp1f6doycaAadqG2hKZyBe8Pfc8Xv7zQs+RhELqhIbHLY2KER7XOT01w2g1YyZ0ndUXFw15BI09eY3OPwq8ky5fSnpkl3LNwiE74dE3ck/hAzPPmfusJYnOiXW7t/TsuhHAIefq6lgYNppuI8aoKwmc3YaQ7jmkqD5JWd7Jqb5YDgbgO6o+IAksh39E9ofHsGbM4joB8nHds2KjbEj1wioh1tljpQUlSW/VluabKGDVyIiQKXJk5pkclG81Zff17SrFA== 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=0yMinIKP3YALVZ5qXKO/GvnKk3wxs0RGpuwCoi0Y2pU=; b=X/oDXZa0iaqWZRWeNH+o3kk+4Rh9wGrIm704n7Q9M73LZVwH/J/ChgiFEd+ZnGKSm4k7PqCy8cVIQOwEu3kIQAxAup7E+aNafkzZdHQjcSYBraevQkBn6K/GB8zjpqtF6snlpFon+P6Xh3Fh71qau8H4ztZwm01xYaucMoZGcBV4Eyc7x6NeWfPCiSolFPawXfph2VO35BtCf8q28ERXswaBGsaQ2DGmrM6/vKIusTBYYqXgDCm5C3JblpEvN+RkmlcGt/9pdSN8e8iSTQBBg744Ret47yU9pstBY90/WFCmYYnCl+4oR6A41pzx9jwRunTVzBiPIx4K5YKThCchuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0yMinIKP3YALVZ5qXKO/GvnKk3wxs0RGpuwCoi0Y2pU=; b=Skni0FXlGQiKeQo1edVhGayCHv0UUF8jrh71bnlsUIFmEQX5PQmOO2E0mhI9guFHFnkDPawkaMqY5tO9BYowVm3gTxYxmfidAC+C2htAF/MaA7T2X/EQ8QL7X2x2wBpSCxvQDjgnVoDEk4aDetP2/w1In1RrUBAL0Ffv6Z+FGoY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=moxa.com; Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) by SEZPR01MB5588.apcprd01.prod.exchangelabs.com (2603:1096:101:12f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 11:43:48 +0000 Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817]) by PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817%5]) with mapi id 15.20.7633.033; Fri, 7 Jun 2024 11:43:48 +0000 From: Crescent Hsieh To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent Hsieh Subject: [PATCH 3/6] tty: mxser: serial: 8250: Relocate device IDs from mxser to 8250_pci Date: Fri, 7 Jun 2024 19:43:33 +0800 Message-Id: <20240607114336.4496-4-crescentcy.hsieh@moxa.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> X-ClientProxiedBy: TYCP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::12) To PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) 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: PUZPR01MB5405:EE_|SEZPR01MB5588:EE_ X-MS-Office365-Filtering-Correlation-Id: 65a7513c-e64c-4b17-199b-08dc86e71844 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: Y76EGalNJurXQ4CUTW7+Ti+GmUAPY/GTk2vmIpe44m6MKkYOa8PEHbyaxJEsfGNwn01BK4e0H5qsrgBeyvU0auzeT38ca0cLtiaEFT5mL+qCob3muviLIWQ7oxSQy+u8EssRGLJxhGUbQymL9Bi+VYRvwN0ls+i502n4gL9cbV/z9bz82SyaoITZZX28AeKua/cERDyFBl9KSNHJADFdFJOhTbEvclUObuizekQlWJkByDF8TMUpFMABNNvyIitF/x0ohf7PnQ3rM76NEPJGmVXBAEchmj7WV5UTthmNICJESrMyI3a8yppLnmRz/LUFtPuZbZW62b9H4Hainb8YYtNE5vW6jm2kOCu+x00dy3qJ8J2l3nLC6rOwpJNAuLjlbwkzbke4sUzLlC3UWLPKwaoKPcq9x5DAJ97011d2J1MV7DrAvdzvdzphaNFcKBChKjlitXtg0kbAu5bpHkIp1J5SJb5xozX+FRTZv16oEBk5UOePXZhDWNkh5cHV/aYHCV/PE1QkTJrKaGaomCaVXQ+2DPcl71bi+dn06KZ1VsKMPNGlIb7KfxuGltdoNsYKx+oBj6prGtpEJqAkI7U3jmkCI40IAGRnqtUTTqM8oylPcE+jm1G9aHqSWapcZzBnubrtQZaMZZTqQl3O+tbXaNkwehrV1rSdMorCbJCdTpK01RoADxPgTDL8CyJyQDxzUbexWivPYCmyC8ehIXIymKISj9bRYELH1fUEJCP8pFptGYl8QCrDEEZjRjUnhbch3u4DWVqHe/4drNxBSjYVU8CdpahyjNvbsLYthjYcTXkDCWBJ0GjRxhuCtp6pzEhYTDbLgiSxMG+NxecOrvERXsH5d86Ko42gVF9hXAF/rHRzNq16DPpfO4U1jYIKzmAUxpv/bEdoIaNKk94VEQOTiyCVql5JqGjY/6QaIcFEipsnkcSKIj3XiLt2B00EuXqQ+YoZI8gw8XbEYFIOxB6OFyAN5lHSDF0kas+P+zYf0RMLqH+A3O9Anz77/gdAPQf8q9p73mhUSVILvXyUo5W4E40rSTAlHJInn3pn/3nALs8CcLoNGucuMX2V3AyfQP9wci01dle4cCLXIfebXBYj3VaygfhPbcumH9GJgrQsKEgdfDQYHwDqs1/ArHeHqd+ZoXRt2aFDXtnddmpTBg10+ZfVB2J36UN/Bk0IIaUYmW3uoBIctDzTxuXvSRKXEtRbnJxJRNVubtA1iPiGDw7KAYMOnShmqQqsZ1TMSvQljhgFp9FUH68XC4rwQAc6hMTiUvSkVbWD7vbo3FkNxwMVOHKqAhAiWvgUIWDNkciewXXzrpr4+AqwYjZFHcfcechUJlJDLAH8zgy5qWBHUQNht6ABG4dvzU++ErbYDF5KmXM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR01MB5405.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WVZjM9lIZUqqDGQJF5v8In0pRLOF3vBP57I/NgE5jKALs44d9h5arrHh+J36poQKIJkwK+nBHLzNMZyho7MGXhC7GRaXlyanso13MFdVGCZus/wJfhzb4Jtae2RBQ+e8LCJEBAw+1RpWewOVoYzWAXV02vwNBDrUZfwralIBnrkbxQgMtzGs70iudD2YhSF889QlR9ajp1EAAd50wu+fVAnioTVgaq8MgJnKWknosyEei8cB8H0g7CDkeSOoJ4guSsUG0nbO/gEB9XLubp1Jl2TsfTYlArWxTop25prcZkj3R0Fq+9u0LVcA2L4heCzEyxQR1Y2MQ2CBRqItkX8lZlU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KHQiFyp1lCTz7XYkb79YaX8DFQizf1MyCEoYgH+EiYNEGmmVjOt6tsiY6v/yumuc2tdrUGlDHJXnQW9VX4N29DAZEQm6QCSkNuLQHNfFuo3adL7Bn0ax8uWtxyyUDR8Cfz+GefQ56OvBSgs7dgCe3/VzkajdH47tFwfgK3Ud6zAaqOOKiWb67QOuWG1fpIWw== X-OriginatorOrg: moxa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65a7513c-e64c-4b17-199b-08dc86e71844 X-MS-Exchange-CrossTenant-AuthSource: PUZPR01MB5405.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 11:43:48.3987 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eHagN9uf/2GySRSE/DYInrLkI4LRwKN74TyKN80QRSP9PrYFQsIhR4ty3wXG9th48QFEodswmo3ZNb0rlfQ++hvPevDpbJCwZnThyS6P+Aw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR01MB5588 The devices in mxser could be supported by 8250_pci, so this patch relocates these device IDs from mxser into 8250_pci. Signed-off-by: Crescent Hsieh --- drivers/tty/mxser.c | 50 ------------------------------ drivers/tty/serial/8250/8250_pci.c | 50 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 458bb1280ebf..b0e7ea6611bf 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -160,31 +160,6 @@ #define MXSER_CUSTOM_DIVISOR (MXSER_BAUD_BASE * 16) #define PCI_DEVICE_ID_MOXA_RC7000 0x0001 -#define PCI_DEVICE_ID_MOXA_CP102 0x1020 -#define PCI_DEVICE_ID_MOXA_CP102UL 0x1021 -#define PCI_DEVICE_ID_MOXA_CP102U 0x1022 -#define PCI_DEVICE_ID_MOXA_CP102UF 0x1023 -#define PCI_DEVICE_ID_MOXA_C104 0x1040 -#define PCI_DEVICE_ID_MOXA_CP104U 0x1041 -#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 -#define PCI_DEVICE_ID_MOXA_CP104EL 0x1043 -#define PCI_DEVICE_ID_MOXA_POS104UL 0x1044 -#define PCI_DEVICE_ID_MOXA_CB108 0x1080 -#define PCI_DEVICE_ID_MOXA_CP112UL 0x1120 -#define PCI_DEVICE_ID_MOXA_CT114 0x1140 -#define PCI_DEVICE_ID_MOXA_CP114 0x1141 -#define PCI_DEVICE_ID_MOXA_CB114 0x1142 -#define PCI_DEVICE_ID_MOXA_CP114UL 0x1143 -#define PCI_DEVICE_ID_MOXA_CP118U 0x1180 -#define PCI_DEVICE_ID_MOXA_CP118EL 0x1181 -#define PCI_DEVICE_ID_MOXA_CP132 0x1320 -#define PCI_DEVICE_ID_MOXA_CP132U 0x1321 -#define PCI_DEVICE_ID_MOXA_CP134U 0x1340 -#define PCI_DEVICE_ID_MOXA_CB134I 0x1341 -#define PCI_DEVICE_ID_MOXA_CP138U 0x1380 -#define PCI_DEVICE_ID_MOXA_C168 0x1680 -#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 -#define PCI_DEVICE_ID_MOXA_CP168EL 0x1682 #define MXSER_NPORTS(ddata) ((ddata) & 0xffU) #define MXSER_HIGHBAUD 0x0100 @@ -212,32 +187,7 @@ static const struct { /* driver_data correspond to the lines in the structure above see also ISA probe function before you change something */ static const struct pci_device_id mxser_pcibrds[] = { - { PCI_DEVICE_DATA(MOXA, C168, 8) }, - { PCI_DEVICE_DATA(MOXA, C104, 4) }, - { PCI_DEVICE_DATA(MOXA, CP132, 2) }, - { PCI_DEVICE_DATA(MOXA, CP114, 4) }, - { PCI_DEVICE_DATA(MOXA, CT114, 4) }, - { PCI_DEVICE_DATA(MOXA, CP102, 2 | MXSER_HIGHBAUD) }, - { PCI_DEVICE_DATA(MOXA, CP104U, 4) }, - { PCI_DEVICE_DATA(MOXA, CP168U, 8) }, - { PCI_DEVICE_DATA(MOXA, CP132U, 2) }, - { PCI_DEVICE_DATA(MOXA, CP134U, 4) }, - { PCI_DEVICE_DATA(MOXA, CP104JU, 4) }, { PCI_DEVICE_DATA(MOXA, RC7000, 8) }, /* RC7000 */ - { PCI_DEVICE_DATA(MOXA, CP118U, 8) }, - { PCI_DEVICE_DATA(MOXA, CP102UL, 2) }, - { PCI_DEVICE_DATA(MOXA, CP102U, 2) }, - { PCI_DEVICE_DATA(MOXA, CP118EL, 8) }, - { PCI_DEVICE_DATA(MOXA, CP168EL, 8) }, - { PCI_DEVICE_DATA(MOXA, CP104EL, 4) }, - { PCI_DEVICE_DATA(MOXA, CB108, 8) }, - { PCI_DEVICE_DATA(MOXA, CB114, 4) }, - { PCI_DEVICE_DATA(MOXA, CB134I, 4) }, - { PCI_DEVICE_DATA(MOXA, CP138U, 8) }, - { PCI_DEVICE_DATA(MOXA, POS104UL, 4) }, - { PCI_DEVICE_DATA(MOXA, CP114UL, 4) }, - { PCI_DEVICE_DATA(MOXA, CP102UF, 2) }, - { PCI_DEVICE_DATA(MOXA, CP112UL, 2) }, { } }; MODULE_DEVICE_TABLE(pci, mxser_pcibrds); diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 4964cb9ccaa0..e5bdabcce720 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -82,23 +82,48 @@ #define PCIE_DEVICE_ID_WCH_CH384_8S 0x3853 #define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253 +#define PCI_DEVICE_ID_MOXA_CP102 0x1020 +#define PCI_DEVICE_ID_MOXA_CP102UL 0x1021 +#define PCI_DEVICE_ID_MOXA_CP102U 0x1022 +#define PCI_DEVICE_ID_MOXA_CP102UF 0x1023 #define PCI_DEVICE_ID_MOXA_CP102E 0x1024 #define PCI_DEVICE_ID_MOXA_CP102EL 0x1025 #define PCI_DEVICE_ID_MOXA_CP102N 0x1027 +#define PCI_DEVICE_ID_MOXA_C104 0x1040 +#define PCI_DEVICE_ID_MOXA_CP104U 0x1041 +#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042 +#define PCI_DEVICE_ID_MOXA_CP104EL 0x1043 +#define PCI_DEVICE_ID_MOXA_POS104UL 0x1044 #define PCI_DEVICE_ID_MOXA_CP104EL_A 0x1045 #define PCI_DEVICE_ID_MOXA_CP104N 0x1046 +#define PCI_DEVICE_ID_MOXA_CB108 0x1080 +#define PCI_DEVICE_ID_MOXA_CP112UL 0x1120 #define PCI_DEVICE_ID_MOXA_CP112N 0x1121 +#define PCI_DEVICE_ID_MOXA_CT114 0x1140 +#define PCI_DEVICE_ID_MOXA_CP114 0x1141 +#define PCI_DEVICE_ID_MOXA_CB114 0x1142 +#define PCI_DEVICE_ID_MOXA_CP114UL 0x1143 #define PCI_DEVICE_ID_MOXA_CP114EL 0x1144 #define PCI_DEVICE_ID_MOXA_CP114N 0x1145 #define PCI_DEVICE_ID_MOXA_CP116E_A_A 0x1160 #define PCI_DEVICE_ID_MOXA_CP116E_A_B 0x1161 +#define PCI_DEVICE_ID_MOXA_CP118U 0x1180 +#define PCI_DEVICE_ID_MOXA_CP118EL 0x1181 #define PCI_DEVICE_ID_MOXA_CP118EL_A 0x1182 #define PCI_DEVICE_ID_MOXA_CP118E_A_I 0x1183 +#define PCI_DEVICE_ID_MOXA_CP132 0x1320 +#define PCI_DEVICE_ID_MOXA_CP132U 0x1321 #define PCI_DEVICE_ID_MOXA_CP132EL 0x1322 #define PCI_DEVICE_ID_MOXA_CP132N 0x1323 +#define PCI_DEVICE_ID_MOXA_CP134U 0x1340 +#define PCI_DEVICE_ID_MOXA_CB134I 0x1341 #define PCI_DEVICE_ID_MOXA_CP134EL_A 0x1342 #define PCI_DEVICE_ID_MOXA_CP134N 0x1343 +#define PCI_DEVICE_ID_MOXA_CP138U 0x1380 #define PCI_DEVICE_ID_MOXA_CP138E_A 0x1381 +#define PCI_DEVICE_ID_MOXA_C168 0x1680 +#define PCI_DEVICE_ID_MOXA_CP168U 0x1681 +#define PCI_DEVICE_ID_MOXA_CP168EL 0x1682 #define PCI_DEVICE_ID_MOXA_CP168EL_A 0x1683 /* Unknown vendors/cards - this should not be in linux/pci_ids.h */ @@ -5774,23 +5799,48 @@ static const struct pci_device_id serial_pci_tbl[] = { /* * MOXA */ + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102), pbn_b2_2_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102UL), pbn_b2_2_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102U), pbn_b2_2_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102UF), pbn_b2_2_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102E), pbn_moxa_2 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102EL), pbn_moxa_2 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP102N), pbn_moxa_2 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_C104), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104U), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104JU), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104EL), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_POS104UL), pbn_b2_4_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104EL_A), pbn_moxa_4 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP104N), pbn_moxa_4 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CB108), pbn_b2_8_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP112UL), pbn_b2_2_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP112N), pbn_moxa_2 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CT114), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP114), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CB114), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP114UL), pbn_b2_4_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP114EL), pbn_moxa_4 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP114N), pbn_moxa_4 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP116E_A_A), pbn_moxa_8 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP116E_A_B), pbn_moxa_8 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP118U), pbn_b2_8_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP118EL), pbn_b2_8_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP118EL_A), pbn_moxa_8 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP118E_A_I), pbn_moxa_8 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132), pbn_b2_2_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132U), pbn_b2_2_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132EL), pbn_moxa_2 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP132N), pbn_moxa_2 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP134U), pbn_b2_4_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CB134I), pbn_b2_4_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP134EL_A), pbn_moxa_4 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP134N), pbn_moxa_4 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP138U), pbn_b2_8_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP138E_A), pbn_moxa_8 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_C168), pbn_b2_8_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP168U), pbn_b2_8_921600 }, + { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP168EL), pbn_b2_8_921600 }, { PCI_VDEVICE(MOXA, PCI_DEVICE_ID_MOXA_CP168EL_A), pbn_moxa_8 }, /* From patchwork Fri Jun 7 11:43:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crescent CY Hsieh X-Patchwork-Id: 802553 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2091.outbound.protection.outlook.com [40.107.215.91]) (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 86938190687; Fri, 7 Jun 2024 11:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760639; cv=fail; b=DLpZQTmexbZxUTSgvikLUO/IWX2q2kEluqGjwVwdw2l0bUKaCjGinNLmz5tob3Rlz0f21MAznQ4Yzx0gKnicZg74vn+7U6svKFHrD+vmv8WDlp6/VM+FoMKJB+6a4qqYwUJ+B8xaK+fsn4xX0WRDI/1qiF1iIK4+jKYRE5txhoA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760639; c=relaxed/simple; bh=zt6VFeofYwI9X7zNEPgVrz5MNFRyNq6++b0+udehY7w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=TsPhwrL/U7DGMz8z5cF+CFTv8tWzZSoqJX5EgvzbUuEVTHIhU/uMTVEUhT7eyIdEOE+N+vG3y3bs6IBzfMeUpn7MK59tQy+r9qqcZN703BLyycaozDyC+G22pD7hK1tZhr1/3v2/34PJaX9fvYjqJDUce4+Sdo7bHxjG6WhCyjk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com; spf=pass smtp.mailfrom=moxa.com; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b=ARZZPQaa; arc=fail smtp.client-ip=40.107.215.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=moxa.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="ARZZPQaa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bf+s5+UmLs0cf2j8eRHol3SPnl+xq21QkMCfL+AFiZuc5AbHEETbAYtfr8QURvz9ZHhZeSGdKIRH1Sq3+7JWkF44kRPgy39pR8IObGN6u/l1I58FNq5pAE5K2yhpz1uD+qxAwS7PTdhrbuC7oEGdZNLJfRKEckzm6aSGOIkiWzZRwsQ9xqTsnyyJFfFtqE2x+7cOJu8w49r3CLfBoC6ZnUuXv8NBA2DF5ghPskw/UXmCTIxiVt/XA2qZJl669YV5T6u/3V8gNV+GyvwqAKtBWJL4XlarXfr6JB4AkHpSkKDBzrsRG7SWWqSpuwz8xBJRYf4Y/giNmeWVGFlv0iGjwQ== 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=8rbk7jRCv8AH7e6eF70Ii9GBtYLdwRykrZXAppaVsyQ=; b=VxM5qQ+ZsWOLPJp6XFO9PJkxuFI95F+RbvpB6zTzUiaWp/95STjf3536RCa22DeyazT8RYYqlSNIS9c8mIUSdKxmtGpjr/tdSHgz3huMwIYU3FRxeGRhRUhBoOQwKWjhmSrSH8OFN0kdFXxPJlLUFUI8wtEKfMgJkvVVau5aWMw3kFY4Vv3chv5QE635Z5kzkEgeyLr6PL3R67Heflo3h+GfGdaYoebOk6Rfa8Vhq/1sOHPL36IbTUsR53IbUJvc35juIOquLLD6DxXyxMw5ES1Q+1rmYI2vJA6eb9j6VsHQpO8m2aaipjmzs9Fdn5AUgqwe5JQrpC7y1MPXDnJ8+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8rbk7jRCv8AH7e6eF70Ii9GBtYLdwRykrZXAppaVsyQ=; b=ARZZPQaaBqtsu9pWlk/Unbd+Ovfiix+JcxXc672x+X7vV8BrFVEJ141Zlliuz6UUzLw3+b/1xA18IQJhvbXRgwPHOFuVwsbz18NJqjKcIfonDBVI+1tbPYLEU8FCLhVb5yGh1TVWBFcjJsFcXqZ86eiWTPzOm2iy/LPQxszGNNA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=moxa.com; Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) by SEZPR01MB5588.apcprd01.prod.exchangelabs.com (2603:1096:101:12f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 11:43:49 +0000 Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817]) by PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817%5]) with mapi id 15.20.7633.033; Fri, 7 Jun 2024 11:43:49 +0000 From: Crescent Hsieh To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent Hsieh Subject: [PATCH 4/6] tty: serial: 8250: Add check for setting default serial interface Date: Fri, 7 Jun 2024 19:43:34 +0800 Message-Id: <20240607114336.4496-5-crescentcy.hsieh@moxa.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> X-ClientProxiedBy: TYCP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::12) To PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) 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: PUZPR01MB5405:EE_|SEZPR01MB5588:EE_ X-MS-Office365-Filtering-Correlation-Id: 864cbfe8-b50f-43b2-fb11-08dc86e718cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: eGjU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waAO2occG2EaOLPiJxZzxIA2vsl3SCRFeCtuWPIMlidlzS81KqS6/tQFIXWgHxYqeKyPAbIgYdHemCVbDypyWLJZHQaxp+k4crwF5Xmkipk/X20OeWZhF62sZ9lHZk8Lg98oY3abBfZEtE7joSbd1pE/GYukFzNEC7InimXdz7AJQK7E4QDaBHkHEDP4QSUYgwWxW2aH7P6g16ylT/xhQBIVxp/Cy8Yx+TnwCF1o7a/gC0pbti36gGEWvPtfEdQi8enA9JPvh7BPm1a2eoND8TwhXMTmZYW00Jcuta4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR01MB5405.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: trMLAPY7W+wi9J84fINDMLiN8HgZaZv9Z3knYsfmlIXw7ZV7JdjkPUF1m9IA6m+DFepUdmskJ0C/VIwrt1zqjAJfUXVtVkVSAbBzXHMwgFjwmKp3WAGN9w3Iq4h9JnAZjNM+NOs9Xln55LmO6TdjHAR9pHIobeX3xzJLDv45xxhBoEwLfXvWz6FGgoDiWHE0xJpAUQgz5VIcz7qt++BpvXIselt9xQHHZwSLtaw8vl7pwY8U28fjXZzXJGYuLLw+rqgnnaupnCzKuaabHir6DH9uiwhIS2AVkhhWzIsT+4tRji6kL0xf9ydBWO06iQhgPKkpCRmvLTilx8pxepVYjdaLQSCuwPJ8Rb1CY96DoA4qh9t2QT+IdKFwB52tuoInnp8HJxMpYTlPsq5aSDW6CeoGJOeFZDyRLHfWOM40I7iJSsQ30AFozrQIoEWd8fCXJ4jSKrpiaIL4c41jKkWq0ciO2/v+xT1XNUX5cQG1ll8golsrzEPkRQrEZjeIYy9XAN+aX6YMALjS27MBUo9YDred0CeD6ujMA5BcFsLMHamb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CrossTenant-Network-Message-Id: 864cbfe8-b50f-43b2-fb11-08dc86e718cf X-MS-Exchange-CrossTenant-AuthSource: PUZPR01MB5405.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 11:43:49.2763 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FO9ebqjOLcPFbDsRC8qsWo6tnvAQkpA2exeaGLJp1se2OY0P2zA0f6AionNaXSvtti1FSfvPiXXfFpoG19H6LWEO9ZNtTPMngn2rFwgk8oI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR01MB5588 Moxa PCIe and Mini-PCIe boards are capable of switching the serial interface through software control, while other PCI boards switch the serial interface through hardware DIP switches. This patch adds a check while setting the default serial interface. Signed-off-by: Crescent Hsieh --- drivers/tty/serial/8250/8250_pci.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index e5bdabcce720..e4e6493a5497 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -2010,6 +2010,25 @@ enum { MOXA_SUPP_RS485 = BIT(2), }; +static bool pci_moxa_is_pcie(unsigned short device) +{ + if (device == PCI_DEVICE_ID_MOXA_CP102E || + device == PCI_DEVICE_ID_MOXA_CP102EL || + device == PCI_DEVICE_ID_MOXA_CP104EL_A || + device == PCI_DEVICE_ID_MOXA_CP114EL || + device == PCI_DEVICE_ID_MOXA_CP116E_A_A || + device == PCI_DEVICE_ID_MOXA_CP116E_A_B || + device == PCI_DEVICE_ID_MOXA_CP118EL_A || + device == PCI_DEVICE_ID_MOXA_CP118E_A_I || + device == PCI_DEVICE_ID_MOXA_CP132EL || + device == PCI_DEVICE_ID_MOXA_CP134EL_A || + device == PCI_DEVICE_ID_MOXA_CP138E_A || + device == PCI_DEVICE_ID_MOXA_CP168EL_A) + return true; + + return false; +} + static bool pci_moxa_is_mini_pcie(unsigned short device) { if (device == PCI_DEVICE_ID_MOXA_CP102N || @@ -2070,11 +2089,13 @@ static int pci_moxa_init(struct pci_dev *dev) device == PCI_DEVICE_ID_MOXA_CP116E_A_B) num_ports = 8; - if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) { - init_mode = MOXA_RS422; + if (pci_moxa_is_pcie(device) || pci_moxa_is_mini_pcie(device)) { + if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) + init_mode = MOXA_RS422; + + for (i = 0; i < num_ports; ++i) + pci_moxa_set_interface(dev, i, init_mode); } - for (i = 0; i < num_ports; ++i) - pci_moxa_set_interface(dev, i, init_mode); /* * Enable hardware buffer to prevent break signal output when system boots up. From patchwork Fri Jun 7 11:43:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crescent CY Hsieh X-Patchwork-Id: 802795 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2116.outbound.protection.outlook.com [40.107.215.116]) (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 B34E8191499; Fri, 7 Jun 2024 11:43:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.116 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760640; cv=fail; b=SacT4vXsYrjZnUw20itSDA81jqV4o18HAZ1Zt2DRjRi7LryWw28IxrdUQfZWp2xkcLbu9Z3RwXiOLWo2xRY/hOqisUDNHxE/4mRRb+8G/bP3TuOHIps0cPSKdWoQ+McsGzB333JtZBE6Ms7cAcEf1hx+J6N4CUq+PfVN7hnzbQs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760640; c=relaxed/simple; bh=F9VaY+pV5mt4Nq2N5KL6cQg6RWcKUAZSkfGDPHo0rJo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=AFcyVzVXl8o0hBC+q8LSFyumFHpuV8pQeUhme9LIEAqFDmxeD3/Z5MM3i3tvHakf3v9Urm9FhSx9qEncgaJi8HiU1y5cixz0c3VN840UWlFPAWRw/bqD2WXPc0c12MdelZL7hNPoF0B3Ikas4JO8JfGxEaHIEVGM6DHc6IyS8D0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com; spf=pass smtp.mailfrom=moxa.com; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b=ODQXFCM4; arc=fail smtp.client-ip=40.107.215.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=moxa.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="ODQXFCM4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JjpJHHXk4D0CUlf5tSQRb0e/nj7AxSJjnjwvoLPZ7atKkPa5+BsBNPCxwwD6fFykFOphthceVd6Nf0urI/WLE4+W5+y9XdibcEZw0+fRTO5dkQVTSQlvTDczjeW86zI9QiVy1iIqILVqmbLIhQe+T0pFwoMgiQI6QloHG5MdG5B1+HCUDGEvKL6KPyuh3HClHnfTeWP0kROJ06o0rqnty5XNnLed+bx9sNpfdYExLZMYsYRFoDkRrNFicQSA4DjEMc3iqPtoI4EsFBY0dz5hrvFSkAu7+S7gJ28M4gc+RfGNLj3wIFZnAO3+C56XgrgJUyqpQTQkDWZjjzhBEkr1OQ== 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=S3dPhyxohBs4ZLuwE+XKON4Z5J4p62gp3GkCXG2f9qc=; b=fLbQ+9L9umb/ZCnjnhDaE7/27PgXZ8Ol374ZV4/QkHGWbF/DdJSN3Kuoximw+q0KmWyWeefd2UUY6jCHNtY/DZQvB0X3oERha5uDul8uP6mUcNn8b5OOPSAA+6Gp8bClHCX74VqAZ0TZdqbWdZY87aOJIiDigK8WCiI+AxdKYVmSGlIyRmPXbGgW2y/pMbcVyZwAzWlmXOVUOD+QEuSFkn/fn6Cir5ft5XtZ/DrhhoMyJKLg0+8b+XaMVCdF7U5+YUu4FDIJtrse/Y1zjIonBluFgoJXhTUYw5BlR9RDylvL5IpRq5d0oevvIEVocVg4gxZkX2tzer8zOMJ1K8CJUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S3dPhyxohBs4ZLuwE+XKON4Z5J4p62gp3GkCXG2f9qc=; b=ODQXFCM4itupcA1wtqWNDxzAfeB9s1XBXqmBj0MiuP7gkBRGMRh3T0XHOWR6fhT4+gvClHVePj0aUKtFARM9KJdeZAQsrxwnmWUaqTMfcrEXZqD1NZ9HvXwDU0phqoVlMkQRYSSyhTPpHX498BuwLzCoqK8gLn3BUXMWprqPrSY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=moxa.com; Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) by SEZPR01MB5588.apcprd01.prod.exchangelabs.com (2603:1096:101:12f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 11:43:49 +0000 Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817]) by PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817%5]) with mapi id 15.20.7633.033; Fri, 7 Jun 2024 11:43:49 +0000 From: Crescent Hsieh To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent Hsieh Subject: [PATCH 5/6] tty: serial: 8250: Add support for Moxa PCIe boards to switch interface Date: Fri, 7 Jun 2024 19:43:35 +0800 Message-Id: <20240607114336.4496-6-crescentcy.hsieh@moxa.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> X-ClientProxiedBy: TYCP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::12) To PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) 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: PUZPR01MB5405:EE_|SEZPR01MB5588:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f167d30-2afa-4679-52ca-08dc86e7192b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: uoTj7BhYdpzYu132bXT9X+M3r3xeY8IFgVqxya8IKYbOHcATfJ6b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CYNC9yT+AOao7WBp8LQ2hf9LzJdPitAS1zJAQst2IGTNDMKVWReAVJht12a0EFouS3dcDILx9c/cC1ej5TfMQ222jimITdywtzVzD0uiTEzJPDsPY9CmtY5VBFgHJVB2zI3EUjn//TCtjcSZO3SZ4/odlfeZVYsEGGezeId30m9yw9IJAS/K8BSDzDmw8D+uDWCHyKdQ7GCa/37yU4RCIHhsAuzhVPaSt+YJkwEwhQV044VorlCRzH/DHRGe386FbN43Ky6WMDmZzCaL/VaIFG+aiM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR01MB5405.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Se63jfOWaFb2afB1Erg3JNpH5dCHav4YIw70rZjQFrbq1m3ezs/t8L01nFesrml7HtHXoD5y7j8x2LCccgXwFkGEsntydY5STnyohu0ZwRw7zUt3Isef2F86ryljOEPXAHao2PBqxPSWO5w5DHCo+gBIuinHh6g/ZNCGb+Iqs9uiuz6UbEkE0qdgl/tuS+WwOh+7KnLRq40vhoO7zmGxW8GHYGIuTxhnIygRBjjFSIo6NfQJaA55fUafv8izN6cE4aguDe8NtMHoI4n+zP0NDwX+W6isR7dMjGKhUVifEUNbbmUba1JnsiEIxzsxTPSv53HfrtO4VPM3l4/zB6g9J1mfzwYSvnek8qcKmoYGFW1pyqyaxFbb6LG2ULVHdUT8s3xFL1TvLVrzEG1Sw5niyl752B1ziE2QEwUgIA5bOYzvQZfAE1egyV8e6+CeWyv/UYnHjfBIyNC96sABK3aVjujdBIwe9/OHJgOkeHxjXU8tGpdMw/3dvoPBlohdtd8ZAQVQrFw49EN6AfO3XiQgk4atrty6dTtzO+bhbQk5LY656xmxXZD+wygofTytE1pthv42w2sSm4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ant-Network-Message-Id: 9f167d30-2afa-4679-52ca-08dc86e7192b X-MS-Exchange-CrossTenant-AuthSource: PUZPR01MB5405.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 11:43:49.8787 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JP/5iJRWJcoRSSL2BqUePbyr52cSQ00oEia+QvuAfKUpEkudfWys6tIN6ggkhUMHzW5HZJ8+0GnYjOrganCsmZYVHc+k7440H7HFBtFtUik= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR01MB5588 This patch adds support for Moxa PCIe serial boards to switch the serial interface by using ioctl() command "TIOCSRS485" with the flags of struct "serial_rs485": - RS232 = (no flags are set) - RS422 = SER_RS485_ENABLED | SER_RS485_MODE_RS422 - RS485_2W (half-duplex) = SER_RS485_ENABLED - RS485_4W (full-duplex) = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX Signed-off-by: Crescent Hsieh --- drivers/tty/serial/8250/8250_pci.c | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index e4e6493a5497..e2fcddec9ab5 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -2010,6 +2010,10 @@ enum { MOXA_SUPP_RS485 = BIT(2), }; +static const struct serial_rs485 pci_moxa_rs485_supported = { + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX | SER_RS485_MODE_RS422, +}; + static bool pci_moxa_is_pcie(unsigned short device) { if (device == PCI_DEVICE_ID_MOXA_CP102E || @@ -2078,6 +2082,37 @@ static int pci_moxa_set_interface(const struct pci_dev *dev, return 0; } +/* + * Moxa PCIe boards support switching the serial interface using the ioctl() + * command "TIOCSRS485". + * + * RS232 = (no flags are set) + * RS422 = SER_RS485_ENABLED | SER_RS485_MODE_RS422 + * RS485_2W (half-duplex) = SER_RS485_ENABLED + * RS485_4W (full-duplex) = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX + */ +static int pci_moxa_rs485_config(struct uart_port *port, + struct ktermios *termios, + struct serial_rs485 *rs485) +{ + struct pci_dev *dev = to_pci_dev(port->dev); + u8 mode = MOXA_RS232; + + if (rs485->flags & SER_RS485_ENABLED) { + if (rs485->flags & SER_RS485_MODE_RS422) + mode = MOXA_RS422; + else if (rs485->flags & SER_RS485_RX_DURING_TX) + mode = MOXA_RS485_4W; + else + mode = MOXA_RS485_2W; + } else { + if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) + return -ENODEV; + } + + return pci_moxa_set_interface(dev, port->port_id, mode); +} + static int pci_moxa_init(struct pci_dev *dev) { unsigned short device = dev->device; @@ -2120,9 +2155,20 @@ pci_moxa_setup(struct serial_private *priv, const struct pciserial_board *board, struct uart_8250_port *port, int idx) { + struct pci_dev *dev = priv->dev; unsigned int bar = FL_GET_BASE(board->flags); int offset; + if (pci_moxa_is_pcie(dev->device) || pci_moxa_is_mini_pcie(dev->device)) { + if (pci_moxa_supported_rs(dev) & MOXA_SUPP_RS485) { + port->port.rs485_config = pci_moxa_rs485_config; + port->port.rs485_supported = pci_moxa_rs485_supported; + + if (!(pci_moxa_supported_rs(dev) & MOXA_SUPP_RS232)) + port->port.rs485.flags = SER_RS485_ENABLED | SER_RS485_MODE_RS422; + } + } + if (board->num_ports == 4 && idx == 3) offset = 7 * board->uart_offset; else From patchwork Fri Jun 7 11:43:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Crescent CY Hsieh X-Patchwork-Id: 802552 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2091.outbound.protection.outlook.com [40.107.215.91]) (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 8DD11192B82; Fri, 7 Jun 2024 11:43:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760641; cv=fail; b=IvFg48AS/k/0QeVIoZJLOgDf5ID7UJlkmCkATaTtvN6f1wDUXDaHjZZ0Y4KK938d8q/1pvOfwGQal2IimB7QWOpPQj+ol4bgLAJ46oguaIO1ZiZ89T19KbtKQHROolxcdJZfCBJvJYINKgktXPmpJWp9sUQjKW7Dh9UP18h84Is= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717760641; c=relaxed/simple; bh=He8PxhPNMnRVM26WTwBYxZsZhtki4GoJfVYZbKLjGl0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=IBl7WAlJjLIFhEc1XD5yHtmI4HnSEtGcNF3wWLn0tF0eZE/vdWoDMyqZXZgKnCuDu0jjjlBKbDFf6z4Zf9dy5j9RqBx2KB/PhaasZydooYBr69lYQ5DlZLZbO8sGpOrCWNfAFP73Z7z7bzhutXJlW87yQJf2Bbhu3Krz7DKz4Fk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com; spf=pass smtp.mailfrom=moxa.com; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b=fyOlEJcY; arc=fail smtp.client-ip=40.107.215.91 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=moxa.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=moxa.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="fyOlEJcY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EZ1blB3P9seaDyRWwS2zbNQe9S+hTDD0bkw0DS9Tz3M9OWyrERYWEQl+j0mtB0euh8lTE7pSAQ26TZJ+/j0yWm5Pmz/UtIXPEZY5L7HJcIv3KMyS+cEhrz/0+JL+/hOecPoTQOBoqdeKQGSaMVA7aW8cG607r3hhVxwY6XEjUoNlTqOwzPJ+N9lC2/tzAaDq6ftKTmL95dmraXgG+2DkOTy335U7hd8V7J26CO1cXyadplHLElthlg7kKfGksPx/srrz8Uo0vk+dBZn36QJGLZAt+nAnePJHC5ubD/14Rx8s6vShgXYJOYX/BXhJJkirtxIsaNr1m9YxM895g8ReEw== 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=WgsLtGV5uXUkGOD/sXOjxWftxGWiqyiIiRFMni8DkmM=; b=IHbvfa6/bqu2Q0rgn12o0gDpzrf8qoZzmHtIFEmO2Ig7F12dwSNWuh/9unIxk9+37vnAsMkh5ZtVeqbIcoRuDX4kBsavbwyR8fGGK9JtbheUMC7JlWzvS4rxKmjCppjWLdERkPBRIZKg9hCrFdOxiGdSn10sX7YwPrBnF4hxJUUXnYaKYqkPmqYafTQjj5Lp2njteXhwltLeb9OEX6ubf02g1OBVl/5kWGw/9Z3aPMmKy/oyoIWmXSTQ9BQZCLhTzg+4OujomFO32csYTob9Tg6xfRWQ4SVWWlKTY2A285A71Wfhnwxn8pLCxRrp+sLe7FEgMkMk2a3NDKvcciH5nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=moxa.com; dmarc=pass action=none header.from=moxa.com; dkim=pass header.d=moxa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=moxa.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WgsLtGV5uXUkGOD/sXOjxWftxGWiqyiIiRFMni8DkmM=; b=fyOlEJcYaPeGWl+dU+2X8pyuYYkmTQPeQ4e9NTS1DZH7jLIOIBAUxmUsmP/LHnTUtvzpIlmTYY9dgP5wLrSBO2pdan9RfdmI9RAzUtxjjTWFYMhGEPzIPwawIik8FGjgCygI9t7AtTmi5qM9/fqeocSox0NzQLAH0XXRXiip7yc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=moxa.com; Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) by SEZPR01MB5588.apcprd01.prod.exchangelabs.com (2603:1096:101:12f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.34; Fri, 7 Jun 2024 11:43:50 +0000 Received: from PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817]) by PUZPR01MB5405.apcprd01.prod.exchangelabs.com ([fe80::60ab:8615:ab67:8817%5]) with mapi id 15.20.7633.033; Fri, 7 Jun 2024 11:43:50 +0000 From: Crescent Hsieh To: Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Crescent Hsieh Subject: [PATCH 6/6] tty: serial: 8250: Add support for MUEX50 UART Date: Fri, 7 Jun 2024 19:43:36 +0800 Message-Id: <20240607114336.4496-7-crescentcy.hsieh@moxa.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> References: <20240607114336.4496-1-crescentcy.hsieh@moxa.com> X-ClientProxiedBy: TYCP286CA0020.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:263::12) To PUZPR01MB5405.apcprd01.prod.exchangelabs.com (2603:1096:301:115::14) 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: PUZPR01MB5405:EE_|SEZPR01MB5588:EE_ X-MS-Office365-Filtering-Correlation-Id: 255eb7ff-e358-42a4-23eb-08dc86e71987 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|376005|366007|38350700005; X-Microsoft-Antispam-Message-Info: syh8tNA7n9boNQzNowkntTE/s+whadkpP3FRvjr1w2+NaoI9uMmLG/5yaE+8/uM93Falo1uqLyaUuOQlWyffH82SLqDKsaA3xtWthYuwsVidw6hsqWoPoe9sMSaTYR41x7purV2gH9f8fEG9Kmbbx5aZx/8O/QZ3REN5SCkJ5rOD2WnxLhFqKD29cUhCx7uzrgb3Hw77qj5fN2/VUMa4jTbQqpNxr3FojkbB/V2xGkwYI6KfaPL/I7St60kCeHPaahC+9h8RWFh8f4reTqFinjh6Eb3Jxs2fUjJtlA7RyEX05F1YgWzBi/EgUCb1TF8eUn6lOTrHvjdOjYHgRzJUb4Ya0T4smkC0ntpqHSFPGEKWKE8+qlAKTloOEeMA1oTqQLmLvrIUhfh4nnYbCIKZ9bl4UNAgZrV5AJqjjLBK49rzCU36i2zYZ4uncfNIib1vh4dgAVi8mRaSQENFkpf0uSep2WQgdLzmuHp5LR4t56Mo27oVx0MR7l5LyD3b1cBrVDvPtbKJggWmoGwn/v+lOimtnUtK3ttkae0syXExC37lTXJCl7PG+Z4Be/aR+PJZRRc8oWKiE4Nq2YAsFBOJMM6DGx/odDAfjetSen2sSyf2ftWPHtzQT7wNfKvXh65R84keIX+zMvi+xz66X/YomXFafugTaAWuHKjzfQa41yf86ZYFbGD2201tE4COJCcODy6lFvaHdRQokaU4SMXrkzB+6SIjjL9UMUBxcwfYjkRqMvdu8udm7SBB/l2DkA44H/9GoQk9CuhIBS9UYzEA4Oq3sLnVa03bQ8bbT1jbYBsUPXhbG9hmGDSGlzVYxgRnnf12G2Ft6czrhAf/do/dGUGQryn7nCXf4Nro7MVPl9gUDRavqS8TRFyNcmF6Hu88Z52JGQmEcFmvMEMkDvC+MzPR6/Osz1/HjjKp6MpI7Sz50wMffeE0p9BoNse4PkJr2kWcGOzjDEqG9TQqsZl/WPCnL8qG4JtwZENbqxruBzsLvEsV8bHv0LlhhU/rNjjwfGYdA7A3V6THTJjaelLslqElO4i7JU64/zCALMfCfBdSyGDXm9EEuSkPCcbWD4LibR+cRNB0+9UBmI64AHbtuWWnsKjHq65UuZIZvM05tr3fDNef/+kaBLICgEgIoxQOJITR9rRIn+vX/FsLZRn+gM02djeMLlK8m7SgXqfN9cTc6gCruJ91QlIga09XrSFvGTm3qOKusvRxsSdplKzJCkOeD5sR+ocaFEQ4rtlJoNuZEqi4H3qCGzzXtFmvce2ISZGnQrUzUxvYJxdDB5ZU5KQMY21P3Wwp4raBR9Sc80sk5dsNwO9y1q+4ax9hwvB/MQPJtccKQH/odSXRhiluPUAUznaITQJ5H6/zPSrwjDQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PUZPR01MB5405.apcprd01.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(1800799015)(376005)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g2fyiWuvYNWMJWNI3CjnP7oKSEBRuiKY4EbWVvOeHQJIqB9QQbP5aUv2Qy2cZoHudHzYPjDkD1+tRTKn8gIBXzIl/xwrAx5oAHPnXdbVReh7XCmbmu5S67aPyLtRDUXlOn6rcfIO/3uBDeSAu8b3FUED3RGkFUDCN1GUJBuYmFM5hfe8zjCF/jX6TumgGDyhHuBsMKrQ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eYvhO88v5JXJFRx8nkkT8mr/DXmmm/VSKIcChg93JgChe9FqUl98siZbaC5kqePcAW37bhWmS1hmc/zofA5D7MKJW1NcaSP/Dab/SeQMy9XeRuC3z5PQoXmxXU0kD4RP+zAvh6we1H82nnEPlkEGnxvSzmMn/WdElfRJQatNmTRyu8/x4ct9esn1JTnoi+VAUy0s/wJphn/6EZo+Md13g9pyF5f5gpRgFIf8apYFub+aOgYhQsd6TuxByezBABjEMLKUuNI5SLD9D7DE5eHTxDntFXCO9v2H2+0DydCbuRva4X9eNm9RBMvCXxm5EgHaAYdBgy5Ob7wtRjD61zVCbcNHm2IV4ZA== X-OriginatorOrg: moxa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 255eb7ff-e358-42a4-23eb-08dc86e71987 X-MS-Exchange-CrossTenant-AuthSource: PUZPR01MB5405.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 11:43:50.4776 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5571c7d4-286b-47f6-9dd5-0aa688773c8e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aIy7zDjq+SMVrAz23oO2HamzOosnhm1xYvE9TvKExHji3LCQ7b3yVlmSzW3z32QzVF+n/TG+INW9clpA1TFjyXlPPiNo5sfvmY+kzl2m0EQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR01MB5588 The MUEX50 UART does not directly match to PORT_16550A or other generic UART configurations. This patch adds an UART configuration to capture the hardware capabilities of MUEX50 UART and apply to Moxa PCI serial boards. Signed-off-by: Crescent Hsieh --- drivers/tty/serial/8250/8250_pci.c | 3 +++ drivers/tty/serial/8250/8250_port.c | 8 ++++++++ include/uapi/linux/serial_core.h | 3 +++ 3 files changed, 14 insertions(+) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index e2fcddec9ab5..3ccbb406f505 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -2159,6 +2159,9 @@ pci_moxa_setup(struct serial_private *priv, unsigned int bar = FL_GET_BASE(board->flags); int offset; + port->port.flags |= UPF_FIXED_TYPE; + port->port.type = PORT_MUEX50; + if (pci_moxa_is_pcie(dev->device) || pci_moxa_is_mini_pcie(dev->device)) { if (pci_moxa_supported_rs(dev) & MOXA_SUPP_RS485) { port->port.rs485_config = pci_moxa_rs485_config; diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 893bc493f662..c3de350e9a30 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -319,6 +319,14 @@ static const struct serial8250_config uart_config[] = { .rxtrig_bytes = {1, 8, 16, 30}, .flags = UART_CAP_FIFO | UART_CAP_AFE, }, + [PORT_MUEX50] = { + .name = "Moxa PCIe UART", + .fifo_size = 128, + .tx_loadsz = 128, + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, + .rxtrig_bytes = {1, 4, 8, 14}, + .flags = UART_CAP_FIFO, + }, }; /* Uart divisor latch read */ diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 9c007a106330..5afeb6d99e7e 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h @@ -231,6 +231,9 @@ /* Sunplus UART */ #define PORT_SUNPLUS 123 +/* Moxa PCIe UART */ +#define PORT_MUEX50 124 + /* Generic type identifier for ports which type is not important to userspace. */ #define PORT_GENERIC (-1)