From patchwork Thu Mar 3 22:35:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12768211 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 4EED3C433EF for ; Thu, 3 Mar 2022 22:37:29 +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=mWkcnAQPc+eGl+ GTWyLJ1G4a9wJJH65NMmijlfBEZ5+FogcF/4Kkk+6QcyNaDA4aiaYjPMB0yBi0ovYFyOCcu5LdQNN HgRAbJLcIQDqND3amnQOyE933jt5/h8W6c43roIpX9eU9SxYdPA2h7Dwj9ozke9Bz2qGVq4zRFaO6 plQVix369ARy3juG3bXShn5esHhsGYPS0tPV8p0sR0cF2NuugcBEDto52nlBjo4Cc8tkOKDiCEt/8 4Ue6AeIoVJC251bqU/LQQWDye6y9/gkYLfLvK3bcX6scFwpSQCs+pFbKsIVb/P8d1upZRCdGfRDEk zEFHjh2jRxnd/diUa12Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPu3Q-007xmN-8s; Thu, 03 Mar 2022 22:36:12 +0000 Received: from mail-am6eur05on2061c.outbound.protection.outlook.com ([2a01:111:f400:7e1b::61c] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPu3L-007xlL-Fi for linux-arm-kernel@lists.infradead.org; Thu, 03 Mar 2022 22:36:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bVt5GMonRJACsBtP1rMFomvsCiGlJEOXk+EmVIIgzwVGucl+n+rXP7jibXsspOUHd7NWtmmGV+4eG3xL3fi2Bcn/LwC6ZsTfxcbw02ZENx2EoVrDlkyIzN/u2qjRCfZTOBQhQTC6t0VteLEGVho/TClXNpBfbipX9n+IkVgoP9AaCMJm7/00Q5SqSxLTeVXvVaWP0Bs8E4JnF9RB6mRpxfo3Pjnla8J23zjidgwma+TYBkT+Cdmh730THl/j6n+uZvhsN/Bdr9YIXg16P7vCHrl2fWj3Xmr8fd5ICL/KTjNjNTLabNCk7fVyzaiXxoNPH5OzqN6I3q9VCdgXpQu0ng== 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=PXxwt8I7O2v44xK2cFcR0y0eG0hcQM4LMoUJFPIN6Krk5zvTpLJPDmCzVWGJ0YOCpA+alyMQ9S5st/j+xSQ6xmvXTpKtpSAE113CExaOfIenS1LVoUKOzm4Frg/8N7nPZo5hTFjuopMLRi8PmbW1OVMu2hOBSvdk5Vt8KXHdQMGFI0pE6vCOaNMK+g/e3APc3tPEI5AVV2qaSzhofnCNQq6ReHPUlAusOOp3y6oBCTxNiyizjl9wnlopKw5dRh4QhKKymqWy9UlLs8lsxtelHZ31hE5RpfS9OyB/zujGn+8cI7GIGoQLZb34BIwnSWS7CA+7sFZG763PFzd+Fa4j3w== 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=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5K6zQeSq3sQcrKCaApSUoICBfsJi/RsiIe4H2tEgccw=; b=QL86BDLq4TteqUSP0O37KrDKS2CzfH+/EtzTHdekQalKZ7DnpnprL3d6nciNaBsMtsmRz9WY/n22vBN0oPFeqM5CFANdazjdGJBFsVc09rwXy89Sw5FjtkvVhBz6qM+AI1lOHwWvDooxvpRkvJFDC7DIwtPw3GdvMvBWTDjMYkLYnzxAKTZy+q1XZuvpG+SgRT7yIiWX6alRKpfoXhB6nvRlcmJFWNhAJje+BJMqVqbbj/tvHkRe4JPhzjoArkaXOHe7XhTIbXrpFdDZwB+tYUqPfZ+WrnquJH1zsaUF988dyirOXX1KJzJ+POmUS45TXbiJNqBl8Gf4VFUBXBZ8uw== 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 AM6PR03MB3878.eurprd03.prod.outlook.com (2603:10a6:20b:22::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Thu, 3 Mar 2022 22:36:04 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::9130:93ae:6e27:e9a]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::9130:93ae:6e27:e9a%4]) with mapi id 15.20.5038.014; Thu, 3 Mar 2022 22:36:04 +0000 From: Sean Anderson To: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, Thierry Reding Cc: linux-kernel@vger.kernel.org, Lee Jones , Mubin Usman Sayyed , linux-arm-kernel@lists.infradead.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , michal.simek@xilinx.com, Alvaro Gamez , Sean Anderson , Rob Herring Subject: [PATCH v14 1/2] dt-bindings: pwm: Add Xilinx AXI Timer Date: Thu, 3 Mar 2022 17:35:42 -0500 Message-Id: <20220303223544.2810594-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MN2PR04CA0009.namprd04.prod.outlook.com (2603:10b6:208:d4::22) 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: 7be3fb09-097e-4132-b764-08d9fd66337e X-MS-TrafficTypeDiagnostic: AM6PR03MB3878:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cXUhF6E0AePhv9m2pHw4KPRwTrir4ldIeqtiyLHL7R+qN0Hi1DnfHAAIrrwZ/YK7lmiRGqT748SQLjNY+bCgxAcWjE3n426r8Y253a0cpeyJjZQLoi5VeHe/fFUAwq567ixlj+QUuZg+rwjdjhhK/8NlyWbs4RALzU6hQRQX9pmqvIGRFe1Ipmk1xTer2ezJeGxNTq2uTbGmRfpm6IVUIrzAHPK5s2hyMISR2Ud60Hww3nQY0aoNYvegM2iaurx7ni0eMDGAXVIB/jST/05OGxUzzItxhrgyT08J9AuwZij0OhRJkkWBIIcC6GtODOOrLs3XcO6ZCN1PpaCusHnMfzzG0Y50NVDJdfGtrkDeO8AGNlhsR1JBD+WGV0XK9IqBDj0qNtUmWSZctlII07q9/16QQ50vrYNOFIE9PAxFNqtMnz43sFH5+I1sFi6FOfx2Cw/R3gENpZ0tbKcA5O+hLsBZJEUeUOwgY/j0ZXlrsHMuqOZhPcbn5JLr5kS/reyoepAh216tiZYd0wjFyr/P0SEQrJGLD0+SRDtUywpdHeVrWKnJAGSvOUTndyobZUf9NqihtC0ygaNbXtzkUNkof8A9TFfy1YgbxrTEbAnfofGfk4XSgVgNF/STcgo0zvCMDkfJTCzHYkY3BeUCT8NIy0ruloJla2Fct/ZkvKAlEgOGS0jF5V1Vv6foTw5LXwtp/tDbs8uxtIEQx8hQqDtU1f7H8rfckG6GDnEZwfLBTphoXYxvLxn3Er7Vy1+nZSzgh27TTzU51RCHCqAEz99YgvKxekKH9D1ft9SvpCA+AYs= 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)(186003)(6512007)(26005)(2906002)(1076003)(52116002)(6666004)(83380400001)(36756003)(4326008)(5660300002)(44832011)(8936002)(7416002)(8676002)(38100700002)(66946007)(86362001)(2616005)(66476007)(66556008)(38350700002)(508600001)(54906003)(966005)(6486002)(6916009)(316002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NQE5Tj9ccIk2ACdPNwzg+ll3G769c5YnOTEtulGoI3Zd6sEurm9YEvQEHU+LOpMlzqFb/DNCi5OFVYZtoNeaFyawiy7Auv4OKXLi2UhkKIXGbDcf9A+Z0fRicTYvqHC8hjF1/xnYlqt1ea3YHYgrig8VRGLXUnZmi0UzdVu0bGwYmRKt7nlWAcfENXRU2nl298RChaMmHkRDmkuzgIOAsn0LcBj9awENgxWFlaBgSWt9b6wsHeA6zq2FtuL1KndKyt/7y2CShZfV7N22UlHchcf4ceTwW2bE0Hg+TCPVhMNws84ulFM4XHJODvMTiE/iqpQ8KQ+6+dmCPDptGsYJg445+gW1WS4ruCFcyC6lw+xeq1r5l5My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n8lN9fjbnO6OKYUCAH4sS2PkaSu0C52kOBFnq4EpuYND2GXyRM8rMY5+AMrZa+/ezg7f78RRKW8TH+771oVAXQlKwqKWRDCXQcAM4TAtHPVZ40+HulUc5CPJb3GGmrNOKcAceqYuei8PhlClGj/VV3sQ0ZbYf9wf3g1ycGOhlGyqtRANm2/gExJTw= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7be3fb09-097e-4132-b764-08d9fd66337e X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2022 22:36:04.3007 (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: FbehmPZB4B5lBToBu0Vevwli2Tw9IQ0a687RFEh6mfKU0SiFnJulzBGeSQZPwbMOf4wjvHk0U/AIjbSTyz01sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB3878 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220303_143607_559351_D86AD557 X-CRM114-Status: GOOD ( 19.57 ) 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>; + };