Skip to content

Commit

Permalink
dt-bindings: net: nxp,sja1105: document spi-cpol/cpha
Browse files Browse the repository at this point in the history
Some boards use SJA1105 Ethernet Switch with SPI CPHA, while ones with
SJA1110 use SPI CPOL, so document this to fix dtbs_check warnings:

  arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dtb: ethernet-switch@0: Unevaluated properties are not allowed ('spi-cpol' was unexpected)

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Krzysztof Kozlowski authored and David S. Miller committed May 17, 2023
1 parent 96ba44c commit af2eab1
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ description:
cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed
depends on the SPI bus master driver.

allOf:
- $ref: dsa.yaml#/$defs/ethernet-ports
- $ref: /schemas/spi/spi-peripheral-props.yaml#

maintainers:
- Vladimir Oltean <vladimir.oltean@nxp.com>

Expand All @@ -36,6 +32,9 @@ properties:
reg:
maxItems: 1

spi-cpha: true
spi-cpol: true

# Optional container node for the 2 internal MDIO buses of the SJA1110
# (one for the internal 100base-T1 PHYs and the other for the single
# 100base-TX PHY). The "reg" property does not have physical significance.
Expand Down Expand Up @@ -109,6 +108,30 @@ $defs:
1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, 2060, 2080,
2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260]

allOf:
- $ref: dsa.yaml#/$defs/ethernet-ports
- $ref: /schemas/spi/spi-peripheral-props.yaml#
- if:
properties:
compatible:
enum:
- nxp,sja1105e
- nxp,sja1105p
- nxp,sja1105q
- nxp,sja1105r
- nxp,sja1105s
- nxp,sja1105t
then:
properties:
spi-cpol: false
required:
- spi-cpha
else:
properties:
spi-cpha: false
required:
- spi-cpol

unevaluatedProperties: false

examples:
Expand All @@ -120,6 +143,7 @@ examples:
ethernet-switch@1 {
reg = <0x1>;
compatible = "nxp,sja1105t";
spi-cpha;
ethernet-ports {
#address-cells = <1>;
Expand Down

0 comments on commit af2eab1

Please sign in to comment.