Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp337237pxv; Wed, 30 Jun 2021 06:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuQA4aK/YFfIOvDbDtYwGuk4R2Pi3gffR7QNs/h7gFgMpbEsYDWAGaj3M1bJlwKsuo1xDZ X-Received: by 2002:a17:906:d54b:: with SMTP id cr11mr34795692ejc.98.1625060947816; Wed, 30 Jun 2021 06:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625060947; cv=none; d=google.com; s=arc-20160816; b=BXTe2Ef1kEvgZQvzLBc4xFAY6BNc6sR6QtVs+4MoOJOBKh+VGjkZuybUYHJv8uhp2p aiNyCQ9whJ1SUcYiRgB1AwAvkSVn9gYV6ymR/b9tjhYihaCT7EF37D2DHRI/Ctlg54Pl puiim1I+5JDURms1DDlYTWE1pyopFSBlcEd6W45jt7G2nQiyB/3E/1kf7CmzMyIoTg5z WjeXetBVghksflJKs4V2jyxaqHvn+fvD+HvtTdL2SFN51hW4mbQ30oHH4+IBGAV4+pNi UfQ/QyIZ+zo5UL7zlaAR1i5hjKRP8OLv6qcKM1M9DyqgNTNgF0srAxmegCY4ZhPxhn1c NI7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=NiFfnM4nxPKv3wBf/KQmGM6lG+GXst7adkovnLuCU8U=; b=vv9hseLkxE1sbTT4COOUA/3Sr4Gxz2l9sHigJjvOnr5a+PuFKvlcFxz643zdth5hOE 4E2cNRBGFvrzQ2gj0sBa8sH/Ye3LMAY32SJYQa36MfsO1j3XWsTPEPEQsZvetAHBAm+O bqrhe5bsK6gi/miVCQI/+Ei+yVBbCXtocrNStu6MqfUCVCOCUSUEzHNUaixRln187hIh QoFzamBmtDCGYIrgFA0zew9A8e2cdJ4QfnQt1h8lqjIIIxIHYS1ELGUs4Gr68IeoWZz8 VPayrp5GfAEkgNaLcw81PjTawLxwXJRHZaTPLvfA8UJO3cHNfYS3jLHqBVcS41WWncjn z8rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b="wQ/r+hCB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b22si20344216edw.104.2021.06.30.06.48.44; Wed, 30 Jun 2021 06:49:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b="wQ/r+hCB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235366AbhF3Nt7 (ORCPT + 99 others); Wed, 30 Jun 2021 09:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235173AbhF3Ntu (ORCPT ); Wed, 30 Jun 2021 09:49:50 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB85C061766 for ; Wed, 30 Jun 2021 06:47:20 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id hr1so913619ejc.1 for ; Wed, 30 Jun 2021 06:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NiFfnM4nxPKv3wBf/KQmGM6lG+GXst7adkovnLuCU8U=; b=wQ/r+hCBG+g9+ksz+k4ZRvsyRx0gxoQDcA+TuwHe8mxhBDxQ0rPrEFZGazh7JncXtc yYVWG8d6O7IOUocV6gfxaHea7kuewGWzhuXl2fmW4lF/KJTUcwvQplKndHLHkpEdlKR2 wtlPBg2u9Hlz4+xy1m3THQwLwcxAVllSBERvcXscx/4vwbUUawRuM29w63EaITUiEeGp ibVGzMn9gY9Q3VAGLnNqg4IX0YHOI0eqya93IxLsJvxaicqDAkDynqW4fBF6XRGAmaOy cF2tQYSrK3uJ4wfpJfXUGToIJbTQxUJJBe/RMkm66nE3cVv92G6bbEdxyqvB8unwLi2d FhnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NiFfnM4nxPKv3wBf/KQmGM6lG+GXst7adkovnLuCU8U=; b=OsrfQm/GViy+ESMUW69g7oUNkr2l3uKXsahyHEHLcQFDRtvsI3hjPbDNwljWpyKCZr GAOGMvefbsR74fil0bcrBJoq0womeoUwiOkuilXw1y5WRDB/gn1b1NCwVj8GxgAMa2gi tM3YVrVAWK3frzULhahXKxr4cuyousPln1Z9s9OTW9V1oLmKypXQDRl/brM2euaXxxks Y30f0D4HrTT65BosvJqXSFeCK0B78fTpOIemxRgz0IPpATaDbKhx+bTUJ/jFp6birQKf RYap0BFxi0gcQtlAzAFMLxN5DP7Ar7CQP7XqSFF6K/dDxJEvXjOMR6q9sSHYDkKkjtBP 4tgw== X-Gm-Message-State: AOAM5336GzqHCfyJT3K9OC3R2gJKB16kU2fWmsYPaprfH61paHBjOpQk PTBVSaQxCt3SM+N71nPTSuHvpA== X-Received: by 2002:a17:906:c010:: with SMTP id e16mr35364761ejz.214.1625060839125; Wed, 30 Jun 2021 06:47:19 -0700 (PDT) Received: from ?IPv6:2a02:768:2307:40d6::648? ([2a02:768:2307:40d6::648]) by smtp.gmail.com with ESMTPSA id s5sm12876834edi.93.2021.06.30.06.47.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jun 2021 06:47:18 -0700 (PDT) From: Michal Simek Subject: Re: [PATCH v4 1/3] dt-bindings: pwm: Add Xilinx AXI Timer To: Sean Anderson , linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Sascha Hauer Cc: michal.simek@xilinx.com, linux-kernel@vger.kernel.org, Alvaro Gamez , linux-arm-kernel@lists.infradead.org, Rob Herring References: <20210528214522.617435-1-sean.anderson@seco.com> Message-ID: <13c9345f-b3e5-cc97-437b-c342777fcf3c@monstr.eu> Date: Wed, 30 Jun 2021 15:47:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210528214522.617435-1-sean.anderson@seco.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/28/21 11:45 PM, Sean Anderson wrote: > This adds a binding for the Xilinx LogiCORE IP AXI Timer. This device is > a "soft" block, so it has many 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 > must be kept as they are. Replacement properties have been provided for > new device trees. > > Because we need to init timer devices so early in boot, the easiest way > to configure things is to use a device tree property. For the moment > this is 'xlnx,pwm', but this could be extended/renamed/etc. in the > future if these is a need for a generic property. > > Signed-off-by: Sean Anderson > --- > > Changes in v4: > - Remove references to generate polarity so this can get merged > - Predicate PWM driver on the presence of #pwm-cells > - Make some properties optional for clocksource drivers > > Changes in v3: > - Mark all boolean-as-int properties as deprecated > - Add xlnx,pwm and xlnx,gen?-active-low properties. > - Make newer replacement properties mutually-exclusive with what they > replace > - Add an example with non-deprecated properties only. > > Changes in v2: > - Use 32-bit addresses for example binding > > .../bindings/pwm/xlnx,axi-timer.yaml | 85 +++++++++++++++++++ > 1 file changed, 85 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pwm/xlnx,axi-timer.yaml > > diff --git a/Documentation/devicetree/bindings/pwm/xlnx,axi-timer.yaml b/Documentation/devicetree/bindings/pwm/xlnx,axi-timer.yaml > new file mode 100644 > index 000000000000..48a280f96e63 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pwm/xlnx,axi-timer.yaml I don't think this is the right location for this. I have done some grepping and I think this should be done in a different way. I pretty much like solution around "ti,omap3430-timer" which is calling dmtimer_systimer_select_best() and later dmtimer_is_preferred() which in this case would allow us to get rid of cases which are not suitable for clocksource and clockevent. And there is drivers/pwm/pwm-omap-dmtimer.c which has link to timer which is providing functions for it's functionality. I have also looked at Documentation/devicetree/bindings/timer/nxp,tpm-timer.yaml which is also the same device. And sort of curious if you look at https://www.xilinx.com/support/documentation/ip_documentation/axi_timer/v2_0/pg079-axi-timer.pdf ( Figure 1-1) that PWM is taking input from generate out 0 and generate out 1 which is maybe can be modeled is any output and pwm driver can register inputs for pwm driver. > @@ -0,0 +1,85 @@ > +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pwm/xlnx,axi-timer.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Xilinx LogiCORE IP AXI Timer Device Tree Binding > + > +maintainers: > + - Sean Anderson > + > +properties: > + compatible: > + oneOf: > + - items: > + - const: xlnx,axi-timer-2.0 > + - const: xlnx,xps-timer-1.00.a > + - items: > + - const: xlnx,xps-timer-1.00.a > + > + clocks: > + maxItems: 1 > + > + clock-names: > + const: s_axi_aclk Origin driver is not using this clock name and it is only one that's why it shouldn't be listed. > + > + interrupts: > + maxItems: 1 > + > + reg: > + maxItems: 1 > + > + xlnx,count-width: > + $ref: /schemas/types.yaml#/definitions/uint32 > + minimum: 8 > + maximum: 32 > + default: 32 This is not accurate. It should be enum because only 8/16/32 are valid values here. > + 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' Let's discussed this usage based on design. > + then: > + allOf: > + - required: > + - clocks > + - properties: > + xlnx,one-timer-only: > + const: 0 > + else: > + required: > + - interrupts > + - if: > + required: > + - clocks > + then: > + required: > + - clock-names And this checking should be removed too. > + > +additionalProperties: true > + > +examples: > + - | > + axi_timer_0: timer@800e0000 { label is useless here and should be removed. > + #pwm-cells = <0>; > + clock-names = "s_axi_aclk"; > + clocks = <&zynqmp_clk 71>; > + compatible = "xlnx,axi-timer-2.0", "xlnx,xps-timer-1.00.a"; > + reg = <0x800e0000 0x10000>; > + xlnx,count-width = <0x20>; > + xlnx,one-timer-only = <0x0>; > + }; > I would list example without pwm-cells first as it is valid and reflect current status. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs