From patchwork Sat Jun 18 12:30:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 583571 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17F59CCA485 for ; Sat, 18 Jun 2022 12:32:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234802AbiFRMcL (ORCPT ); Sat, 18 Jun 2022 08:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234630AbiFRMcK (ORCPT ); Sat, 18 Jun 2022 08:32:10 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E7331DA4D for ; Sat, 18 Jun 2022 05:32:09 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id o8so8815224wro.3 for ; Sat, 18 Jun 2022 05:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=conchuod.ie; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MzCNuZqg5sJhSSZ4d8it+v4YJ89K4kJOhMYbzqau3T0=; b=Q/DW33pApkzDugaxPE3P0mBkLxqeHFjsQF8z1VV2ne8TRKuN2bIqDfzxsSTkLEjBrA wpdDJgUWP+1wDHdQ9JS4O1x4Gq88lL49JAWRWB4H62ef/kDIyGqiJWklnIhvj7t3gOgQ m1btN41fR+l8tqU5xRyuBWhlJfRunVaRxbUCkNPjxFxCR7fgJ76b5iLyDoxgvaEFgta2 Y7jzvGqyxY8ynrhbm2wsHOUw8jsjq4R2c+1hs16sLw8LkR/A8wnX+Rcz+CEvY4HTn+12 wA1hi5h2lS6EglrFG2mc1iaWo2T8RWK90k4OmUe37mNSSxwVnWaTmTTERIaDVuiKnqg6 uvGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MzCNuZqg5sJhSSZ4d8it+v4YJ89K4kJOhMYbzqau3T0=; b=QJuW5imQ9HDlGI32N9RmeOQi+/qC6PJXTMgaFaAIHYG7BhlbqLVdCv2lnC47AsfB9j ITkdEqPmUjKQX4VinNEicaeS1OkSZKp0UMhAYUZZ/nw3Xbzli5Xedj8MQYmrjtuA3DIi s8Bb3b9v3owy253Ak68aIXvUVQdrpAuanZ/WeyhdtI6FFRKTn8yD6hPDSuVS53bODlOU 9bw+uwDCvL0EGfqRGHYoytP9eUcQdW/tXZtIlAZKzkopGmotl8ulj68E7B9SZtgb5S97 YJHoChc6uc/5Zad19B5ThoKUdyhHTYjSr4KqwlH6wODsfbgL7PLtarAweF07fiFXDayV roVg== X-Gm-Message-State: AJIora8qwV56lWaN1WOEruLAVwqV9wt9w7FJxuWXxnZVlmfYDDNCknTh bLrCAkXP/R96jerCl/J7IKTphA== X-Google-Smtp-Source: AGRyM1sSSQqHjZc3Rjokw1+aDQhZh51cPdEwrDgxvVJw3mbh+xunRoRwhQyu4jAgaA6W5FK27IHXAg== X-Received: by 2002:a5d:598e:0:b0:219:ea16:5a2a with SMTP id n14-20020a5d598e000000b00219ea165a2amr13955140wri.343.1655555528086; Sat, 18 Jun 2022 05:32:08 -0700 (PDT) Received: from henark71.. ([51.37.234.167]) by smtp.gmail.com with ESMTPSA id az10-20020adfe18a000000b00210396b2eaesm9292305wrb.45.2022.06.18.05.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jun 2022 05:32:07 -0700 (PDT) From: Conor Dooley To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Sam Ravnborg , Eugeniy Paltsev , Vinod Koul , Liam Girdwood , Mark Brown , Serge Semin , Daniel Lezcano , Palmer Dabbelt , Palmer Dabbelt Cc: Thomas Gleixner , Paul Walmsley , Albert Ou , Conor Dooley , Masahiro Yamada , Damien Le Moal , Geert Uytterhoeven , Niklas Cassel , Dillon Min , Heng Sia , Jose Abreu , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH 05/14] dt-bindings: timer: add Canaan k210 to Synopsys DesignWare timer Date: Sat, 18 Jun 2022 13:30:27 +0100 Message-Id: <20220618123035.563070-6-mail@conchuod.ie> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618123035.563070-1-mail@conchuod.ie> References: <20220618123035.563070-1-mail@conchuod.ie> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org From: Conor Dooley The Canaan k210 apparently has a Sysnopsys Designware timer but according to the documentation & devicetree it has 2 interrupts rather than the standard one. Add a custom compatible that supports the 2 interrupt configuration and falls back to the standard binding (which is currently the one in use in the devicetree entry). Link: https://canaan-creative.com/wp-content/uploads/2020/03/kendryte_standalone_programming_guide_20190311144158_en.pdf #Page 58 Signed-off-by: Conor Dooley --- .../bindings/timer/snps,dw-apb-timer.yaml | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml b/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml index d33c9205a909..9a76acc7a66f 100644 --- a/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml +++ b/Documentation/devicetree/bindings/timer/snps,dw-apb-timer.yaml @@ -12,6 +12,9 @@ maintainers: properties: compatible: oneOf: + - items: + - const: canaan,k210-apb-timer + - const: snps,dw-apb-timer - const: snps,dw-apb-timer - enum: - snps,dw-apb-timer-sp @@ -21,9 +24,6 @@ properties: reg: maxItems: 1 - interrupts: - maxItems: 1 - resets: maxItems: 1 @@ -41,7 +41,23 @@ properties: clock-frequency: true -additionalProperties: false +unevaluatedProperties: false + +if: + properties: + compatible: + contains: + const: canaan,k210-apb-timer + +then: + properties: + interrupts: + maxItems: 2 + +else: + properties: + interrupts: + maxItems: 1 required: - compatible @@ -60,8 +76,8 @@ oneOf: examples: - | timer@ffe00000 { - compatible = "snps,dw-apb-timer"; - interrupts = <0 170 4>; + compatible = "canaan,k210-apb-timer", "snps,dw-apb-timer"; + interrupts = <0 170 4>, <0 170 4>; reg = <0xffe00000 0x1000>; clocks = <&timer_clk>, <&timer_pclk>; clock-names = "timer", "pclk";