- Add Krzysztof Kozlowski as co-maintainer for DT bindings providing much needed help. - DT schema validation now takes DTB files as input rather than intermediate YAML files. This decouples the validation from the source level syntax information. There's a bunch of schema fixes as a result of switching to DTB based validation which exposed some errors and incomplete schemas and examples. - Kbuild improvements to explicitly warn users running 'make dt_binding_check' on missing yamllint - Expand DT_SCHEMA_FILES kbuild variable to take just a partial filename or path instead of the full path to 1 file. - Convert various bindings to schema format: mscc,vsc7514-switch, multiple GNSS bindings, ahci-platform, i2c-at91, multiple UFS bindings, cortina,gemini-sata-bridge, cortina,gemini-ethernet, Atmel SHA, Atmel TDES, Atmel AES, armv7m-systick, Samsung Exynos display subsystem, nuvoton,npcm7xx-timer, samsung,s3c2410-i2c, zynqmp_dma, msm/mdp4, rda,8810pl-uart - New schemas for u-boot environment variable partition, TI clksel - New compatible strings for Renesas RZ/V2L SoC - Vendor prefixes for Xen, HPE, deprecated Synopsys, deprecated HiSilicon - Add/fix schemas for QEMU Arm 'virt' machine - Drop unused of_alias_get_alias_list() function - Add a script to check DT unittest EXPECT message output. Pass messages also now print by default at PR_INFO level to help test automation. -----BEGIN PGP SIGNATURE----- iQJEBAABCgAuFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmI8s64QHHJvYmhAa2Vy bmVsLm9yZwAKCRD6+121jbxhwx3tD/4j56NE+aLkL636+I8tGFm3r+r6uLLT4SWh zDuiX3MP9OKfhJw43TjjURLwX5adBnG3nn505IXcAeiMRgEiciOpSa12w0mXyjMX QgVOcoaI3H2GBMEddJRo1PLTM/K5sYzZxAKLB827xoOk4mGNA0ZBAHvlB3W+yLE5 CE5yTaFoL4EMXuhWMtMrMlG1PQrbO3FpQ2DHBKrpxHPJmnHLk3c0YtMSTHGQnWbN AxT3S6RSsOLwLzZAXi2AlswqY82n5KtUf/RBrYi8rdr/xnIsCfMeXxafkP2Hyxkq L9RfKVn05c0LRtO1Eh8kYr+lmYmcWz/SIdJZXzpviIgE9MJapCAk0blBZ4S/FH0B EVGB1JkwCZFck6DBmkNJxAwR0iQOGWkJIkn6iBPNF0dHp58eE6adaXjhFH3uBEHk dXFaxPlvZ3P/Q2I/vmQ//m5tZMyjeCY2BlVYpkUJMOFfN26MIGHUmUlLnovLDqu4 lYgZG4V244uYzALLbURpbp+5dlPH/PL2gxvJJNqTS+/hXktQx1XnML4wD+xfJ4nT OY5DD7Z+KGBrdsMtxkFtIFvKD63E2gtAR5RZO0J/txlzhW7Wg6fJbhJZeRFhZKmN GAfud2s6rliyygByBL4ea50DSLLQpc/9HZtFmZ3NTILM6NbUR74sHt+1EZ1hee+M LaNsSscHuQ== =g1li -----END PGP SIGNATURE----- Merge tag 'devicetree-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: - Add Krzysztof Kozlowski as co-maintainer for DT bindings providing much needed help. - DT schema validation now takes DTB files as input rather than intermediate YAML files. This decouples the validation from the source level syntax information. There's a bunch of schema fixes as a result of switching to DTB based validation which exposed some errors and incomplete schemas and examples. - Kbuild improvements to explicitly warn users running 'make dt_binding_check' on missing yamllint - Expand DT_SCHEMA_FILES kbuild variable to take just a partial filename or path instead of the full path to 1 file. - Convert various bindings to schema format: mscc,vsc7514-switch, multiple GNSS bindings, ahci-platform, i2c-at91, multiple UFS bindings, cortina,gemini-sata-bridge, cortina,gemini-ethernet, Atmel SHA, Atmel TDES, Atmel AES, armv7m-systick, Samsung Exynos display subsystem, nuvoton,npcm7xx-timer, samsung,s3c2410-i2c, zynqmp_dma, msm/mdp4, rda,8810pl-uart - New schemas for u-boot environment variable partition, TI clksel - New compatible strings for Renesas RZ/V2L SoC - Vendor prefixes for Xen, HPE, deprecated Synopsys, deprecated HiSilicon - Add/fix schemas for QEMU Arm 'virt' machine - Drop unused of_alias_get_alias_list() function - Add a script to check DT unittest EXPECT message output. Pass messages also now print by default at PR_INFO level to help test automation. * tag 'devicetree-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (96 commits) dt-bindings: kbuild: Make DT_SCHEMA_LINT a recursive variable dt-bindings: nvmem: add U-Boot environment variables binding dt-bindings: ufs: qcom: Add SM6350 compatible string dt-bindings: dmaengine: sifive,fu540-c000: include generic schema dt-bindings: gpio: pca95xx: drop useless consumer example Revert "of: base: Introduce of_alias_get_alias_list() to check alias IDs" dt-bindings: virtio,mmio: Allow setting devices 'dma-coherent' dt-bindings: gnss: Add two more chips dt-bindings: gnss: Rewrite sirfstar binding in YAML dt-bindings: gnss: Modify u-blox to use common bindings dt-bindings: gnss: Rewrite common bindings in YAML dt-bindings: ata: ahci-platform: Add rk3568-dwc-ahci compatible dt-bindings: ata: ahci-platform: Add power-domains property dt-bindings: ata: ahci-platform: Convert DT bindings to yaml dt-bindings: kbuild: Use DTB files for validation dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate dt-bindings: Add QEMU virt machine compatible dt-bindings: arm: Convert QEMU fw-cfg to DT schema dt-bindings: i2c: at91: Add SAMA7G5 compatible strings list dt-bindings: i2c: convert i2c-at91 to json-schema ...
147 lines
3.9 KiB
YAML
147 lines
3.9 KiB
YAML
# SPDX-License-Identifier: GPL-2.0
|
|
%YAML 1.2
|
|
---
|
|
$id: http://devicetree.org/schemas/spi/spi-controller.yaml#
|
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
|
|
|
title: SPI Controller Generic Binding
|
|
|
|
maintainers:
|
|
- Mark Brown <broonie@kernel.org>
|
|
|
|
description: |
|
|
SPI busses can be described with a node for the SPI controller device
|
|
and a set of child nodes for each SPI slave on the bus. The system SPI
|
|
controller may be described for use in SPI master mode or in SPI slave mode,
|
|
but not for both at the same time.
|
|
|
|
properties:
|
|
$nodename:
|
|
pattern: "^spi(@.*|-[0-9a-f])*$"
|
|
|
|
"#address-cells":
|
|
enum: [0, 1]
|
|
|
|
"#size-cells":
|
|
const: 0
|
|
|
|
cs-gpios:
|
|
description: |
|
|
GPIOs used as chip selects.
|
|
If that property is used, the number of chip selects will be
|
|
increased automatically with max(cs-gpios, hardware chip selects).
|
|
|
|
So if, for example, the controller has 4 CS lines, and the
|
|
cs-gpios looks like this
|
|
cs-gpios = <&gpio1 0 0>, <0>, <&gpio1 1 0>, <&gpio1 2 0>;
|
|
|
|
Then it should be configured so that num_chipselect = 4, with
|
|
the following mapping
|
|
cs0 : &gpio1 0 0
|
|
cs1 : native
|
|
cs2 : &gpio1 1 0
|
|
cs3 : &gpio1 2 0
|
|
|
|
The second flag of a gpio descriptor can be GPIO_ACTIVE_HIGH (0)
|
|
or GPIO_ACTIVE_LOW(1). Legacy device trees often use 0.
|
|
|
|
There is a special rule set for combining the second flag of an
|
|
cs-gpio with the optional spi-cs-high flag for SPI slaves.
|
|
|
|
Each table entry defines how the CS pin is to be physically
|
|
driven (not considering potential gpio inversions by pinmux):
|
|
|
|
device node | cs-gpio | CS pin state active | Note
|
|
================+===============+=====================+=====
|
|
spi-cs-high | - | H |
|
|
- | - | L |
|
|
spi-cs-high | ACTIVE_HIGH | H |
|
|
- | ACTIVE_HIGH | L | 1
|
|
spi-cs-high | ACTIVE_LOW | H | 2
|
|
- | ACTIVE_LOW | L |
|
|
|
|
Notes:
|
|
1) Should print a warning about polarity inversion.
|
|
Here it would be wise to avoid and define the gpio as
|
|
ACTIVE_LOW.
|
|
2) Should print a warning about polarity inversion
|
|
because ACTIVE_LOW is overridden by spi-cs-high.
|
|
Should be generally avoided and be replaced by
|
|
spi-cs-high + ACTIVE_HIGH.
|
|
|
|
num-cs:
|
|
$ref: /schemas/types.yaml#/definitions/uint32
|
|
description:
|
|
Total number of chip selects.
|
|
|
|
spi-slave:
|
|
$ref: /schemas/types.yaml#/definitions/flag
|
|
description:
|
|
The SPI controller acts as a slave, instead of a master.
|
|
|
|
slave:
|
|
type: object
|
|
|
|
properties:
|
|
compatible:
|
|
description:
|
|
Compatible of the SPI device.
|
|
|
|
required:
|
|
- compatible
|
|
|
|
patternProperties:
|
|
"^.*@[0-9a-f]+$":
|
|
type: object
|
|
$ref: spi-peripheral-props.yaml
|
|
|
|
required:
|
|
- compatible
|
|
- reg
|
|
|
|
allOf:
|
|
- if:
|
|
not:
|
|
required:
|
|
- spi-slave
|
|
then:
|
|
properties:
|
|
"#address-cells":
|
|
const: 1
|
|
else:
|
|
properties:
|
|
"#address-cells":
|
|
const: 0
|
|
|
|
additionalProperties: true
|
|
|
|
examples:
|
|
- |
|
|
spi@80010000 {
|
|
#address-cells = <1>;
|
|
#size-cells = <0>;
|
|
compatible = "fsl,imx28-spi";
|
|
reg = <0x80010000 0x2000>;
|
|
interrupts = <96>;
|
|
dmas = <&dma_apbh 0>;
|
|
dma-names = "rx-tx";
|
|
|
|
display@0 {
|
|
compatible = "lg,lg4573";
|
|
spi-max-frequency = <1000000>;
|
|
reg = <0>;
|
|
};
|
|
|
|
sensor@1 {
|
|
compatible = "bosch,bme680";
|
|
spi-max-frequency = <100000>;
|
|
reg = <1>;
|
|
};
|
|
|
|
flash@2 {
|
|
compatible = "jedec,spi-nor";
|
|
spi-max-frequency = <50000000>;
|
|
reg = <2>, <3>;
|
|
stacked-memories = /bits/ 64 <0x10000000 0x10000000>;
|
|
};
|
|
};
|