From patchwork Fri Jul 23 22:31:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 484966 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05761C4338F for ; Fri, 23 Jul 2021 22:32:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7FA360F25 for ; Fri, 23 Jul 2021 22:32:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231742AbhGWVvg (ORCPT ); Fri, 23 Jul 2021 17:51:36 -0400 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:51343 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232301AbhGWVvd (ORCPT ); Fri, 23 Jul 2021 17:51:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qh3k+uWWNSea+Wf0/hHky1krVO6I5OeFDi6hF5FbioFlnQfL6KidJs5dsHU/lQTQFEHK64mOxIs5wIaB7laacoj3bU6gUADRHv1VTIH2H5kSC+d0uhdC3dxYSOGSWUdKiUOQOK/q0ds4l5InsmjWCYFS6pxk2/9nPcTKTtws9Ac9KVoYCt+nCWLO5ySiRyphEZa22CIrtajvC9JG5fVUBXkVApD/Q78kpwJRQiXh1vWHUob2VVSPsKGIUrvLvVx0+75s1P3Pv1RQA2P4q2V1Tvp1qvZ74i9J3FkUY2Bn7C8b/Azy4GmAw60836RhbBw/Vpqm3WztIE8DBYWKe/XDUQ== 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-SenderADCheck; bh=ckz772AntD/S+oZfxN8PtWWTbWO9arb0RHy2pzyEU3k=; b=A8d2SUUKJcRHQT0FPCxcfwPBm06CpT27wZ5Eg+uR518p4t9cR07SAwnu3D8kFXrZIpvKirMwPDwTGzlCcIIs1fGFx3gV3S/9bYf5fKGyDylQ4NtygNUe2bshmnSdLQggxAQxwA3taUUz8QRE8MRvS44rDS+s7piRgjiV50jy4MUWTrgvBnT65lAQgzHFEkEqy8jWquzkf2GJYXXPROovdm5EHY3BtVVKTAXxQGoiMOxjyU2BBIbY3u1G1ZH+LE9llb0fwU0uNArrrX+mFaHMHy14a8wnWBp+rOZxDAUfsVkGcd/3MW1jM1KzF0eIof3+tE0n2LBSUDIk8fFLSSA3lw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ckz772AntD/S+oZfxN8PtWWTbWO9arb0RHy2pzyEU3k=; b=UdvQqtgr2h2HyETvOZSgVfJTzmhZ0nOc9VVbH7T5OhJ/Tk6/SJfcKlgbdqFAmTBsuVBmdz1WwNANU3vyEvJUgqZ8U+quXcq/LH+VR95dAJGDqiuD1U3phEHYP4hfo73B4YpNEvdD5taG2M0GTWjUo5JFK3lR2LvDMn5Qi5W6nRU= Authentication-Results: barco.com; dkim=none (message not signed) header.d=none; barco.com; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DBBPR03MB7068.eurprd03.prod.outlook.com (2603:10a6:10:20e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Fri, 23 Jul 2021 22:32:03 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1%7]) with mapi id 15.20.4352.025; Fri, 23 Jul 2021 22:32:02 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Alexander Sverdlin , Michal Simek , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 1/5] dt-bindings: serial: uartlite: Convert to json-schema Date: Fri, 23 Jul 2021 18:31:47 -0400 Message-Id: <20210723223152.648326-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210723223152.648326-1-sean.anderson@seco.com> References: <20210723223152.648326-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 22:32:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc634b06-5ad0-4b54-346b-08d94e29b178 X-MS-TrafficTypeDiagnostic: DBBPR03MB7068: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:580; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LyIjhiO/rcfF1DGk2rnBLRCwYZXc4S5x6r/RcEZREkSQiPO/GBQDBoKsch79kcfRtn+dOtdY7QazDTYqAuJWu27l1BLjjK3xi32hg73pBhNxGAGubJauSEjLdhJtatMcVzhcS5QnBfW36CQmTEvGdWa3CSCZtljdvT1Oxd5Q0XFu8E0Q/6x2riyqg88P+Ha/WuXQRrIZxtg+qwg4kQdWDkis6Zr2yAaTETSILaM2gusb4SmIJi6uqKAYPIe+do8n2h6yKVD/2Johjp2AsAxLUZPqKuY4zvctz73TSX0IGRuJLfJl92EM7kK7v0NkQTg5x1kQgvLNC2n/wPPv9VzOQNqCDza9LMdres9VrWv6iHoxG0xhp3gIZjb9qUxmsEEuqo3xlT1qvGLgHyjFd/C9A2zWBiNTJS8zvYk7tnG2UgOhC+YqIkTRitG1yVcak0sYl+pTJfosGgZqzG3pTf9hSPVL8JRK2fTMfYsSKDpP/kT5Reo7xoiqmUQTQQotDyCCkdYkO33dn/dS4qfwDXSlpH+8FiIqdWArJ2rcPx97lA+Pf/bc1KEZIHHhpYhPiCE0Mbvl47O8bvw0Pc1af5p+QPD+TZ+ozKA0K192iidEugB8+0c/tSCLF5xeBXuCGSATxrPJBAfhjQeWk3RMQU7g8Lwwy+dklv+knm8FrIVQEd+Uxell3ojV656b7E0ncrLMC9XIYkbdCziXhBTvg+vHIIe57J90uLhY+9oq7bZBAD8Vk8X+DRFebT9rZ66g7+Cqv8X4ZEuv8H0u5w6XDqp1GW69+s5U6CyiTK9f4Ky0QmY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(396003)(376002)(366004)(346002)(39840400004)(52116002)(478600001)(2906002)(2616005)(6512007)(6666004)(186003)(26005)(1076003)(956004)(44832011)(966005)(5660300002)(36756003)(38350700002)(38100700002)(316002)(8676002)(110136005)(4326008)(86362001)(6486002)(8936002)(83380400001)(66556008)(66476007)(6506007)(54906003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IviaRhzZG1b4rjq2rPFXP6TwqidA+6USK3MBn+KJ719z0ZK7NImP8PhpQsXj/PKF95/M8tyV8w8Z2VQBqov5ouiMxn21Cd0DyDLX+iXxnYpsa2ra6s78U2nTjYpawdl8YLhGh3MTwvynkjyLUrIzWoZxQO0thXnCYsaVlvxbgpu15PYhZ4gTU4xZSNuieeKLM+hd92FfM8rdrk0V/Vv1cdryiRWx3Vschjo1Rg1hkCeQMD6TAQinv/ENWSJBwHZVgb8VCXE/pEaRZBiFP1itkYMq8h+t761JKHUWA/r5ob1GLLi/G2/FbMhSOQwwDn9beTlMFY7ad1pdIMBwfnr1VTla+mFZmZTSmTptDlzNb+qsDHPSI34obIjjwKhd3uHgh/kn8YocNX48DM40QslPReC0n/YTYoh9CIXEe7Y6tUZLUeV+gsZiPI+nvU4auI2hOYppMz0WdyVlhnLdMq22sFc9nNe+JLVDoTTG3cOJF7SEPz+qeiMzpXecLOCgSCuqzL2CHWo8KBAjdcg/J3I58kbQulhKIuAT/xqczKI7qTZClnh5/M2llQXuE+G5sKlyIPrpaCUlefUrSPowKr4N4VyqtRBHRbmyJmwN/RWxZI2dmVhShjylFeha9DiR8Ra6CYZOyKbLdYWowvZBLV1DAAeqMiSt/sYbJstTaBNShoHWgYTxWNm5Hno3gyBQWyaW7AbxfwFgEZWcN/htdBGah1lfiI6c/lCTSmL6lDlfK36+wgAEzB44xpiGiC6p1U6F0prp6/sAsuk/cIZ+p5TaSxxvn1DMytbTI/IhLk8nF3Y5mu5Wecb/IHFcCefB4f74Cv/xQ06SCXdt5XZ3HqrcCPEg9GL4GHBWPaYXrJE6ACkv4p3y5FvGBi6Zo9opv32BIcw0Q6jI8vDAgf9UBPhaa2rQtOetECnZEAoxul+oceV4cbB8I/m1wErd+L+FfR7pNRAVGQM6dtS+N46+ZQh1eCOJ82VjUguEUc9byaFtpzGLKq8nPT6uJSGRhX0AyXtICabR8LRDfZsyA7NXhR02lS8DgNfe0ByVkaVjL8qCx2tDHwnIA/0htP44T5YnuSAN+ZzaT1if5DdfFBo8n5zOij9IxfC/S8Usa5ZVRWzwmhhB8tsJhJwkDW9eUxTwsBLAE2V1w9k8FM9vfHISpm5kXQlQkcL9cW6WObvWvXv9tFMKzALXZMnhqDBALxeyw0A/231u4eBAuDkEOLN5k4mnYip5MIOuEyYolXrLrCePSQj5XM9VV1Za1Ygxl08bavlgkx2d3hxOpLh7ED0bWS5349iweQFY3No+tp5vNKDn39hpng5iqpKHoCoASQlrGd+/ X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc634b06-5ad0-4b54-346b-08d94e29b178 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 22:32:02.8635 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hN/3yFqPlXa0S9nLsMSZMf5bagD3ZXQbGXIu9x6SJcTUV2feD6ZMzVpcZUuJ6gXP7lxEjmu5o+UuzBh/t0GeUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB7068 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This converts the existing documentation for the uartlite binding to json-schema. Signed-off-by: Sean Anderson --- .../bindings/serial/xlnx,opb-uartlite.txt | 23 -------- .../bindings/serial/xlnx,opb-uartlite.yaml | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+), 23 deletions(-) delete mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt create mode 100644 Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml diff --git a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt deleted file mode 100644 index c37deb44dead..000000000000 --- a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.txt +++ /dev/null @@ -1,23 +0,0 @@ -Xilinx Axi Uartlite controller Device Tree Bindings ---------------------------------------------------------- - -Required properties: -- compatible : Can be either of - "xlnx,xps-uartlite-1.00.a" - "xlnx,opb-uartlite-1.00.b" -- reg : Physical base address and size of the Axi Uartlite - registers map. -- interrupts : Should contain the UART controller interrupt. - -Optional properties: -- port-number : Set Uart port number -- clock-names : Should be "s_axi_aclk" -- clocks : Input clock specifier. Refer to common clock bindings. - -Example: -serial@800c0000 { - compatible = "xlnx,xps-uartlite-1.00.a"; - reg = <0x0 0x800c0000 0x10000>; - interrupts = <0x0 0x6e 0x1>; - port-number = <0>; -}; diff --git a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml new file mode 100644 index 000000000000..4ef29784ae97 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/xlnx,opb-uartlite.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx Axi Uartlite + +maintainers: + - Peter Korsgaard + +properties: + compatible: + contains: + enum: + - xlnx,xps-uartlite-1.00.a + - xlnx,opb-uartlite-1.00.b + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + port-number: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Set Uart port number + + clocks: + maxItems: 1 + + clock-names: + const: s_axi_aclk + +required: + - compatible + - reg + - interrupts + +allOf: + - $ref: /schemas/serial.yaml# + +additionalProperties: true + +examples: + - | + serial@800c0000 { + compatible = "xlnx,xps-uartlite-1.00.a"; + reg = <0x800c0000 0x10000>; + interrupts = <0x0 0x6e 0x1>; + port-number = <0>; + }; +... From patchwork Fri Jul 23 22:31:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 485530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BC6DC432BE for ; Fri, 23 Jul 2021 22:32:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3688560ED7 for ; Fri, 23 Jul 2021 22:32:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbhGWVvh (ORCPT ); Fri, 23 Jul 2021 17:51:37 -0400 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:51343 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232848AbhGWVvg (ORCPT ); Fri, 23 Jul 2021 17:51:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LrlWRfbGrhyYFAPO5j4OhA7crZfE9hNYI/c1owkGbpj+5lOwezZ97WbcmMoO49AP8tfGfSIaD5gRCEKOJFL3rDoA3nHsrRBbUWqQMBIuLvOC/FHOVpGbRdRVMz+Cf7feR3MguEpx2vvXhF7Pc/Zgca6VFsRJvSHMV+8xcvMyN4pQu4a5kKkOM+dYiMKlbHszF35bJTsyWuN0On54aUMD8TYrUKqCkJ0Cd/hG8ufv7VJ756Pu51N+FSa4CVcBa5HGeiJ6/REkXk2neiwNhl7sBBeUa1XzF6qantL8C4RMT4ttwuhwK9CrYc08gqMVea0+1XvdG333xrpif1p/gD3lyA== 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-SenderADCheck; bh=kn4Oetd7MVi77TxHQzbs3926LvqsikxwXRIREgwnJ80=; b=LQECZN2eeRU0WIgjikU4hE9mxRQTrZr2Ejrat2CX4CYV2iZ5a464tKPAQkCodFpLjGeHcmx5aFYagT38sN2nAW2Nb9/tKYCxetW7qq1L9ljwLSPR1rynWqPSffIwsBUBO/cjVtpzMJ5qZJpzIt9QpJYfQPem/xvoCxJEkvoFTOYQ1VZ0D5QUkf+nyahxcQSB2slP+NgnQh8BlJwExV8xJSK3gOf7HNvyqqECsazXqGVZ1PnXcXFa+vZQ4a0bGKv6EQJ6dQTXyIryDLxvd7ZRVLC/ZQ17FuU+hoX1P8w4bLPYBCdcQNrw2rZvahrxSDl7j0L98CXIGXEWJOKn+ZVpKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kn4Oetd7MVi77TxHQzbs3926LvqsikxwXRIREgwnJ80=; b=tZPhcGgyv6L5M348zTz+mSosqoXPUeLJ8UsZpNVnRaDV1n6W5msyW4zACZ44j5IdVq36ZNWT6HUUEE6vGASr3JxmeRyBhm/mqgL3WEMd/5d627huSQabQghPXvEml6fBKIdUV6pOQGPQcOt86UGFDV6iFGOkRfuB7Sx+fjOTOKU= Authentication-Results: barco.com; dkim=none (message not signed) header.d=none; barco.com; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DBBPR03MB7068.eurprd03.prod.outlook.com (2603:10a6:10:20e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Fri, 23 Jul 2021 22:32:04 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1%7]) with mapi id 15.20.4352.025; Fri, 23 Jul 2021 22:32:04 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Alexander Sverdlin , Michal Simek , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH 2/5] dt-bindings: serial: uartlite: Add properties for synthesis-time parameters Date: Fri, 23 Jul 2021 18:31:48 -0400 Message-Id: <20210723223152.648326-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210723223152.648326-1-sean.anderson@seco.com> References: <20210723223152.648326-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 22:32:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e1fd1a1-1e23-44d3-d699-08d94e29b258 X-MS-TrafficTypeDiagnostic: DBBPR03MB7068: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ULuoTR0nbtenVH9K+8UIAfnn2CAJCp41ySoregR4Zow+nsFnp/QtW2/IUDKxs5tITy1FjOjaMcaNyHVoZu/ZlabBV/5MTO/47HlzAgRZOpBvY//HHNbalrPu3iX+M9tKh1DXx6Anpl0TdiUx4P+bL6qTWIc+nLC+STV/wBS6+6aXQIR9F2ruVK1k62OB6gGTs8GCoTPSAke969F4ns/u2Aq15TH7UijN3wNIBsjZhGpn9QQ9N7YiQE0q9e9K7WXzKK3ZQavHOG29FvQMg133d28l5A4NP3FPhkxo70vD7rqwdqEFRi2xT8tEK5ZJxAS9hwkdmkAYvzDQcpSk3wVRdtK2at/Avcumdc/1bfpoC9yhv19Q4Op3ayWJrdF1pLSAJG+0xQzYyXe3kNfo5hnOx4eBMR3O+Aq3ourSpZWYSf3wAbFn3WDWnMFvtuOSvaUraNA9St0/0guEg61uVC+bkQon6pSA5swSINq9d2SifW2cqYaHHyyOrnFuUYk/+kxGa+F2Tq/OQaAgIzcxTUiiYy7rRPgySpn/m8TCODOMbMn7YTefG6DXO1JPNMe3NTgAG2Fw/uZ0W7CpBfI4V60X7uSaJMDaBM99bW7sRRS7YRW4mb0bAIfaoQtEzTJ2dbFJXS8dNINg9UNPIIOiscd524vK5700RfAcyBG724gKrQQLe/X1dFDDRi1v4i06UZWnjJxVb2B1FLSR03kBD5iW8A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(396003)(376002)(366004)(346002)(39840400004)(52116002)(478600001)(2906002)(2616005)(6512007)(6666004)(186003)(26005)(1076003)(956004)(44832011)(5660300002)(36756003)(38350700002)(38100700002)(316002)(8676002)(110136005)(4326008)(86362001)(6486002)(8936002)(83380400001)(66556008)(66476007)(6506007)(54906003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a6De966cIAuiehdBHdfSFuMtnInJwgS0Sf4/3kHBCZ2Q5lu5QMzbz9i7tupfJvXF02lecJu8DUCikvLWwGRzcylbsHJzMbcYu6Hv7uf5wRD1ZJmhauRTPfC0cNeTQcRGjtNNax0X+fnMywJG6j0Nxm9n+FgWPo0THJhaJ8iP7yvCBkrr9jj03mswwJ74Bo1TSKKxJriqzWSiQ0C4SjAMsqjEsr+MUcFDAgdZZbRTGcjc2BIUcSLSoIs6AHA+TRkNvy/k/ox15Yq0ufJHOazO6/ArtZKsOhJs3dhoooh+Ayn0E/+RY9IJlDk5Fa6gMyyGlajZWRCH1zt1CP1r0Lu6etdUonjXRiaXAswHvpxuSXFNrYdLxJVG8HZj0N6yjrXTeIclXwrtaMIXnSab2hS6SmGqSvfzGkPnSE6kIxPmn/Q5j7uysnYP76SWSBccUKHAF+o2ytMq4koM1zP4n6iFsNgion4xD/c8hk/5L/6AWoE5C319fwNxmZ1x8wSeAjvwwiees5mfIiMhJNEtDC0nV4T7y8oaHBa9LU91kKD7L7T3kjXLK/nhuha+QUkQSxsnm8ni7eFi4Sp0M2Jd/82N6a0bw0Q2TyCtbYse3BWRZ7VFm9771liPAIyF8uvueKXRtsYM1hX3zbI2CUd+lPpkHh5HbEAWfAY7cN3UZn9Gq/TzTvxg0x5zBBOQZsUvxiHHdAoX7dz7UFK01xwCYy0xn1vJkKa2H14XBA6sk7vcCiraILngTkCY872c8kNkmccJbL1t+ATtQHnUvge5Gu20N7YdqL2xS+Y31o1J/zqkNi5bESh+H6oLTiLjQLfQPOK2iyS8VzFiF9lxBYaRNRGZpKksqASxLelWlZKjcg9uLwVA0Bu5G3aqr6zCBnFAaYOwmqO93HaS6k8jpt3RvnCp8DSxtZ7YMSiQDsS2s+BXbeqalTm3J4pABvZnB5ULiAPFFeoGMX4gn5s2pCpfkDOu+HjuXjvEKY7mLUEjd+puxON85dIVvcEtQmBW/792c+FQx+dqmKODPUqZz8Bgo/Q/5fBEImnre+yBu55XmKgLzWRRADd3plRT8IeG0Lri2pLmJ0A23jVvFijnx8okuGpJxn9g/NLoO/D0Rf0urkBqLWWFlPT9dxPoo2uUe2m9p3MhKUIv3s5cNucirRG6QwS9gcjftep/Uqo24i2lQetnkQfh1Tmwemd1Ce4EDXbCQmY87Q42AFd3LST/wmBNBuu7BleB1HO7xwk4Y6194ntU/1aL1l072gLzfcaEfk28yOE9qFEFJ5IAkcbfgx4mneI3fKfABSyYDjKyaluc7CRlqFuP9A5o1DjbZh5FnXTw/g3Y X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e1fd1a1-1e23-44d3-d699-08d94e29b258 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 22:32:04.3187 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WzY3SL0nNHEAw601kbEIhD6aGmXnikv9YuaPJ0+bEHpoOHCGPycZzH9mleOIeK6k01eORWB5xLesFuumWUIvqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB7068 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org The uartlite device is a "soft" device. Many parameters, such as baud rate, data bits, and the presence of a parity bit are configured before synthesis and may not be changed (or discovered) at runtime. However, we must know what these settings are in order to properly calculate the uart timeout (and to inform the user about the actual baud of the uart). These properties are present for out-of-tree bindings generated by Xilinx's tools. However, they are also (mostly) present in in-tree bindings. I chose current-speed over xlnx,baudrate primarily because it seemed to be used by more existing bindings. Signed-off-by: Sean Anderson --- .../bindings/serial/xlnx,opb-uartlite.yaml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml index 4ef29784ae97..28859e70e60f 100644 --- a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml +++ b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml @@ -32,13 +32,49 @@ properties: clock-names: const: s_axi_aclk + current-speed: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The fixed baud rate that the device was configured for. + + xlnx,data-bits: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [5, 6, 7, 8] + default: 8 + description: + The fixed number of data bits that the device was configured for. + + xlnx,use-parity: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + default: 0 + description: + Whether parity checking was enabled when the device was configured. + + xlnx,odd-parity: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] + description: + Whether odd parity was configured. + required: - compatible - reg - interrupts + - current-speed + - xlnx,data-bits + - xlnx,use-parity allOf: - $ref: /schemas/serial.yaml# + - if: + properties: + xlnx,use-parity: + contains: + const: 1 + then: + required: + - xlnx,odd-parity additionalProperties: true @@ -49,5 +85,8 @@ examples: reg = <0x800c0000 0x10000>; interrupts = <0x0 0x6e 0x1>; port-number = <0>; + current-speed = <115200>; + xlnx,data-bits = <8>; + xlnx,use-parity = <0>; }; ... From patchwork Fri Jul 23 22:31:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 484965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96823C4338F for ; Fri, 23 Jul 2021 22:32:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F79060F23 for ; Fri, 23 Jul 2021 22:32:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232974AbhGWVvn (ORCPT ); Fri, 23 Jul 2021 17:51:43 -0400 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:51343 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232301AbhGWVvi (ORCPT ); Fri, 23 Jul 2021 17:51:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nQ3iMW16dz+kshCjPo/AT+yVc0OY2wpWQLa9CIa/bHKnw+A9D/WchauiK+w5sWB3uJMbfSjOkV+4wuZMz0Ub2MNMB2Pjnpy5XJsd2SITvJR1A5NHldYVxo67F9XTzu2kh7ITpsV1rjzJ2iZPo4QQcV9UsNv3xRI4mpxsfaQvPpuVPbuA7fQFP8swceLl0r8pPbpk5VohpeV6tSIbDXNNv8vUo6j9KDXg8UPhWy6vxIgpMJlm7EV3S9W+sMHfnG/fhhU27I8EAWNS5io1TTLRfhLyElzF9+kV3+ksa7Y4rpnOER5mIACZgVpB7VzQsk/3JlgntTPe+4Tup42TqFmloA== 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-SenderADCheck; bh=euxq4rPLYIPF+HBCvF7BS4X/iys40/GCtqU5gx3Khsc=; b=m14wBhKw3zQLb1JwodI4ZLyXtkTxB2BLDObM1/6IaTT1s4hLKor88Q5Dk8ZYPA2yiap0U99+tnDvDfAa7lk5ujDSA62GYlTYMHLu+8HC9DH9CoNyyBBnJNHMb/bDtEskQCba6RT4iPyqS6onLySuxOBAunFuaSpI/25xcqd4R0eqYb4EwIaoGEn8NwuGLg9Lm44/1ZPDpiFi6kXIjY+QC+ZuEYOvnUYAvHxKvWpcBNX4b9d1RQxUX/ItOOuawt6dyoXhR2j2vqP0BgD/qDuWYFo4K4bgAAulU6QEPO9oQ41AMyGrZUvu4xiI6zmopgJMsSS22FlB4SIvJ0uCDvUrxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=euxq4rPLYIPF+HBCvF7BS4X/iys40/GCtqU5gx3Khsc=; b=s9Whd//yxMRAwg0kexJPxj6CqzfgCSkz/OpoPtTMNLAvLwH1CnZk3KiPqrQuZVpwlKYXP8FresKVyDpHkGtu2J69G7w2Pq6igTbtYyua1+nX3n5pZMcJ0z43PyjsVWdf4K5l1iUA4KeabR0PK0R8C7blBPPdw4gIUlOoCw92X0U= Authentication-Results: barco.com; dkim=none (message not signed) header.d=none; barco.com; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DBBPR03MB7068.eurprd03.prod.outlook.com (2603:10a6:10:20e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Fri, 23 Jul 2021 22:32:06 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1%7]) with mapi id 15.20.4352.025; Fri, 23 Jul 2021 22:32:05 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Alexander Sverdlin , Michal Simek , Sean Anderson , Rich Felker , Yoshinori Sato Subject: [PATCH 3/5] sh: j2: Update uartlite binding with data and parity properties Date: Fri, 23 Jul 2021 18:31:49 -0400 Message-Id: <20210723223152.648326-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210723223152.648326-1-sean.anderson@seco.com> References: <20210723223152.648326-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 22:32:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8671c76f-af08-40aa-0c98-08d94e29b335 X-MS-TrafficTypeDiagnostic: DBBPR03MB7068: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MrZ782XWdtxDK20z5b9J+SmTFYygfyJAIpfICOQkBdH/2ReeiTeFeynvZHk12Cz3gfryODxoXDWqJbx/iufhwUtijNISF2yxhwHNv5ikctfH4yLnHlcTCy5I2/ZT/DmS3RlpnZTPrcwChxESNDLvp0ZmXo3gkZ5pDIK2LJxZRdeV/Ak9bJwLGagLOFd4xXar4BVxqdCcW5N40BURFsusS7juP6nGCy1BZ4vIU98vPud+yhpC1MBpMWatpQ9IrwtF+M0Y6wMsUZ4cpbORTL/+sIa5QWviftTnCWoOmBC9BG7i1hNzeR+jOBs37mDs7wH+BBdm6L1E9WAlB5JuvPaRytbKqHz5eHV39bFXowvht8ENtxSec1VLkCB9OjWwKNnaWCL/JPkqhV/5NUmW/h/G6TUVP6vRrdk9nFDKZSjspybgIbXLNhHBJq8juBGUwP58Gkobjg+gPVljDuS0KOONUgRQJ9xL4DZg8yA7AG6Kuz5vr5S3sgHhwzdUwm65djvZP9wR9OBazDOgv0hm1RfSUofXD8laTVflwiOtBAOjW6v6AMTuq06lE/gZgWFobRFY/KmiEnV7k2YRW8YuIPLEj6iWgtJ7wt4YDT6AOkt2uaQ8bfLWStjz5e+aE7mrUlx1FzGKiQi01iN2pJnGq/3K1WfPx92PYdhxRVJi+vRAlj6R6xEVst1SArUtyJkmQ+Xg7/AzhDfTD09zCe+ECTa95g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(396003)(376002)(366004)(346002)(39840400004)(52116002)(478600001)(2906002)(2616005)(6512007)(6666004)(4744005)(186003)(26005)(1076003)(956004)(44832011)(5660300002)(36756003)(38350700002)(38100700002)(316002)(8676002)(110136005)(4326008)(86362001)(6486002)(8936002)(83380400001)(66556008)(66476007)(6506007)(54906003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NiCzpRQnvnedeGVj1BsGgMHy3h1KrY7zvajxw/PrtYJNy2Ltjyh0w/JGNzPE9+VrHw0IayVJQq9UwWy3kj2Cj3kg9i/H2Wc4p3PAisY5BqRMYIokLcsGeQR8ff6/H9vySV8A8Ut1bQRJm8jTiF2IzPYv8avph9ypBP6aywn0I5WUEvQ5j3lEcUk3xata9RVyStLiW/dai+N7atmrS9wN66k1ADmbKk7zky1decY7q6wrCU1OKWkSh+dw3VosCze2pY7mOOHOrtkxVt0Gl3JPdmhZ1dEXwir2j+OJZ9++6eWDeeSGx6gh+/d6qmZvOO6wBa/c4OG4OUZSq04uFegX+vcDb8+p8I2dKtGf97ZOt04WpOZ6Xzhz7N+y4p4Hg+AbrlnP0Pepv5XmoBWLiFuNz3j6BthpVERFHz09UxiGhoutHJknRtjZHtgQoB9vTKnSFZuW0x29jcA9Xkg2naeo4iZQyXlHr7EILy8GEMtwdxc3Ro4KJgoXbzNmQF7oriaqVPtr5KbBAE7c2HuTW5iRUd+AJbaKA17ERacInyCdU5WK+xCwpDP0PGH/tovHDBnF5RU4YtUGzt60AOw4v1Bw9mveQX8B1mzKPdltWPfpKIikJqu7vlQH7FbB3GgDTBP6+fhwUTkmZQkJB8PI97afgkAd5gEsy57lH1ndkP8mwAqbTTzEo7e2g+ubZFXQhzQeM8ko1zdb3FZmznbQvyVTfMUXOyAm+pDUTWo8QlEqPcz1aN2UQe3G9aewj0PWt6fDE+gACt60MSpNy9j+pvYPpMmAGE+pyUXOjkEfgRAosOBVouEQPv6f7hwHfYFzAhPIPHIIXh/gvB2NuMYBVQYYGFSOXlTlgSfFeNm02SJGpvUUQ814IdAV0R9sHRfOvsISNKE5ddo47On6ZU7nYOIqyLCU7F7KuGlgok0SKdmiVqJmXpyaX/IBk9OaAQdj40gB9RH42sYTYRFuuz3W/oeNtJsN/v/6IzFb7bMuyL/wMD1nRqJI7vkX7jTOdviHitVGfDL2IHmvImFT3HTHxcco7TCras5KykzI3Y0IqaSZQoXdMzpVRElVziDPfI2sMl8KP+JorVFTAuLrVZxMe3lM+Nw7r67H8BPS7rqm342Us1Bg0DbhNjX0+rF6ZBbfTCO6k5iOyZfH2Dzfref0LqzeOCOH+9Lgoif3kAuLOLpJ3y+YCrRfR9z3cFHRYGkZitb09/edUtJZY0sZw8xwEUuyj56pGKwlq1Q5uKU3/ctdyoR8Xdh0S4+jumdsLusLUDa87I81ObFCxqvfbGcn9dDYCg+LPcdHeWs6JChAA6P+KSZBQOsmmB9CrsrM7+NKUXPk X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8671c76f-af08-40aa-0c98-08d94e29b335 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 22:32:05.8788 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7nZgL7cITV1yi3M1udTyMeZHGRlGDz9NVXNedk1kTV8xlKATWq3CJsWMNbcm5JAgLTN9Cf7MrM++S7DjEd/zuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB7068 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org These properties are necessary for properly calculating the uart timeout. I inspected the J2 source code, and believe these values to be correct. Signed-off-by: Sean Anderson --- arch/sh/boot/dts/j2_mimas_v2.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sh/boot/dts/j2_mimas_v2.dts b/arch/sh/boot/dts/j2_mimas_v2.dts index 9f4742fab329..fa9562f78d53 100644 --- a/arch/sh/boot/dts/j2_mimas_v2.dts +++ b/arch/sh/boot/dts/j2_mimas_v2.dts @@ -88,6 +88,8 @@ uart0: serial@100 { clock-frequency = <125000000>; compatible = "xlnx,xps-uartlite-1.00.a"; current-speed = <19200>; + xlnx,use-parity = <0>; + xlnx,data-bits = <8>; device_type = "serial"; interrupts = <0x12>; port-number = <0>; From patchwork Fri Jul 23 22:31:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 485529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 655D4C4338F for ; Fri, 23 Jul 2021 22:32:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C4FF60F23 for ; Fri, 23 Jul 2021 22:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232848AbhGWVvp (ORCPT ); Fri, 23 Jul 2021 17:51:45 -0400 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:51343 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232226AbhGWVvo (ORCPT ); Fri, 23 Jul 2021 17:51:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FzjV6G1Mmp5NnvmWHJBuiYVE6nDBJeZSHvhG/i2nidYfriw8EwImzBW9RoWpPUC3skVTKX3l18mkQd7x/MLQkkzGAF8LKahFDhhucWCMv5++oV/B26yCEVvpqBnkiul8/3kqzSwVzTOPhXtOsY6OxM+NE6xb0qtTqJO6fEdFGPqOUjkbM/rDX9kBLFQpklRZmd6xtij7eK8lqJbenaF7j7LkAaweY4LjnbKGzmyf010Q7dv9h29MCtbWd49Uzy275s0/vi4njAodO1GFLYlAHFZORVP2lDNc4QQWSumWcJsebdZuxxMXkbZj4xKBXU87g39oai4L6Ka0bth1Fmw+rw== 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-SenderADCheck; bh=CNFvKMBCv+YGQGZYX8BGVhpzTXsTcFW0MbLi0AEGLAI=; b=jyQ3kf4gMyVi1LFxWg0j36z1Wuw7m4JMJBpOFa5uHd2ObcYi/6XWN1rBh960+HcKXZ0/lBTMajTa0KkITj/rUkqGpzqXmwc0dnAJR5RifUmU0vjDdBMdYQ995qkRAwt5H3M4eeIErNSFnNge43AoVPPsCOfzDYyJFHRS8Ei1KbPuxhMj94glrEFQx/rTNIdsIai0pwvLnWwu6exkP5jMps/hptaVHflR48SyCzrA2aurhx5BfWnGWxCnydvxD9iRvs3YBrXOM0ehkCATcAoyXB2Pr6MrQMtzHISkbya0yev/d3ENTcb7f96kpAT7U29l7qIaGGUmUuOLW7RuIU66pA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CNFvKMBCv+YGQGZYX8BGVhpzTXsTcFW0MbLi0AEGLAI=; b=mtSIPiIirA1FGm9PT2HO1j8Vk2A48BN1YuKsXofT1s7pBdd9lZZkaZvM7gbsuatIpeuifEW9pZ6ObXVl9L1iXnYiRsmKGUfOyqmwLCkz+MHcLdVh6kVEpVXvoV08HnkiIsrRhq0oWVxMn89XAL7t0A0LFJPwgW4ihUYmvrDsoYI= Authentication-Results: barco.com; dkim=none (message not signed) header.d=none; barco.com; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DBBPR03MB7068.eurprd03.prod.outlook.com (2603:10a6:10:20e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Fri, 23 Jul 2021 22:32:07 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1%7]) with mapi id 15.20.4352.025; Fri, 23 Jul 2021 22:32:07 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Alexander Sverdlin , Michal Simek , Sean Anderson Subject: [PATCH 4/5] tty: serial: uartlite: Initialize termios with fixed synthesis parameters Date: Fri, 23 Jul 2021 18:31:50 -0400 Message-Id: <20210723223152.648326-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210723223152.648326-1-sean.anderson@seco.com> References: <20210723223152.648326-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 22:32:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f916e65-8313-427c-d66f-08d94e29b40c X-MS-TrafficTypeDiagnostic: DBBPR03MB7068: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zPqI02X2NtBcC5H6LYKBaRJ8Us3F/3L5JJuSP2RxgYky94/Hkp47MqQKtVo57iBJGB/+6kSTeKBA48eMvpXx8T0s67Sa9WEp9ncdXs62jJuUKu1MCUeWwSaLV8rCSm7J4eKrKz+6pQpNSOJdcR5hY7Il0DpOWyqy5qPEGbtsjcAAX/GBJ28Mj6ZvoIJrK6qlQl8HaGSQf9mgHTysFKUEDULRDWmp3cHbqOY9WfASa1JfcizA0mTTpETaTY7XqQdj9+AeMVnmhfmd5pwsG91YcZMxbTn4NBFmR3dLuQpQxq3FQu/o/DoDUeM3QA/dNP7kYV5F/s4ZcSuGK5X3deAuGLg4u0FYQAs/yLutintSJ+DprOzyAmjQh0zyLh/5fr+nne/wHJPiVcdhGpqfM/BzQYICc9M3nudMBaztD6Hf5RcqNSIa4XMcqNMbGPHhFgCj9K+30tqCVQiXh6tCttEJ+aSdr+C8In9cLm5V9WSskqvL0YK8wGa+MnHAJlnlNck01GPQqgpPLgJFkyXUT8zI1JDalWab1CqmshELzEvezIK7/iyyeXCGyHzCNZ0YjthG2638lRC73TKrZ96ZPCyNzHwg0zSEuT1evvK3sbBPnPXxuMW0LhOqF1/RTTn86JM+5dVRO3AG7SVPWiw46roBJgWoMMApyerUOeJomuq1Va42ZK6E9wYjMTcT18/WwokBOJJOkoRQz3AoWNo7n5wRPQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(396003)(376002)(366004)(346002)(39840400004)(52116002)(478600001)(2906002)(2616005)(6512007)(6666004)(186003)(26005)(1076003)(956004)(107886003)(44832011)(5660300002)(36756003)(38350700002)(38100700002)(316002)(8676002)(110136005)(4326008)(86362001)(6486002)(8936002)(83380400001)(66556008)(66476007)(6506007)(54906003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NcIvNBIx33rIggKb1su1uqBuq0OKeoZUh2C6ntotWKwK+PneR8YpbfQZAx/44UiSKuHCawsG6bT1DloozZcLSRsBNCdNFek6a46ZftoHzqMpMAmeuvIhDGl+OJWjoiF2tzqMI3tqwsljOkNAmvayoBhjJofdsDKi1NAgKA68NGuZlrkFV6SAG0ejxMkCZ2usMKpUnNg4sTpQUK3T3U75e3dtx0S9iP79WUkBijWqsjEb9i54Tf49sWs633ubw6p+Z6evphJw+ZclWOwcBQfV1GDfI1xB7ZehlNf3gZjitu0QAhP/QEROIgsvKUctuH1xSRUhZ4o6bgifUGDoffXo6zo98m7IkfIf/16UUy4qwaE/5VakTxxiOSyXFeWkZjLO1d10sm1KUlgnOEilbbEWHApff9IDyHxnuWy7KW0MAKppnMKhSbSUreH033VHPV6IBYHImTJTHHklEqVlDwfwPAY6NVSZNhq9JJcPtRB8adQP8IBoVaPrCDWFZYbiSdxaKV/mTGFIJr6ItoAarDFjUgUhhvNoWPfuvuYlAQhnvJ48WesccT87E7ft600FB+TXvp5Gzs7c2bHgxooMuFaIVECyeeMBW3mr9mXgMgocwj0ZklWDDX19PDf5PwNFOidiyZdAAko5hnIdf6AkYWLtlufssCUbEwGzQTSmCGfQvr486x/YLXK5TTQP2fh3a8TxZyuhS9YALUIRPlJebIby6h/laIvCw4tAqkrV75HVCfnMbPpnFYvI9cE4ODTI8g7Hbdy6X3Oah/KA7BYwp8yM91Stbo9+7SD9LtylK2FxochaufvJ2+djUvyMO5KXsjl/9hQDsE6ajzBJgpyKDT2jn5pOwQ51znu0hoyzoGRLrjECnCUm7u5B+MCBs+q5OHoedwczisysTWOt9UYuiE49RPaKpx0xGaRjpycydfSR2z0rAb1qlJngYVA3tE+xiuLuMb4pKevfYveNGMMMZtVTSn47e171h/3E73+yOSKqrwl5XUwTXCITLM5vJqo/PP2pfkvUx9njcrfaAnU/ZopW/UAEKsOTYZUoKFsevLiTrSRFhYh5twyBBnj6Rxb0/dO0M0tVroojcXKaarX061f7pC8d0kHUnEese7kSC1Swp+D+0uQumeMOFwSxW7E9eLstAluH1MJp6sFI/ayv1U6GqN1a/7UbaiRd7rQhCcUb2DxTeUajT2zoCIUnAZHwNToHuOoflY3PigV9yszhPoy3OGq4Y7luuNrpJn9f+0ER9FyLUhy/2YDCWIG7DcmjVvuZ5srVCrX0LhkovES+OOwPoc72W2YdIbG2Js3JWC+wWCG7GoX+C/YNJtI8L+VheVNQ X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f916e65-8313-427c-d66f-08d94e29b40c X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 22:32:07.1771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: x1mFzwpp2Q64SHPzeTR8LrvFQQdSw5EaEQP/7Z/gz1mXUQe5U6fdleFKggGy58WAhnyLtgz0apCxfUcI1FWeQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB7068 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This reads the various new devicetree parameters to discover how the uart was configured when it was synthesized. Note that these properties are fixed and undiscoverable. Once we have determined how the uart is configured, we set the termios to let users know, and to initialize the timeout to the correct value. The defaults match ulite_console_setup. xlnx,use-parity, xlnx,odd-parity, and xlnx,data-bits are optional since there were in-tree users (and presumably out-of-tree users) who did not set them. Signed-off-by: Sean Anderson --- drivers/tty/serial/uartlite.c | 66 +++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index f42ccc40ffa6..39c17ab206ca 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -60,9 +60,20 @@ static struct uart_port *console_port; #endif +/** + * struct uartlite_data: Driver private data + * reg_ops: Functions to read/write registers + * clk: Our parent clock, if present + * baud: The baud rate configured when this device was synthesized + * parity: The parity settings, like for uart_set_options() + * bits: The number of data bits + */ struct uartlite_data { const struct uartlite_reg_ops *reg_ops; struct clk *clk; + int baud; + int parity; + int bits; }; struct uartlite_reg_ops { @@ -652,6 +663,9 @@ static int ulite_assign(struct device *dev, int id, u32 base, int irq, port->type = PORT_UNKNOWN; port->line = id; port->private_data = pdata; + /* Initialize the termios to what was configured at synthesis-time */ + uart_set_options(port, NULL, pdata->baud, pdata->parity, pdata->bits, + 'n'); dev_set_drvdata(dev, port); @@ -756,18 +770,58 @@ static int ulite_probe(struct platform_device *pdev) struct uartlite_data *pdata; int irq, ret; int id = pdev->id; -#ifdef CONFIG_OF - const __be32 *prop; - prop = of_get_property(pdev->dev.of_node, "port-number", NULL); - if (prop) - id = be32_to_cpup(prop); -#endif pdata = devm_kzalloc(&pdev->dev, sizeof(struct uartlite_data), GFP_KERNEL); if (!pdata) return -ENOMEM; + if (IS_ENABLED(CONFIG_OF)) { + const char *prop; + struct device_node *np = pdev->dev.of_node; + u32 val; + + prop = "port-number"; + ret = of_property_read_u32(np, prop, &id); + if (ret && ret != -EINVAL) +of_err: + return dev_err_probe(&pdev->dev, ret, + "could not read %s\n", prop); + + prop = "current-speed"; + ret = of_property_read_u32(np, prop, &pdata->baud); + if (ret) + goto of_err; + + prop = "xlnx,use-parity"; + ret = of_property_read_u32(np, prop, &val); + if (ret && ret != -EINVAL) + goto of_err; + + if (val) { + prop = "xlnx,odd-parity"; + ret = of_property_read_u32(np, prop, &val); + if (ret) + goto of_err; + + if (val) + pdata->parity = 'o'; + else + pdata->parity = 'e'; + } else { + pdata->parity = 'n'; + } + + prop = "xlnx,data-bits"; + ret = of_property_read_u32(np, prop, &pdata->bits); + if (ret && ret != -EINVAL) + goto of_err; + } else { + pdata->baud = 9600; + pdata->parity = 'n'; + pdata->bits = 8; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENODEV; From patchwork Fri Jul 23 22:31:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 484964 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35B00C4320A for ; Fri, 23 Jul 2021 22:32:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B18260F25 for ; Fri, 23 Jul 2021 22:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232226AbhGWVvq (ORCPT ); Fri, 23 Jul 2021 17:51:46 -0400 Received: from mail-eopbgr130051.outbound.protection.outlook.com ([40.107.13.51]:51343 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232301AbhGWVvq (ORCPT ); Fri, 23 Jul 2021 17:51:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gh+aysgwIfh147GyDHvLdjaKtmk94uME0Cao3xbXsCOuLH0ghuop9+OXf0yOnQZL7Sy2MkoIX6WfxnpxS0WYBPcG7G5+6oUQuDjp/EY7v3oncQ03Nts4HVKFaUDJPGjQFzSoZibLFXREx7Y6E1MBlrwdtxoAALtk6zaG2TPhdXAm1ZT+RK/wDQMpky9Q59KgXg/Ctc8EwnOGKDqFls9hIjl9HUDrge/YEg78rnlQuyobeTpPjJc0GDErsRon1R9sN6CtRdfy3t73muu/aiM8CkrJvjg9518TLAsuKzpV1o+JQw/5/SiBRwElnD/IT++xbyIZibwS45Fstszd5JTduA== 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-SenderADCheck; bh=rtu5cragWjS+0rol8msqzz9d6l18kgzG1WAxZSpmIlQ=; b=nmTcOzV6RU24jRIS65ySd8k5a8VIQRxlM7B2c3UuJgRn8+vLfIbGoJDGyYAVgglg/n9p3vT6vxE7WOBo+fZs2QcwAuF8m0lUEm6O+dPQ0GRG01uATdFsTlVWQFv/z96CvoAMrUOaCtvLVl9yoChTjyp03eAYTI8fZYnWCNdUZN7v997hpjmjCM5QzjIMcRjKJk18oH07EuFIBfi6dSfuc/yiIx7Y35cqmUWIkmatcmJOSOm2iUXjBx36lXeiYqUFUwSfe4oTZdfGLNZQE6l9vGwkljBryO0HI520Gm2aQZ/V09nkutiYqI9ltvdxKsz18KFua2dN7p45uDMdsx3Bnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rtu5cragWjS+0rol8msqzz9d6l18kgzG1WAxZSpmIlQ=; b=Drk+bgArGU8mM2wSoz/wcm09jalRW3SeF9QY/QJWHIdBdaF9wlpQiKBs+OGoh7T96ifBa5wB4sVCpL+sqG7VXpUDd7fb9+G/C50OJoPkI/jex84YASWDK7VQRf2a6s7mVfc+Nv7cM7NNJ0Icl+gnjbkYGUA2jhxi3SrflzJa46E= Authentication-Results: barco.com; dkim=none (message not signed) header.d=none; barco.com; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DBBPR03MB7068.eurprd03.prod.outlook.com (2603:10a6:10:20e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Fri, 23 Jul 2021 22:32:08 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::dc6c:815b:2062:d1f1%7]) with mapi id 15.20.4352.025; Fri, 23 Jul 2021 22:32:08 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman , Alexander Sverdlin , Michal Simek , Sean Anderson Subject: [PATCH 5/5] tty: serial: uartlite: Prevent changing fixed parameters Date: Fri, 23 Jul 2021 18:31:51 -0400 Message-Id: <20210723223152.648326-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210723223152.648326-1-sean.anderson@seco.com> References: <20210723223152.648326-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from plantagenet.inhand.com (50.195.82.171) by BLAP220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Fri, 23 Jul 2021 22:32:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d743082a-28cf-475d-d604-08d94e29b4cc X-MS-TrafficTypeDiagnostic: DBBPR03MB7068: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oj07zPLqw5H+rMZaPc4d9FVQTOgxy5vl/w5p37BOL81aS/q3iR231MGf0o4dObRA6kN11/wzeWF/9nkMJDZD6kfpjs7WwpSLIlsa5kf1R11JxAAcch4YqlPmI2Pg9AA0G6G6YgIyis4SYpx7lEZ9Znq919i7wU6HGUrhVSGmSxPwsJHRWZY36MIy5EISYHVTBOe+HU1HOY8sI/vU4X3AZl3SQj6SI2VBZH7eya9fkEjUhn4lgagpQ5b5CGl8MvAY6+FtBrRmHfC/fJ5e0Ida1HGbKjDSdXIzMsRzmI8ceJGgRLLoJXVv+33o/aIsmVKHDAbt6fHdquWuSu/onch1nXtUFREBk6z1AkOudGekMdf9oulcMIpboeBXbBSNiUzu+e9f7dg5G2G+bXjQN/5MTRdBkFaBaQK/B2bra6HCa34dT8EOlGONrFnTWBXquvHFRIEzzhJZxYuMcYGA2y0TSBhu1WfDDw4bqczJPLckcsIT9dO8OJYj5zH49gcBfcsjS8ZI9A9153jDYT+BNBsHFjA79c7F6dkGcWvtWVqhbayahLu/Swj0EsNwvS9wU+j5nU1wNt4+jViZNC1l14LwdRIU5gVUDpd298XFoL33UDJHIN0d7DX4uAftHSL5k1cYL0v6bRQpSU1+Wol/2SlM5XSWnDQVCnrTZ++ziJg1YGjXseS2A4Bi89vwGloyY6sBV5uZo7HI/mrCK3iA4wHLug== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(396003)(376002)(366004)(346002)(39840400004)(52116002)(478600001)(2906002)(2616005)(6512007)(6666004)(186003)(26005)(1076003)(956004)(107886003)(44832011)(5660300002)(36756003)(38350700002)(38100700002)(316002)(8676002)(110136005)(4326008)(86362001)(6486002)(8936002)(83380400001)(66556008)(66476007)(6506007)(54906003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 79iIBCtrnGtokt9qCj1IJK2+p2EQA/rvb6tZ+f5W5I+487Pg7CDsTTRdo/oqR1q0nzF5WgDv3oD4BtQk0J5nxGJV2uvaJsE8HkE+dOsaAqAzMRFA8x8Nm/EoxqhK+orLG2kOWUs7PWZmE40FA7ShOPT0773GX4Mh7fFaqCuylfMZ5aLgI9kvuM3QuCx9fWJ7QgbssaX3gsF/siS24bcxYcUf+dXC6Z15m6DiwwgJNZv8wqmPt4x8qRRXvjAUotAvvnyOBza+ua/P0KVHhO+vkG6yQvJ33CkasWclnGuW//fpR2vRVQlKZrvjsYdhFHuNc3E6GWE3F2JE1p0uFdaXesXZshdjC8PFjGhNSVWwf1KeLdcMkROWSK/w2itP+j7Y5RyfCBhLFZYLUajftwzndQMgBkC6O3jVHrLhRGWdoMYzioDvZQ+A0yp/QKz8MkklWnp/x5SUlJWh/lHr0OBCfMRES09P5F7JRbH5E8MlUiqPsKo/uaD6kLXHwN25TVcsQ1eyL0apZy4LvcuawzeUUl/SLG2xX8KtA2fodvn8tl1F9MGw7eYegrWXtVIrna6n89TdZhsklrB6b0oQA1t/9zXFaIM9lB66OzDVslJc3JlcKIGsLQCT11zEKC5qhaELo9sB2xy5VDMWHD8/Xqiz2wCuQRI/RDqBiX+MA9+j876FUewdueKfXhtc7t0pKWiHYBym5mc1y+rj6tcqwixTqhdk6Rp9/AJMv9xEzOfpm50ZnZ2COthfi2BLk7XN5wE7Sm9xq3TLw5sBqDE5ps5Z9dxaI88HEg5Htih7fv9Miovfvh2EfFe7V6QFYSVgiloaROW+1BaT5S9BrZqZ0K2ftrEk74QNHMccOv6ARf4iTYmPcbOz7kQX5zJ9WvWDubbEZWopML0bei09HBY4/DuiV9o9IRFyoop8aRUlI8aNZjmxQ0wTzC2kryyr2Q5S+ys2UkD40h0Y432Gw2Gft6NCdJu/iC8XKbJdPiC/8OB+nNAzQhVPLxgx2l7ollY9xEGG90wkjUOAWRTSaN/5cy6RM6gcuOaVhFzzRkqhAxEwU1V5+5ApJMsRGMY36DzFzaKycQLD249xv8ZhXt/enA1AlyYRshMNKQbsg/1WvP35n1qxf490V/LT2T0WAhACU7CPe9N2gQBb4Z08c75xUyAqB04wBWuIlDvtIL893PybyZMvA72TSI1pL5rmpKU3cgMKrZc8XbIqtrAvMdA0i4zimVvZUcfqFO4dI+7FtgbwbKo8POvkzyo8K2E464VaGxOTIrERLlKlPrUol3N6klF0MpZAdiMmjWVKWJRZJStOkYS69nM8sPeiEFptJb4GTATg X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d743082a-28cf-475d-d604-08d94e29b4cc X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 22:32:08.4923 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: z13ebU1ILRFEzOYzWTZRmlCn1QeqdG2cH2s2eGSKvtf4vORxkLFWQFsWS0CNmDKX1O/ria5QM4hPv1nQuDE1hA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB7068 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This device does not support changing baud, parity, data bits, stop bits, or detecting breaks. Disable "changing" these settings to prevent their termios from diverging from the actual state of the uart. To inform users of these limitations, warn if the new termios change these parameters. We only do this once to avoid spamming the log. These warnings are inspired by those in the sifive driver. Signed-off-by: Sean Anderson --- drivers/tty/serial/uartlite.c | 52 +++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 39c17ab206ca..0aed70039f46 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -314,7 +314,54 @@ static void ulite_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old) { unsigned long flags; - unsigned int baud; + struct uartlite_data *pdata = port->private_data; + tcflag_t old_cflag; + + if (termios->c_iflag & BRKINT) + dev_err_once(port->dev, "BREAK detection not supported\n"); + termios->c_iflag &= ~BRKINT; + + if (termios->c_cflag & CSTOPB) + dev_err_once(port->dev, "only one stop bit supported\n"); + termios->c_cflag &= ~CSTOPB; + + old_cflag = termios->c_cflag; + termios->c_cflag &= ~(PARENB | PARODD); + if (pdata->parity == 'e') + termios->c_cflag |= PARENB; + else if (pdata->parity == 'o') + termios->c_cflag |= PARENB | PARODD; + + if (termios->c_cflag != old_cflag) + dev_err_once(port->dev, "only '%c' parity supported\n", + pdata->parity); + + old_cflag = termios->c_cflag; + termios->c_cflag &= ~CSIZE; + switch (termios->c_cflag & CSIZE) { + case 5: + termios->c_cflag |= CS5; + break; + case 6: + termios->c_cflag |= CS6; + break; + case 7: + termios->c_cflag |= CS7; + break; + default: + case 8: + termios->c_cflag |= CS8; + break; + } + if (termios->c_cflag != old_cflag) + dev_err_once(port->dev, "only %d data bits supported\n", + pdata->bits); + + old_cflag = termios->c_cflag; + tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud); + if (termios->c_cflag != old_cflag) + dev_err_once(port->dev, "only %d baud supported\n", + pdata->baud); spin_lock_irqsave(&port->lock, flags); @@ -337,8 +384,7 @@ static void ulite_set_termios(struct uart_port *port, struct ktermios *termios, | ULITE_STATUS_FRAME | ULITE_STATUS_OVERRUN; /* update timeout */ - baud = uart_get_baud_rate(port, termios, old, 0, 460800); - uart_update_timeout(port, termios->c_cflag, baud); + uart_update_timeout(port, termios->c_cflag, pdata->baud); spin_unlock_irqrestore(&port->lock, flags); }