From patchwork Fri Dec 17 23:30:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12696736 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 D8C79C433EF for ; Fri, 17 Dec 2021 23:33:10 +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=lQYM1ASZMKVGM4 dwFttWKhG+yxegtr5l5UWlxBTlXJr7Aog0RqwfLv/EcHto7x+ucVRbzxV6U72vNcp0mlFu5UzCaGa wgBBC9LRew5kZCuh3K5KkBcqQ0mJ1aqu9VNSCmXOuEU1jfD+SZ3amoIXr32iv5j+v9L5yjx1FYn6U jIcn9i9M+ftugjqRj8GYtLzBDByePLy0Ed5DWHN7kpZshVIX7e22vavwJ+6mLRD6Z9iLsH2zf3RfP JTQM1Pyr3N82KcdfH7w7l4K2haCAUquiOSNEZ2QxOn8nbszGg3lB0GtkIUlQQctxadPVhPSLHi4gQ rjgbGFjVhjz4QFwlMqGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myMgR-00CjGy-RA; Fri, 17 Dec 2021 23:30:40 +0000 Received: from mail-eopbgr40049.outbound.protection.outlook.com ([40.107.4.49] helo=EUR03-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myMgM-00CjEa-Fw for linux-arm-kernel@lists.infradead.org; Fri, 17 Dec 2021 23:30:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bSLiHHqEs2tUOhjoteCjG/S6upwWEb+kS76KCOQyorOS4aVnu9xgy3sH54LDNikYbim1CEOH56BxlIZZmCku0/fJrI/hZhY1rNMM5QeLVwsF6Cy4Jlo8yVwFOCOgV3cK07tnZspKX4m5uya8RnchDYrHnFm2hcxpKpixeXh1VsiaPnGJrkpDhK3gfzXEsjj1SqBQPdrsgOEQZF7ujtwBsC8B/4fDBMG/Xt+3YS2hSvUq89A11OzD7O4aEoGKb6uguEQ5YYr+Wq6xE+DTW9jNst5JX0luFzhQrqybDCk6k2nH82oOnGG241STbDjXwolbhr0iDQbIFj0sOOS68415cQ== 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=QNExOxXhJ3DvYaE8OiRfMPgnU2IEcdZ/eETLVA+PgT8mFcUDkQTqi+l2G8GpkTF6XzoQ5gJUVIPVaRhpBYX4RxrKv70UcQQPBj1FNaeEjEkNWDYc3ZlCBHj3yHMzY60AxwxYN7JWTkDEENEtpYjqGFuvtD+1d/4UBYQAtlUXcSvoaP/mCflaDQL+Xxa99CRIfosndpg/FBLV3OR8iAWzc9IFcXASh7Ix5dKMl8Ln/+3cjdqBmyzz+1+6bYDAgQP2cRoaogvFCP8Uo6Dis/hUb4yqBzVHp8o3p9RK9075mtt4IdUAp7yCQDVZV3qsedFI7RGbAzPfbeAA5LB4hJGCxQ== 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=yRJrQQYIa944xWojB4TID6Sv9pM6w/anIBi1jkNs9Cj6sHX0bw29ZryCUqrQ3obHiwcBaRcRrD22KpuySaVxC6IIYRSrmW5zyEbgr3AyOqdwkm+mRayYQn7W/xgkHrDkPpX67bymf640mV0GLL4CEdsI6q1Wt5EKaSnIrkDjum0= 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 DBBPR03MB5142.eurprd03.prod.outlook.com (2603:10a6:10:df::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Fri, 17 Dec 2021 23:30:27 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::9093:a60b:46b7:32ee]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::9093:a60b:46b7:32ee%4]) with mapi id 15.20.4778.019; Fri, 17 Dec 2021 23:30:27 +0000 From: Sean Anderson To: linux-pwm@vger.kernel.org, devicetree@vger.kernel.org, Thierry Reding Cc: michal.simek@xilinx.com, Mubin Usman Sayyed , linux-kernel@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Alvaro Gamez , Lee Jones , linux-arm-kernel@lists.infradead.org, Sean Anderson , Rob Herring Subject: [PATCH v12 1/2] dt-bindings: pwm: Add Xilinx AXI Timer Date: Fri, 17 Dec 2021 18:30:14 -0500 Message-Id: <20211217233015.67664-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: BL0PR0102CA0039.prod.exchangelabs.com (2603:10b6:208:25::16) 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: 58794715-2a7f-4211-666d-08d9c1b534c6 X-MS-TrafficTypeDiagnostic: DBBPR03MB5142: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: WdGgUoFH63UyzjBylLwxc6T3LG9t+dxoeEufTSuiVZ9zSZw3+0HKjn9WirGUONqkmKNzgDlPOOBGNuabdcDfKTBNo9ijdiLav0ZlIa8xVkQ52BgMsbkrKRlMEqf0XYV81UM3y1Lfcqqco6jFu16LQ+J2WKw+3qKwIhq3s0uXkpMApTR0hWEAYfdu1etQH2YOdT31lR9Rw5D5XOSjJrQXvkpkijAYXH7mnAWyzm3f49PsQGqLW/krCP8fZuQFG7NbR4ycQLB5ulqy3+0lVKefbhWJxcrlEZrmy2RAOKXRUNeP1AyTRKE++V4rTce+G2ZsHVsrWvzakeuT8UMAyIUoSIkDba/59GafLKWkEeQ7S4vOYl89c0CLI27t+09BvooAAWR64zBelKMBfhLGGbBwNhvoY+/oIaQqE2WZ91h97tny1fkwjVGqoFt9GorRc7fUuEhsWIhFkaKjOMMSGRjnE0nFiAwVOAd0aJoRypAnPknQ2qoURdlLxjOJerTzsqhoPMkeLQgE6tlCEWdgd/EU3MvCDXj+QMmrsGzp14GNeJZ0Cv7Wx4IX8qlt7ulr+rGAiN6x8tO+WmJ8eE/PXxHfUewjyNAuYtlwBEl8eJqrV6uEYSKLDSDUPmftxw7RyX88WnzQxA2wGKwD4nQSfZSKURC8OPPl9ULhskVFAIdksbFUSa3+HzNOZZOqIbSuXvZQ802OybrRlKS396K4eccezdVfI5Mxv2oPuvyTM7Ap4BZJ5stcF9R1SpjbHJkZa2+MFHiErw2P0XoXFVdisHYb9ROYRNdodzK7f5Yf/Ad9yfg= 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)(44832011)(8936002)(6666004)(52116002)(83380400001)(316002)(6506007)(66556008)(6916009)(2616005)(2906002)(86362001)(508600001)(66476007)(7416002)(186003)(4326008)(966005)(5660300002)(1076003)(66946007)(26005)(36756003)(6486002)(6512007)(38100700002)(8676002)(54906003)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: owg2ufVdVd0YXD7El+6RqSCJdVfozQ7rpWEFuzD0LYVMxAyxiAHbbnPgDmu5l61530Om2FkugmcnzwJHyJS64brtP/z3NPiWXS9bd9xWg/oL29KWDzyOYBH8EamXHOsAF2EZn1k2Idzh/fz6GB0PuS/ecyN4VgeuLTodO+3WYdOoMKzfiVe8E/pcpB3LboiyddfZQMVBPfEX1APqNXUEy437Pf20dwRt56odDmwbqxZmQm4YCQ7Ei9FZYGqQUSd2AsbQKC3hoFIoMAJvzrf8RwjJnIWcYtTqnKrEy53xXWDT73YhCyqMaStP1Fjsif7w8Co17YPR1ULRNthWoxSqMKjeXlSbQ9lIHsImX55fyUapHPt3gGHTpmlp0rvssiRf2NeDDX1CA4onZ3MKUkUfjkPDvo6Mk930c0phrTh9ivv2nHq557AxoKbcH4eeZWNrBBa5M8Qi09bhhqwe/tPt/zmJetENlcR9s379MlqGEKztQmxQOR/OCQk21VrIS9uDj2dno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co6sbK9v7RrmyV6MDPFxqeNDOdwNN4iNTgoPbdBsNVnQ= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58794715-2a7f-4211-666d-08d9c1b534c6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2021 23:30:26.9414 (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: Bhktn11fEv9xq2mp+nPUuYUodzsFXOpUfHOTIrDLJEdzhuF1RAWbTl1D9obYiWdn9jNj/FIzu+WSLvnX13qZiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB5142 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_153034_588675_D5C9A7DD X-CRM114-Status: GOOD ( 18.11 ) 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>; + };