From patchwork Thu Aug 26 19:21: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: 503603 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 5E7FBC00143 for ; Thu, 26 Aug 2021 19:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DB7061037 for ; Thu, 26 Aug 2021 19:22:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243391AbhHZTXL (ORCPT ); Thu, 26 Aug 2021 15:23:11 -0400 Received: from mail-vi1eur05on2071.outbound.protection.outlook.com ([40.107.21.71]:10016 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243342AbhHZTXK (ORCPT ); Thu, 26 Aug 2021 15:23:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RfNA9psK3TC5w1VX6r3jxF1oxabbbrL6yaNrFP+ez6SYxQyb6lmNIGtQps0FslM78FK4A9LKYUGh6/60B5ChoNwwd+Ev2lN2NMJszURMZ9YAgU9bW0qSw8kxY4WpnrWM068ZA3Z3cujoydEOQz7RhzT/ks+x2qyAMmwNhguUMgwUJsUv9GUdo16BSub+t/mH/+OgSapOtmUW2sKx2pXOZGofY8qrh+mkfvtbz9/Krzlsb61TM5BhnYuhE2r8REoHeXM8ioqqTIud5R4Kpytvy8rGSdp7kP6dr8zq6u8BTiIuMtCtq1wzrtOny20WMAwqcmbtgcSALMxEraPwfz8kdA== 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=1hej7rbzxBDMjsHNDpAmXDL4Of/gybLbwFsjz0+SA3w=; b=EiIoXU8qUA9THN+M3rzuniBFCaRDz0DssAucELEGewi5VIhsvrFZnIZQ9DLGfdB6lYQEZxmhcwHzkplMD7XS/tG7oFkugSL5SV3N9Ck0eyWtEWuYqE858B9hii5EtrjypHEJL0Ub5lt6zoWaLXsSRXaQgWAdlxynkbuwcPfsQIKxX8wUM/yZhhphTthMiSQTf3ZQU93qahPt1rEFBBXi/Jp8tSZOMBufwmUnYsWrkH36Ei1YvoPdWOKSxi6naGGdXxYBD3ZmxyUJI8SG+Gz5puMEj7Q7KSTuf0EYq+6Zh93sqDs8nh16g1t1SYp109OQZh5zdZh/nV/DLLU03Jo8fw== 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=1hej7rbzxBDMjsHNDpAmXDL4Of/gybLbwFsjz0+SA3w=; b=BpzqP14ci2WFbr/DzS09oGx1tNM5lIlJnJUkWiIoBibtMFHCc4gPl3350cDfWCFWQD9C8+jygytXxhXCjtaeh/xc7YLH9lnXPCm280JBYQc629iP5Arg7z8olppYd2zuc1EDYDtWNfMrZ2oF4MyEpJKVG5eoz1Qpl/FHapRb978= 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 DBBPR03MB6748.eurprd03.prod.outlook.com (2603:10a6:10:204::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Thu, 26 Aug 2021 19:22:13 +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.4436.025; Thu, 26 Aug 2021 19:22:13 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Shubhrajyoti Datta , Greg Kroah-Hartman , Michal Simek , Alexander Sverdlin , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v3 1/4] dt-bindings: serial: uartlite: Convert to json-schema Date: Thu, 26 Aug 2021 15:21:51 -0400 Message-Id: <20210826192154.3202269-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826192154.3202269-1-sean.anderson@seco.com> References: <20210826192154.3202269-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) 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 BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.8 via Frontend Transport; Thu, 26 Aug 2021 19:22:12 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66ff275a-6521-4ed1-3235-08d968c6cf11 X-MS-TrafficTypeDiagnostic: DBBPR03MB6748: 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: VdCEXApyPnI6KdU4q27rzYQt81xbd7B4f92TcUHrnR+LLrZEEsiOutHqM8YjGJ3QufTk1sfsEOeAugAqoTmcSrsS+psG9o63PjYq0FAKwYyjdzITg1vCwtMiTyTQ9QEOh1l9KfHn3HwbTazSwf2ksPzWziqhOjxqUf2JbcE5+nTgWN4rTgxZtsluHy6DLnhCskqhQ2jY19r48LsYcUjPyT/4Cq/OvwJDnlG6lcyivDudQl9QcahZ5JxP3pzOBaQMvLIk9RNPUt8NvR4nZpYxZQ9tbZESN81mOfvZjNwRuqDHmlhuZu4H/FDsO7mdy1CzIq0vQU+vYfPNECw10x1tZq0cgA+PBoxRROLfFLMQUbvto2rgBFA6Kamp92fbeR5uGntWaVCP55vRB6xWG1YE5Jb5F5e5J67J1KXDpGZejgLJC1wCaUQxLwyYXTvnHq+YMCmZFCaZJIEOto3Vv0So9LHJtJ8R0uk/YcEwdjONxU86+1y9M2AkHmvmDJOdP3C/hZ5elDahIcbCXAT4jDwvU5v0hAEWfXQYDdDm/xn+G3gotunwdmFPb9efJ1jeInb+rstv/FS3Q1x198Ib4ehdhAIXyFy5iReTgG9UxcODMj0vUdHHSwRtFeQSgHaQ/ceAmUI0cxxVRhVRsMxDSxJ44wSdXGEHlTrgOc1NaRSVF4pNb0Rg4vLjg5EnGcwWF4TWLt0JNxiN824o6T/h75rqdpwuLzyWzzU9zqH+a5mJBGD6KlMiSzTKZq0twEjp7BnY9QEB4A2drf0nA7tWgrhcCmw8roVSR37Igw2PI/9a23A= 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:(39840400004)(346002)(136003)(366004)(396003)(376002)(83380400001)(6512007)(966005)(66476007)(86362001)(478600001)(110136005)(186003)(66556008)(4326008)(54906003)(38100700002)(36756003)(38350700002)(316002)(6486002)(52116002)(8676002)(26005)(6506007)(6666004)(2616005)(44832011)(956004)(5660300002)(66946007)(2906002)(1076003)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sK+8wMd0wuFy+grOgfzhkGm/ucpt0FCg7daFDQNn5CYDV1Fs7K8acn7CZLRsPkcPA91y7HlXx+03OZ1QLAjGbEru99VK5IJKjdC7ZJSJqHWjpUeXSyaiC/b0bNNh6WvEcv14ahczIKgBRAZLc9XYOPO+jfXeKEk7O32rEa8ei/IAQRjYckZ7QvM0Y0pJx70WuJ44DJv769DyX65B7IK1geXXt1vFAneXjS6DapRiA62O43lu4ZcwmZD9CE8cXIZlZbl8YFF2mUFO7SGFBa7bZOjcflYQxN+uZ01e4FnC/rCPVN+C7LTKxdsrVwP/k7cN36wrHCerldimg2BcVfD0P2xVG/6KhLstH1VAIapgrx9Cc46qIzXG5UlgWP+4h9VRqop7S6/eVtaZJL8fF/jAKtmJb9WrWH7kqynbiAd1EvVm/RylVOvTwGNgkJAmKQK96UfK2SBO3dtxQ+sCT0pequc92PA+DtJqHALItPKFDeRZzNRdNWTLr9jk+fwvyy02Ss98fee4HcQS1v9zCdFdryo24xTt7QHmLQuI1P8EzGXlNsTplb5uJ6DRWAehDFe0MUqd6TpMfpsZJdhH86iHjAi0fG838mCVVkzkQa+jvBSN+joLuGRhWgvMxCm0/UsnBTxPxX47ivar7cl3s1jwVczGD4XL3wfNIsXp2UWMVBYB2zKIXqIT22QahJ0vwdXWom+iKIytyMv1dOlnYe1NsdUUfgtXoK63yX673SJhRUHVtgQF9Uoxl6JF5k50v6PUfZXMytMPl6uVY2mP4QH/mHd2fqmEhhxYiRfx12pjkYW4/FLTf/Hk4yC2MeSL0popvgwYdmIDwVOCXsqVAtQ5NPkAIWaWK9eGJYPleRF7/X0Tn0MKVxds0Ai00C8vbkXzzY6EpkACJE7SdobHDY20fM2lCR3HEgmpVF2AVGKKko7OjyHX3lKy5u2aulErjlAYkezu2vSMPtvCMvaoAU9/O3n5su7JUBfCMeXhplmclgRXoMBK6ctEM5unCCDe5cteTktWqiqj9smrZTJHaDjbNFlyq8MFg+EQqQ5ekk6YEKuQqI9NQxmSg+oKT/1ijtuzN9iS8XiMIXCTbM/CuHodOvS3HoUJETrkRkV6OQm8+PybZWnyRMePKQ8ZnAdRoVsoKJvsFkNZT0jVevh6D+QsQBxHcUc6bSb+zmLeVbMJ+XVrgh+mMXOBWokqawgdxQ8AG0gy4Sgk35oO9ExUK51XIV+o6XHwn85I1t3gPWmomfJJr5WomR+5eH/kHYXIXzeA0x/iQitzquf17xlDN9YT9CUYB+1Y0Cw79YE69ejPgo92/x4LAfGT0QYkme9D4uOf X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66ff275a-6521-4ed1-3235-08d968c6cf11 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 19:22:13.7789 (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: QlHxruYnHaegj8Y/eVCUIRG+IIdEhsiT1EauiXBECsu2bmvH3Di1PRGKpWVVHnBe4fkfV/741S4eSFZ9MfBRpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB6748 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 Reviewed-by: Rob Herring --- Changes in v3: - Use unevaluatedProperties: false instead of additionalProperties .../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..0cc94c920b17 --- /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# + +unevaluatedProperties: false + +examples: + - | + serial@800c0000 { + compatible = "xlnx,xps-uartlite-1.00.a"; + reg = <0x800c0000 0x10000>; + interrupts = <0x0 0x6e 0x1>; + port-number = <0>; + }; +... From patchwork Thu Aug 26 19:21:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 503191 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 554C7C19F37 for ; Thu, 26 Aug 2021 19:22:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3EEF461053 for ; Thu, 26 Aug 2021 19:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243342AbhHZTXM (ORCPT ); Thu, 26 Aug 2021 15:23:12 -0400 Received: from mail-vi1eur05on2071.outbound.protection.outlook.com ([40.107.21.71]:10016 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243360AbhHZTXL (ORCPT ); Thu, 26 Aug 2021 15:23:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PMikZuFuHZdNGHhueO3LjrpghbAa5R0hLM3P5a07H6Eujrh84MItQ8fYN2yXeMMhzujXPRDkumF427VAVT+dSzCBPc+6oSYJzNRq4J1whHsE1xKsatua77cEniu3J2pia3x0GZ85q8yJRKxmbqRjmDHnIIqMGyai2A0cupa8ZNUbdOGZ5i1sYrh60mFKZ2PiaZm9TufFwXYvi9F7saI59r2tPccvWY6e/x5oeL4w4TnFivfciUjPPCVq96chLRcrl/3rA4Xq5dd7jd1UWpPKLBiHZW1rM7BpfQCa3N90aKDL9IOvJO8kAyaXNZm0c4zYFsQVbIhrheYuKepFY3f/KQ== 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=QqEDdB0HgKNcvn5dMidfdmzHvG3ttIKx5o9jhdUwnLI=; b=T75KoWM0LwCP9IVmzKPa+7mo9oIy3qP2J+Yyb5xvKLNpENvcn7bAwZToPww+VZJcvz+utkkWDUygcL6CcUg1Zkg7btTNGO6MIJLQWAgkYXVyT1q3Dx9jT+I6ysHEgtPFJsq+cUGKfAEDL7l+y8HutomirLdij4MV7nNU1VuRJq8tkShps4CvpcapSEdjWcZQ5jXV4LeiGcnxbVS2tpWPWLRG/H3RryiRdeulSsj4judp0DYkdII2wpuPySmcMa5cHsPXEEBbl79BV1abwJupA/1iU/c//A2IOG9USiS7HXP5TYrKQIT1oF0PVJK/DLdAbjcgkzcHmwXPMw7ubwWJYA== 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=QqEDdB0HgKNcvn5dMidfdmzHvG3ttIKx5o9jhdUwnLI=; b=N4Z7McIJ/CAKpUGV9mf2Ah7biG+bWmEFwkPvuq6ZtPPZ8gieIca4Br0V68W3VC0H5QVoCjytGojWbw2sNecpl95Gx9K0FNO5kxofSWZW5fc+C0/W+n+tbCur5y75lQv7Z6RaLIKUYBBl2KwSNOZflFottKy4CShMtntinBI4+Oo= 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 DBBPR03MB6748.eurprd03.prod.outlook.com (2603:10a6:10:204::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Thu, 26 Aug 2021 19:22:15 +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.4436.025; Thu, 26 Aug 2021 19:22:15 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Shubhrajyoti Datta , Greg Kroah-Hartman , Michal Simek , Alexander Sverdlin , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v3 2/4] dt-bindings: serial: uartlite: Add properties for synthesis-time parameters Date: Thu, 26 Aug 2021 15:21:52 -0400 Message-Id: <20210826192154.3202269-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826192154.3202269-1-sean.anderson@seco.com> References: <20210826192154.3202269-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) 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 BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.8 via Frontend Transport; Thu, 26 Aug 2021 19:22:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 174cdff2-6f81-4079-72d9-08d968c6d014 X-MS-TrafficTypeDiagnostic: DBBPR03MB6748: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IpnpjwSAhOvV21E6fznk2byBJCbBq5QiQkfvUDk3s1lWN9npyHPHsTYeUkDSLRJoRxC1NuHAt5kbc9yGX0fcwHoe+kqNLGOtlMU88aE+0pgFFxwQBkHdtfwArNa4SIbpvPYzOCsB3uD/q8u0RMgoAU7zqlqa+7sgYy4v59karmIZ+agb3SrWc2AZGjNDXKAyL/eW1F/xev/VQT4hqk6TncyjCcSbET6o0n2hzTv+jLZ1603qvKIyumu7bRgWsu2bBbVze+BcSAU4rLDpbM7Th3Ev0EYTJaPo/7izSGBnWRy6Sq2+GKjVzmIasi+e6yPfto4s7RAOFMbjp4z7MAgPfAlClyKx51kHpdcl74vaFs4/u1VamaIVc0BiqY1weXUB06+DBk7qyDPFkaO3l5d9BbrtXQXCpF346Xi6AGs+UlovB9CE6ukoe9BSdbBCYsXxqKcIe1jjhTU0hJJkbfVQfYJe3LGz+vWRgQfMkbK4RXK66EVmPwlF4I+TVgEM1eqqG25+slk4WLqUs1AJ44hEZUAsCGHucC2wrHKfJWjO/9Q2ZR0Any320eB9ytC3hJbxcCKmmUtHE/MA5CteKsBgXhzdlIukcqCNrQFG5Sd/rs17sWHC6p06mVji9pkkWqlQHkdQ1DXwtkZ1UHMV4K+9xza3gtQiwHbSy6qG2th3OGvMdU4tjs+jg3p3Bi6DSzqahZxDqcfT84o80oi72eKI6w== 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:(39840400004)(346002)(136003)(366004)(396003)(376002)(83380400001)(6512007)(66476007)(86362001)(478600001)(110136005)(186003)(66556008)(4326008)(54906003)(38100700002)(36756003)(38350700002)(316002)(6486002)(52116002)(8676002)(26005)(6506007)(6666004)(2616005)(44832011)(956004)(5660300002)(66946007)(2906002)(1076003)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a6pUvqH5SGsvYkoyc24kdr3NcJO8UKiL3UZ6ebyHXTVHIuBFRtOmXD+Hep+JSywEKl98eb2X0+V0DARR0+5494Okv1X3l1TmEuRXWG1C6KYWr/RSgb0HC8HoSMnObe9fgdhBofiHybmCVMoiiCWLN/lMqIjgWzEc/uH7ulCSyQItPk52twFRB4BRnVt9Hjmrb24QHih9QOH7a32kgQ/rk8jbW/QABDSwhHFIjWlEQcyKM3R1lOAnS67YqTO9iJlUmHx4WShc2X5DmJOBO80sfkvHwM/qFyG+XTR6eaCh6vf+WzSYjWQ1dABhvgEzRHG7vhOewjgVa/JWshyT1v6HomXn9azgij4O165o+eEx3qsn49ljDmbWHTVjhv6QNDCl7KgjOQASTfNwrkxArW9TobdpZuSIxCYBCdzBzIf0hdZnKZYL6P8JomKoUqWN5jAx5clY9N6qx6d663BTVlevClo2i5aRdXgn+zZEr9SV+3Z0G1/aEfigzF5baHWdMaDbWN2HCMSCiGS5ayAuiKrtU2DcR0cQGrmdnsu8r0Yt8YrROY+MNbL+9evkjUYpAhyJv8MTdZLgYIJDZmcu70N1O4Wa86EUtIqSnjQo+Lyv6zaNAwZgT1GiMOz9/pe01fZ4mA6Y/PXqMl0jFGnQ8IJb/9C86JBYjFsvMFPBVERG7MAcuXvyHCfomoFFo80jbvtTqewU7ElJq8BVC/30R2M30qbC0ATLhmezKgFiZ475J2skWuLoed9pdzjCJ5eNYJSI4FCen3K3YFY0IAWnQVLCag3N89Qa2g7Sn3ocImOfi4hrvjUbYwkqZiu4o2Hc9JP3Ef1svJIMDBOmgoQzfNmYHNPWx6L/O2V27f6O+Y3z7df6NjXgjQdp1tbG4TQzTpxzIzNwFuceoGccR27BFdMT1SwairTZqHNZgTdVp23buNBvrjv+Hw5xXeTqZEzUalLvpyhz5xlPRAdslUEEycI2TCc8z/IMHZv+QCikmCIvrk8mIn/vCR+IEUuGqKJfBSZPOtGD5YxDyWZ+hTjHadohT/uF1X/HWtOA/7sop1B35aKvmYmHsuFGU2diV2GaU7BAJ4l9ZZMQgVTO1f2d/IZwnKjceXuzcXrcRQVLtWuqEoYOTXHZaUNCu1uD6BPV07991W6rmk2Qs/1LMOIGY4mNgzY0USGVkXKi+Wz/X7Ew3S65OZlPXLLl4wC+8mKDuZYVxHNjxkXqwGFXSULA8lV/0mmL3jQ+25Z8b2v9ucBJxlstw/mwxbp8/XG/+bM34xGZIfkPUek4lNQYeSCO8ptF0H9ufrhW4/t6Aucnh3Wc4PghkJWDqkAnLFy8VFDSzmed X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 174cdff2-6f81-4079-72d9-08d968c6d014 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 19:22:15.4629 (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: zINDlE10WLq+3dfxyH1Hsi0ELStoKaalwS4lTkKUhRIIsZvPnhMOKN12KFsECk7Ld4C0xxVtrGYmckIIAP6FAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB6748 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. Although these properties are marked as "required", note that only current-speed is required by the driver itself. Hopefully, this will allow for an easier transition. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring --- Changes in v3: - Removed defaults for required properties .../bindings/serial/xlnx,opb-uartlite.yaml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml index 0cc94c920b17..b8a2bfe14bed 100644 --- a/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml +++ b/Documentation/devicetree/bindings/serial/xlnx,opb-uartlite.yaml @@ -32,13 +32,47 @@ 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] + 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] + 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 unevaluatedProperties: false @@ -49,5 +83,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 Thu Aug 26 19:21:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 503604 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.8 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, 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 CE6BFC4320E for ; Thu, 26 Aug 2021 19:22:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B78E360F58 for ; Thu, 26 Aug 2021 19:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243356AbhHZTXK (ORCPT ); Thu, 26 Aug 2021 15:23:10 -0400 Received: from mail-eopbgr60074.outbound.protection.outlook.com ([40.107.6.74]:17536 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243360AbhHZTXJ (ORCPT ); Thu, 26 Aug 2021 15:23:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fdv0ZnwPPM837o2RxdfEcNEzpOZKT9Dy85b0J+uQcsbpsFKWTk/9wPSBbo/tcY1PXBf9WSENvJbv/7Wpjf08V07gAzhKLq1PauqL7tPDSuh0JGVa3C2NvRfAfDbHamk+rrnRdYdHQ/y2D12hU2Myglp6fKmnJERnjR65cvl3I1cS/LocmqQEvptfnbbBR1uzJca4NmQ1L3JUV7Zip+xzKQIy19uAHn+A0OsmT1wpyRYjBrIVMC5d+p7Clxpvv6yTnNGXEegIdlwJ+q/SCO6hBMgnSInRNGzK99/qXH/XyANXiY6rXOg2sZhWQZm9nr03ethfBog97ybM27cs6E5WSQ== 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=ACoRWMJ1AriHpNFpfrl08YsAmKtKRx5N6LUWTgMdAxE=; b=TjWdSmCHTz+jrJWDLjB+ovaFR5/hloKipkAxSm0xiKorrrT/+9S5wAtmcx1rAO0iD8+W8Tpr5AUNAOo4Nfyd1AyqPyFUyx6Qrbc68eVIxwrYvlLh4LyMK5pf6iFaLuPJkZedgAZgDBlFFi9RZJ+DgZO3TqmJ+eM/C9/UrR5Y47hDgG2mKfkNCo5o5fDPOXRT5rHwS3/On+pFaNvA487tHOCSq0gqhNKNfQ31P+AhA5Xke8b38ogjJzrlg+thjPERJ1yIzwNGwjXOkmE+zfZv1ysHcEyFqi9sA7gUR5NspNgrQoKEy0gGWPztw09y+i+w+0xWobpysAibjrwJFVpo/A== 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=ACoRWMJ1AriHpNFpfrl08YsAmKtKRx5N6LUWTgMdAxE=; b=dD4IKlzVYXOSX+1nJuxUOK9KZNmHAM6XusR9/f32zs+fTFzcV6n1XOR8Zi+qPIHNXoMK3N1KwnG+rj+WaKo3yaGlKTOKs9HMNHXVqk4PDfe/cjiRwSFTje0PoTCjPoHxp5XW0Ll9edusSJ3j2I3cscaxWWzx0WgdVmdPm7PqC3E= 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 DB7PR03MB4859.eurprd03.prod.outlook.com (2603:10a6:10:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Thu, 26 Aug 2021 19:22:17 +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.4436.025; Thu, 26 Aug 2021 19:22:17 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Shubhrajyoti Datta , Greg Kroah-Hartman , Michal Simek , Alexander Sverdlin , Sean Anderson , Rich Felker , Yoshinori Sato Subject: [PATCH v3 3/4] sh: j2: Update uartlite binding with data and parity properties Date: Thu, 26 Aug 2021 15:21:53 -0400 Message-Id: <20210826192154.3202269-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826192154.3202269-1-sean.anderson@seco.com> References: <20210826192154.3202269-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) 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 BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.8 via Frontend Transport; Thu, 26 Aug 2021 19:22:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c15f14d-05c2-431b-26a0-08d968c6d0f6 X-MS-TrafficTypeDiagnostic: DB7PR03MB4859: 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: cJ2Q13QgLCCBgGZECs5wkfOarExv31i2Zr63nED+Y4ySZc0Fqlzjud7DxSX3KWAG9zUjIJwA/JNT8QBTImgvWIJeSN7+sQlhCOMxNypkTKQYdVbIvytoFlL/F2m+fT7cNSBbg8vgfUTxGwbvCGSNqRQaUpBS5bYv4ktYJFGOr2ScECOZ4+EiNvz0+YBfEYDhGcJ8GZgde/tw7YFi4t84ODnRlSsjWt1WWygSzXA8Kh6wDIQjNIhUTwgekGIeDxOXRrMt11zJyY4oIG8z2BdqBRc+MJO35mTq5CAcDqLIunBbmYJNstu5qgvFMKsmih4PY59jOSolByqYaUbFcno+5Zsm0B4CBeWyjEnjQA/rMysk0mrncgjmGbbsni1lHrbNimo/raKw+4b5dPp5da3xkfX7+jJLzQUmNzUFktgetxwk6sWYOVnxp/DIEWzBWtts7Uiyu4/X0hjRoUJZPd97vUdgbXXariJtOhDl5Vblq9NA5WT2iwmK9pFfj3dsUfPrXBpDLxfelL++nHrHZLff2+lfli3o9ZSoCnN3pd5Kk1eTSb0QQChBYxurJ8oGbEnyTAUFvwNV5MketXCWcHHO/Iw1xNY9Wq6etkD3geHKLeA6nO/eyWlU84EXO5pEEmK8jpa5O90Df4rK5BVc1SEoEydJ0HEKJhOUXUNHwEQki0IyniwOzorKlBuSz13AGX0xPqz3/j1C32cgNO9QxfMt4w== 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:(376002)(346002)(366004)(39840400004)(396003)(136003)(86362001)(54906003)(110136005)(478600001)(6512007)(316002)(83380400001)(4744005)(5660300002)(6506007)(1076003)(186003)(8936002)(8676002)(26005)(66556008)(2616005)(4326008)(6666004)(66476007)(52116002)(44832011)(66946007)(38350700002)(38100700002)(2906002)(956004)(36756003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HpnIaatensttCPDUpi7C2nzwWos4ifIAweGZ5/vx8chBnypJrHKkz030JiyNHmWFmewKaYFUWKi1STdmh8sDvOEgbK+fwGxfgjU26Qko0SUnOb2Z7bPqyBs1ihUS9YbJ1uxPT8d+JxdrZa/F3mrS/WeYZXrm4+rHlua3+R1LzNxjCeGfcASr1ENduqnk5X48P1lxvgEEHYjVJUu9cllAZ7rgKaHItPBdvSROdZZ5fy+905Ya3ga2Q4muWFsJ4mqp1sj8ev7sW2Gj3VpjBtoUPPemks2Xc2Xqjxsh8DqjPvbmrQ4aKqZkLb4U4Om32TGzZm9gAZT4D2jMP1c56Ck/Oo5fNc2dIhe7/vpnbcAbZh/CAwI6hG4ZW2wEVrjO9l0UgqCEH9ibOlm3rAVuhR0r9sAjmZ3eDv8AoMpBljbZWn8YPctOhXpNSsQIonKFrZ1ORgGkdxEhDts1jPYGATcK9B1nbKW1PmTiWmQH/oQgJbKOfb16dJHxLy00rBaIfiDKxuOGYpMqBmFxH8F5nnw1QeaHfgp09jch09NZDR9g4ljvgYva0Z7CAD9fFo+wwOrEjnU4gsK16b6feNghxKNYOrMVsm6EMo7aPLilmUN3wxgQDS2wzMDxawKPPT3FDTLBM8+c62c2hmhXWff4O8JD9L42s7PUl1gqjct0jvJM43h8R+rYv6uV9wLNnM28Gu3Rw5dvB/eYviADwmOk/dTQ3JZ5srg8fiKKjThQzXMfPPTBAwnZYQzK16Zv5g0FTmSvsMcAbxcLzqgp6ep/Z6Tm1jiEKn5xx6ipecvKRni5/efYH6QR/ZUDB/QbBKuDoL95UGr9zyMLQOt7+OVfggGqJoPkY1woTdR3Y4XIvu7ao2HbnN5eUO6KUKPeI/yLNbigpGVZFXwthDUuFHff1RJZJFBpxUrvXVHBjZfRYMehDjDPB5X8GKMsLVUU4TaEYFk897hByBYHlz9CwLd3qeCUKkO7K+LidjDP3rxk1t9m1pFdKQ2HZyE1u81ossH9PzC2b2cxbIVNuOpVwHEq3gSee3jhYtI9GfhFzQ6HMu8x1boAS7t0Q81vyqfDsF5rAi4zTbX50A3hzpRM4cQdnbJdUfda8hsWqQLYHTxl7X9ryMTMnkONbcxO6C002GnT0tLaxpK/yjGxyl5PfPHXvM87f54bGKDWaT4xHYQmK24aYQzCla2RDAoxjl6+CehSb0CsTyoTYWFpEr/eFRF1OudbvD4wQ/d/jlCaaOORPMMHEyVuyqY4G1aGYqphjACTqctlkgw2JGhysMNEgeqTxREfb2dD8Q5k15FnB82F+HilkbLOB3RGqDrALBn50QhLdQA9 X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c15f14d-05c2-431b-26a0-08d968c6d0f6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 19:22:17.0160 (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: dW3GIS8v5JZeCnDUy6r6oNYV0dMPnbaoLIYyUniTeFtCUXwIonmEPFHzdjYW5Iu2fceChql/MMdkej3imRsrbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB4859 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 --- (no changes since v1) 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 Thu Aug 26 19:21:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 503192 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 B7701C43214 for ; Thu, 26 Aug 2021 19:22:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A11616103E for ; Thu, 26 Aug 2021 19:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243394AbhHZTXL (ORCPT ); Thu, 26 Aug 2021 15:23:11 -0400 Received: from mail-eopbgr60074.outbound.protection.outlook.com ([40.107.6.74]:17536 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243391AbhHZTXK (ORCPT ); Thu, 26 Aug 2021 15:23:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UPNBd07lyBy0F3mtS700q8cSDT92gqSfByDWix9lJe2ULto91savPmFjhj+vetSlDatx2YZ8oxxLp0ZCs7ijLJocrdo4DgbO76eYTR6E/Jdo8cyzVRBn4+3PHOwMUQkg09GiBJcQGbQgaSSvFhYKX7uVA4qNEWz7ldoNnDq71P3WzJumItH45aCn208KeAdbyNiDk7jaiEVsem8enZAaxJZcJApFYF5MGxZxxF57WjEkV1xfTu+B3x/ahW3pX7b7e5jh4ohfB6vGn9rzgKKwz4VD+OFjte2cSimH82C/wlA/AO8Y+K4rHb472cFg2npmh/acJADxbYIKykwfRiyaSg== 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=+++k6yptvMRCw1rPf0eQVBc8YD/HmfwtiBLN60iOdtM=; b=eaXgk4opYx4WxgMWDCgINvW8WSAicctOLWBtA2URBFt4h723zdfslU1FbGXplQVOyPlFx36qVX6pCH0Fs8OLdmifotPIM/2a7pUgW0FBxsCqZskt72JcAY6pP8iOLd5LhBqT1Irabwh8RXxwXhN/qAiRgp8Asnx3uhDS8ogZ4yKv7cZedWRs+ORbIvMt4UCZrRU01chDngabNWErmmv+zsG8JUPhHLq58/C6BMHQpKzgr149uVX/a6yfsiQfpN1aAqGgsRHmns0a/HCdxZAJXKgI6jjkKmSr3rm6AykQFA9AyE2F+/mlX2QxrrRPRR0YZ0wM6h+Ik1bJTV+TPXmyqA== 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=+++k6yptvMRCw1rPf0eQVBc8YD/HmfwtiBLN60iOdtM=; b=gZoUpeXQYa8oVVqNLMz7pWQamzuvfNDpWzDgw1I/mhc1OajrTb81+E8sqIAuBAKlDlN19lHVur6SERGBRhjfaQQ33ZQx4uAyNVBJNaxMaP0LMx88NmYyQlTjUtJajClxvCLMyxvMXXACBaLDAyGWjBuIHh6M369a4z97q9q8ATQ= 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 DB7PR03MB4859.eurprd03.prod.outlook.com (2603:10a6:10:33::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20; Thu, 26 Aug 2021 19:22:18 +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.4436.025; Thu, 26 Aug 2021 19:22:18 +0000 From: Sean Anderson To: Peter Korsgaard , Peter Korsgaard , linux-serial@vger.kernel.org Cc: Shubhrajyoti Datta , Greg Kroah-Hartman , Michal Simek , Alexander Sverdlin , Sean Anderson Subject: [PATCH v3 4/4] tty: serial: uartlite: Prevent changing fixed parameters Date: Thu, 26 Aug 2021 15:21:54 -0400 Message-Id: <20210826192154.3202269-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210826192154.3202269-1-sean.anderson@seco.com> References: <20210826192154.3202269-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) 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 BL1PR13CA0046.namprd13.prod.outlook.com (2603:10b6:208:257::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.8 via Frontend Transport; Thu, 26 Aug 2021 19:22:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ddc284c-042f-4b1c-4871-08d968c6d1c1 X-MS-TrafficTypeDiagnostic: DB7PR03MB4859: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nRHoR1hSHEaaKmX1na6l3VqvPCqbSnH1BHfqiFL3VaLeMMB35uRhUisjfUWLD8hwXbWLHc/DiI+knMQRdJ16yfAjIEoxyNXMKoVnAsOn/ou8es4+f++pFwX2frd2kDqEAKs5gUlVSyD9pmfn+y6UoSzVRv+sB7kyXI8h2ST0x2xk+17PRnWnRA5fWwKqxBcwGt4zV7DanoYcuZFXr61YAidsqAxnflkYh5OQx9rlSA5R4CqDC3PiwlGNS17h2T1thbva2Nh4plB6P3AV9OW+Mx0P63t0IeEi2M9uLRSv0jMEtldqrEYNHDijJWN4uzZBvg4oJK+rY8M5qUdggrFDr7JzSliYBtssJH/4R4kr1ivSLgzw4ejrYr8lXIMrZS/c+lCQDGLNU5BVIIFxSaVaQq/UoJiJG9jlHL6bjrfUYPm9hmAv46SDpHe4DvWFYcEkokvG9xYOyo31OXCF5ZB5Oszt0Xk7LZGC2Mao3LCQaWq85cTl8WffxnjK3YJxDOv/XT2UE8MEM7cc/DWz/IMHh/YuYljQZYt9O7Ah1LMOXutv7bZFXMgL4rdpRNy5wwpYKAAeBqFliiF1PWMU97wrmrPWldAfzu9lfZdlCPRXS0kyKitRrc41tlFvoeQaYF/YSFycjzbZXAwbtGWADrNnIWIyF21RRQdeL7djSbeR6ENaKANd9cxgKG36S4gMgbVl0VGs5+CP/wkIgrPKWt2RAQ== 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:(376002)(346002)(366004)(39840400004)(396003)(136003)(86362001)(54906003)(110136005)(478600001)(6512007)(316002)(83380400001)(5660300002)(6506007)(1076003)(186003)(8936002)(8676002)(26005)(66556008)(2616005)(4326008)(6666004)(66476007)(52116002)(107886003)(44832011)(66946007)(38350700002)(38100700002)(2906002)(956004)(36756003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9rba6ZBJqaN3xEeH1CbmOrGiz7vqkt5Jf37gO6wRkoEnYaHDoojcMyUBi/VkSi1atC6NayH0z5xoipQ6vYH+ym9m/cpCscmvFOVRwE1Rvj3+guuER2gYWipKH7+SfhVWZYGAz/37G53ekwZj5ztxN07h3hPwb8wtq/FwS+AjFQkSTnY+nDI+8q58ZhNhq6SidiEILmnhyLUhc/zWpZ3/rKP9qO/QuTNWR762J8UNDlh0O2mF3OPAJrGoK0mq36UHbOlK/EUZ6+XDU+TuiGQx/eqqxuXPYgxd35S9qCQCPM8QhEBkUmN34RijfxkfHOuCl2cjn5aKdSAiovI1QO/I95zkbQi6LJFo0P2gAbuxg32mY1Vov9ELarHERVf8YXM0XhOtysjU/afVEgoyufrBm/BI47J/kWwXYEexX0w9ywvqXGnAWNpXzdwSDrS86d/mA7ahF9ufif3yL0TljfaahmcVNRwcgDhVOH01LHpT84PhNpxuDkGA1boL4VoAGFbvzHO3Y2nhpdraAaaRYrT2LJlkoLYppIGLU44ZYeQ1TQgLnXxxz067vnOzwto6gFbw/WC9OaJ9/OMZS1ZmJ9C/u53QXakwzBAju2TrCoJJsu29NemH0SV3za+mCwVIW/MTcZWvSEi5urA0VXNN9XwWjyB9Ns7FNNKymkZ+rpYEKfPjPU8VqIiwoxDnSiVBXqUgwSbk5tynMu8kUsKGYeh25ZM3GYf0uVWIZpVrzhZuiSODfOsCROZDDOA0ZMbsajah2MX4fIduFagw/gNueos9ujlqaZbYVaV7P6vn4NnV503if890hZHi/QZ7xEb7DWpeWuArt4yxPDKglA5ZIVzwQUKNPqqSjsBQmZvDaKkc/4LvdpDjY1LA7oFOBkYeRtQVSbF05xX8kRg+0+s93s5VSE9ArIWHyriM7tQs+xakoCT3+GDDPeLNIg0E1NusewROBWTWYRGRB1p7mvgWDZZOPxkzDIu2R2xXjllry/DyEKeQ5YXBrWtX4T1pL4TJ61t5wgNOjeszSLRqbHxAupGXKJvtiEMGz1Hurq0Yop4ATvQoq6AWI+ZzpREFIvZzfS6einHSJONug49nif10NakI4C6tv7D/6mKCDgUa475R0up7OE54fsH35WwZ9HuZWjr8aIXm69GKojqmafNiEf4yRUYS738hXnjRwTgWD7S8zvH9LkwzdOmejuM09eBNxX8y/a1uM24tFa9hPq7ZWFMmXJWNLTZpg+6BiNEO0220t2rBjlWlYa84V0RablocrB7Yjnea4zY4iHsy1RbxeVoyE7gI/GcBUTKwz2pyncCs9Mm61mTpOBmk5Py7pQSvrUgP X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ddc284c-042f-4b1c-4871-08d968c6d1c1 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 19:22:18.3293 (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: I3/Bb0Vk/iFYcb9i9aCkJpBP6a1KddC2jSWEFPIZsum+I3rb7jnnC2yap3c8N5WG3zPjNtM/bpffK/cQipr26w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB4859 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. In order to determine the correct parameters to enforce, we read the various new devicetree parameters to discover how the uart was configured when it was synthesized. 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 --- Changes in v3: - Remove warnings about unsupported termios - Set defaults for xlnx,data-bits and xlnx,use-parity Changes in v2: - Compare the baud computed with uart_get_baud_rate to pdata->baud, instead of just checking c_cflag. This will catch anything that messes with ispeed and ospeed. - Don't bother trying to set the initial termios. Instead, just skip warning if old is NULL. - Because we no longer use uart_set_options, just convert the devicetree properties directly to clflags. - Merge with [PATCH 4/5] ("tty: serial: uartlite: Initialize termios with fixed synthesis parameters") to make it clearer what the properties we read are being used for. drivers/tty/serial/uartlite.c | 91 ++++++++++++++++++++++++++++++----- 1 file changed, 80 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index f42ccc40ffa6..0bea3866bfb8 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -60,9 +61,18 @@ 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 + * cflags: The cflags for parity and data bits + */ struct uartlite_data { const struct uartlite_reg_ops *reg_ops; struct clk *clk; + unsigned int baud; + tcflag_t cflags; }; struct uartlite_reg_ops { @@ -116,6 +126,8 @@ static inline void uart_out32(u32 val, u32 offset, struct uart_port *port) static struct uart_port ulite_ports[ULITE_NR_UARTS]; +static struct uart_driver ulite_uart_driver; + /* --------------------------------------------------------------------- * Core UART driver operations */ @@ -303,7 +315,12 @@ 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; + + /* Set termios to what the hardware supports */ + termios->c_cflag &= ~(BRKINT | CSTOPB | PARENB | PARODD | CSIZE); + termios->c_cflag |= pdata->cflags & (PARENB | PARODD | CSIZE); + tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud); spin_lock_irqsave(&port->lock, flags); @@ -326,8 +343,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); } @@ -532,8 +548,6 @@ static int ulite_console_setup(struct console *co, char *options) return uart_set_options(port, co, baud, parity, bits, flow); } -static struct uart_driver ulite_uart_driver; - static struct console ulite_console = { .name = ULITE_NAME, .write = ulite_console_write, @@ -756,18 +770,73 @@ 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 = 0; + + 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->cflags |= PARODD; + pdata->cflags |= PARENB; + } + + val = 8; + prop = "xlnx,data-bits"; + ret = of_property_read_u32(np, prop, &val); + if (ret && ret != -EINVAL) + goto of_err; + + switch (val) { + case 5: + pdata->cflags |= CS5; + break; + case 6: + pdata->cflags |= CS6; + break; + case 7: + pdata->cflags |= CS7; + break; + case 8: + pdata->cflags |= CS8; + break; + default: + return dev_err_probe(&pdev->dev, -EINVAL, + "bad data bits %d\n", val); + } + } else { + pdata->baud = 9600; + pdata->cflags = CS8; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENODEV;