net: ethoc: Remove non-DM_ETH code

As DM_ETH is required for all network drivers, it's now safe to
remove the non-DM_ETH support code.

Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Tom Rini 2022-11-27 10:25:11 -05:00
parent 4fb814f571
commit ecca44805d
2 changed files with 0 additions and 89 deletions

View File

@ -643,8 +643,6 @@ static inline int ethoc_phy_init(struct ethoc *priv, void *dev)
#endif #endif
#ifdef CONFIG_DM_ETH
static int ethoc_write_hwaddr(struct udevice *dev) static int ethoc_write_hwaddr(struct udevice *dev)
{ {
struct ethoc_eth_pdata *pdata = dev_get_plat(dev); struct ethoc_eth_pdata *pdata = dev_get_plat(dev);
@ -753,86 +751,3 @@ U_BOOT_DRIVER(ethoc) = {
.priv_auto = sizeof(struct ethoc), .priv_auto = sizeof(struct ethoc),
.plat_auto = sizeof(struct ethoc_eth_pdata), .plat_auto = sizeof(struct ethoc_eth_pdata),
}; };
#else
static int ethoc_init(struct eth_device *dev, struct bd_info *bd)
{
struct ethoc *priv = (struct ethoc *)dev->priv;
return ethoc_init_common(priv);
}
static int ethoc_write_hwaddr(struct eth_device *dev)
{
struct ethoc *priv = (struct ethoc *)dev->priv;
u8 *mac = dev->enetaddr;
return ethoc_write_hwaddr_common(priv, mac);
}
static int ethoc_send(struct eth_device *dev, void *packet, int length)
{
return ethoc_send_common(dev->priv, packet, length);
}
static void ethoc_halt(struct eth_device *dev)
{
ethoc_disable_rx_and_tx(dev->priv);
}
static int ethoc_recv(struct eth_device *dev)
{
struct ethoc *priv = (struct ethoc *)dev->priv;
int count;
if (!ethoc_is_new_packet_received(priv))
return 0;
for (count = 0; count < PKTBUFSRX; ++count) {
uchar *packetp;
int size = ethoc_rx_common(priv, &packetp);
if (size < 0)
break;
if (size > 0)
net_process_received_packet(packetp, size);
ethoc_free_pkt_common(priv);
}
return 0;
}
int ethoc_initialize(u8 dev_num, int base_addr)
{
struct ethoc *priv;
struct eth_device *dev;
priv = malloc(sizeof(*priv));
if (!priv)
return 0;
dev = malloc(sizeof(*dev));
if (!dev) {
free(priv);
return 0;
}
memset(dev, 0, sizeof(*dev));
dev->priv = priv;
dev->iobase = base_addr;
dev->init = ethoc_init;
dev->halt = ethoc_halt;
dev->send = ethoc_send;
dev->recv = ethoc_recv;
dev->write_hwaddr = ethoc_write_hwaddr;
sprintf(dev->name, "%s-%hu", "ETHOC", dev_num);
priv->iobase = ioremap(dev->iobase, ETHOC_IOSIZE);
eth_register(dev);
ethoc_mdio_init(dev->name, priv);
ethoc_phy_init(priv, dev);
return 1;
}
#endif

View File

@ -8,13 +8,9 @@
#include <net.h> #include <net.h>
#ifdef CONFIG_DM_ETH
struct ethoc_eth_pdata { struct ethoc_eth_pdata {
struct eth_pdata eth_pdata; struct eth_pdata eth_pdata;
phys_addr_t packet_base; phys_addr_t packet_base;
}; };
#endif
#endif /* _ETHOC_H */ #endif /* _ETHOC_H */