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.
103 #elif defined(CONFIG_FSL_LSCH2)
106 * Nobody will check whether the device 'NONE' has been configured,
107 * So use it to indicate if the serdes_prtcl_map has been initialized.
157 QSGMII_FM1_A, /* A indicates MACs 1,2,5,6 */
158 QSGMII_FM1_B, /* B indicates MACs 5,6,9,10 */
168 QSGMII_SW1_A, /* Indicates ports on L2 Switch */
170 SGMII_2500_FM1_DTSEC1,
171 SGMII_2500_FM1_DTSEC2,
172 SGMII_2500_FM1_DTSEC3,
173 SGMII_2500_FM1_DTSEC4,
174 SGMII_2500_FM1_DTSEC5,
175 SGMII_2500_FM1_DTSEC6,
176 SGMII_2500_FM1_DTSEC9,
177 SGMII_2500_FM1_DTSEC10,
178 SGMII_2500_FM2_DTSEC1,
179 SGMII_2500_FM2_DTSEC2,
180 SGMII_2500_FM2_DTSEC3,
181 SGMII_2500_FM2_DTSEC4,
182 SGMII_2500_FM2_DTSEC5,
183 SGMII_2500_FM2_DTSEC6,
184 SGMII_2500_FM2_DTSEC9,
185 SGMII_2500_FM2_DTSEC10,
197 int is_serdes_configured(enum srds_prtcl device);
198 void fsl_serdes_init(void);
199 int serdes_get_first_lane(u32 sd, enum srds_prtcl device);
200 enum srds_prtcl serdes_get_prtcl(int serdes, int cfg, int lane);
201 int is_serdes_prtcl_valid(int serdes, u32 prtcl);
202 int serdes_get_number(int serdes, int cfg);
203 void fsl_rgmii_init(void);
205 #ifdef CONFIG_FSL_LSCH2
206 const char *serdes_clock_to_string(u32 clock);
207 int get_serdes_protocol(void);
209 #ifdef CONFIG_SYS_HAS_SERDES
210 /* Get the volt of SVDD in unit mV */
211 int get_serdes_volt(void);
212 /* Set the volt of SVDD in unit mV */
213 int set_serdes_volt(int svdd);
214 /* The target volt of SVDD in unit mV */
215 int setup_serdes_volt(u32 svdd);
218 #endif /* __FSL_SERDES_H__ */