[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221209101443.77fbbe49@xps-13>
Date: Fri, 9 Dec 2022 10:14:43 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Xiangsheng Hou <xiangsheng.hou@...iatek.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Mark Brown <broonie@...nel.org>,
Chuanhong Guo <gch981213@...il.com>,
linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-spi@...r.kernel.org, benliang.zhao@...iatek.com,
bin.zhang@...iatek.com
Subject: Re: [PATCH v3 7/9] dt-bindings: mtd: Split ECC engine with rawnand
controller
Hi Krzysztof,
krzysztof.kozlowski@...aro.org wrote on Thu, 8 Dec 2022 11:27:27 +0100:
> On 08/12/2022 11:00, Miquel Raynal wrote:
> > Hi Krzysztof,
> >
> > krzysztof.kozlowski@...aro.org wrote on Thu, 8 Dec 2022 10:44:17 +0100:
> >
> >> On 08/12/2022 07:29, Xiangsheng Hou wrote:
> >>> Split MediaTek ECC engine with rawnand controller and convert to
> >>> YAML schema.
> >>>
> >>> Signed-off-by: Xiangsheng Hou <xiangsheng.hou@...iatek.com>
> >>> ---
> >>> .../bindings/mtd/mediatek,mtk-nfc.yaml | 154 +++++++++++++++
> >>> .../mtd/mediatek,nand-ecc-engine.yaml | 62 ++++++
> >>> .../devicetree/bindings/mtd/mtk-nand.txt | 176 ------------------
> >>> 3 files changed, 216 insertions(+), 176 deletions(-)
> >>> create mode 100644 Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
> >>> create mode 100644 Documentation/devicetree/bindings/mtd/mediatek,nand-ecc-engine.yaml
> >>> delete mode 100644 Documentation/devicetree/bindings/mtd/mtk-nand.txt
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml b/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
> >>> new file mode 100644
> >>> index 000000000000..eb1a44c7ae4e
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/mtd/mediatek,mtk-nfc.yaml
> >>> @@ -0,0 +1,154 @@
> >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >>> +%YAML 1.2
> >>> +---
> >>> +$id: http://devicetree.org/schemas/mtd/mediatek,mtk-nfc.yaml#
> >>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >>> +
> >>> +title: MediaTek(MTK) SoCs raw NAND FLASH controller (NFC)
> >>> +
> >>> +maintainers:
> >>> + - Xiangsheng Hou <xiangsheng.hou@...iatek.com>
> >>> +
> >>> +properties:
> >>> + compatible:
> >>> + enum:
> >>> + - mediatek,mt2701-nfc
> >>> + - mediatek,mt2712-nfc
> >>> + - mediatek,mt7622-nfc
> >>> +
> >>> + reg:
> >>> + items:
> >>> + - description: Base physical address and size of NFI.
> >>> +
> >>> + interrupts:
> >>> + items:
> >>> + - description: NFI interrupt
> >>> +
> >>> + clocks:
> >>> + items:
> >>> + - description: clock used for the controller
> >>> + - description: clock used for the pad
> >>> +
> >>> + clock-names:
> >>> + items:
> >>> + - const: nfi_clk
> >>> + - const: pad_clk
> >>> +
> >>> + ecc-engine:
> >>> + description: device-tree node of the required ECC engine.
> >>> + $ref: /schemas/types.yaml#/definitions/phandle
> >>> +
> >>> +patternProperties:
> >>> + "^nand@[a-f0-9]$":
> >>> + type: object
> >>
> >> This should be instead:
> >> $ref: nand-chip.yaml#
> >> unevaluatedProperties: false
> >>
> >> and then properties below (due to current dtschema limitations) should
> >> list properties from nand-controller.yaml:
> >>
> >> nand-on-flash-bbt: true
> >>
> >> Optionally, we could create additional schema - nand-controller-chip,
> >> which would be referenced directly by nand-controller and itself would
> >> ref nand-chip.
> >
> > Isn't this enough? (in linux-next)
> > https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/tree/Documentation/devicetree/bindings/mtd/nand-controller.yaml?h=mtd/next#n54
>
> No, I tested it and it does not work as intended. In this particular
> case. I think this is a limitation of dtschema, because binding itself
> looks fine. The problem is that you have:
> 1. mtk-nfc having nand@ children. mtk-nfc references nand-controller
> which brings these children.
> 2. However nand-controller while bringing these children does two things:
> a. ref: nand-chip
> b. add more propeties
>
> 3. The mtk-nfc must further extend the nand@ child.
> 4. If you add "unevaluatedProperties: false" you notice warnings of
> unevaluated propertie from nand-controller children.
Thanks for the details. Any chances this can eventually be fixed at
dt-schema level?
Thanks,
Miquèl
Powered by blists - more mailing lists