Lines Matching +full:dual +full:- +full:port
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2011-2015 Freescale Semiconductor, Inc.
115 /* simple linear search to map from port to array index */
116 static int fm_port_to_index(enum fm_port port) in fm_port_to_index() argument
121 if (fm_info[i].port == port) in fm_port_to_index()
125 return -1; in fm_port_to_index()
140 enet_if = fman_port_enet_if(fm_info[i].port); in fman_enet_init()
152 void fm_disable_port(enum fm_port port) in fm_disable_port() argument
154 int i = fm_port_to_index(port); in fm_disable_port()
156 if (i == -1) in fm_disable_port()
161 fman_disable_port(port); in fm_disable_port()
165 void fm_enable_port(enum fm_port port) in fm_enable_port() argument
167 int i = fm_port_to_index(port); in fm_enable_port()
169 if (i == -1) in fm_enable_port()
173 fman_enable_port(port); in fm_enable_port()
176 void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus) in fm_info_set_mdio() argument
178 int i = fm_port_to_index(port); in fm_info_set_mdio()
180 if (i == -1) in fm_info_set_mdio()
186 void fm_info_set_phy_address(enum fm_port port, int address) in fm_info_set_phy_address() argument
188 int i = fm_port_to_index(port); in fm_info_set_phy_address()
190 if (i == -1) in fm_info_set_phy_address()
197 * Returns the PHY address for a given Fman port
199 * The port must be set via a prior call to fm_info_set_phy_address().
200 * A negative error code is returned if the port is invalid.
202 int fm_info_get_phy_address(enum fm_port port) in fm_info_get_phy_address() argument
204 int i = fm_port_to_index(port); in fm_info_get_phy_address()
206 if (i == -1) in fm_info_get_phy_address()
207 return -1; in fm_info_get_phy_address()
216 phy_interface_t fm_info_get_enet_if(enum fm_port port) in fm_info_get_enet_if() argument
218 int i = fm_port_to_index(port); in fm_info_get_enet_if()
220 if (i == -1) in fm_info_get_enet_if()
231 enum fm_port port, int offset) in __def_board_ft_fman_fixup_port() argument
237 enum fm_port port, int offset)
244 phys_addr_t paddr = CONFIG_SYS_CCSRBAR_PHYS + info->compat_offset; in ft_fixup_port()
251 if (off == -FDT_ERR_NOTFOUND) in ft_fixup_port()
252 return -EINVAL; in ft_fixup_port()
254 if (info->enabled) { in ft_fixup_port()
255 fdt_fixup_phy_connection(blob, off, info->enet_if); in ft_fixup_port()
256 board_ft_fman_fixup_port(blob, prop, paddr, info->port, off); in ft_fixup_port()
264 * dual-role MAC, when FM1_10GEC1 is enabled and FM1_DTSEC9 in ft_fixup_port()
265 * is disabled, ensure that the dual-role MAC is not disabled, in ft_fixup_port()
266 * ditto for other dual-role MACs. in ft_fixup_port()
268 if (((info->port == FM1_DTSEC9) && (PORT_IS_ENABLED(FM1_10GEC1))) || in ft_fixup_port()
269 ((info->port == FM1_DTSEC10) && (PORT_IS_ENABLED(FM1_10GEC2))) || in ft_fixup_port()
270 ((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC3))) || in ft_fixup_port()
271 ((info->port == FM1_DTSEC2) && (PORT_IS_ENABLED(FM1_10GEC4))) || in ft_fixup_port()
272 ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC9))) || in ft_fixup_port()
273 ((info->port == FM1_10GEC2) && (PORT_IS_ENABLED(FM1_DTSEC10))) || in ft_fixup_port()
274 ((info->port == FM1_10GEC3) && (PORT_IS_ENABLED(FM1_DTSEC1))) || in ft_fixup_port()
275 ((info->port == FM1_10GEC4) && (PORT_IS_ENABLED(FM1_DTSEC2))) in ft_fixup_port()
278 ((info->port == FM2_DTSEC9) && (PORT_IS_ENABLED(FM2_10GEC1))) || in ft_fixup_port()
279 ((info->port == FM2_DTSEC10) && (PORT_IS_ENABLED(FM2_10GEC2))) || in ft_fixup_port()
280 ((info->port == FM2_10GEC1) && (PORT_IS_ENABLED(FM2_DTSEC9))) || in ft_fixup_port()
281 ((info->port == FM2_10GEC2) && (PORT_IS_ENABLED(FM2_DTSEC10))) in ft_fixup_port()
284 /* FM1_DTSECx and FM1_10GECx use the same dual-role MAC */ in ft_fixup_port()
285 if (((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC1))) || in ft_fixup_port()
286 ((info->port == FM1_DTSEC2) && (PORT_IS_ENABLED(FM1_10GEC2))) || in ft_fixup_port()
287 ((info->port == FM1_DTSEC3) && (PORT_IS_ENABLED(FM1_10GEC3))) || in ft_fixup_port()
288 ((info->port == FM1_DTSEC4) && (PORT_IS_ENABLED(FM1_10GEC4))) || in ft_fixup_port()
289 ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC1))) || in ft_fixup_port()
290 ((info->port == FM1_10GEC2) && (PORT_IS_ENABLED(FM1_DTSEC2))) || in ft_fixup_port()
291 ((info->port == FM1_10GEC3) && (PORT_IS_ENABLED(FM1_DTSEC3))) || in ft_fixup_port()
292 ((info->port == FM1_10GEC4) && (PORT_IS_ENABLED(FM1_DTSEC4))) in ft_fixup_port()
301 /* Don't disable FM1-DTSEC1 MAC as its used for MDIO */ in ft_fixup_port()
306 /* disable the fsl,dpa-ethernet node that points to the MAC */ in ft_fixup_port()
308 do_fixup_by_prop(blob, "fsl,fman-mac", &ph, sizeof(ph), in ft_fixup_port()
320 ft_fixup_port(blob, &fm_info[i], "fsl,fman-memac"); in fdt_fixup_fman_ethernet()
327 if (ft_fixup_port(blob, &fm_info[i], "fsl,fman-dtsec")) in fdt_fixup_fman_ethernet()
329 "fsl,fman-1g-mac"); in fdt_fixup_fman_ethernet()
331 if (ft_fixup_port(blob, &fm_info[i], "fsl,fman-xgec") && in fdt_fixup_fman_ethernet()
332 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()