From patchwork Thu Oct 29 16:20:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 310735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58415C2D0A3 for ; Thu, 29 Oct 2020 16:20:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE95D2076E for ; Thu, 29 Oct 2020 16:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603988429; bh=3qAjnhHz1kcAriq2G1giteB+HNPzOLqsVeeCAC7VxDA=; h=From:To:Cc:Subject:Date:List-ID:From; b=HH67AMG53w/6zl0B890QNpudn0q/YVf2kv5nUpQh2qV3KwxLXDQNSfnk9s+oHxe5D NpeI4Gin9xYu735eYw+78Pk0SPET9WFkvFGevwEgSFBwRrVrqNlD5RR8i/FQa4XATe 4vIdTLtoXxVfG2Qtttfqtv/gnF7ctoGwCqUq4aCc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725841AbgJ2QU2 (ORCPT ); Thu, 29 Oct 2020 12:20:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:43138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbgJ2QU2 (ORCPT ); Thu, 29 Oct 2020 12:20:28 -0400 Received: from localhost.localdomain (adsl-84-226-167-205.adslplus.ch [84.226.167.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 37AFF2076D; Thu, 29 Oct 2020 16:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603988427; bh=3qAjnhHz1kcAriq2G1giteB+HNPzOLqsVeeCAC7VxDA=; h=From:To:Cc:Subject:Date:From; b=RFnfg7Iow8R1ZrzmX0c9C4MoxZBa5/xOtn/SaXjH8mu7prmUQwnPrjLb6XIdfxdX6 rnxNtUIBO3fBDzyCpaSRP5+12k3IAz1BuXmg0oQJoOqxgltltMlv9Vq0wBirElIaaf XkrJbcjOJ8ouAITA0mvpKa+I5VP9Ly5yaeURnkWE= From: Krzysztof Kozlowski To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Han Xu , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v4] dt-bindings: mtd: gpmi-nand: Fix matching of clocks on different SoCs Date: Thu, 29 Oct 2020 17:20:21 +0100 Message-Id: <20201029162021.80839-1-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Driver requires different amount of clocks for different SoCs. Describe these requirements properly to fix dtbs_check warnings like: arch/arm64/boot/dts/freescale/imx8mm-beacon-kit.dt.yaml: nand-controller@33002000: clock-names:1: 'gpmi_apb' was expected Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring --- Changes since v3: 1. Go back to fixed order of clocks, after explanation from Rob. Changes since v1: 1. Do not require order of clocks (use pattern). --- .../devicetree/bindings/mtd/gpmi-nand.yaml | 76 +++++++++++++++---- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml index 28ff8c581837..9d764e654e1d 100644 --- a/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml +++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.yaml @@ -9,9 +9,6 @@ title: Freescale General-Purpose Media Interface (GPMI) binding maintainers: - Han Xu -allOf: - - $ref: "nand-controller.yaml" - description: | The GPMI nand controller provides an interface to control the NAND flash chips. The device tree may optionally contain sub-nodes @@ -58,22 +55,10 @@ properties: clocks: minItems: 1 maxItems: 5 - items: - - description: SoC gpmi io clock - - description: SoC gpmi apb clock - - description: SoC gpmi bch clock - - description: SoC gpmi bch apb clock - - description: SoC per1 bch clock clock-names: minItems: 1 maxItems: 5 - items: - - const: gpmi_io - - const: gpmi_apb - - const: gpmi_bch - - const: gpmi_bch_apb - - const: per1_bch fsl,use-minimum-ecc: type: boolean @@ -107,6 +92,67 @@ required: unevaluatedProperties: false +allOf: + - $ref: "nand-controller.yaml" + + - if: + properties: + compatible: + contains: + enum: + - fsl,imx23-gpmi-nand + - fsl,imx28-gpmi-nand + then: + properties: + clocks: + items: + - description: SoC gpmi io clock + clock-names: + items: + - const: gpmi_io + + - if: + properties: + compatible: + contains: + enum: + - fsl,imx6q-gpmi-nand + - fsl,imx6sx-gpmi-nand + then: + properties: + clocks: + items: + - description: SoC gpmi io clock + - description: SoC gpmi apb clock + - description: SoC gpmi bch clock + - description: SoC gpmi bch apb clock + - description: SoC per1 bch clock + clock-names: + items: + - const: gpmi_io + - const: gpmi_apb + - const: gpmi_bch + - const: gpmi_bch_apb + - const: per1_bch + + - if: + properties: + compatible: + contains: + const: fsl,imx7d-gpmi-nand + then: + properties: + clocks: + items: + - description: SoC gpmi io clock + - description: SoC gpmi bch apb clock + clock-names: + minItems: 2 + maxItems: 2 + items: + - const: gpmi_io + - const: gpmi_bch_apb + examples: - | nand-controller@8000c000 {