From patchwork Mon Jun 27 19:39:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12897075 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 427F3CCA47E for ; Mon, 27 Jun 2022 19:41:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240541AbiF0Tlp (ORCPT ); Mon, 27 Jun 2022 15:41:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240450AbiF0Tl2 (ORCPT ); Mon, 27 Jun 2022 15:41:28 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26DFA17066 for ; Mon, 27 Jun 2022 12:41:27 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id t17-20020a1c7711000000b003a0434b0af7so3725594wmi.0 for ; Mon, 27 Jun 2022 12:41:27 -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=cUa3Qgj83LJO9FwTx4+4xOL790JLFgJuhmgrSJi2YTyi4TgZ3QHn23OZlSeP4eGr4a +enZvFjacedK5hJJSmGuCcyBjxh6MEKPUZcAKWykCCkkzvwUXNfJsUoFjLQwQryYFGEJ SEbmehS1/iTbEmVVTU2q3WXprQHUDo8Yv+5IRCY/CL6szKGQQ7BpxVYKxwivyntZnwWp 5Xv8KR8mPYL/SOmWZuX8ct7NDa7Xzt9ST4L4cgfrh9H9lYDK+db/7RreYUhPECg4PNpK JaGXGh00MEhhzcMG33inGWEsNDk9YWUpGPQgCmkOL0K2m2AjTH2Zi02b+cHy0MmqI0tK MzQQ== 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=aWBZ5EG7T2QUAHTluCVwyGvR5aXi6S3gdA5PFnd7qcfXZ1siVaYUU809NdzqszsfF5 7BcasW1yuK6jyiCiuoMeLOSQ28vFgyWH8vsngRWL1hz/Uzn59eVPmNGb4c+vu/heGqGk UctmSVGX6St61scjuhuq7YcW+5Z1MbGqIT6+YuLi7PN0IvC+6FT9vHUwkjGZoLz3ox3S bfEdJ+XpQWxtpgGtBkvzrsB+oFFRY+eb+6aPy766rTcEHNdMeXGScBDmtc19/nYzSDwU yu7ltxgRYv3EzRmPxMQTPChtik0N6x3LCW0WtnZR/5v1DBPmqSgjMdteBvrkfTOTJa00 H9eQ== X-Gm-Message-State: AJIora/nJwXrVPmUwECchq/LfTavAWOEnLZ94z0hHvphcmenRptTDce5 MAZs/TIEbgrxmlcAMMl+TtS/Gg== X-Google-Smtp-Source: AGRyM1t6tJJ0mxAtUsYUzthMYkrnacnVvnK447unbGgsisXeL7ZGVx2xR03CLUvVfWRC838snmZcVA== X-Received: by 2002:a1c:4b05:0:b0:3a0:32df:533 with SMTP id y5-20020a1c4b05000000b003a032df0533mr22012475wma.155.1656358885670; Mon, 27 Jun 2022 12:41:25 -0700 (PDT) Received: from henark71.. ([51.37.234.167]) by smtp.gmail.com with ESMTPSA id e9-20020a5d4e89000000b0021a3a87fda9sm11428047wru.47.2022.06.27.12.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 12:41:25 -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 v2 06/16] dt-bindings: timer: add Canaan k210 to Synopsys DesignWare timer Date: Mon, 27 Jun 2022 20:39:54 +0100 Message-Id: <20220627194003.2395484-7-mail@conchuod.ie> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627194003.2395484-1-mail@conchuod.ie> References: <20220627194003.2395484-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";