1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2015 Freescale Semiconductor, Inc.
6 #ifndef __FSL_SERDES_H__
7 #define __FSL_SERDES_H__
11 #ifdef CONFIG_FSL_LSCH3
14 * Nobody will check whether the device 'NONE' has been configured,
15 * So use it to indicate if the serdes_prtcl_map has been initialized.
61 #elif defined(CONFIG_FSL_LSCH2)
64 * Nobody will check whether the device 'NONE' has been configured,
65 * So use it to indicate if the serdes_prtcl_map has been initialized.
115 QSGMII_FM1_A, /* A indicates MACs 1,2,5,6 */
116 QSGMII_FM1_B, /* B indicates MACs 5,6,9,10 */
126 QSGMII_SW1_A, /* Indicates ports on L2 Switch */
128 SGMII_2500_FM1_DTSEC1,
129 SGMII_2500_FM1_DTSEC2,
130 SGMII_2500_FM1_DTSEC3,
131 SGMII_2500_FM1_DTSEC4,
132 SGMII_2500_FM1_DTSEC5,
133 SGMII_2500_FM1_DTSEC6,
134 SGMII_2500_FM1_DTSEC9,
135 SGMII_2500_FM1_DTSEC10,
136 SGMII_2500_FM2_DTSEC1,
137 SGMII_2500_FM2_DTSEC2,
138 SGMII_2500_FM2_DTSEC3,
139 SGMII_2500_FM2_DTSEC4,
140 SGMII_2500_FM2_DTSEC5,
141 SGMII_2500_FM2_DTSEC6,
142 SGMII_2500_FM2_DTSEC9,
143 SGMII_2500_FM2_DTSEC10,
155 int is_serdes_configured(enum srds_prtcl device);
156 void fsl_serdes_init(void);
157 int serdes_get_first_lane(u32 sd, enum srds_prtcl device);
158 enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane);
159 int is_serdes_prtcl_valid(int serdes, u32 prtcl);
160 int serdes_get_number(int serdes, int cfg);
161 void fsl_rgmii_init(void);
163 #ifdef CONFIG_FSL_LSCH2
164 const char *serdes_clock_to_string(u32 clock);
165 int get_serdes_protocol(void);
167 #ifdef CONFIG_SYS_HAS_SERDES
168 /* Get the volt of SVDD in unit mV */
169 int get_serdes_volt(void);
170 /* Set the volt of SVDD in unit mV */
171 int set_serdes_volt(int svdd);
172 /* The target volt of SVDD in unit mV */
173 int setup_serdes_volt(u32 svdd);
176 #endif /* __FSL_SERDES_H__ */