xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/nxp,sja1105.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
15956d97fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/net/dsa/nxp,sja1105.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
78bab661aSEmmanuel Vadottitle: NXP SJA1105 Automotive Ethernet Switch Family
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotdescription:
105956d97fSEmmanuel Vadot  The SJA1105 SPI interface requires a CS-to-CLK time (t2 in UM10944.pdf) of at
115956d97fSEmmanuel Vadot  least one half of t_CLK. At an SPI frequency of 1MHz, this means a minimum
125956d97fSEmmanuel Vadot  cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed
135956d97fSEmmanuel Vadot  depends on the SPI bus master driver.
145956d97fSEmmanuel Vadot
155956d97fSEmmanuel Vadotmaintainers:
165956d97fSEmmanuel Vadot  - Vladimir Oltean <vladimir.oltean@nxp.com>
175956d97fSEmmanuel Vadot
185956d97fSEmmanuel Vadotproperties:
195956d97fSEmmanuel Vadot  compatible:
205956d97fSEmmanuel Vadot    enum:
215956d97fSEmmanuel Vadot      - nxp,sja1105e
225956d97fSEmmanuel Vadot      - nxp,sja1105t
235956d97fSEmmanuel Vadot      - nxp,sja1105p
245956d97fSEmmanuel Vadot      - nxp,sja1105q
255956d97fSEmmanuel Vadot      - nxp,sja1105r
265956d97fSEmmanuel Vadot      - nxp,sja1105s
275956d97fSEmmanuel Vadot      - nxp,sja1110a
285956d97fSEmmanuel Vadot      - nxp,sja1110b
295956d97fSEmmanuel Vadot      - nxp,sja1110c
305956d97fSEmmanuel Vadot      - nxp,sja1110d
315956d97fSEmmanuel Vadot
325956d97fSEmmanuel Vadot  reg:
335956d97fSEmmanuel Vadot    maxItems: 1
345956d97fSEmmanuel Vadot
35f126890aSEmmanuel Vadot  spi-cpha: true
36f126890aSEmmanuel Vadot  spi-cpol: true
37f126890aSEmmanuel Vadot
385956d97fSEmmanuel Vadot  # Optional container node for the 2 internal MDIO buses of the SJA1110
395956d97fSEmmanuel Vadot  # (one for the internal 100base-T1 PHYs and the other for the single
405956d97fSEmmanuel Vadot  # 100base-TX PHY). The "reg" property does not have physical significance.
415956d97fSEmmanuel Vadot  # The PHY addresses to port correspondence is as follows: for 100base-T1,
425956d97fSEmmanuel Vadot  # port 5 has PHY 1, port 6 has PHY 2 etc, while for 100base-TX, port 1 has
435956d97fSEmmanuel Vadot  # PHY 1.
445956d97fSEmmanuel Vadot  mdios:
455956d97fSEmmanuel Vadot    type: object
46*84943d6fSEmmanuel Vadot    additionalProperties: false
475956d97fSEmmanuel Vadot
485956d97fSEmmanuel Vadot    properties:
495956d97fSEmmanuel Vadot      '#address-cells':
505956d97fSEmmanuel Vadot        const: 1
515956d97fSEmmanuel Vadot      '#size-cells':
525956d97fSEmmanuel Vadot        const: 0
535956d97fSEmmanuel Vadot
545956d97fSEmmanuel Vadot    patternProperties:
555956d97fSEmmanuel Vadot      "^mdio@[0-1]$":
56e67e8565SEmmanuel Vadot        $ref: /schemas/net/mdio.yaml#
57e67e8565SEmmanuel Vadot        unevaluatedProperties: false
585956d97fSEmmanuel Vadot
595956d97fSEmmanuel Vadot        properties:
605956d97fSEmmanuel Vadot          compatible:
615956d97fSEmmanuel Vadot            oneOf:
625956d97fSEmmanuel Vadot              - enum:
635956d97fSEmmanuel Vadot                  - nxp,sja1110-base-t1-mdio
645956d97fSEmmanuel Vadot                  - nxp,sja1110-base-tx-mdio
655956d97fSEmmanuel Vadot
665956d97fSEmmanuel Vadot          reg:
675956d97fSEmmanuel Vadot            oneOf:
685956d97fSEmmanuel Vadot              - enum:
695956d97fSEmmanuel Vadot                  - 0
705956d97fSEmmanuel Vadot                  - 1
715956d97fSEmmanuel Vadot
725956d97fSEmmanuel Vadot        required:
735956d97fSEmmanuel Vadot          - compatible
745956d97fSEmmanuel Vadot          - reg
755956d97fSEmmanuel Vadot
768cc087a1SEmmanuel VadotpatternProperties:
778cc087a1SEmmanuel Vadot  "^(ethernet-)?ports$":
78*84943d6fSEmmanuel Vadot    additionalProperties: true
798cc087a1SEmmanuel Vadot    patternProperties:
80*84943d6fSEmmanuel Vadot      "^(ethernet-)?port@[0-9]$":
818cc087a1SEmmanuel Vadot        allOf:
828cc087a1SEmmanuel Vadot          - if:
838cc087a1SEmmanuel Vadot              properties:
848cc087a1SEmmanuel Vadot                phy-mode:
858cc087a1SEmmanuel Vadot                  contains:
868cc087a1SEmmanuel Vadot                    enum:
878cc087a1SEmmanuel Vadot                      - rgmii
888cc087a1SEmmanuel Vadot                      - rgmii-rxid
898cc087a1SEmmanuel Vadot                      - rgmii-txid
908cc087a1SEmmanuel Vadot                      - rgmii-id
918cc087a1SEmmanuel Vadot            then:
928cc087a1SEmmanuel Vadot              properties:
938cc087a1SEmmanuel Vadot                rx-internal-delay-ps:
948cc087a1SEmmanuel Vadot                  $ref: "#/$defs/internal-delay-ps"
958cc087a1SEmmanuel Vadot                tx-internal-delay-ps:
968cc087a1SEmmanuel Vadot                  $ref: "#/$defs/internal-delay-ps"
978cc087a1SEmmanuel Vadot
985956d97fSEmmanuel Vadotrequired:
995956d97fSEmmanuel Vadot  - compatible
1005956d97fSEmmanuel Vadot  - reg
1015956d97fSEmmanuel Vadot
1028cc087a1SEmmanuel Vadot$defs:
1038cc087a1SEmmanuel Vadot  internal-delay-ps:
1048cc087a1SEmmanuel Vadot    description:
1058cc087a1SEmmanuel Vadot      Disable tunable delay lines using 0 ps, or enable them and select
1068cc087a1SEmmanuel Vadot      the phase between 1640 ps (73.8 degree shift at 1Gbps) and 2260 ps
1078cc087a1SEmmanuel Vadot      (101.7 degree shift) in increments of 0.9 degrees (20 ps).
1088cc087a1SEmmanuel Vadot    enum:
1098cc087a1SEmmanuel Vadot      [0, 1640, 1660, 1680, 1700, 1720, 1740, 1760, 1780, 1800, 1820, 1840,
1108cc087a1SEmmanuel Vadot       1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, 2060, 2080,
1118cc087a1SEmmanuel Vadot       2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260]
1128cc087a1SEmmanuel Vadot
113f126890aSEmmanuel VadotallOf:
114f126890aSEmmanuel Vadot  - $ref: dsa.yaml#/$defs/ethernet-ports
115f126890aSEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
116f126890aSEmmanuel Vadot  - if:
117f126890aSEmmanuel Vadot      properties:
118f126890aSEmmanuel Vadot        compatible:
119f126890aSEmmanuel Vadot          enum:
120f126890aSEmmanuel Vadot            - nxp,sja1105e
121f126890aSEmmanuel Vadot            - nxp,sja1105p
122f126890aSEmmanuel Vadot            - nxp,sja1105q
123f126890aSEmmanuel Vadot            - nxp,sja1105r
124f126890aSEmmanuel Vadot            - nxp,sja1105s
125f126890aSEmmanuel Vadot            - nxp,sja1105t
126f126890aSEmmanuel Vadot    then:
127f126890aSEmmanuel Vadot      properties:
128f126890aSEmmanuel Vadot        spi-cpol: false
129f126890aSEmmanuel Vadot      required:
130f126890aSEmmanuel Vadot        - spi-cpha
131f126890aSEmmanuel Vadot    else:
132f126890aSEmmanuel Vadot      properties:
133f126890aSEmmanuel Vadot        spi-cpha: false
134f126890aSEmmanuel Vadot      required:
135f126890aSEmmanuel Vadot        - spi-cpol
136f126890aSEmmanuel Vadot
1375956d97fSEmmanuel VadotunevaluatedProperties: false
1385956d97fSEmmanuel Vadot
1395956d97fSEmmanuel Vadotexamples:
1405956d97fSEmmanuel Vadot  - |
1415956d97fSEmmanuel Vadot    spi {
1425956d97fSEmmanuel Vadot            #address-cells = <1>;
1435956d97fSEmmanuel Vadot            #size-cells = <0>;
1445956d97fSEmmanuel Vadot
1455956d97fSEmmanuel Vadot            ethernet-switch@1 {
1465956d97fSEmmanuel Vadot                    reg = <0x1>;
1475956d97fSEmmanuel Vadot                    compatible = "nxp,sja1105t";
148f126890aSEmmanuel Vadot                    spi-cpha;
1495956d97fSEmmanuel Vadot
1505956d97fSEmmanuel Vadot                    ethernet-ports {
1515956d97fSEmmanuel Vadot                            #address-cells = <1>;
1525956d97fSEmmanuel Vadot                            #size-cells = <0>;
1535956d97fSEmmanuel Vadot
1545956d97fSEmmanuel Vadot                            port@0 {
1555956d97fSEmmanuel Vadot                                    phy-handle = <&rgmii_phy6>;
1565956d97fSEmmanuel Vadot                                    phy-mode = "rgmii-id";
1578cc087a1SEmmanuel Vadot                                    rx-internal-delay-ps = <0>;
1588cc087a1SEmmanuel Vadot                                    tx-internal-delay-ps = <0>;
1595956d97fSEmmanuel Vadot                                    reg = <0>;
1605956d97fSEmmanuel Vadot                            };
1615956d97fSEmmanuel Vadot
1625956d97fSEmmanuel Vadot                            port@1 {
1635956d97fSEmmanuel Vadot                                    phy-handle = <&rgmii_phy3>;
1645956d97fSEmmanuel Vadot                                    phy-mode = "rgmii-id";
1658cc087a1SEmmanuel Vadot                                    rx-internal-delay-ps = <0>;
1668cc087a1SEmmanuel Vadot                                    tx-internal-delay-ps = <0>;
1675956d97fSEmmanuel Vadot                                    reg = <1>;
1685956d97fSEmmanuel Vadot                            };
1695956d97fSEmmanuel Vadot
1705956d97fSEmmanuel Vadot                            port@2 {
1715956d97fSEmmanuel Vadot                                    phy-handle = <&rgmii_phy4>;
1725956d97fSEmmanuel Vadot                                    phy-mode = "rgmii-id";
1738cc087a1SEmmanuel Vadot                                    rx-internal-delay-ps = <0>;
1748cc087a1SEmmanuel Vadot                                    tx-internal-delay-ps = <0>;
1755956d97fSEmmanuel Vadot                                    reg = <2>;
1765956d97fSEmmanuel Vadot                            };
1775956d97fSEmmanuel Vadot
1785956d97fSEmmanuel Vadot                            port@3 {
1798cc087a1SEmmanuel Vadot                                    phy-handle = <&rgmii_phy4>;
1805956d97fSEmmanuel Vadot                                    phy-mode = "rgmii-id";
1818cc087a1SEmmanuel Vadot                                    rx-internal-delay-ps = <0>;
1828cc087a1SEmmanuel Vadot                                    tx-internal-delay-ps = <0>;
1835956d97fSEmmanuel Vadot                                    reg = <3>;
1845956d97fSEmmanuel Vadot                            };
1855956d97fSEmmanuel Vadot
1865956d97fSEmmanuel Vadot                            port@4 {
1875956d97fSEmmanuel Vadot                                    ethernet = <&enet2>;
1885956d97fSEmmanuel Vadot                                    phy-mode = "rgmii";
1898cc087a1SEmmanuel Vadot                                    rx-internal-delay-ps = <0>;
1908cc087a1SEmmanuel Vadot                                    tx-internal-delay-ps = <0>;
1915956d97fSEmmanuel Vadot                                    reg = <4>;
1925956d97fSEmmanuel Vadot
1935956d97fSEmmanuel Vadot                                    fixed-link {
1945956d97fSEmmanuel Vadot                                            speed = <1000>;
1955956d97fSEmmanuel Vadot                                            full-duplex;
1965956d97fSEmmanuel Vadot                                    };
1975956d97fSEmmanuel Vadot                            };
1985956d97fSEmmanuel Vadot                    };
1995956d97fSEmmanuel Vadot            };
2005956d97fSEmmanuel Vadot    };
201