Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp975959lqt; Fri, 7 Jun 2024 04:45:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyfbBIqbiIl54gB8TzqC5he2GfWjj+63O14lwgCpvo2tKGfCl6iBbHvwT9aL5D5ZTpGB8UaW7hVGaYWgNHESr4n9Yiv5+pNa9kx2UB2A== X-Google-Smtp-Source: AGHT+IG1CPuY3+ua7RhYdFxHkcvz8NIer+z06zbU3HptqfiUjyg5rYx9Z9eRtEOcJDnsqht3jTUR X-Received: by 2002:a17:902:c085:b0:1f6:828e:869b with SMTP id d9443c01a7336-1f6d036a7dcmr21736025ad.53.1717760714198; Fri, 07 Jun 2024 04:45:14 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7f46a4si2393095ad.476.2024.06.07.04.45.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 04:45:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@moxa.com header.s=selector1 header.b=fyOlEJcY; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-205949-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205949-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=moxa.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8C215287729 for ; Fri, 7 Jun 2024 11:45:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E031194098; Fri, 7 Jun 2024 11:44:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=moxa.com header.i=@moxa.com header.b="fyOlEJcY" 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 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-kernel@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: =?us-ascii?Q?syh8tNA7n9boNQzNowkntTE/s+whadkpP3FRvjr1w2+NaoI9uMmLG/5yaE+8?= =?us-ascii?Q?/uM93Falo1uqLyaUuOQlWyffH82SLqDKsaA3xtWthYuwsVidw6hsqWoPoe9s?= =?us-ascii?Q?MSaTYR41x7purV2gH9f8fEG9Kmbbx5aZx/8O/QZ3REN5SCkJ5rOD2WnxLhFq?= =?us-ascii?Q?KD29cUhCx7uzrgb3Hw77qj5fN2/VUMa4jTbQqpNxr3FojkbB/V2xGkwYI6Kf?= =?us-ascii?Q?aPL/I7St60kCeHPaahC+9h8RWFh8f4reTqFinjh6Eb3Jxs2fUjJtlA7RyEX0?= =?us-ascii?Q?5F1YgWzBi/EgUCb1TF8eUn6lOTrHvjdOjYHgRzJUb4Ya0T4smkC0ntpqHSFP?= =?us-ascii?Q?GEKWKE8+qlAKTloOEeMA1oTqQLmLvrIUhfh4nnYbCIKZ9bl4UNAgZrV5AJqj?= =?us-ascii?Q?jLBK49rzCU36i2zYZ4uncfNIib1vh4dgAVi8mRaSQENFkpf0uSep2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PJtccKQH/odSXRhiluPUAUznaITQJ5H6/z?= =?us-ascii?Q?PSrwjDQ=3D?= 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: =?us-ascii?Q?g2fyiWuvYNWMJWNI3CjnP7oKSEBRuiKY4EbWVvOeHQJIqB9QQbP5aUv2Qy2c?= =?us-ascii?Q?ZoHudHzYPjDkD1+tRTKn8gIBXzIl/xwrAx5oAHPnXdbVReh7XCmbmu5S67aP?= =?us-ascii?Q?yLtRDUXlOn6rcfIO/3uBDeSAu8b3FUED3RGkFUDCN1GUJBuYmFM5hfe8zjCF?= =?us-ascii?Q?/jX6TumgGDyhHuBsMKrQ9rwZGOTbH8gVjTKohEQ+JuAVmp2slq8jN+jGYfRE?= =?us-ascii?Q?mxPAixC8ox1q+UlIQc2JFRZikYjlw2jRItsWDU3rTuF3TxaxRGLVYH7j5z2s?= =?us-ascii?Q?0J5Q6oPuAEmZetfwCj0zffMO9n0mUU7mx3UcsOj0T6j4PiEoZYQzdUflCpwp?= =?us-ascii?Q?1pGVisGzQHiz8FkCGHpHuYmATmETJlp9qwW1CE7j9/B5u06/KiRxLpp5C1qS?= =?us-ascii?Q?xoRZWz5FXuTuPel35KXegsOjkMorkwisFcZPXyE9X2sSDtx0WnbgeCmzJOk2?= =?us-ascii?Q?lRs7JR6np3vyp1PiOZKWLLHCnodWOXjgS4YBPRP4+rkCgvrty5e+8OEmYWqa?= =?us-ascii?Q?Uu06NRkFTiS3imKEeG+P/wL3zWWf1MBqMiJKcvALZjOS7DXXBfpdmn5K96nZ?= =?us-ascii?Q?THAfvfXCvobex/mQin4jDFfz9nS/AatKgEW2Kk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q?pYFub+aOgYhQsd6TuxByezBABjEMLKUuNI5SLD9D7DE5eHTxDntFXCO9v2H2?= =?us-ascii?Q?+0DydCbuRva4X9eNm9RBMvCXxm5EgHaAYdBgy5Ob7wtRjD61zVCbcNHm2IV4?= =?us-ascii?Q?ZA=3D=3D?= 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) -- 2.34.1