From patchwork Mon Oct 25 18:06:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12582571 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 3130BC433EF for ; Mon, 25 Oct 2021 18:07:55 +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 DB70F60F46 for ; Mon, 25 Oct 2021 18:07:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DB70F60F46 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=q906Scrl22an8icXe3sbloMj0nMcYdE6vz4LZuBeKRg=; b=sQ3d+7tNYaoWqQ PeOeMB/hdDn2cBYVS0UoaE6qzeaeTqRe6YsxqTkGbPLbyxaKBCjQhJRv7u74XFoTPyJkicmlvU0rU 2q9PWbRzF0iPekcmtBs7ha255bxWpbLNPSj7HljcStBg5WnIuAnbCjMvZgC5c1iOdcFctWFjibdwO xoCzrOuzbITEkXd55PUQjTnaS2WeaGEx54xjcQ+RCzGMM09ZA5A/Gdq/ZfbPXqxMh57oYYTEFOSF/ wbO8RbXT6ds6C+uEEu17uFSnwfH47L66D9dq59YthLA2FK0doxUgs41Hp1snoQRk851h00tQKR+Hp ArJCkEprwmuEHAxVQvdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mf4Mm-00HHmm-1b; Mon, 25 Oct 2021 18:06:36 +0000 Received: from mail-eopbgr70087.outbound.protection.outlook.com ([40.107.7.87] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mf4MZ-00HHjg-Vq for linux-arm-kernel@lists.infradead.org; Mon, 25 Oct 2021 18:06:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kax4IbwjuTx9+1ikEXYwL8DF9QaigN8IwYBamCT4zg8WAIo1kFFHI9bkNn1fruGjzqsQsb4jKlh+E6MYS2qSSajAyymjWx8BE/pBIJ4qzjU/qTA1g6LLTUnlZvaNgMRnr3A1hNSsMX74G9UcNBmxtMycD7JglQQn0c3BLMa2xPNRqbW+fGvOI4/G6n9qC7UGFz2PiyjsknZfyOmBGz8QWDqlFnwAkRcvBqbUxsTnolEGtjW8vAyNsM4avU5t2IAXIOOk6WYaaiWffkCN+k7CoQ2rmdbvd9wT2Wd4ght2dtEAOxQ2vqKR4tW4MO75Hh+KaVOn9hqc1qIDkmtN1cnLGQ== 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=h7gltaICtLVq+vgX+41/ZXhYSjqFW7l5ZPaqshYVPoth0nzoKZhshWZqJc5ZEjy0SETHzQC12OEnLErMQQ3AtHWlwmgUjkNuwax05S7B0A9PZEJ7GdSg8vksSr5ShCObTM7Yt1vGmRsWg9O4gsBht/FMJraMrMwvZlvWGAuRy5RUuA+Gd1zCf6CBJ0iOG4U7ikHr8KStOmuh0IOer6GCT3Em1w1hWK3uMPumN5ixVWQJCsDxWy2csEr1THBpy7JnvOxwkUcjALma1KJoBmRbGAhj2t4U3P6I0Fo5Opt/3cBgNphCL/MoZdCONG/S0JDyFQk+bvtHQLmMyu0aEh6Dmg== 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=5K6zQeSq3sQcrKCaApSUoICBfsJi/RsiIe4H2tEgccw=; b=HBbTadaXGtvysgCnF4qWzYd8exqQdZ+7fwSVe/dxJk/zShslJLotzzk/8vmoQ4HvWRPbgexm2T2AcSWiq8N8UXo5E6rPqaS7YT2740Axm2S2i7kGG3oq9xhazvsNB4KYWrmhX36P65ns7AsrCOBxcSkPb1VKARAY05wO9Hbqgck= 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 DB6PR0302MB2823.eurprd03.prod.outlook.com (2603:10a6:4:af::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Mon, 25 Oct 2021 18:06:20 +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.4628.020; Mon, 25 Oct 2021 18:06:20 +0000 From: Sean Anderson To: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, Thierry Reding Cc: Alvaro Gamez , Lee Jones , linux-kernel@vger.kernel.org, michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Sean Anderson , Rob Herring Subject: [PATCH v9 2/3] dt-bindings: pwm: Add Xilinx AXI Timer Date: Mon, 25 Oct 2021 14:06:04 -0400 Message-Id: <20211025180605.252476-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211025180605.252476-1-sean.anderson@seco.com> References: <20211025180605.252476-1-sean.anderson@seco.com> X-ClientProxiedBy: BLAPR03CA0036.namprd03.prod.outlook.com (2603:10b6:208:32d::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 BLAPR03CA0036.namprd03.prod.outlook.com (2603:10b6:208:32d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Mon, 25 Oct 2021 18:06:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fa8ba43-5d49-4476-ba71-08d997e22593 X-MS-TrafficTypeDiagnostic: DB6PR0302MB2823: 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: 4jajTX74m5loCPjPI8eScWFDOd74Se/oZX2j/CBu9AYDUqToYV7ZYXd/P8g8NhboutHlbESErhZwm7VQFpUXvAE5Dwog39FGIyaonANKEU0y5u9Z4+5GH616F2gWk0AgmTteI0wAPVMydvCZ+Xw4HnOKB3H8+Fx3OV//mrUNziGL5384tjopLonIK2NyWl0u8DGDa6NpeT6rip+E2xbM8e6sEDCMZ34948TLhEdql7LEtOw/SoM8arQPgoUNHc/ZeGiMSlvqd/SWDiHOyyOU9BQwAcKp5V0L72jPnlz9/g26aCTP4BWMvWt0dSZoaN3dfJvfNZhdjCif/o0hti5T5oas0r3N6AFNDkZoPJJeHlzM3sNPHylk+3uv0/kSnp+u06GLQbTuCf+TBfJ1LGXwt0K2NDiTGgzMGowjTQz+X6cDxyJLJUoBsjNDecOaKmAi/unJGQuRZl5FnCsjMBm2qrBHvm6j6OkEnptmuB0sM1RrKttI4PVFqgwXcpM/BQMaZrxKiM9W01zWnFzVEeGOOsVFo9XmaVKGLEJKWFrSMIlz7/IO4BuG+A9lYXZxUddwjwQpuQvsU2BZRKGANF3LMPrFSpq7EV3SnJ8r3E6QoEQMHwODw56v4gscJb/AUUpRJXHi6FFl4wno5WmoZ8yqvTemrYS7w4B9IBW06wr7oU5ht8Vsxy0pCh41TS7stjecqKGDEtzbIxyjuFU7cowHV1sboq6RQJ+bl+cveLdsTeVCpEt1hPTmu9oLQNUV5SXWnWc0fFgb/ASLYzBuVE+Ui7mjEB49jLabAio1hhtlhvg= 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)(4326008)(6486002)(6666004)(54906003)(7416002)(2616005)(44832011)(956004)(5660300002)(83380400001)(508600001)(2906002)(6916009)(6506007)(316002)(1076003)(36756003)(66476007)(8936002)(66556008)(38350700002)(186003)(38100700002)(6512007)(66946007)(86362001)(52116002)(966005)(8676002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GxEhVOcNjdVz41sZhaMMXwyz4ng+hc8x/pnEaWzCgyXR+ryJ3xw91RxMHjEy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ip+QBuewudPKI+4t/SjrLoFADW0M3YM4R+S+lHLRtbhieXhrJcS0DJ4M3TRQEEOLUTKWREoD2YKk7QpGH7jozd6NBqBqPm/nSLl++J8524tnaU8R3eam91+nG+QJWKKbwcLUkZuyaiQIE5MB/dQh5Ah+1AV1grO4pgS8rY9ch+PFqEQrQrljrm9CtQVg4j3MPLaKh/9ENm5fL600SPdE/21uwZxEITLk/B4+fuK7IvNe1pExxiP2fE4lkm3MpMyy0Op8V8h5XrTbL8sPizcyuRh+/L7g4AtKPwZD9THKRISMPQumzT3it1F0gCQIVAX5PBKhjL/iTaiQ3Ara6PhTOnkHbCwaZ2I9p//8kZFd0FZo/+JCRQcp5iNj2ggLgWhm0G6eBirtw+1sOiE/qg4TSrNJAGn/u4DCbfa3rVKYuz5ZB8430hD3ETx6+sg/OhI45x6REn61HbjzdvjRFqiofANoo5HVutjMScAKXPtK8uqUZnBskBAPM= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa8ba43-5d49-4476-ba71-08d997e22593 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2021 18:06:19.9386 (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: aMDrej3ZfDdeL+dhHL3Nq25ikLCOEiGqGPtJ47Y0YrizU8Yj2d9/mux/lliZebKDKwO1ZKc7iggEuwfqCHqQlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0302MB2823 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211025_110624_054912_46845114 X-CRM114-Status: GOOD ( 19.67 ) 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>; + };