From patchwork Fri Aug 28 16:47:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 253237 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=-14.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_PASS,USER_AGENT_GIT autolearn=ham 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 D8032C433E7 for ; Fri, 28 Aug 2020 16:49:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9AF020C56 for ; Fri, 28 Aug 2020 16:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598633351; bh=98AU22xTYMCZ0QAZTXK9ChSrXEOj0TuIT22qgKEeDKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AycyaTfOvWLd5IGwwLyqFAdiUoRcdaNl4Zrk8r3C9MvFHzGQIQ8fxde5JQi4ZdRy0 G74nQrc6caj/jNQdXM7f1Mh7u3/61Snzgtl1ZvlcOuxEE4TIFrqt2FePLkfUZ7BYzi i/NL6eEU9s+wPvvHa56T7FL9cFFoJm0KiLIyvQkE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbgH1QtL (ORCPT ); Fri, 28 Aug 2020 12:49:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgH1QtJ (ORCPT ); Fri, 28 Aug 2020 12:49:09 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.216]) (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 D92822098B; Fri, 28 Aug 2020 16:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598633348; bh=98AU22xTYMCZ0QAZTXK9ChSrXEOj0TuIT22qgKEeDKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r+/vJbN6iXqQNVME/w5zvRS3yUo/9L0rC5pX/zWzknm/6fbP93h1bn3NqmTmIgEWz csYos3Uuk3GSUnVkCTg3eK9GOC7QHsuoqHOpkujRz6MrDCcLJvgVhgnlM8efHskEv8 XiZQr6wP7rk99B3/FaAZCoV9M9IkivQM9lh+HCI0= From: Krzysztof Kozlowski To: Lee Jones , Rob Herring , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Anson Huang , Matti Vaittinen , Han Xu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org Cc: Krzysztof Kozlowski Subject: [PATCH v2 02/19] dt-bindings: mtd: gpmi-nand: Fix matching of clocks on different SoCs Date: Fri, 28 Aug 2020 18:47:33 +0200 Message-Id: <20200828164750.10377-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200828164750.10377-1-krzk@kernel.org> References: <20200828164750.10377-1-krzk@kernel.org> Sender: devicetree-owner@vger.kernel.org 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 --- 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..e08e0a50929e 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: + - pattern: "^(gpmi_(io|apb|bch|bch_apb)|per1_bch)$" + - pattern: "^(gpmi_(io|apb|bch|bch_apb)|per1_bch)$" + - pattern: "^(gpmi_(io|apb|bch|bch_apb)|per1_bch)$" + - pattern: "^(gpmi_(io|apb|bch|bch_apb)|per1_bch)$" + - pattern: "^(gpmi_(io|apb|bch|bch_apb)|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: + - pattern: "^gpmi_(io|bch_apb)$" + - pattern: "^gpmi_(io|bch_apb)$" + examples: - | nand-controller@8000c000 {