]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/keystone_net.c
arm: mx6: add support for i.MX6ULL
[karo-tx-uboot.git] / drivers / net / keystone_net.c
index c8681d02234b3b7d692d57c416328d83ce72790e..67b570279ec3280b77851a356c4b83f46bbe9242 100644 (file)
@@ -315,7 +315,7 @@ int mac_sl_config(u_int16_t port, struct mac_sl_cfg *cfg)
        writel(cfg->max_rx_len, DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_MAXLEN);
        writel(cfg->ctl, DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_CTL);
 
-#ifdef CONFIG_K2E_EVM
+#if defined(CONFIG_SOC_K2E) || defined(CONFIG_SOC_K2L)
        /* Map RX packet flow priority to 0 */
        writel(0, DEVICE_EMACSL_BASE(port) + CPGMACSL_REG_RX_PRI_MAP);
 #endif
@@ -398,7 +398,8 @@ static int keystone2_eth_open(struct eth_device *dev, bd_t *bis)
        sys_has_mdio =
                (eth_priv->sgmii_link_type == SGMII_LINK_MAC_PHY) ? 1 : 0;
 
-       keystone2_net_serdes_setup();
+       if (sys_has_mdio)
+               keystone2_mdio_reset(mdio_bus);
 
        keystone_sgmii_config(phy_dev, eth_priv->slave_port - 1,
                              eth_priv->sgmii_link_type);
@@ -504,13 +505,20 @@ static int keystone2_eth_rcv_packet(struct eth_device *dev)
        if (hd == NULL)
                return 0;
 
-       NetReceive((uchar *)pkt, pkt_size);
+       net_process_received_packet((uchar *)pkt, pkt_size);
 
        ksnav_release_rxhd(&netcp_pktdma, hd);
 
        return pkt_size;
 }
 
+#ifdef CONFIG_MCAST_TFTP
+static int keystone2_eth_bcast_addr(struct eth_device *dev, u32 ip, u8 set)
+{
+       return 0;
+}
+#endif
+
 /*
  * This function initializes the EMAC hardware.
  */
@@ -536,6 +544,9 @@ int keystone2_emac_initialize(struct eth_priv_t *eth_priv)
        dev->halt               = keystone2_eth_close;
        dev->send               = keystone2_eth_send_packet;
        dev->recv               = keystone2_eth_rcv_packet;
+#ifdef CONFIG_MCAST_TFTP
+       dev->mcast              = keystone2_eth_bcast_addr;
+#endif
 
        eth_register(dev);
 
@@ -553,6 +564,8 @@ int keystone2_emac_initialize(struct eth_priv_t *eth_priv)
                        return res;
        }
 
+       keystone2_net_serdes_setup();
+
        /* Create phy device and bind it with driver */
 #ifdef CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE
        phy_dev = phy_connect(mdio_bus, eth_priv->phy_addr,
@@ -582,7 +595,7 @@ static void keystone2_net_serdes_setup(void)
                        &ks2_serdes_sgmii_156p25mhz,
                        CONFIG_KSNET_SERDES_LANES_PER_SGMII);
 
-#ifdef CONFIG_SOC_K2E
+#if defined(CONFIG_SOC_K2E) || defined(CONFIG_SOC_K2L)
        ks2_serdes_init(CONFIG_KSNET_SERDES_SGMII2_BASE,
                        &ks2_serdes_sgmii_156p25mhz,
                        CONFIG_KSNET_SERDES_LANES_PER_SGMII);