xref: /freebsd/sys/dts/include/dt-bindings/net/qcom-qca807x.h (revision d91f8db5f1822c43cd256f19aae1d059e4b25a26)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2022 Adrian Chadd <adrian@FreeBSD.org>
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in
13  *    the documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
28 /*
29  * DT constants for the Qualcomm QCA807x PHY
30  */
31 
32 #ifndef	_DT_BINDINGS_NET_QCOM_QCA807X_H__
33 #define	_DT_BINDINGS_NET_QCOM_QCA807X_H__
34 
35 /*
36  * PSGMII driver configuration.  This controls the TX voltage
37  * used between the SoC and the external PHY over the SERDES
38  * interface.
39  *
40  * The default value is 12 (600mV)
41  */
42 #define	PSGMII_QSGMII_TX_DRIVER_140MV	0
43 #define	PSGMII_QSGMII_TX_DRIVER_160MV	1
44 #define	PSGMII_QSGMII_TX_DRIVER_180MV	2
45 #define	PSGMII_QSGMII_TX_DRIVER_200MV	3
46 #define	PSGMII_QSGMII_TX_DRIVER_220MV	4
47 #define	PSGMII_QSGMII_TX_DRIVER_240MV	5
48 #define	PSGMII_QSGMII_TX_DRIVER_260MV	6
49 #define	PSGMII_QSGMII_TX_DRIVER_280MV	7
50 #define	PSGMII_QSGMII_TX_DRIVER_300MV	8
51 #define	PSGMII_QSGMII_TX_DRIVER_320MV	9
52 #define	PSGMII_QSGMII_TX_DRIVER_400MV	10
53 #define	PSGMII_QSGMII_TX_DRIVER_500MV	11
54 #define	PSGMII_QSGMII_TX_DRIVER_600MV	12
55 
56 /*
57  * These fields control the PHY power saving based on the
58  * cable length.
59  *
60  * 0 - full amplitude, full bias current
61  * 1 - amplitude follows cable length, half bias current
62  * 2 - full amplitude, bias current follows cable length
63  * 3 - both amplitude and bias current follow cable length
64  * 4 - full amplitude, half bias current
65  * 5 - amplitude follows cable length, 1/4 bias current
66  *     when cable length < 10m else half bias current
67  * 6 - full amplitude, bias current follows cable length,
68  *     bias reduced further by half when cable length < 10m
69  * 7 - amplitude follows cable length, same bias current
70  *     setting as '6'
71  */
72 #define	QCA807X_CONTROL_DAC_FULL_VOLT_BIAS		0
73 #define	QCA807X_CONTROL_DAC_DSP_VOLT_HALF_BIAS		1
74 #define	QCA807X_CONTROL_DAC_FULL_VOLT_DSP_BIAS		2
75 #define	QCA807X_CONTROL_DAC_DSP_VOLT_BIAS		3
76 #define	QCA807X_CONTROL_DAC_FULL_VOLT_HALF_BIAS		4
77 #define	QCA807X_CONTROL_DAC_DSP_VOLT_QUARTER_BIAS	5
78 #define	QCA807X_CONTROL_DAC_FULL_VOLT_HALF_BIAS_SHORT	6
79 #define	QCA807X_CONTROL_DAC_DSP_VOLT_HALF_BIAS_SHORT	7
80 
81 #endif	/* __DT_BINDINGS_NET_QCOM_QCA807X_H__ */
82