mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2026-01-28 05:53:14 +00:00
In an effort to constrain as much as we can the existing binding, we want to add "unevaluatedProperties: false" in all the NAND chip descriptions part of NAND controller bindings. But in order to do that properly, we also need to reference a file which contains all the "allowed" properties. Right now this file is nand-chip.yaml but in practice raw NAND controllers may use additional properties in their NAND chip children node. These properties are listed under nand-controller.yaml, which makes the "unevaluatedProperties" checks fail while the description are valid. We need to move these NAND chip related properties into another file, because we do not want to pollute nand-chip.yaml which is also referenced by eg. SPI-NAND devices. Let's create a raw-nand-chip.yaml file to reference all the properties a raw NAND chip description can contain. The chain of inheritance becomes: nand-controller.yaml <- raw-nand-chip.yaml raw-nand-chip.yaml <- nand-chip.yaml spi-nand.yaml <- nand-chip.yaml Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/linux-mtd/20230619092916.3028470-3-miquel.raynal@bootlin.com
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
# SPDX-License-Identifier: GPL-2.0
|
|
%YAML 1.2
|
|
---
|
|
$id: http://devicetree.org/schemas/mtd/nand-controller.yaml#
|
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
|
|
|
title: NAND Controller Common Properties
|
|
|
|
maintainers:
|
|
- Miquel Raynal <miquel.raynal@bootlin.com>
|
|
- Richard Weinberger <richard@nod.at>
|
|
|
|
description: |
|
|
The NAND controller should be represented with its own DT node, and
|
|
all NAND chips attached to this controller should be defined as
|
|
children nodes of the NAND controller. This representation should be
|
|
enforced even for simple controllers supporting only one chip.
|
|
|
|
properties:
|
|
$nodename:
|
|
pattern: "^nand-controller(@.*)?"
|
|
|
|
"#address-cells":
|
|
const: 1
|
|
|
|
"#size-cells":
|
|
const: 0
|
|
|
|
ranges: true
|
|
|
|
cs-gpios:
|
|
description:
|
|
Array of chip-select available to the controller. The first
|
|
entries are a 1:1 mapping of the available chip-select on the
|
|
NAND controller (even if they are not used). As many additional
|
|
chip-select as needed may follow and should be phandles of GPIO
|
|
lines. 'reg' entries of the NAND chip subnodes become indexes of
|
|
this array when this property is present.
|
|
minItems: 1
|
|
maxItems: 8
|
|
|
|
patternProperties:
|
|
"^nand@[a-f0-9]$":
|
|
type: object
|
|
$ref: raw-nand-chip.yaml#
|
|
|
|
required:
|
|
- "#address-cells"
|
|
- "#size-cells"
|
|
|
|
# This is a generic file other binding inherit from and extend
|
|
additionalProperties: true
|
|
|
|
examples:
|
|
- |
|
|
nand-controller {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
cs-gpios = <0>, <&gpioA 1>; /* A single native CS is available */
|
|
|
|
/* controller specific properties */
|
|
|
|
nand@0 {
|
|
reg = <0>; /* Native CS */
|
|
/* NAND chip specific properties */
|
|
};
|
|
|
|
nand@1 {
|
|
reg = <1>; /* GPIO CS */
|
|
};
|
|
};
|