Currently ldpaa ethernet driver rely on DPL file to statically configure
mac address for the DPNIs. It is not a correct approach.
Add support setting MAC address from env variable or Random MAC address.
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
{
struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
struct dpni_queue_attr rx_queue_attr;
{
struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)net_dev->priv;
struct dpni_queue_attr rx_queue_attr;
int err;
if (net_dev->state == ETH_STATE_ACTIVE)
int err;
if (net_dev->state == ETH_STATE_ACTIVE)
- err = dpni_get_primary_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
- priv->dpni_handle, mac_addr);
+ err = dpni_add_mac_addr(dflt_mc_io, MC_CMD_NO_FLAGS,
+ priv->dpni_handle, net_dev->enetaddr);
- printf("dpni_get_primary_mac_addr() failed\n");
+ printf("dpni_add_mac_addr() failed\n");
- memcpy(net_dev->enetaddr, mac_addr, 0x6);
-
- /* setup the MAC address */
- if (net_dev->enetaddr[0] & 0x01) {
- printf("%s: MacAddress is multcast address\n", __func__);
- return 1;
- }
-
#ifdef CONFIG_PHYLIB
/* TODO Check this path */
err = phy_startup(priv->phydev);
#ifdef CONFIG_PHYLIB
/* TODO Check this path */
err = phy_startup(priv->phydev);