1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Copyright 2015 Freescale Semiconductor, Inc.
7 #ifndef __FSL_SERDES_H__
8 #define __FSL_SERDES_H__
12 #ifdef CONFIG_FSL_LSCH3
15 * Nobody will check whether the device 'NONE' has been configured,
16 * So use it to indicate if the serdes_prtcl_map has been initialized.
91 #elif defined(CONFIG_FSL_LSCH2)
94 * Nobody will check whether the device 'NONE' has been configured,
95 * So use it to indicate if the serdes_prtcl_map has been initialized.
145 QSGMII_FM1_A, /* A indicates MACs 1,2,5,6 */
146 QSGMII_FM1_B, /* B indicates MACs 5,6,9,10 */
156 QSGMII_SW1_A, /* Indicates ports on L2 Switch */
158 SGMII_2500_FM1_DTSEC1,
159 SGMII_2500_FM1_DTSEC2,
160 SGMII_2500_FM1_DTSEC3,
161 SGMII_2500_FM1_DTSEC4,
162 SGMII_2500_FM1_DTSEC5,
163 SGMII_2500_FM1_DTSEC6,
164 SGMII_2500_FM1_DTSEC9,
165 SGMII_2500_FM1_DTSEC10,
166 SGMII_2500_FM2_DTSEC1,
167 SGMII_2500_FM2_DTSEC2,
168 SGMII_2500_FM2_DTSEC3,
169 SGMII_2500_FM2_DTSEC4,
170 SGMII_2500_FM2_DTSEC5,
171 SGMII_2500_FM2_DTSEC6,
172 SGMII_2500_FM2_DTSEC9,
173 SGMII_2500_FM2_DTSEC10,
185 int is_serdes_configured(enum srds_prtcl device);
186 void fsl_serdes_init(void);
187 int serdes_get_first_lane(u32 sd, enum srds_prtcl device);
188 enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane);
189 int is_serdes_prtcl_valid(int serdes, u32 prtcl);
190 int serdes_get_number(int serdes, int cfg);
191 void fsl_rgmii_init(void);
193 #ifdef CONFIG_FSL_LSCH2
194 const char *serdes_clock_to_string(u32 clock);
195 int get_serdes_protocol(void);
197 #ifdef CONFIG_SYS_HAS_SERDES
198 /* Get the volt of SVDD in unit mV */
199 int get_serdes_volt(void);
200 /* Set the volt of SVDD in unit mV */
201 int set_serdes_volt(int svdd);
202 /* The target volt of SVDD in unit mV */
203 int setup_serdes_volt(u32 svdd);
206 #endif /* __FSL_SERDES_H__ */