Commit d17e1577a203e486d8a15bfa015a6410d99079de

Authored by Hans de Goede
1 parent b6006baf9c

sunxi: emac: Remove non driver-model code

All sunxi boards now use the driver-model, so remove the non driver-model
code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ian Campbell <ijc@hellion.org.uk>

Showing 3 changed files with 0 additions and 82 deletions Side-by-side Diff

arch/arm/cpu/armv7/sunxi/board.c
... ... @@ -12,10 +12,6 @@
12 12  
13 13 #include <common.h>
14 14 #include <i2c.h>
15   -#ifndef CONFIG_DM_ETH
16   -#include <netdev.h>
17   -#endif
18   -#include <miiphy.h>
19 15 #include <serial.h>
20 16 #ifdef CONFIG_SPL_BUILD
21 17 #include <spl.h>
... ... @@ -219,14 +215,6 @@
219 215 #ifdef CONFIG_MACPWR
220 216 gpio_direction_output(CONFIG_MACPWR, 1);
221 217 mdelay(200);
222   -#endif
223   -
224   -#if defined CONFIG_SUNXI_EMAC && !defined CONFIG_DM_ETH
225   - rc = sunxi_emac_initialize(bis);
226   - if (rc < 0) {
227   - printf("sunxi: failed to initialize emac\n");
228   - return rc;
229   - }
230 218 #endif
231 219  
232 220 #ifdef CONFIG_SUNXI_GMAC
drivers/net/sunxi_emac.c
... ... @@ -513,74 +513,6 @@
513 513 clrsetbits_le32(&regs->mac_mcfg, 0xf << 2, 0xd << 2);
514 514 }
515 515  
516   -#ifndef CONFIG_DM_ETH
517   -static int sunxi_emac_eth_init(struct eth_device *dev, bd_t *bis)
518   -{
519   - return _sunxi_emac_eth_init(dev->priv, dev->enetaddr);
520   -}
521   -
522   -static void sunxi_emac_eth_halt(struct eth_device *dev)
523   -{
524   - /* Nothing to do here */
525   -}
526   -
527   -static int sunxi_emac_eth_recv(struct eth_device *dev)
528   -{
529   - int rx_len;
530   -
531   - rx_len = _sunxi_emac_eth_recv(dev->priv, net_rx_packets[0]);
532   - if (rx_len <= 0)
533   - return 0;
534   -
535   - /* Pass to upper layer */
536   - net_process_received_packet(net_rx_packets[0], rx_len);
537   -
538   - return rx_len;
539   -}
540   -
541   -static int sunxi_emac_eth_send(struct eth_device *dev, void *packet, int length)
542   -{
543   - return _sunxi_emac_eth_send(dev->priv, packet, length);
544   -}
545   -
546   -int sunxi_emac_initialize(void)
547   -{
548   - struct emac_regs *regs =
549   - (struct emac_regs *)SUNXI_EMAC_BASE;
550   - struct eth_device *dev;
551   - struct emac_eth_dev *priv;
552   -
553   - dev = malloc(sizeof(*dev));
554   - if (dev == NULL)
555   - return -ENOMEM;
556   -
557   - priv = (struct emac_eth_dev *)malloc(sizeof(struct emac_eth_dev));
558   - if (!priv) {
559   - free(dev);
560   - return -ENOMEM;
561   - }
562   -
563   - memset(dev, 0, sizeof(*dev));
564   - memset(priv, 0, sizeof(struct emac_eth_dev));
565   -
566   - priv->regs = regs;
567   - dev->iobase = (int)regs;
568   - dev->priv = priv;
569   - dev->init = sunxi_emac_eth_init;
570   - dev->halt = sunxi_emac_eth_halt;
571   - dev->send = sunxi_emac_eth_send;
572   - dev->recv = sunxi_emac_eth_recv;
573   - strcpy(dev->name, "emac");
574   -
575   - sunxi_emac_board_setup(priv);
576   -
577   - eth_register(dev);
578   -
579   - return sunxi_emac_init_phy(priv, dev);
580   -}
581   -#endif
582   -
583   -#ifdef CONFIG_DM_ETH
584 516 static int sunxi_emac_eth_start(struct udevice *dev)
585 517 {
586 518 struct eth_pdata *pdata = dev_get_platdata(dev);
... ... @@ -653,5 +585,4 @@
653 585 .priv_auto_alloc_size = sizeof(struct emac_eth_dev),
654 586 .platdata_auto_alloc_size = sizeof(struct eth_pdata),
655 587 };
656   -#endif
... ... @@ -80,7 +80,6 @@
80 80 int skge_initialize(bd_t *bis);
81 81 int smc91111_initialize(u8 dev_num, int base_addr);
82 82 int smc911x_initialize(u8 dev_num, int base_addr);
83   -int sunxi_emac_initialize(bd_t *bis);
84 83 int tsi108_eth_initialize(bd_t *bis);
85 84 int uec_standard_init(bd_t *bis);
86 85 int uli526x_initialize(bd_t *bis);