Lines Matching +full:port +full:- +full:2

2  * Copyright 2011-2015 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
23 #if (CONFIG_SYS_NUM_FM1_DTSEC >= 2)
24 FM_DTSEC_INFO_INITIALIZER(1, 2),
45 FM_DTSEC_INFO_INITIALIZER(2, 1),
47 #if (CONFIG_SYS_NUM_FM2_DTSEC >= 2)
48 FM_DTSEC_INFO_INITIALIZER(2, 2),
51 FM_DTSEC_INFO_INITIALIZER(2, 3),
54 FM_DTSEC_INFO_INITIALIZER(2, 4),
57 FM_DTSEC_INFO_INITIALIZER(2, 5),
60 FM_DTSEC_INFO_INITIALIZER(2, 6),
63 FM_DTSEC_INFO_INITIALIZER(2, 9),
66 FM_DTSEC_INFO_INITIALIZER(2, 10),
71 #if (CONFIG_SYS_NUM_FM1_10GEC >= 2)
72 FM_TGEC_INFO_INITIALIZER(1, 2),
81 FM_TGEC_INFO_INITIALIZER(2, 1),
83 #if (CONFIG_SYS_NUM_FM2_10GEC >= 2)
84 FM_TGEC_INFO_INITIALIZER(2, 2),
102 #if (CONFIG_SYS_NUM_FMAN == 2) in fm_standard_init()
108 if ((fm_info[i].enabled) && (fm_info[i].index == 2)) in fm_standard_init()
116 /* simple linear search to map from port to array index */
117 static int fm_port_to_index(enum fm_port port) in fm_port_to_index() argument
122 if (fm_info[i].port == port) in fm_port_to_index()
126 return -1; in fm_port_to_index()
141 enet_if = fman_port_enet_if(fm_info[i].port); in fman_enet_init()
153 void fm_disable_port(enum fm_port port) in fm_disable_port() argument
155 int i = fm_port_to_index(port); in fm_disable_port()
157 if (i == -1) in fm_disable_port()
162 fman_disable_port(port); in fm_disable_port()
166 void fm_enable_port(enum fm_port port) in fm_enable_port() argument
168 int i = fm_port_to_index(port); in fm_enable_port()
170 if (i == -1) in fm_enable_port()
174 fman_enable_port(port); in fm_enable_port()
177 void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus) in fm_info_set_mdio() argument
179 int i = fm_port_to_index(port); in fm_info_set_mdio()
181 if (i == -1) in fm_info_set_mdio()
187 void fm_info_set_phy_address(enum fm_port port, int address) in fm_info_set_phy_address() argument
189 int i = fm_port_to_index(port); in fm_info_set_phy_address()
191 if (i == -1) in fm_info_set_phy_address()
198 * Returns the PHY address for a given Fman port
200 * The port must be set via a prior call to fm_info_set_phy_address().
201 * A negative error code is returned if the port is invalid.
203 int fm_info_get_phy_address(enum fm_port port) in fm_info_get_phy_address() argument
205 int i = fm_port_to_index(port); in fm_info_get_phy_address()
207 if (i == -1) in fm_info_get_phy_address()
208 return -1; in fm_info_get_phy_address()
217 phy_interface_t fm_info_get_enet_if(enum fm_port port) in fm_info_get_enet_if() argument
219 int i = fm_port_to_index(port); in fm_info_get_enet_if()
221 if (i == -1) in fm_info_get_enet_if()
232 enum fm_port port, int offset) in __def_board_ft_fman_fixup_port() argument
238 enum fm_port port, int offset)
245 phys_addr_t paddr = CONFIG_SYS_CCSRBAR_PHYS + info->compat_offset; in ft_fixup_port()
252 if (off == -FDT_ERR_NOTFOUND) in ft_fixup_port()
253 return -EINVAL; in ft_fixup_port()
255 if (info->enabled) { in ft_fixup_port()
256 fdt_fixup_phy_connection(blob, off, info->enet_if); in ft_fixup_port()
257 board_ft_fman_fixup_port(blob, prop, paddr, info->port, off); in ft_fixup_port()
265 * dual-role MAC, when FM1_10GEC1 is enabled and FM1_DTSEC9 in ft_fixup_port()
266 * is disabled, ensure that the dual-role MAC is not disabled, in ft_fixup_port()
267 * ditto for other dual-role MACs. in ft_fixup_port()
269 if (((info->port == FM1_DTSEC9) && (PORT_IS_ENABLED(FM1_10GEC1))) || in ft_fixup_port()
270 ((info->port == FM1_DTSEC10) && (PORT_IS_ENABLED(FM1_10GEC2))) || in ft_fixup_port()
271 ((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC3))) || in ft_fixup_port()
272 ((info->port == FM1_DTSEC2) && (PORT_IS_ENABLED(FM1_10GEC4))) || in ft_fixup_port()
273 ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC9))) || in ft_fixup_port()
274 ((info->port == FM1_10GEC2) && (PORT_IS_ENABLED(FM1_DTSEC10))) || in ft_fixup_port()
275 ((info->port == FM1_10GEC3) && (PORT_IS_ENABLED(FM1_DTSEC1))) || in ft_fixup_port()
276 ((info->port == FM1_10GEC4) && (PORT_IS_ENABLED(FM1_DTSEC2))) in ft_fixup_port()
277 #if (CONFIG_SYS_NUM_FMAN == 2) in ft_fixup_port()
279 ((info->port == FM2_DTSEC9) && (PORT_IS_ENABLED(FM2_10GEC1))) || in ft_fixup_port()
280 ((info->port == FM2_DTSEC10) && (PORT_IS_ENABLED(FM2_10GEC2))) || in ft_fixup_port()
281 ((info->port == FM2_10GEC1) && (PORT_IS_ENABLED(FM2_DTSEC9))) || in ft_fixup_port()
282 ((info->port == FM2_10GEC2) && (PORT_IS_ENABLED(FM2_DTSEC10))) in ft_fixup_port()
285 /* FM1_DTSECx and FM1_10GECx use the same dual-role MAC */ in ft_fixup_port()
286 if (((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC1))) || in ft_fixup_port()
287 ((info->port == FM1_DTSEC2) && (PORT_IS_ENABLED(FM1_10GEC2))) || in ft_fixup_port()
288 ((info->port == FM1_DTSEC3) && (PORT_IS_ENABLED(FM1_10GEC3))) || in ft_fixup_port()
289 ((info->port == FM1_DTSEC4) && (PORT_IS_ENABLED(FM1_10GEC4))) || in ft_fixup_port()
290 ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC1))) || in ft_fixup_port()
291 ((info->port == FM1_10GEC2) && (PORT_IS_ENABLED(FM1_DTSEC2))) || in ft_fixup_port()
292 ((info->port == FM1_10GEC3) && (PORT_IS_ENABLED(FM1_DTSEC3))) || in ft_fixup_port()
293 ((info->port == FM1_10GEC4) && (PORT_IS_ENABLED(FM1_DTSEC4))) in ft_fixup_port()
302 /* Don't disable FM1-DTSEC1 MAC as its used for MDIO */ in ft_fixup_port()
307 /* disable the fsl,dpa-ethernet node that points to the MAC */ in ft_fixup_port()
309 do_fixup_by_prop(blob, "fsl,fman-mac", &ph, sizeof(ph), in ft_fixup_port()
321 ft_fixup_port(blob, &fm_info[i], "fsl,fman-memac"); in fdt_fixup_fman_ethernet()
328 if (ft_fixup_port(blob, &fm_info[i], "fsl,fman-dtsec")) in fdt_fixup_fman_ethernet()
330 "fsl,fman-1g-mac"); in fdt_fixup_fman_ethernet()
332 if (ft_fixup_port(blob, &fm_info[i], "fsl,fman-tgec")) in fdt_fixup_fman_ethernet()
334 "fsl,fman-10g-mac"); in fdt_fixup_fman_ethernet()
359 phy_real_addr = phy_base_addr + i - base_port; in set_sgmii_phy()
376 val = bus->read(bus, i, MDIO_DEVAD_NONE, regnum); in is_qsgmii_riser_card()