serial: add BCM283x mini UART driver
[oweals/u-boot.git] / drivers / net / xilinx_axi_emac.c
index 172ccc5b952bdb198906f43029e22f8bbd4b970f..81274ee13bca869567ecc3986f4f90fe8c071f7d 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_PHYLIB)
-# error AXI_ETHERNET requires PHYLIB
-#endif
-
 /* Link setup */
 #define XAE_EMMC_LINKSPEED_MASK        0xC0000000 /* Link speed */
 #define XAE_EMMC_LINKSPD_10    0x00000000 /* Link Speed mask for 10 Mbit */
@@ -316,7 +312,7 @@ static int setup_phy(struct udevice *dev)
 }
 
 /* STOP DMA transfers */
-static void axiemac_halt(struct udevice *dev)
+static void axiemac_stop(struct udevice *dev)
 {
        struct axidma_priv *priv = dev_get_priv(dev);
        u32 temp;
@@ -376,7 +372,7 @@ static int axi_ethernet_init(struct axidma_priv *priv)
        return 0;
 }
 
-static int axiemac_setup_mac(struct udevice *dev)
+static int axiemac_write_hwaddr(struct udevice *dev)
 {
        struct eth_pdata *pdata = dev_get_platdata(dev);
        struct axidma_priv *priv = dev_get_priv(dev);
@@ -416,7 +412,7 @@ static void axi_dma_init(struct axidma_priv *priv)
                printf("%s: Timeout\n", __func__);
 }
 
-static int axiemac_init(struct udevice *dev)
+static int axiemac_start(struct udevice *dev)
 {
        struct axidma_priv *priv = dev_get_priv(dev);
        struct axi_regs *regs = priv->iobase;
@@ -470,7 +466,7 @@ static int axiemac_init(struct udevice *dev)
 
        /* PHY setup */
        if (!setup_phy(dev)) {
-               axiemac_halt(dev);
+               axiemac_stop(dev);
                return -1;
        }
 
@@ -571,9 +567,14 @@ static int axiemac_recv(struct udevice *dev, int flags, uchar **packetp)
 #ifdef DEBUG
        print_buffer(&rxframe, &rxframe[0], 1, length, 16);
 #endif
-       /* Pass the received frame up for processing */
-       if (length)
-               net_process_received_packet(rxframe, length);
+
+       *packetp = rxframe;
+       return length;
+}
+
+static int axiemac_free_pkt(struct udevice *dev, uchar *packet, int length)
+{
+       struct axidma_priv *priv = dev_get_priv(dev);
 
 #ifdef DEBUG
        /* It is useful to clear buffer to be sure that it is consistent */
@@ -652,11 +653,12 @@ static int axi_emac_remove(struct udevice *dev)
 }
 
 static const struct eth_ops axi_emac_ops = {
-       .start                  = axiemac_init,
+       .start                  = axiemac_start,
        .send                   = axiemac_send,
        .recv                   = axiemac_recv,
-       .stop                   = axiemac_halt,
-       .write_hwaddr           = axiemac_setup_mac,
+       .free_pkt               = axiemac_free_pkt,
+       .stop                   = axiemac_stop,
+       .write_hwaddr           = axiemac_write_hwaddr,
 };
 
 static int axi_emac_ofdata_to_platdata(struct udevice *dev)