From patchwork Fri Oct 15 19:00:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12562657 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 187F8C433F5 for ; Fri, 15 Oct 2021 19:03:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D14B260ED4 for ; Fri, 15 Oct 2021 19:03:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D14B260ED4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=seco.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=/YTOlwXsPd3fRqIiernmuxT0CEZ634vJ8Rp5QwLLkRc=; b=WPey+F3f7LGJAJ ShGs6KFaER/wOLGTNZsXWu+Q0c6/YDasxuCZan/ix+SJUElHho33CBHkAipDbpqJT8v6kGwFzLCNH Jt3K59n7UC/RHH4DqGOWhGMkdebY0z/x42yvcppivSVKwBcUPISfpi9Yhf4aIO0Cy3gOwpfzOWFVi jIPNdtKoop5V9OXu4BnL6NJzjJ7foI6pi2MsOGlMZ8VPKy2o2bAj1K9sv8P4tbMwgiRLZ0OwZ6nzH Noh8hKc/ygJ7hdzP1VfakP/qld5tIeQhA84Al0PEJW/ls9HaCF6DfIthgXp6wvWYaeo03pBJdrTsc sZ+UeH6C3lTP5Hb8LUzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbSSG-008XgV-Rt; Fri, 15 Oct 2021 19:01:21 +0000 Received: from mail-eopbgr70059.outbound.protection.outlook.com ([40.107.7.59] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbSRv-008XSn-1q for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 19:01:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAGQ3oDqb94LyxFxHNJF+wfOYJxePMSknGWoCDmvq6SCyKIM6j1bMhILS1srbcxLlXsLZ0LB7glCtyBTqgKZEsUmOw50Q+Fr4symBsWWh7pcNjiQh6cCBvPmp0qsURtknteV+E80K7Xt6d0dj3SnCRyGD9H6KoDB2NtW1ZRg3dyAJMOlH/hsQwGnuE2GjUKgOQywOV8DJcIptyZvT+RAkhNHLMhtiQwnkLg92MjCTsyAIPos7evdkkQAYEwTBx+8JLWw3VPjlz9BNS3x/nehJCt3wbHyQMdrDMhY1eNI3H1U5fJGNGhSBlPRUWyZY/Z3oxnBc5bJl3tRiqqGJtABYg== 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=6bDddFOCGEZpmSDvv4+Zcm9PpbngTevxWi1q2WxlNO8=; b=XW4Uv4GZ0ETdPxUMcd8DysVhHfewRawCfq+aFdsc81oBMQ2aqxkHvLfvPDBgBajZvVwo5B9Aj1PE2YOUiZKHBENZMwUiAEDUt2Rjuf97ucuA19wi1zMmblFFVoWxOTBTvyqenBY7yc0ds4PgNDiC/9rVO41c1keDPxi51EiGxhUiCmGWbcIuWJGY8bn/YmKg72ixZ6atuas4kZNRcAGD6CUkbYh0ZWOkrjG4sKPo/+0ziJ3Fd/FmxZTYbdQNtVTgHEoYD2Eo+vCsvQusiHC+u3qKcfFnONuwiXQsPXOLBj9aVm21poEp+GJlO7EDIrEVTBZ+FQ7bDLWyDDavMiuTjA== 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=6bDddFOCGEZpmSDvv4+Zcm9PpbngTevxWi1q2WxlNO8=; b=M8Mex4KYCJ/UXxzHM9ytkEx3SbSYBEmLyLNXJOBrOMJVssTnGhJ0gOi9sMbi/hg1Z5/NGXXSZJswrhB+7L0p9Dnq4e49UsgEscf/halxhXK8bnd1l/XG/Xa+r63kGkHGYxAP/mYVelO4iimkxCjNJkieiSM8IJCAmp6EzDL+R5A= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DBBPR03MB6905.eurprd03.prod.outlook.com (2603:10a6:10:205::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Fri, 15 Oct 2021 19:00:50 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf%6]) with mapi id 15.20.4608.017; Fri, 15 Oct 2021 19:00:50 +0000 From: Sean Anderson To: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, Thierry Reding Cc: Lee Jones , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org, Alvaro Gamez , linux-kernel@vger.kernel.org, Sean Anderson , Rob Herring Subject: [PATCH v8 2/3] dt-bindings: pwm: Add Xilinx AXI Timer Date: Fri, 15 Oct 2021 15:00:24 -0400 Message-Id: <20211015190025.409426-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211015190025.409426-1-sean.anderson@seco.com> References: <20211015190025.409426-1-sean.anderson@seco.com> X-ClientProxiedBy: BL1PR13CA0096.namprd13.prod.outlook.com (2603:10b6:208:2b9::11) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 Received: from plantagenet.inhand.com (50.195.82.171) by BL1PR13CA0096.namprd13.prod.outlook.com (2603:10b6:208:2b9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.8 via Frontend Transport; Fri, 15 Oct 2021 19:00:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 682fd9fd-75e9-4047-18f8-08d9900e1ac0 X-MS-TrafficTypeDiagnostic: DBBPR03MB6905: X-MS-Exchange-Transport-Forked: True 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: Dd9r+YnPKZfM2rphXUgw/jt2YWGOISMoyBNVoEikcI/HTuqH9GOc01ylMisonogzO93p5BxE9ptrWjrqmLMIzil5Sd8Cor0lW+om57fA2uocYiwoLsCgB1zambACzAZZ0uQkEyejum/k7wVcSeHKWmrxo/rZoVtWOpSQpRxVtNNc22oDDPnO7+s+YFfrXMizycpTm5JASTJxfzIg6jOEmKzLhMHVErqA3zKckpP5OFycKQrkvYFm9bQenu23NoDbb7JmZW597BJ0XynyY9YwjXUJJ6ddasu3K5JS5dLei5TWU0rH4L8NZ3Uh4AbvF5OatTAoMMO4CTq2L/VN4h7gJvla72PbTEVbJpP8rNL3aTLLAuq/WLA9olMCKUZe6ySwHdKCd5JqlJXZS1OetxuMTzb7dDakCztyygWLL/qOyv2B0j04mRmRN9LVYGE7cOIBos0Fh/PwmliiiRnFqxFCXHynX6BnFxnzNBgc7xw1XoWmNnXOxIAS0JnJiUg3RwLmcgC9zyThkbHedYoZya5pC+JHeD6IdPXtG+iI9LMcp1TbxvbKMkB1Qp/vmaEGE5DY8ArfU4bEd5A7SyVVp4XnlAsDSHdFH+dCWG/4Ui/pwQu6tbkC3SLBWYMRhp/ND6IRsvrn1xeL9d75fcjRONwRrs0Npx9VjSxe3JsVahuRRUP08P4Pp+Wi4L0aqNf3GgmpIeRtjMhPSiN2aPIsJbBYDV4K1szjzkyyFEHU13tI3BkK/2YM/pha6dOq9YPIST5pL5HlLIolqNBaBuLCbfFkYPcfvGeGJhayyortWYR3AxU= 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:(366004)(956004)(6916009)(6506007)(54906003)(508600001)(966005)(1076003)(6666004)(316002)(26005)(44832011)(4326008)(2616005)(66946007)(83380400001)(7416002)(86362001)(8936002)(52116002)(6512007)(186003)(8676002)(66476007)(66556008)(2906002)(38100700002)(38350700002)(6486002)(5660300002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f0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3BasR/ZeS+Pe5j96Fdm0AG/wnaiWsZzcR/bzsnsRQ5KssS2CTpuyX2ShJ8JedgbO+tRGaX+CE1Sxao15W/VUv8niIi56bOOxhq78GczEq8Us3bWGpkKiaFhxAYwkYsSUkSD4mfwgeExxHqm1Z9vIJ+turxhJLG6dQXsgThDCi4VpjWsm+YzWLcH6C6SVaP5WxXzoqFxg9bKeWoGaUmncKK1j22a0loG5fbklOoaArudlrdz4etit0bYyD+iRWTBxxPvTBiPYhmkQEMgf9xMHifgXM9 X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 682fd9fd-75e9-4047-18f8-08d9900e1ac0 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2021 19:00:50.3873 (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: V67NqNtJaHpzk8hgz7O+35OwxYZgI3zymfxXjUtD795Vcl6ko0G2Hve1pvwNf/3YXsD1Tb5XL0JDnNE1SPvKmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB6905 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_120059_152567_61FE9FEA X-CRM114-Status: GOOD ( 19.79 ) 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 --- 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>; + };