From patchwork Fri Feb 4 18:01:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12735422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A541AC433EF for ; Fri, 4 Feb 2022 18:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=q906Scrl22an8icXe3sbloMj0nMcYdE6vz4LZuBeKRg=; b=nSYuTpOoXM3XZa yU7mzlsk74UAfglTNugFw5v1UKMjzlYBRdKLqJylu4zVGyQkmtFblhBwbgMVpbXwSkEfQZCYlsn2H Dhs/g3frVjECUwbZ9UkWyuWa5v4hYkCY52EzkTTOXmgyOwfHrmmQ0wQjwriNp/3Jo/diLeKJ1U5AN feVFH62vW0J8rHWzwMXjWixxjzMSTu/tzWie5KLeoQ2EZ5ebSZEVKEy+fMS9MBCO/jjPwIo8+om2v /pzEoVK2EPbvvno4/ENHrTgpBxbOF9JUFdYd0NveGYyqoWSJ8Q/f/Run/ARNSdSoU4Qph55na+xYU Z2bh5FXK0h+FEAuqTctw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG2tz-0056ML-2l; Fri, 04 Feb 2022 18:01:43 +0000 Received: from mail-am6eur05on2040.outbound.protection.outlook.com ([40.107.22.40] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG2tu-0056L6-W3 for linux-arm-kernel@lists.infradead.org; Fri, 04 Feb 2022 18:01:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MiIEYgB2auWSCQ3WV4fqWmPDfp0kfWCh8nKuub8SykuMZzl5vjo7QOQ+8QJX0J6HoUfpmiBu6qbcunG5XkT1d0ccekimRXWZ1w1BWilAlLhXvggw3hi0Uwn6Bxb8XRr+4bhN0mSWFgbVGNtaqHHgNqpFAUmREKjz0BxQGjMtMGXz3UKf7uOEuMyT/Bby8s1xhGeQOwakd1M8jzcvELcHVC2J1CvrjNaNaNPlW6xbThE4VzI8j6lbpY5SrmTVL7zfAQAPoK2suYY6Z8DYnaDQqz7FVCpNJquUuAwP/KzUnkvX/BvFjCU+bZgdiSCvpPfroZIUOToo2JCYxK9YoJ7DNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5K6zQeSq3sQcrKCaApSUoICBfsJi/RsiIe4H2tEgccw=; b=VWM1gKLSVGkJU/oAkXyiSozt9xpnndYf40ztTCKvToezYrH+0obDrMLztYxL0H2ePIALsnkJU6WxewtpQSPm3g6JYJkGH2Jww+dliRaq1cvL+OZQQOSCBAmv7qJb6kptksJmLr5GTCZTqCWQyx4/Y15oIPbu/BiPHPw88fIo25RZ0+2KjiAMDSPkMJMewX+sEJ12SmwCESx8Nuk1iJIVqRvaIyLJDADDI8HNZtEcHYN2FH0qA3Azr3Qxjf97unnraqOIoghoQ/N1wSDC64eMc6SDEvd6u7s/wp3OpeLLcFBp1NL9vYkO6Ntns1Fas/uunTRn9uBu9G0LJanTiDwxhA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5K6zQeSq3sQcrKCaApSUoICBfsJi/RsiIe4H2tEgccw=; b=cPTz0mdwsc3GHmhWPyjYwIBJt9ZAyfWVxCR+RqivJnX2hNrDxDY3IpcaIZWnfeavG8x8cx1kZmu74MccxZoAOL+eH+PmJaWHH7PfcHYF3qc7TXLmiyEyKWsgm5EqDEvQLV/HBrF6E0JbDNn0pkViDRRTY1F/XGx4kccbBzBSYf5F9zAfCK7Pc3YY/aNe5mZmB09gqTGFUX5Teo/tFZhnDrjlsU5un5j0Ng+M0vEdH17Ihq0f0uqqqIkAplGbeM4BzCY6dJRw5+vSQIjCRjWNUS3EFtI/TeybAA9sDFv6owKq8KKx9ZRDeAdeJj5phB+3gcdgu3Sun6ZbgRsVVynQaQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB5764.eurprd03.prod.outlook.com (2603:10a6:208:173::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.14; Fri, 4 Feb 2022 18:01:36 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::ed45:f086:5e82:fccd]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::ed45:f086:5e82:fccd%4]) with mapi id 15.20.4951.016; Fri, 4 Feb 2022 18:01:35 +0000 From: Sean Anderson To: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, Thierry Reding Cc: linux-arm-kernel@lists.infradead.org, Alvaro Gamez , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Mubin Usman Sayyed , linux-kernel@vger.kernel.org, michal.simek@xilinx.com, Lee Jones , Sean Anderson , Rob Herring Subject: [PATCH v13 1/2] dt-bindings: pwm: Add Xilinx AXI Timer Date: Fri, 4 Feb 2022 13:01:05 -0500 Message-Id: <20220204180106.154000-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: BL1PR13CA0433.namprd13.prod.outlook.com (2603:10b6:208:2c3::18) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 204f03f5-401d-45c2-bb28-08d9e808626a X-MS-TrafficTypeDiagnostic: AM0PR03MB5764:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QVaKYXqNF8BlhuoxhelPRVNeOhmBCJAuWeYFEiFdwY9O9idLWZ99+WYcXMcTnE08vHYkMdSSjLJ8D487qUJRBw3Xi6vJ0iSMvQNUERI70imGZX1V6fLkLVGjEpkRgikSfGOI5ZqOePeznZ5qHQ0CGGGqibOe8jDBZXGj4hY3jEV7vbS9V/i/YaRK8Pb6rDinupshaJ+9oxC5uYWThxKxpAituu7WK6HrEt5RDVniS++D75c9tm6Xz2iW5TUZOiWnwNfQfJEjz5mecAthd63O/C6sOIdAf3UQ0syQVtFXA5eOcj10UsY79DFfUxsTP0zRG9AQyXj51OPzKQBoU7fOQxPPbesX03XHO4Oni6Yq+AarQZUr5a+Rgd9RGJVl3SmK6dblKSxAhG+o0+c3/nGMi+/QrWZKT88ePukubWZO+STRVvz8eBg/nkBmcvIZ9TLsIoeQcorqHCMj63t5TzPDc3stCE0pbqFLoNnbXMmLIsm7lZ6XqW91mjVllWlTdVLukkDyuNuKJYrB211tu8N5VSluHYwjNkAWc83Z8FJgIAOJXR2pKtPj4aRHnLd98FebHI11lY2xu3i7viW4DqWiK5eNJU3XCkFl1aMMGLl7YWX/SwvA87+jTmxEsjRoBTFUiM+BKRv2whnbb8yXWOjHMA0dpm0QYKskjPaP6U37Y4+TXKeATP1YAGdVhYf1WiK/ExbnCuS+K3M1bdC0wfOSCmaXS3mh0yPF1KZhbn61Ky2P+j6wqRrCj7aJe0wtUa4Qzn0yqaS0GNm5zJkHnH8dctpGRiwIq0wGNwJ+LNo7c48= 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:(13230001)(366004)(6512007)(83380400001)(52116002)(66556008)(6506007)(38100700002)(66476007)(86362001)(36756003)(8936002)(4326008)(6666004)(316002)(38350700002)(8676002)(66946007)(7416002)(5660300002)(2616005)(2906002)(26005)(1076003)(186003)(54906003)(6486002)(44832011)(6916009)(966005)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bvGgz7csUoYVBKYsg9ZFprzfwHetVmclmF/Gj+YXXXnLhTr49t0QCprZKhL18P5VLb3bA7MHvB1KwEueI4WX5TrZtTHwySJYT7X2m8LOvSrzBygNcwVxNvaCCy9noTo/Lb6uuIzFKn12oRz9Db4kl8QnhKsf5wxZknq2cRHbJOijvTwBLPZow1biRZk4yk9uvjiunopxHchI7WyDWLPjiX5TuXtiHT+LyuGdCYr7pSbLfjWLTHBSi5ZvZCW8NpZ7oZl2jWZbrL7ZPxse9qdZa3Ehf1aIfVc+eIS852DKoAFrCpOwztlRw/cXh98HG2+MQQ8iyLnHB/bsEWzsaZKsm8LC8L+dK1nb1YJHELJLJJJHlWsDgVVuvNogq+8Kxy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ivwGajW9sDhDg9GCUOu3ZhzT6X7xdOJBXQv8whafP6QQM2rNIqCB2aXyxMEtJmFikjXbuDL1kNgfqeUy/whI0k0t8+ENOONCjkVnr/ZSQGAGjznTQvU8ho40CvlDeePf8lp21BvjcTi7ApEavlggyrzbGbJMz5u4in+fkJpE+Zd30IxDkvTeH4k17Y= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 204f03f5-401d-45c2-bb28-08d9e808626a X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2022 18:01:35.9117 (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: Z5VBL5wduK4IkP+SCvDTXizBOhJI9xQw0sXjCvIlHyp136fHdBGkQz0YLGtGyIBMMcy1Khk5tkMRmFR4Wmywqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB5764 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220204_100139_059376_11E4B553 X-CRM114-Status: GOOD ( 19.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds a binding for the Xilinx LogiCORE IP AXI Timer. This device is a "soft" block, so it has some parameters which would not be configurable in most hardware. This binding is usually automatically generated by Xilinx's tools, so the names and values of some properties should be kept as they are, if possible. In addition, this binding is already in the kernel at arch/microblaze/boot/dts/system.dts, and in user software such as QEMU. The existing driver uses the clock-frequency property, or alternatively the /cpus/timebase-frequency property as its frequency input. Because these properties are deprecated, they have not been included with this schema. All new bindings should use the clocks/clock-names properties to specify the parent clock. Because we need to init timer devices so early in boot, we determine if we should use the PWM driver or the clocksource/clockevent driver by the presence/absence, respectively, of #pwm-cells. Because both counters are used by the PWM, there is no need for a separate property specifying which counters are to be used for the PWM. Signed-off-by: Sean Anderson Reviewed-by: Rob Herring --- (no changes since v8) Changes in v8: - Set additionalProperties: false Changes in v7: - Add #pwm-cells to properties - Document why additionalProperties is true Changes in v6: - Enumerate possible counter widths - Fix incorrect schema id Changes in v5: - Add example for timer binding - Fix indentation lint - Move schema into the timer directory - Remove xlnx,axi-timer-2.0 compatible string - Update commit message to reflect revisions Changes in v4: - Make some properties optional for clocksource drivers - Predicate PWM driver on the presence of #pwm-cells - Remove references to generate polarity so this can get merged Changes in v3: - Add an example with non-deprecated properties only. - Add xlnx,pwm and xlnx,gen?-active-low properties. - Make newer replacement properties mutually-exclusive with what they replace - Mark all boolean-as-int properties as deprecated Changes in v2: - Use 32-bit addresses for example binding .../bindings/timer/xlnx,xps-timer.yaml | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/xlnx,xps-timer.yaml diff --git a/Documentation/devicetree/bindings/timer/xlnx,xps-timer.yaml b/Documentation/devicetree/bindings/timer/xlnx,xps-timer.yaml new file mode 100644 index 000000000000..dd168d41d2e0 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/xlnx,xps-timer.yaml @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/xlnx,xps-timer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx LogiCORE IP AXI Timer Device Tree Binding + +maintainers: + - Sean Anderson + +properties: + compatible: + contains: + const: xlnx,xps-timer-1.00.a + + clocks: + maxItems: 1 + + clock-names: + const: s_axi_aclk + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + + '#pwm-cells': true + + xlnx,count-width: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [8, 16, 32] + default: 32 + description: + The width of the counter(s), in bits. + + xlnx,one-timer-only: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [ 0, 1 ] + description: + Whether only one timer is present in this block. + +required: + - compatible + - reg + - xlnx,one-timer-only + +allOf: + - if: + required: + - '#pwm-cells' + then: + allOf: + - required: + - clocks + - properties: + xlnx,one-timer-only: + const: 0 + else: + required: + - interrupts + - if: + required: + - clocks + then: + required: + - clock-names + +additionalProperties: false + +examples: + - | + timer@800e0000 { + clock-names = "s_axi_aclk"; + clocks = <&zynqmp_clk 71>; + compatible = "xlnx,xps-timer-1.00.a"; + reg = <0x800e0000 0x10000>; + interrupts = <0 39 2>; + xlnx,count-width = <16>; + xlnx,one-timer-only = <0x0>; + }; + + timer@800f0000 { + #pwm-cells = <0>; + clock-names = "s_axi_aclk"; + clocks = <&zynqmp_clk 71>; + compatible = "xlnx,xps-timer-1.00.a"; + reg = <0x800e0000 0x10000>; + xlnx,count-width = <32>; + xlnx,one-timer-only = <0x0>; + };