xref: /freebsd/sys/contrib/device-tree/Bindings/net/qcom,qca807x.yaml (revision 01950c46b8155250f64374fb72fc11faa44bf099)
1*01950c46SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*01950c46SEmmanuel Vadot%YAML 1.2
3*01950c46SEmmanuel Vadot---
4*01950c46SEmmanuel Vadot$id: http://devicetree.org/schemas/net/qcom,qca807x.yaml#
5*01950c46SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*01950c46SEmmanuel Vadot
7*01950c46SEmmanuel Vadottitle: Qualcomm QCA807x Ethernet PHY
8*01950c46SEmmanuel Vadot
9*01950c46SEmmanuel Vadotmaintainers:
10*01950c46SEmmanuel Vadot  - Christian Marangi <ansuelsmth@gmail.com>
11*01950c46SEmmanuel Vadot  - Robert Marko <robert.marko@sartura.hr>
12*01950c46SEmmanuel Vadot
13*01950c46SEmmanuel Vadotdescription: |
14*01950c46SEmmanuel Vadot  Qualcomm QCA8072/5 Ethernet PHY is PHY package of 2 or 5
15*01950c46SEmmanuel Vadot  IEEE 802.3 clause 22 compliant 10BASE-Te, 100BASE-TX and
16*01950c46SEmmanuel Vadot  1000BASE-T PHY-s.
17*01950c46SEmmanuel Vadot
18*01950c46SEmmanuel Vadot  They feature 2 SerDes, one for PSGMII or QSGMII connection with
19*01950c46SEmmanuel Vadot  MAC, while second one is SGMII for connection to MAC or fiber.
20*01950c46SEmmanuel Vadot
21*01950c46SEmmanuel Vadot  Both models have a combo port that supports 1000BASE-X and
22*01950c46SEmmanuel Vadot  100BASE-FX fiber.
23*01950c46SEmmanuel Vadot
24*01950c46SEmmanuel Vadot  Each PHY inside of QCA807x series has 4 digitally controlled
25*01950c46SEmmanuel Vadot  output only pins that natively drive LED-s for up to 2 attached
26*01950c46SEmmanuel Vadot  LEDs. Some vendor also use these 4 output for GPIO usage without
27*01950c46SEmmanuel Vadot  attaching LEDs.
28*01950c46SEmmanuel Vadot
29*01950c46SEmmanuel Vadot  Note that output pins can be set to drive LEDs OR GPIO, mixed
30*01950c46SEmmanuel Vadot  definition are not accepted.
31*01950c46SEmmanuel Vadot
32*01950c46SEmmanuel Vadot$ref: ethernet-phy-package.yaml#
33*01950c46SEmmanuel Vadot
34*01950c46SEmmanuel Vadotproperties:
35*01950c46SEmmanuel Vadot  compatible:
36*01950c46SEmmanuel Vadot    enum:
37*01950c46SEmmanuel Vadot      - qcom,qca8072-package
38*01950c46SEmmanuel Vadot      - qcom,qca8075-package
39*01950c46SEmmanuel Vadot
40*01950c46SEmmanuel Vadot  qcom,package-mode:
41*01950c46SEmmanuel Vadot    description: |
42*01950c46SEmmanuel Vadot      PHY package can be configured in 3 mode following this table:
43*01950c46SEmmanuel Vadot
44*01950c46SEmmanuel Vadot                    First Serdes mode       Second Serdes mode
45*01950c46SEmmanuel Vadot      Option 1      PSGMII for copper       Disabled
46*01950c46SEmmanuel Vadot                    ports 0-4
47*01950c46SEmmanuel Vadot      Option 2      PSGMII for copper       1000BASE-X / 100BASE-FX
48*01950c46SEmmanuel Vadot                    ports 0-4
49*01950c46SEmmanuel Vadot      Option 3      QSGMII for copper       SGMII for
50*01950c46SEmmanuel Vadot                    ports 0-3               copper port 4
51*01950c46SEmmanuel Vadot
52*01950c46SEmmanuel Vadot      PSGMII mode (option 1 or 2) is configured dynamically based on
53*01950c46SEmmanuel Vadot      the presence of a connected SFP device.
54*01950c46SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
55*01950c46SEmmanuel Vadot    enum:
56*01950c46SEmmanuel Vadot      - qsgmii
57*01950c46SEmmanuel Vadot      - psgmii
58*01950c46SEmmanuel Vadot    default: psgmii
59*01950c46SEmmanuel Vadot
60*01950c46SEmmanuel Vadot  qcom,tx-drive-strength-milliwatt:
61*01950c46SEmmanuel Vadot    description: set the TX Amplifier value in mv.
62*01950c46SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
63*01950c46SEmmanuel Vadot    enum: [140, 160, 180, 200, 220,
64*01950c46SEmmanuel Vadot           240, 260, 280, 300, 320,
65*01950c46SEmmanuel Vadot           400, 500, 600]
66*01950c46SEmmanuel Vadot    default: 600
67*01950c46SEmmanuel Vadot
68*01950c46SEmmanuel VadotpatternProperties:
69*01950c46SEmmanuel Vadot  ^ethernet-phy@[a-f0-9]+$:
70*01950c46SEmmanuel Vadot    $ref: ethernet-phy.yaml#
71*01950c46SEmmanuel Vadot
72*01950c46SEmmanuel Vadot    properties:
73*01950c46SEmmanuel Vadot      qcom,dac-full-amplitude:
74*01950c46SEmmanuel Vadot        description:
75*01950c46SEmmanuel Vadot          Set Analog MDI driver amplitude to FULL.
76*01950c46SEmmanuel Vadot
77*01950c46SEmmanuel Vadot          With this not defined, amplitude is set to DSP.
78*01950c46SEmmanuel Vadot          (amplitude is adjusted based on cable length)
79*01950c46SEmmanuel Vadot
80*01950c46SEmmanuel Vadot          With this enabled and qcom,dac-full-bias-current
81*01950c46SEmmanuel Vadot          and qcom,dac-disable-bias-current-tweak disabled,
82*01950c46SEmmanuel Vadot          bias current is half.
83*01950c46SEmmanuel Vadot        type: boolean
84*01950c46SEmmanuel Vadot
85*01950c46SEmmanuel Vadot      qcom,dac-full-bias-current:
86*01950c46SEmmanuel Vadot        description:
87*01950c46SEmmanuel Vadot          Set Analog MDI driver bias current to FULL.
88*01950c46SEmmanuel Vadot
89*01950c46SEmmanuel Vadot          With this not defined, bias current is set to DSP.
90*01950c46SEmmanuel Vadot          (bias current is adjusted based on cable length)
91*01950c46SEmmanuel Vadot
92*01950c46SEmmanuel Vadot          Actual bias current might be different with
93*01950c46SEmmanuel Vadot          qcom,dac-disable-bias-current-tweak disabled.
94*01950c46SEmmanuel Vadot        type: boolean
95*01950c46SEmmanuel Vadot
96*01950c46SEmmanuel Vadot      qcom,dac-disable-bias-current-tweak:
97*01950c46SEmmanuel Vadot        description: |
98*01950c46SEmmanuel Vadot          Set Analog MDI driver bias current to disable tweak
99*01950c46SEmmanuel Vadot          to bias current.
100*01950c46SEmmanuel Vadot
101*01950c46SEmmanuel Vadot          With this not defined, bias current tweak are enabled
102*01950c46SEmmanuel Vadot          by default.
103*01950c46SEmmanuel Vadot
104*01950c46SEmmanuel Vadot          With this enabled the following tweak are NOT applied:
105*01950c46SEmmanuel Vadot          - With both FULL amplitude and FULL bias current: bias current
106*01950c46SEmmanuel Vadot            is set to half.
107*01950c46SEmmanuel Vadot          - With only DSP amplitude: bias current is set to half and
108*01950c46SEmmanuel Vadot            is set to 1/4 with cable < 10m.
109*01950c46SEmmanuel Vadot          - With DSP bias current (included both DSP amplitude and
110*01950c46SEmmanuel Vadot            DSP bias current): bias current is half the detected current
111*01950c46SEmmanuel Vadot            with cable < 10m.
112*01950c46SEmmanuel Vadot        type: boolean
113*01950c46SEmmanuel Vadot
114*01950c46SEmmanuel Vadot      gpio-controller: true
115*01950c46SEmmanuel Vadot
116*01950c46SEmmanuel Vadot      '#gpio-cells':
117*01950c46SEmmanuel Vadot        const: 2
118*01950c46SEmmanuel Vadot
119*01950c46SEmmanuel Vadot    if:
120*01950c46SEmmanuel Vadot      required:
121*01950c46SEmmanuel Vadot        - gpio-controller
122*01950c46SEmmanuel Vadot    then:
123*01950c46SEmmanuel Vadot      properties:
124*01950c46SEmmanuel Vadot        leds: false
125*01950c46SEmmanuel Vadot
126*01950c46SEmmanuel Vadot    unevaluatedProperties: false
127*01950c46SEmmanuel Vadot
128*01950c46SEmmanuel Vadotrequired:
129*01950c46SEmmanuel Vadot  - compatible
130*01950c46SEmmanuel Vadot
131*01950c46SEmmanuel VadotunevaluatedProperties: false
132*01950c46SEmmanuel Vadot
133*01950c46SEmmanuel Vadotexamples:
134*01950c46SEmmanuel Vadot  - |
135*01950c46SEmmanuel Vadot    #include <dt-bindings/leds/common.h>
136*01950c46SEmmanuel Vadot
137*01950c46SEmmanuel Vadot    mdio {
138*01950c46SEmmanuel Vadot        #address-cells = <1>;
139*01950c46SEmmanuel Vadot        #size-cells = <0>;
140*01950c46SEmmanuel Vadot
141*01950c46SEmmanuel Vadot        ethernet-phy-package@0 {
142*01950c46SEmmanuel Vadot            #address-cells = <1>;
143*01950c46SEmmanuel Vadot            #size-cells = <0>;
144*01950c46SEmmanuel Vadot            compatible = "qcom,qca8075-package";
145*01950c46SEmmanuel Vadot            reg = <0>;
146*01950c46SEmmanuel Vadot
147*01950c46SEmmanuel Vadot            qcom,package-mode = "qsgmii";
148*01950c46SEmmanuel Vadot
149*01950c46SEmmanuel Vadot            ethernet-phy@0 {
150*01950c46SEmmanuel Vadot                reg = <0>;
151*01950c46SEmmanuel Vadot
152*01950c46SEmmanuel Vadot                leds {
153*01950c46SEmmanuel Vadot                    #address-cells = <1>;
154*01950c46SEmmanuel Vadot                    #size-cells = <0>;
155*01950c46SEmmanuel Vadot
156*01950c46SEmmanuel Vadot                    led@0 {
157*01950c46SEmmanuel Vadot                        reg = <0>;
158*01950c46SEmmanuel Vadot                        color = <LED_COLOR_ID_GREEN>;
159*01950c46SEmmanuel Vadot                        function = LED_FUNCTION_LAN;
160*01950c46SEmmanuel Vadot                        default-state = "keep";
161*01950c46SEmmanuel Vadot                    };
162*01950c46SEmmanuel Vadot                };
163*01950c46SEmmanuel Vadot            };
164*01950c46SEmmanuel Vadot
165*01950c46SEmmanuel Vadot            ethernet-phy@1 {
166*01950c46SEmmanuel Vadot                reg = <1>;
167*01950c46SEmmanuel Vadot            };
168*01950c46SEmmanuel Vadot
169*01950c46SEmmanuel Vadot            ethernet-phy@2 {
170*01950c46SEmmanuel Vadot                reg = <2>;
171*01950c46SEmmanuel Vadot
172*01950c46SEmmanuel Vadot                gpio-controller;
173*01950c46SEmmanuel Vadot                #gpio-cells = <2>;
174*01950c46SEmmanuel Vadot            };
175*01950c46SEmmanuel Vadot
176*01950c46SEmmanuel Vadot            ethernet-phy@3 {
177*01950c46SEmmanuel Vadot                reg = <3>;
178*01950c46SEmmanuel Vadot            };
179*01950c46SEmmanuel Vadot
180*01950c46SEmmanuel Vadot            ethernet-phy@4 {
181*01950c46SEmmanuel Vadot                reg = <4>;
182*01950c46SEmmanuel Vadot            };
183*01950c46SEmmanuel Vadot        };
184*01950c46SEmmanuel Vadot    };
185