From mboxrd@z Thu Jan 1 00:00:00 1970 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 D2E69EB64DB for ; Thu, 15 Jun 2023 07:45:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238023AbjFOHp0 (ORCPT ); Thu, 15 Jun 2023 03:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238246AbjFOHpZ (ORCPT ); Thu, 15 Jun 2023 03:45:25 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C3CE107 for ; Thu, 15 Jun 2023 00:45:24 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-51a2de3385fso73262a12.0 for ; Thu, 15 Jun 2023 00:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686815122; x=1689407122; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GShQN3aNeb/7szyOAsiAwnXDqLh1QR1gf41/K50luCM=; b=SqSio0bSvHU9qKGsCc/ZYZRiw60stlxeWgphdgk06A11rBVv/rM5MDeiRuYtth2CV3 m2a01lcAf6P8y0X+eQ9pnNAjL8YtpHW3piO4T9dVixCuWuhO24pRvQIFtB7iJAHKwV7T d2gigFLi0nqg/m7CQ8hgquYF6FlsdEn37vButF3jwbnQE7Y2vW+MDmIazSdSKft1/kh6 nS5j/9YiimTsBX3hfgyy9rD0K8aJEjg6+BAzqqZpUo3KAaUMjaPPnrluLuhDgf/IoJaq DKY/fjwdv4lwvDdyRpCyUzlDys3OtUb/vRpuFfOLy7VxxZ07V95BOTsprxts/RQcE1lD rsqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686815122; x=1689407122; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GShQN3aNeb/7szyOAsiAwnXDqLh1QR1gf41/K50luCM=; b=cnQQ44fJA+xGqu6t2Ili/FzjgBJmzC1QoXEWFqfBBa+8WhI/q0FShzdQwgKTy/aBPl b8BRGG4sykH84aid1Y6vTf5y4yQ5UxH2jm8dFP8ejuuTC1eL5iHOBpkkgwovjKhAxPT1 xKVRvrCR13YkU3uzuN+qj413pKdTB/Jj+VVvp6kstrHx48A0pgMqGk0rPhNz3Mu+02+1 GqRyBtVRFvESDKi0SnKkrMx1DAH5GqHM8eVa8JxXA2G0Xj95JhX8EIVYxARabABh6dkq GxZrhKVewkmujtiWZZYddEgxp9Tz0P/tk660QgS0sB/KJl9q3Dwqq3a++FRwiOMb007S yFZA== X-Gm-Message-State: AC+VfDxMIHroC5ZtDnxpzeLipOE6ZZ+o3bDgIV9x8JY5akSi3qZd76IX N2/0NXmOA2ZAbpWZA7R7VYjt0w== X-Google-Smtp-Source: ACHHUZ4pJSvwAenolK+mWB2JCajqR5hFQLSmeiE6Bf/3XMsDiYfnIdxnsdy4W2q12qVAnyu1p3SRDw== X-Received: by 2002:a17:906:7308:b0:968:1e8:a754 with SMTP id di8-20020a170906730800b0096801e8a754mr18444931ejc.72.1686815122438; Thu, 15 Jun 2023 00:45:22 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id bi9-20020a170906a24900b009745417ca38sm8967577ejb.21.2023.06.15.00.45.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jun 2023 00:45:22 -0700 (PDT) Message-ID: Date: Thu, 15 Jun 2023 09:45:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v9 3/3] dt-bindings: mtd: marvell-nand: Convert to YAML DT scheme Content-Language: en-US To: Chris Packham , miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vadym Kochan References: <20230615040447.3484564-1-chris.packham@alliedtelesis.co.nz> <20230615040447.3484564-4-chris.packham@alliedtelesis.co.nz> From: Krzysztof Kozlowski In-Reply-To: <20230615040447.3484564-4-chris.packham@alliedtelesis.co.nz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 15/06/2023 06:04, Chris Packham wrote: > From: Vadym Kochan > > Switch the DT binding to a YAML schema to enable the DT validation. > > The text binding didn't mention it as a requirement but existing usage > has > > compatible = "marvell,armada-8k-nand-controller", > "marvell,armada370-nand-controller"; > > so the YAML allows this in addition to the individual compatible values. > > There was also an incorrect reference to dma-names being "rxtx" where > the driver and existing device trees actually use dma-names = "data" so > this is corrected in the conversion. > > Signed-off-by: Vadym Kochan > Signed-off-by: Chris Packham > --- > > Notes: > Changes in v9: > - depend on series from Miquel > https://lore.kernel.org/linux-mtd/20230606175246.190465-1-miquel.raynal@bootlin.com/ > - enforce minimum/maximum for nand-rb > - move required: block for controller > - move unevaluatedProperties: for nand chip > - remove label, partitions and nand-on-flash-bbt which are covered by > generic schema > > Changes in v8: > - Mark deprecated compatible values as such > - Allow "marvell,armada-8k-nand-controller" without > "marvell,armada370-nand-controller" ??? > + > +properties: > + compatible: > + oneOf: > + - items: > + - const: marvell,armada-8k-nand-controller > + - const: marvell,armada370-nand-controller > + - enum: > + - marvell,armada-8k-nand-controller This is wrong. 8k cannot be both: compatible and not compatible with 370. It's not someone's cat to be in both states at the same time... > + - marvell,armada370-nand-controller > + - marvell,pxa3xx-nand-controller > + - description: legacy bindings > + deprecated: true > + enum: > + - marvell,armada-8k-nand > + - marvell,armada370-nand > + - marvell,pxa3xx-nand > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + clocks: > + description: > + Shall reference the NAND controller clocks, the second one is > + is only needed for the Armada 7K/8K SoCs > + minItems: 1 > + maxItems: 2 > + > + clock-names: > + minItems: 1 > + items: > + - const: core > + - const: reg > + > + dmas: > + maxItems: 1 > + > + dma-names: > + items: > + - const: data > + > + marvell,system-controller: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: Syscon node that handles NAND controller related registers > + > +patternProperties: > + "^nand@[a-f0-9]$": > + type: object > + $ref: raw-nand-chip.yaml > + > + properties: > + reg: > + minimum: 0 > + maximum: 3 > + > + nand-rb: > + items: > + - minimum: 0 > + maximum: 1 > + > + nand-ecc-step-size: > + const: 512 > + > + nand-ecc-strength: > + enum: [1, 4, 8, 12, 16] > + > + nand-ecc-mode: > + const: hw > + > + marvell,nand-keep-config: > + $ref: /schemas/types.yaml#/definitions/flag > + description: | Do not need '|' unless you need to preserve formatting. > + Orders the driver not to take the timings from the core and > + leaving them completely untouched. Bootloader timings will then > + be used. > + > + marvell,nand-enable-arbiter: > + $ref: /schemas/types.yaml#/definitions/flag > + description: | Do not need '|' unless you need to preserve formatting. > + To enable the arbiter, all boards blindly used it, > + this bit was set by the bootloader for many boards and even if > + it is marked reserved in several datasheets, it might be needed to set > + it (otherwise it is harmless). > + deprecated: true > + > + required: > + - reg > + - nand-rb > + > + unevaluatedProperties: false > + > +required: > + - compatible > + - reg > + - interrupts > + - clocks > + > +allOf: > + - $ref: nand-controller.yaml# > + > + - if: > + properties: > + compatible: > + contains: > + const: marvell,pxa3xx-nand-controller > + then: > + required: > + - dmas > + - dma-names > + > + - if: > + properties: > + compatible: > + contains: > + const: marvell,armada-8k-nand-controller > + then: > + properties: > + clocks: > + minItems: 2 > + > + clock-names: > + minItems: 2 > + > + required: > + - marvell,system-controller else: narrow clocks to 1? Or is the second clod also valid for other variants? Does not look like from your example. Best regards, Krzysztof