[U-Boot-Users] FW: resend#4 [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver

Ben Warren biggerbadderben at gmail.com
Thu Jan 17 20:23:09 CET 2008


Liew Tsi Chung wrote:
> Ben,
>
>   
>> I haven't seen the patch that removes the prototypes, but it's 
>> quite possible I looked past it. In a previous e-mail I added a
>> 'signed-off-by' that John Rigby can add to the patch commit. I 
>> consider this to be a Coldfire patch because it's dependent on 
>> other patches in the series and I have no way of testing it.
>>     
>
> Here is the one of the two copied from my email box, it will reach
> u-boot-mailinglist later (not sure how long).
>
> Regards,
> TsiChung
>
> -----Original Message-----
> From: Liew Tsi Chung 
> Sent: Thursday, January 17, 2008 11:20 AM
> To: U-Boot-Users
> Cc: Wolfgang Denx; Rigby John; Liew Tsi Chung
> Subject: resend#4 [PATCH 6/8] ColdFire: Add MCF547x_8x FEC driver
>
> Signed-off-by: TsiChungLiew <Tsi-Chung.Liew at freescale.com>
> ---
>  drivers/net/Makefile       |    1 +
>  drivers/net/fsl_mcdmafec.c |  571
> ++++++++++++++++++++++++++++++++++++++++++++
>  net/eth.c                  |    4 +
>  3 files changed, 576 insertions(+), 0 deletions(-)  create mode 100644
> drivers/net/fsl_mcdmafec.c
>
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile index
> 41e1bde..b9723fa 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -33,6 +33,7 @@ COBJS-y += dm9000x.o
>  COBJS-y += e1000.o
>  COBJS-y += eepro100.o
>  COBJS-y += enc28j60.o
> +COBJS-y += fsl_mcdmafec.o
>  COBJS-y += inca-ip_sw.o
>  COBJS-y += ks8695eth.o
>  COBJS-y += lan91c96.o
> diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c new
> file mode 100644 index 0000000..38cf85b
> --- /dev/null
> +++ b/drivers/net/fsl_mcdmafec.c
> @@ -0,0 +1,571 @@
> +/*
> + * (C) Copyright 2000-2004
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + *
> + * (C) Copyright 2007 Freescale Semiconductor, Inc.
> + * TsiChung Liew (Tsi-Chung.Liew at freescale.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
> + */
> +
> +#include <common.h>
> +#include <malloc.h>
> +#include <command.h>
> +#include <config.h>
> +#include <net.h>
> +#include <miiphy.h>
> +
> +#ifdef CONFIG_FSLDMAFEC
> +#undef	ET_DEBUG
> +#undef	MII_DEBUG
> +
> +/* Ethernet Transmit and Receive Buffers */
> +#define DBUF_LENGTH		1520
> +#define PKT_MAXBUF_SIZE		1518
> +#define PKT_MINBUF_SIZE		64
> +#define PKT_MAXBLR_SIZE		1536
> +#define LAST_PKTBUFSRX		PKTBUFSRX - 1
> +#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)
> +#define FIFO_ERRSTAT		(FIFO_STAT_RXW | FIFO_STAT_UF |
> FIFO_STAT_OF)
> +
> +/* RxBD bits definitions */
> +#define BD_ENET_RX_ERR	(BD_ENET_RX_LG | BD_ENET_RX_NO | BD_ENET_RX_CR |
> \
> +			 BD_ENET_RX_OV | BD_ENET_RX_TR)
> +
> +#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) #include 
> +<asm/immap.h> #include <asm/fsl_mcdmafec.h>
> +
> +#include "MCD_dma.h"
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +struct fec_info_dma fec_info[] = {
> +#ifdef CFG_FEC0_IOBASE
> +	{
> +	 0,			/* index */
> +	 CFG_FEC0_IOBASE,	/* io base */
> +	 CFG_FEC0_PINMUX,	/* gpio pin muxing */
> +	 CFG_FEC0_MIIBASE,	/* mii base */
> +	 -1,			/* phy_addr */
> +	 0,			/* duplex and speed */
> +	 0,			/* phy name */
> +	 0,			/* phyname init */
> +	 0,			/* RX BD */
> +	 0,			/* TX BD */
> +	 0,			/* rx Index */
> +	 0,			/* tx Index */
> +	 0,			/* tx buffer */
> +	 0,			/* initialized flag */
> +	 (struct fec_info_dma *)-1,	/* next */
> +	 FEC0_RX_TASK,		/* rxTask */
> +	 FEC0_TX_TASK,		/* txTask */
> +	 FEC0_RX_PRIORITY,	/* rxPri */
> +	 FEC0_TX_PRIORITY,	/* txPri */
> +	 FEC0_RX_INIT,		/* rxInit */
> +	 FEC0_TX_INIT,		/* txInit */
> +	 0,			/* usedTbdIndex */
> +	 0,			/* cleanTbdNum */
> +	 },
> +#endif
> +#ifdef CFG_FEC1_IOBASE
> +	{
> +	 1,			/* index */
> +	 CFG_FEC1_IOBASE,	/* io base */
> +	 CFG_FEC1_PINMUX,	/* gpio pin muxing */
> +	 CFG_FEC1_MIIBASE,	/* mii base */
> +	 -1,			/* phy_addr */
> +	 0,			/* duplex and speed */
> +	 0,			/* phy name */
> +	 0,			/* phy name init */
> +	 0,			/* RX BD */
> +	 0,			/* TX BD */
> +	 0,			/* rx Index */
> +	 0,			/* tx Index */
> +	 0,			/* tx buffer */
> +	 0,			/* initialized flag */
> +	 (struct fec_info_dma *)-1,	/* next */
> +	 FEC1_RX_TASK,		/* rxTask */
> +	 FEC1_TX_TASK,		/* txTask */
> +	 FEC1_RX_PRIORITY,	/* rxPri */
> +	 FEC1_TX_PRIORITY,	/* txPri */
> +	 FEC1_RX_INIT,		/* rxInit */
> +	 FEC1_TX_INIT,		/* txInit */
> +	 0,			/* usedTbdIndex */
> +	 0,			/* cleanTbdNum */
> +	 }
> +#endif
> +};
> +
> +int fec_send(struct eth_device *dev, volatile void *packet, int 
> +length); int fec_recv(struct eth_device *dev); int fec_init(struct 
> +eth_device *dev, bd_t * bd); void fec_halt(struct eth_device *dev);
> +
>   
It looks like you have line wrapping issues here, and elsewhere. If you 
clean it up, John Rigby can pull in this patch and add my:

Signed-off-by: Ben Warren <biggerbadderben at gmail.com>

regards,
Ben




More information about the U-Boot mailing list