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>
This commit is contained in:
@@ -12,10 +12,6 @@
|
|||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
#ifndef CONFIG_DM_ETH
|
|
||||||
#include <netdev.h>
|
|
||||||
#endif
|
|
||||||
#include <miiphy.h>
|
|
||||||
#include <serial.h>
|
#include <serial.h>
|
||||||
#ifdef CONFIG_SPL_BUILD
|
#ifdef CONFIG_SPL_BUILD
|
||||||
#include <spl.h>
|
#include <spl.h>
|
||||||
@@ -221,14 +217,6 @@ int cpu_eth_init(bd_t *bis)
|
|||||||
mdelay(200);
|
mdelay(200);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined CONFIG_SUNXI_EMAC && !defined CONFIG_DM_ETH
|
|
||||||
rc = sunxi_emac_initialize(bis);
|
|
||||||
if (rc < 0) {
|
|
||||||
printf("sunxi: failed to initialize emac\n");
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_SUNXI_GMAC
|
#ifdef CONFIG_SUNXI_GMAC
|
||||||
rc = sunxi_gmac_initialize(bis);
|
rc = sunxi_gmac_initialize(bis);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
@@ -513,74 +513,6 @@ static void sunxi_emac_board_setup(struct emac_eth_dev *priv)
|
|||||||
clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2);
|
clrsetbits_le32(®s->mac_mcfg, 0xf << 2, 0xd << 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_DM_ETH
|
|
||||||
static int sunxi_emac_eth_init(struct eth_device *dev, bd_t *bis)
|
|
||||||
{
|
|
||||||
return _sunxi_emac_eth_init(dev->priv, dev->enetaddr);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sunxi_emac_eth_halt(struct eth_device *dev)
|
|
||||||
{
|
|
||||||
/* Nothing to do here */
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sunxi_emac_eth_recv(struct eth_device *dev)
|
|
||||||
{
|
|
||||||
int rx_len;
|
|
||||||
|
|
||||||
rx_len = _sunxi_emac_eth_recv(dev->priv, net_rx_packets[0]);
|
|
||||||
if (rx_len <= 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* Pass to upper layer */
|
|
||||||
net_process_received_packet(net_rx_packets[0], rx_len);
|
|
||||||
|
|
||||||
return rx_len;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int sunxi_emac_eth_send(struct eth_device *dev, void *packet, int length)
|
|
||||||
{
|
|
||||||
return _sunxi_emac_eth_send(dev->priv, packet, length);
|
|
||||||
}
|
|
||||||
|
|
||||||
int sunxi_emac_initialize(void)
|
|
||||||
{
|
|
||||||
struct emac_regs *regs =
|
|
||||||
(struct emac_regs *)SUNXI_EMAC_BASE;
|
|
||||||
struct eth_device *dev;
|
|
||||||
struct emac_eth_dev *priv;
|
|
||||||
|
|
||||||
dev = malloc(sizeof(*dev));
|
|
||||||
if (dev == NULL)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
priv = (struct emac_eth_dev *)malloc(sizeof(struct emac_eth_dev));
|
|
||||||
if (!priv) {
|
|
||||||
free(dev);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(dev, 0, sizeof(*dev));
|
|
||||||
memset(priv, 0, sizeof(struct emac_eth_dev));
|
|
||||||
|
|
||||||
priv->regs = regs;
|
|
||||||
dev->iobase = (int)regs;
|
|
||||||
dev->priv = priv;
|
|
||||||
dev->init = sunxi_emac_eth_init;
|
|
||||||
dev->halt = sunxi_emac_eth_halt;
|
|
||||||
dev->send = sunxi_emac_eth_send;
|
|
||||||
dev->recv = sunxi_emac_eth_recv;
|
|
||||||
strcpy(dev->name, "emac");
|
|
||||||
|
|
||||||
sunxi_emac_board_setup(priv);
|
|
||||||
|
|
||||||
eth_register(dev);
|
|
||||||
|
|
||||||
return sunxi_emac_init_phy(priv, dev);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_DM_ETH
|
|
||||||
static int sunxi_emac_eth_start(struct udevice *dev)
|
static int sunxi_emac_eth_start(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct eth_pdata *pdata = dev_get_platdata(dev);
|
struct eth_pdata *pdata = dev_get_platdata(dev);
|
||||||
@@ -653,4 +585,3 @@ U_BOOT_DRIVER(eth_sunxi_emac) = {
|
|||||||
.priv_auto_alloc_size = sizeof(struct emac_eth_dev),
|
.priv_auto_alloc_size = sizeof(struct emac_eth_dev),
|
||||||
.platdata_auto_alloc_size = sizeof(struct eth_pdata),
|
.platdata_auto_alloc_size = sizeof(struct eth_pdata),
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
@@ -80,7 +80,6 @@ int sh_eth_initialize(bd_t *bis);
|
|||||||
int skge_initialize(bd_t *bis);
|
int skge_initialize(bd_t *bis);
|
||||||
int smc91111_initialize(u8 dev_num, int base_addr);
|
int smc91111_initialize(u8 dev_num, int base_addr);
|
||||||
int smc911x_initialize(u8 dev_num, int base_addr);
|
int smc911x_initialize(u8 dev_num, int base_addr);
|
||||||
int sunxi_emac_initialize(bd_t *bis);
|
|
||||||
int tsi108_eth_initialize(bd_t *bis);
|
int tsi108_eth_initialize(bd_t *bis);
|
||||||
int uec_standard_init(bd_t *bis);
|
int uec_standard_init(bd_t *bis);
|
||||||
int uli526x_initialize(bd_t *bis);
|
int uli526x_initialize(bd_t *bis);
|
||||||
|
Reference in New Issue
Block a user