Lines Matching +full:gmii +full:- +full:to +full:- +full:sgmii +full:- +full:2

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright © 2021-2022 Dmitry Salychev
11 * 2. Redistributions in binary form must reproduce the above copyright
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
78 * NOTE: MC command portals (MCPs) are used to send commands to, and
84 /* --- */
86 /* --- */
94 /* Subroutines to get text representation. */
123 sc->dev = dev; in dpaa2_mac_attach()
125 memset(sc->addr, 0, ETHER_ADDR_LEN); in dpaa2_mac_attach()
127 error = bus_alloc_resources(sc->dev, dpaa2_mac_spec, sc->res); in dpaa2_mac_attach()
129 device_printf(dev, "%s: failed to allocate resources: " in dpaa2_mac_attach()
135 mcp_dev = (device_t) rman_get_start(sc->res[MCP_RID(0)]); in dpaa2_mac_attach()
137 dinfo->portal = mcp_dinfo->portal; in dpaa2_mac_attach()
141 error = DPAA2_CMD_RC_OPEN(dev, child, &cmd, rcinfo->id, &rc_token); in dpaa2_mac_attach()
143 device_printf(dev, "%s: failed to open DPRC: error=%d\n", in dpaa2_mac_attach()
147 error = DPAA2_CMD_MAC_OPEN(dev, child, &cmd, dinfo->id, &mac_token); in dpaa2_mac_attach()
149 device_printf(dev, "%s: failed to open DPMAC: id=%d, error=%d\n", in dpaa2_mac_attach()
150 __func__, dinfo->id, error); in dpaa2_mac_attach()
154 error = DPAA2_CMD_MAC_GET_ATTRIBUTES(dev, child, &cmd, &sc->attr); in dpaa2_mac_attach()
156 device_printf(dev, "%s: failed to get DPMAC attributes: id=%d, " in dpaa2_mac_attach()
157 "error=%d\n", __func__, dinfo->id, error); in dpaa2_mac_attach()
160 error = DPAA2_CMD_MAC_GET_ADDR(dev, child, &cmd, sc->addr); in dpaa2_mac_attach()
162 device_printf(dev, "%s: failed to get physical address: " in dpaa2_mac_attach()
167 device_printf(dev, "ether %6D\n", sc->addr, ":"); in dpaa2_mac_attach()
169 sc->attr.max_rate, in dpaa2_mac_attach()
170 dpaa2_mac_ethif_to_str(sc->attr.eth_if), in dpaa2_mac_attach()
171 dpaa2_mac_link_type_to_str(sc->attr.link_type)); in dpaa2_mac_attach()
176 device_printf(dev, "%s: failed to setup IRQs: error=%d\n", in dpaa2_mac_attach()
201 * @brief Configure DPMAC object to generate interrupts.
218 device_printf(dev, "%s: failed to allocate MSI\n", __func__); in dpaa2_mac_setup_irq()
221 if ((sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, in dpaa2_mac_setup_irq()
222 &sc->irq_rid[0], RF_ACTIVE | RF_SHAREABLE)) == NULL) { in dpaa2_mac_setup_irq()
223 device_printf(dev, "%s: failed to allocate IRQ resource\n", in dpaa2_mac_setup_irq()
228 if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, in dpaa2_mac_setup_irq()
229 NULL, dpaa2_mac_intr, sc, &sc->intr)) { in dpaa2_mac_setup_irq()
230 device_printf(dev, "%s: failed to setup IRQ resource\n", in dpaa2_mac_setup_irq()
238 error = DPAA2_CMD_RC_OPEN(dev, child, &cmd, rcinfo->id, &rc_token); in dpaa2_mac_setup_irq()
240 device_printf(dev, "%s: failed to open DPRC: error=%d\n", in dpaa2_mac_setup_irq()
244 error = DPAA2_CMD_MAC_OPEN(dev, child, &cmd, dinfo->id, &mac_token); in dpaa2_mac_setup_irq()
246 device_printf(dev, "%s: failed to open DPMAC: id=%d, error=%d\n", in dpaa2_mac_setup_irq()
247 __func__, dinfo->id, error); in dpaa2_mac_setup_irq()
260 device_printf(dev, "%s: failed to set IRQ mask\n", __func__); in dpaa2_mac_setup_irq()
266 device_printf(dev, "%s: failed to enable IRQ\n", __func__); in dpaa2_mac_setup_irq()
290 val = pci_msi_count(sc->dev); in dpaa2_mac_setup_msi()
292 device_printf(sc->dev, "MSI: actual=%d, expected=%d\n", val, in dpaa2_mac_setup_msi()
296 if (pci_alloc_msi(sc->dev, &val) != 0) in dpaa2_mac_setup_msi()
300 sc->irq_rid[i] = i + 1; in dpaa2_mac_setup_msi()
309 device_t pdev = device_get_parent(sc->dev); in dpaa2_mac_intr()
310 device_t dev = sc->dev; in dpaa2_mac_intr()
321 error = DPAA2_CMD_RC_OPEN(dev, child, &cmd, rcinfo->id, &rc_token); in dpaa2_mac_intr()
323 device_printf(dev, "%s: failed to open DPRC: error=%d\n", in dpaa2_mac_intr()
327 error = DPAA2_CMD_MAC_OPEN(dev, child, &cmd, dinfo->id, &mac_token); in dpaa2_mac_intr()
329 device_printf(dev, "%s: failed to open DPMAC: id=%d, error=%d\n", in dpaa2_mac_intr()
330 __func__, dinfo->id, error); in dpaa2_mac_intr()
336 device_printf(sc->dev, "%s: failed to obtain IRQ status: " in dpaa2_mac_intr()
358 return ("GMII"); in dpaa2_mac_ethif_to_str()
362 return ("SGMII"); in dpaa2_mac_ethif_to_str()
372 return ("1000BASE-X"); in dpaa2_mac_ethif_to_str()