xref: /freebsd/sys/contrib/device-tree/Bindings/net/qca,qca7000.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/net/qca,qca7000.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: Qualcomm QCA7000
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotmaintainers:
10*833e5d42SEmmanuel Vadot  - Frank Li <Frank.Li@nxp.com>
11*833e5d42SEmmanuel Vadot
12*833e5d42SEmmanuel Vadotdescription: |
13*833e5d42SEmmanuel Vadot  The QCA7000 is a serial-to-powerline bridge with a host interface which could
14*833e5d42SEmmanuel Vadot  be configured either as SPI or UART slave. This configuration is done by
15*833e5d42SEmmanuel Vadot  the QCA7000 firmware.
16*833e5d42SEmmanuel Vadot
17*833e5d42SEmmanuel Vadot  (a) Ethernet over SPI
18*833e5d42SEmmanuel Vadot
19*833e5d42SEmmanuel Vadot  In order to use the QCA7000 as SPI device it must be defined as a child of a
20*833e5d42SEmmanuel Vadot  SPI master in the device tree.
21*833e5d42SEmmanuel Vadot
22*833e5d42SEmmanuel Vadot  (b) Ethernet over UART
23*833e5d42SEmmanuel Vadot
24*833e5d42SEmmanuel Vadot  In order to use the QCA7000 as UART slave it must be defined as a child of a
25*833e5d42SEmmanuel Vadot  UART master in the device tree. It is possible to preconfigure the UART
26*833e5d42SEmmanuel Vadot  settings of the QCA7000 firmware, but it's not possible to change them during
27*833e5d42SEmmanuel Vadot  runtime
28*833e5d42SEmmanuel Vadot
29*833e5d42SEmmanuel Vadotproperties:
30*833e5d42SEmmanuel Vadot  compatible:
31*833e5d42SEmmanuel Vadot    const: qca,qca7000
32*833e5d42SEmmanuel Vadot
33*833e5d42SEmmanuel Vadot  reg:
34*833e5d42SEmmanuel Vadot    maxItems: 1
35*833e5d42SEmmanuel Vadot
36*833e5d42SEmmanuel Vadot  interrupts:
37*833e5d42SEmmanuel Vadot    maxItems: 1
38*833e5d42SEmmanuel Vadot
39*833e5d42SEmmanuel Vadot  qca,legacy-mode:
40*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
41*833e5d42SEmmanuel Vadot    description:
42*833e5d42SEmmanuel Vadot      Set the SPI data transfer of the QCA7000 to legacy mode.
43*833e5d42SEmmanuel Vadot      In this mode the SPI master must toggle the chip select
44*833e5d42SEmmanuel Vadot      between each data word. In burst mode these gaps aren't
45*833e5d42SEmmanuel Vadot      necessary, which is faster. This setting depends on how
46*833e5d42SEmmanuel Vadot      the QCA7000 is setup via GPIO pin strapping. If the
47*833e5d42SEmmanuel Vadot      property is missing the driver defaults to burst mode.
48*833e5d42SEmmanuel Vadot
49*833e5d42SEmmanuel VadotallOf:
50*833e5d42SEmmanuel Vadot  - $ref: ethernet-controller.yaml#
51*833e5d42SEmmanuel Vadot
52*833e5d42SEmmanuel Vadot  - if:
53*833e5d42SEmmanuel Vadot      required:
54*833e5d42SEmmanuel Vadot        - reg
55*833e5d42SEmmanuel Vadot
56*833e5d42SEmmanuel Vadot    then:
57*833e5d42SEmmanuel Vadot      properties:
58*833e5d42SEmmanuel Vadot        spi-cpha: true
59*833e5d42SEmmanuel Vadot
60*833e5d42SEmmanuel Vadot        spi-cpol: true
61*833e5d42SEmmanuel Vadot
62*833e5d42SEmmanuel Vadot        spi-max-frequency:
63*833e5d42SEmmanuel Vadot          default: 8000000
64*833e5d42SEmmanuel Vadot          maximum: 16000000
65*833e5d42SEmmanuel Vadot          minimum: 1000000
66*833e5d42SEmmanuel Vadot
67*833e5d42SEmmanuel Vadot      allOf:
68*833e5d42SEmmanuel Vadot        - $ref: /schemas/spi/spi-peripheral-props.yaml#
69*833e5d42SEmmanuel Vadot
70*833e5d42SEmmanuel Vadot    else:
71*833e5d42SEmmanuel Vadot      properties:
72*833e5d42SEmmanuel Vadot        current-speed:
73*833e5d42SEmmanuel Vadot          default: 115200
74*833e5d42SEmmanuel Vadot
75*833e5d42SEmmanuel Vadot        qca,legacy-mode: false
76*833e5d42SEmmanuel Vadot
77*833e5d42SEmmanuel Vadot      allOf:
78*833e5d42SEmmanuel Vadot        - $ref: /schemas/serial/serial-peripheral-props.yaml#
79*833e5d42SEmmanuel Vadot
80*833e5d42SEmmanuel VadotunevaluatedProperties: false
81*833e5d42SEmmanuel Vadot
82*833e5d42SEmmanuel Vadotexamples:
83*833e5d42SEmmanuel Vadot  - |
84*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
85*833e5d42SEmmanuel Vadot
86*833e5d42SEmmanuel Vadot    spi {
87*833e5d42SEmmanuel Vadot        #address-cells = <1>;
88*833e5d42SEmmanuel Vadot        #size-cells = <0>;
89*833e5d42SEmmanuel Vadot
90*833e5d42SEmmanuel Vadot        ethernet@0 {
91*833e5d42SEmmanuel Vadot            compatible = "qca,qca7000";
92*833e5d42SEmmanuel Vadot            reg = <0x0>;
93*833e5d42SEmmanuel Vadot            interrupt-parent = <&gpio3>;
94*833e5d42SEmmanuel Vadot            interrupts = <25 IRQ_TYPE_EDGE_RISING>;
95*833e5d42SEmmanuel Vadot            spi-cpha;
96*833e5d42SEmmanuel Vadot            spi-cpol;
97*833e5d42SEmmanuel Vadot            spi-max-frequency = <8000000>;
98*833e5d42SEmmanuel Vadot            local-mac-address = [ a0 b0 c0 d0 e0 f0 ];
99*833e5d42SEmmanuel Vadot        };
100*833e5d42SEmmanuel Vadot    };
101*833e5d42SEmmanuel Vadot
102*833e5d42SEmmanuel Vadot  - |
103*833e5d42SEmmanuel Vadot    serial {
104*833e5d42SEmmanuel Vadot        ethernet {
105*833e5d42SEmmanuel Vadot            compatible = "qca,qca7000";
106*833e5d42SEmmanuel Vadot            local-mac-address = [ a0 b0 c0 d0 e0 f0 ];
107*833e5d42SEmmanuel Vadot            current-speed = <38400>;
108*833e5d42SEmmanuel Vadot        };
109*833e5d42SEmmanuel Vadot    };
110