const char *mname, *fname;
const char *dname = dpa_node->full_name;
size_t lenp;
- int _errno;
+ int _errno, is_shared = 0;
const char *char_prop;
uint32_t na;
if (of_device_is_available(dpa_node) == false)
return 0;
+ if (!of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-init") &&
+ !of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-shared")) {
+ return 0;
+ }
+
+ if (of_device_is_compatible(dpa_node, "fsl,dpa-ethernet-shared"))
+ is_shared = 1;
+
rprop = "fsl,qman-frame-queues-rx";
mprop = "fsl,fman-mac";
goto err;
}
- assert(lenp == (4 * sizeof(phandle)));
+ assert(lenp >= (4 * sizeof(phandle)));
na = of_n_addr_cells(mac_node);
/* Get rid of endianness (issues). Convert to host byte order */
goto err;
}
- assert(lenp == (4 * sizeof(phandle)));
+ assert(lenp >= (4 * sizeof(phandle)));
/*TODO: Fix for other cases also */
na = of_n_addr_cells(mac_node);
/* Get rid of endianness (issues). Convert to host byte order */
pools_phandle++;
}
+ if (is_shared)
+ __if->__if.is_shared_mac = 1;
+
/* Parsing of the network interface is complete, add it to the list */
DPAA_BUS_LOG(DEBUG, "Found %s, Tx Channel = %x, FMAN = %x,"
"Port ID = %x",
int
fman_init(void)
{
- const struct device_node *dpa_node;
+ const struct device_node *dpa_node, *parent_node;
int _errno;
/* If multiple dependencies try to initialise the Fman driver, don't
return fman_ccsr_map_fd;
}
- for_each_compatible_node(dpa_node, NULL, "fsl,dpa-ethernet-init") {
+ parent_node = of_find_compatible_node(NULL, NULL, "fsl,dpaa");
+ if (!parent_node) {
+ DPAA_BUS_LOG(ERR, "Unable to find fsl,dpaa node");
+ return -ENODEV;
+ }
+
+ for_each_child_node(parent_node, dpa_node) {
_errno = fman_if_init(dpa_node);
if (_errno) {
FMAN_ERR(_errno, "if_init(%s)\n", dpa_node->full_name);
struct rte_ether_addr mac_addr;
/* The Qman channel to schedule Tx FQs to */
u16 tx_channel_id;
+
+ uint8_t is_shared_mac;
/* The hard-coded FQIDs for this interface. Note: this doesn't cover
* the PCD nor the "Rx default" FQIDs, which are configured via FMC
* and its XML-based configuration.
PMD_INIT_FUNC_TRACE();
- fman_if_disable_rx(fif);
+ if (!fif->is_shared_mac)
+ fman_if_disable_rx(fif);
dev->tx_pkt_burst = dpaa_eth_tx_drop_all;
}
fman_intf->mac_addr.addr_bytes[4],
fman_intf->mac_addr.addr_bytes[5]);
-
- /* Disable RX mode */
- fman_if_discard_rx_errors(fman_intf);
- fman_if_disable_rx(fman_intf);
- /* Disable promiscuous mode */
- fman_if_promiscuous_disable(fman_intf);
- /* Disable multicast */
- fman_if_reset_mcast_filter_table(fman_intf);
- /* Reset interface statistics */
- fman_if_stats_reset(fman_intf);
- /* Disable SG by default */
- fman_if_set_sg(fman_intf, 0);
- fman_if_set_maxfrm(fman_intf, RTE_ETHER_MAX_LEN + VLAN_TAG_SIZE);
+ if (!fman_intf->is_shared_mac) {
+ /* Disable RX mode */
+ fman_if_discard_rx_errors(fman_intf);
+ fman_if_disable_rx(fman_intf);
+ /* Disable promiscuous mode */
+ fman_if_promiscuous_disable(fman_intf);
+ /* Disable multicast */
+ fman_if_reset_mcast_filter_table(fman_intf);
+ /* Reset interface statistics */
+ fman_if_stats_reset(fman_intf);
+ /* Disable SG by default */
+ fman_if_set_sg(fman_intf, 0);
+ fman_if_set_maxfrm(fman_intf,
+ RTE_ETHER_MAX_LEN + VLAN_TAG_SIZE);
+ }
return 0;
}
dpaa_intf->netenv_handle = NULL;
+ if (fif && fif->is_shared_mac) {
+ ret = fm_port_enable(dpaa_intf->port_handle);
+ if (ret != E_OK) {
+ DPAA_PMD_ERR("shared mac re-enable failed");
+ return ret;
+ }
+ }
+
/* FM PORT Close */
fm_port_close(dpaa_intf->port_handle);
dpaa_intf->port_handle = NULL;
}
}
/* Set default netenv and scheme */
- ret = set_default_scheme(dpaa_intf);
- if (ret) {
- DPAA_PMD_ERR("Set PCD NetEnv and Scheme: Failed");
- goto unset_pcd_netenv_scheme1;
+ if (!fif->is_shared_mac) {
+ ret = set_default_scheme(dpaa_intf);
+ if (ret) {
+ DPAA_PMD_ERR("Set PCD NetEnv and Scheme: Failed");
+ goto unset_pcd_netenv_scheme1;
+ }
}
/* Set Port PCD */