xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/net/qca,qca7000.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun* Qualcomm QCA7000
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThe QCA7000 is a serial-to-powerline bridge with a host interface which could
4*4882a593Smuzhiyunbe configured either as SPI or UART slave. This configuration is done by
5*4882a593Smuzhiyunthe QCA7000 firmware.
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun(a) Ethernet over SPI
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunIn order to use the QCA7000 as SPI device it must be defined as a child of a
10*4882a593SmuzhiyunSPI master in the device tree.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunRequired properties:
13*4882a593Smuzhiyun- compatible	    : Should be "qca,qca7000"
14*4882a593Smuzhiyun- reg		    : Should specify the SPI chip select
15*4882a593Smuzhiyun- interrupts	    : The first cell should specify the index of the source
16*4882a593Smuzhiyun		      interrupt and the second cell should specify the trigger
17*4882a593Smuzhiyun		      type as rising edge
18*4882a593Smuzhiyun- spi-cpha	    : Must be set
19*4882a593Smuzhiyun- spi-cpol	    : Must be set
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunOptional properties:
22*4882a593Smuzhiyun- spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at.
23*4882a593Smuzhiyun		      Numbers smaller than 1000000 or greater than 16000000
24*4882a593Smuzhiyun		      are invalid. Missing the property will set the SPI
25*4882a593Smuzhiyun		      frequency to 8000000 Hertz.
26*4882a593Smuzhiyun- qca,legacy-mode   : Set the SPI data transfer of the QCA7000 to legacy mode.
27*4882a593Smuzhiyun		      In this mode the SPI master must toggle the chip select
28*4882a593Smuzhiyun		      between each data word. In burst mode these gaps aren't
29*4882a593Smuzhiyun		      necessary, which is faster. This setting depends on how
30*4882a593Smuzhiyun		      the QCA7000 is setup via GPIO pin strapping. If the
31*4882a593Smuzhiyun		      property is missing the driver defaults to burst mode.
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunThe MAC address will be determined using the optional properties
34*4882a593Smuzhiyundefined in ethernet.txt.
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunSPI Example:
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun/* Freescale i.MX28 SPI master*/
39*4882a593Smuzhiyunssp2: spi@80014000 {
40*4882a593Smuzhiyun	#address-cells = <1>;
41*4882a593Smuzhiyun	#size-cells = <0>;
42*4882a593Smuzhiyun	compatible = "fsl,imx28-spi";
43*4882a593Smuzhiyun	pinctrl-names = "default";
44*4882a593Smuzhiyun	pinctrl-0 = <&spi2_pins_a>;
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun	qca7000: ethernet@0 {
47*4882a593Smuzhiyun		compatible = "qca,qca7000";
48*4882a593Smuzhiyun		reg = <0x0>;
49*4882a593Smuzhiyun		interrupt-parent = <&gpio3>;      /* GPIO Bank 3 */
50*4882a593Smuzhiyun		interrupts = <25 0x1>;            /* Index: 25, rising edge */
51*4882a593Smuzhiyun		spi-cpha;                         /* SPI mode: CPHA=1 */
52*4882a593Smuzhiyun		spi-cpol;                         /* SPI mode: CPOL=1 */
53*4882a593Smuzhiyun		spi-max-frequency = <8000000>;    /* freq: 8 MHz */
54*4882a593Smuzhiyun		local-mac-address = [ A0 B0 C0 D0 E0 F0 ];
55*4882a593Smuzhiyun	};
56*4882a593Smuzhiyun};
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun(b) Ethernet over UART
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunIn order to use the QCA7000 as UART slave it must be defined as a child of a
61*4882a593SmuzhiyunUART master in the device tree. It is possible to preconfigure the UART
62*4882a593Smuzhiyunsettings of the QCA7000 firmware, but it's not possible to change them during
63*4882a593Smuzhiyunruntime.
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunRequired properties:
66*4882a593Smuzhiyun- compatible        : Should be "qca,qca7000"
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunOptional properties:
69*4882a593Smuzhiyun- local-mac-address : see ./ethernet.txt
70*4882a593Smuzhiyun- current-speed     : current baud rate of QCA7000 which defaults to 115200
71*4882a593Smuzhiyun		      if absent, see also ../serial/serial.yaml
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunUART Example:
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun/* Freescale i.MX28 UART */
76*4882a593Smuzhiyunauart0: serial@8006a000 {
77*4882a593Smuzhiyun	compatible = "fsl,imx28-auart", "fsl,imx23-auart";
78*4882a593Smuzhiyun	reg = <0x8006a000 0x2000>;
79*4882a593Smuzhiyun	pinctrl-names = "default";
80*4882a593Smuzhiyun	pinctrl-0 = <&auart0_2pins_a>;
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun	qca7000: ethernet {
83*4882a593Smuzhiyun		compatible = "qca,qca7000";
84*4882a593Smuzhiyun		local-mac-address = [ A0 B0 C0 D0 E0 F0 ];
85*4882a593Smuzhiyun		current-speed = <38400>;
86*4882a593Smuzhiyun	};
87*4882a593Smuzhiyun};
88