[U-Boot] [PATCH 2/3] Add support W90P710 EMC interface

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Feb 9 13:51:06 CET 2009


On 13:10 Mon 09 Feb     , Vovk Konstantin wrote:
> This will add Ethernet interfacse to uBoot
> W90P710 ARM SoC port. If you want reset
> and initialize PHY KSZ8001 after MAC init,
> simply add CONFIG_RESET_PHY_R define in your
> board configuration file. In most cases this is
> not necessarily.
> ---
>   drivers/net/Makefile      |    5 +-
>   drivers/net/w90p710_eth.c |  482 +++++++++++++++++++++++++++++++++++++++++++++
>   drivers/net/w90p710_eth.h |  277 ++++++++++++++++++++++++++
>   include/netdev.h          |    3 +-
>   4 files changed, 763 insertions(+), 4 deletions(-)
>   create mode 100644 drivers/net/w90p710_eth.c
>   create mode 100644 drivers/net/w90p710_eth.h
> 
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 128dc11..2dff5a5 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk
>   LIB	:= $(obj)libnet.a
> 
>   COBJS-$(CONFIG_DRIVER_3C589) += 3c589.o
> -COBJS-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
>   COBJS-$(CONFIG_DRIVER_AX88180) += ax88180.o
>   COBJS-$(CONFIG_BCM570x) += bcm570x.o bcm570x_autoneg.o 5701rls.o
>   COBJS-$(CONFIG_BFIN_MAC) += bfin_mac.o
> @@ -55,11 +54,11 @@ COBJS-$(CONFIG_NS8382X) += ns8382x.o
>   COBJS-$(CONFIG_DRIVER_NS9750_ETHERNET) += ns9750_eth.o
>   COBJS-$(CONFIG_PCNET) += pcnet.o
>   COBJS-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
> +COBJS-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
why?
>   COBJS-$(CONFIG_DRIVER_RTL8019) += rtl8019.o
>   COBJS-$(CONFIG_RTL8139) += rtl8139.o
>   COBJS-$(CONFIG_RTL8169) += rtl8169.o
>   COBJS-$(CONFIG_DRIVER_S3C4510_ETH) += s3c4510b_eth.o
> -COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
>   COBJS-$(CONFIG_DRIVER_SMC91111) += smc91111.o
>   COBJS-$(CONFIG_DRIVER_SMC911X) += smc911x.o
>   COBJS-$(CONFIG_TIGON3) += tigon3.o bcm570x_autoneg.o 5701rls.o
> @@ -69,6 +68,8 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o
>   COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o
>   COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o
>   COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
> +COBJS-$(CONFIG_SH_ETHER) += sh_eth.o
> +COBJS-$(CONFIG_DRIVER_W90P710_ETH) += w90p710_eth.o
> 
>   COBJS	:= $(COBJS-y)
>   SRCS	:= $(COBJS:.o=.c)
> diff --git a/drivers/net/w90p710_eth.c b/drivers/net/w90p710_eth.c
> new file mode 100644
> index 0000000..654df08
> --- /dev/null
> +++ b/drivers/net/w90p710_eth.c
> @@ -0,0 +1,482 @@
> +/***********************************************************************
> + *
> + * (C) Copyright 2008
> + * KSL Embedded Development Team <www.kslemb.com>
> + * Konstantin Vovk <ksl at kslemb.com>
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + *
> + * Description:   Ethernet interface for Winbond W90P710 SoC
> + */
> +
> +#include <common.h>
> +#ifdef CONFIG_DRIVER_W90P710_ETH
> +
> +#include <command.h>
> +#include <net.h>
> +#include <malloc.h>
> +#include <asm/hardware.h>
> +#include "w90p710_eth.h"
> +
> +#ifdef CONFIG_STATUS_LED
> +#include <status_led.h>
> +#endif
> +
> +#if 0
> +#define DEBUG
> +#endif
please remove if no need
> +
> +#if 1
> +#define DEBUG_PHY_RESET
> +#endif
please the if 1 if no need
> +
> +#ifdef	DEBUG
> +#define printk(fmt, args...)	printf(fmt, ##args)
> +#else
> +#define printk(fmt, args...)
> +#endif
please use debug()
> +
> +#ifdef DEBUG_PHY_RESET
> +#define print_phy(fmt, args...)	printf(fmt, ##args)
> +#else
> +#define print_phy(fmt, args...)
> +#endif
> +
> +static TX_FrameDescriptor	txFDbase[ETH_MaxTxFrames];
please no uppper case in struct name or var or function
> +static MACFrame			txFrameBase[ETH_MaxTxFrames];
> +static RX_FrameDescriptor	rxFDbase[PKTBUFSRX];
> +static ETH			m_eth;
> +
Best Regards,
J.


More information about the U-Boot mailing list