X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=drivers%2Fnet%2Fmcffec.c;h=9a3a8455a11af595375a85228825fced5a7f2055;hb=68a6aa85ecbab5696fdcf970fdd7b7fe5a967146;hp=7c4b210b00111070b4b037cb944a4e1481969bd1;hpb=5480ac32171ab0e38c48c9f585fa650c7867f6a1;p=platform%2Fkernel%2Fu-boot.git diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c index 7c4b210..9a3a845 100644 --- a/drivers/net/mcffec.c +++ b/drivers/net/mcffec.c @@ -1,14 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000-2004 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * (C) Copyright 2007 Freescale Semiconductor, Inc. * TsiChung Liew (Tsi-Chung.Liew@freescale.com) - * - * SPDX-License-Identifier: GPL-2.0+ */ #include +#include #include #include @@ -18,6 +18,7 @@ #include #include +#include #undef ET_DEBUG #undef MII_DEBUG @@ -32,8 +33,6 @@ #define BD_ENET_RX_W_E (BD_ENET_RX_WRAP | BD_ENET_RX_EMPTY) #define BD_ENET_TX_RDY_LST (BD_ENET_TX_READY | BD_ENET_TX_LAST) -DECLARE_GLOBAL_DATA_PTR; - struct fec_info_s fec_info[] = { #ifdef CONFIG_SYS_FEC0_IOBASE { @@ -219,7 +218,8 @@ int fec_recv(struct eth_device *dev) length -= 4; /* Pass the packet up to the protocol layers. */ - NetReceive(NetRxPackets[info->rxIdx], length); + net_process_received_packet(net_rx_packets[info->rxIdx], + length); fecp->eir |= FEC_EIR_RXF; } @@ -427,25 +427,25 @@ int fec_init(struct eth_device *dev, bd_t * bd) if ((u32) fecp == CONFIG_SYS_FEC0_IOBASE) { #ifdef CONFIG_SYS_FEC1_IOBASE volatile fec_t *fecp1 = (fec_t *) (CONFIG_SYS_FEC1_IOBASE); - eth_getenv_enetaddr("eth1addr", ea); + eth_env_get_enetaddr("eth1addr", ea); fecp1->palr = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]); fecp1->paur = (ea[4] << 24) | (ea[5] << 16); #endif - eth_getenv_enetaddr("ethaddr", ea); + eth_env_get_enetaddr("ethaddr", ea); fecp->palr = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]); fecp->paur = (ea[4] << 24) | (ea[5] << 16); } else { #ifdef CONFIG_SYS_FEC0_IOBASE volatile fec_t *fecp0 = (fec_t *) (CONFIG_SYS_FEC0_IOBASE); - eth_getenv_enetaddr("ethaddr", ea); + eth_env_get_enetaddr("ethaddr", ea); fecp0->palr = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]); fecp0->paur = (ea[4] << 24) | (ea[5] << 16); #endif #ifdef CONFIG_SYS_FEC1_IOBASE - eth_getenv_enetaddr("eth1addr", ea); + eth_env_get_enetaddr("eth1addr", ea); fecp->palr = (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]); fecp->paur = (ea[4] << 24) | (ea[5] << 16); @@ -464,7 +464,7 @@ int fec_init(struct eth_device *dev, bd_t * bd) fecp->emrbr = PKT_MAXBLR_SIZE; /* - * Setup Buffers and Buffer Desriptors + * Setup Buffers and Buffer Descriptors */ info->rxIdx = 0; info->txIdx = 0; @@ -477,7 +477,7 @@ int fec_init(struct eth_device *dev, bd_t * bd) for (i = 0; i < PKTBUFSRX; i++) { info->rxbd[i].cbd_sc = BD_ENET_RX_EMPTY; info->rxbd[i].cbd_datlen = 0; /* Reset */ - info->rxbd[i].cbd_bufaddr = (uint) NetRxPackets[i]; + info->rxbd[i].cbd_bufaddr = (uint) net_rx_packets[i]; } info->rxbd[PKTBUFSRX - 1].cbd_sc |= BD_ENET_RX_WRAP; @@ -594,8 +594,17 @@ int mcffec_initialize(bd_t * bis) eth_register(dev); #if defined(CONFIG_MII) || defined(CONFIG_CMD_MII) - miiphy_register(dev->name, - mcffec_miiphy_read, mcffec_miiphy_write); + int retval; + struct mii_dev *mdiodev = mdio_alloc(); + if (!mdiodev) + return -ENOMEM; + strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); + mdiodev->read = mcffec_miiphy_read; + mdiodev->write = mcffec_miiphy_write; + + retval = mdio_register(mdiodev); + if (retval < 0) + return retval; #endif if (i > 0) fec_info[i - 1].next = &fec_info[i];