Re: [U-Boot] [PATCH 5/5] vybrid: add ethernet driver support

2013-04-13 Thread wang alison
Hi, Fabio,

On Fri, Apr 12, 2013 at 3:53 AM, Alison Wang b18...@freescale.com wrote:
 This patch adds ethernet driver support for vybrid platform.

 Signed-off-by: TsiChung Liew tsicl...@gmail.com
 Signed-off-by: Jason Jin jason@freescale.com
 Signed-off-by: Alison Wang b18...@freescale.com
 ---
  arch/arm/include/asm/fec.h| 302 
 ++
  arch/arm/include/asm/u-boot.h |   3 +
  drivers/net/mcffec.c  |  18 ++-
  drivers/net/mcfmii.c  |   5 +-

Can't we use the mxc_fec driver here?

In the kernel we have only one FEC driver that is common to Coldfire,
imx and MPC.

[Alison] Agree, I will investigate it.

Thanks!

Best Regards,
Alison Wang
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/5] vybrid: add ethernet driver support

2013-04-12 Thread Alison Wang
This patch adds ethernet driver support for vybrid platform.

Signed-off-by: TsiChung Liew tsicl...@gmail.com
Signed-off-by: Jason Jin jason@freescale.com
Signed-off-by: Alison Wang b18...@freescale.com
---
 arch/arm/include/asm/fec.h| 302 ++
 arch/arm/include/asm/u-boot.h |   3 +
 drivers/net/mcffec.c  |  18 ++-
 drivers/net/mcfmii.c  |   5 +-
 4 files changed, 322 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/include/asm/fec.h

diff --git a/arch/arm/include/asm/fec.h b/arch/arm/include/asm/fec.h
new file mode 100644
index 000..5bb946e
--- /dev/null
+++ b/arch/arm/include/asm/fec.h
@@ -0,0 +1,302 @@
+/*
+ * fec.h -- Fast Ethernet Controller definitions
+ *
+ * Some definitions copied from commproc.h for MPC8xx:
+ * MPC8xx Communication Processor Module.
+ *
+ * Add FEC Structure and definitions
+ * Copyright 2004-2013 Freescale Semiconductor, Inc.
+ *
+ * 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
+ */
+
+#ifndeffec_h
+#definefec_h
+
+/* Buffer descriptors used FEC */
+typedef struct cpm_buf_desc {
+   ushort cbd_datlen;  /* Data length in buffer */
+   ushort cbd_sc;  /* Status and Control */
+   uint cbd_bufaddr;   /* Buffer address in host memory */
+} cbd_t;
+
+#define BD_SC_EMPTY((ushort)0x8000) /* Receive is empty */
+#define BD_SC_READY((ushort)0x8000) /* Transmit is ready */
+#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
+#define BD_SC_INTRPT   ((ushort)0x1000) /* Interrupt on change */
+#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
+#define BD_SC_TC   ((ushort)0x0400) /* Transmit CRC */
+#define BD_SC_CM   ((ushort)0x0200) /* Continous mode */
+#define BD_SC_ID   ((ushort)0x0100) /* Rec'd too many idles */
+#define BD_SC_P((ushort)0x0100) /* xmt preamble */
+#define BD_SC_BR   ((ushort)0x0020) /* Break received */
+#define BD_SC_FR   ((ushort)0x0010) /* Framing error */
+#define BD_SC_PR   ((ushort)0x0008) /* Parity error */
+#define BD_SC_OV   ((ushort)0x0002) /* Overrun */
+#define BD_SC_CD   ((ushort)0x0001) /* Carrier Detect lost */
+
+/* Buffer descriptor control/status used by Ethernet receive */
+#define BD_ENET_RX_EMPTY   ((ushort)0x8000)
+#define BD_ENET_RX_RO1 ((ushort)0x4000)
+#define BD_ENET_RX_WRAP((ushort)0x2000)
+#define BD_ENET_RX_INTR((ushort)0x1000)
+#define BD_ENET_RX_RO2 BD_ENET_RX_INTR
+#define BD_ENET_RX_LAST((ushort)0x0800)
+#define BD_ENET_RX_FIRST   ((ushort)0x0400)
+#define BD_ENET_RX_MISS((ushort)0x0100)
+#define BD_ENET_RX_BC  ((ushort)0x0080)
+#define BD_ENET_RX_MC  ((ushort)0x0040)
+#define BD_ENET_RX_LG  ((ushort)0x0020)
+#define BD_ENET_RX_NO  ((ushort)0x0010)
+#define BD_ENET_RX_SH  ((ushort)0x0008)
+#define BD_ENET_RX_CR  ((ushort)0x0004)
+#define BD_ENET_RX_OV  ((ushort)0x0002)
+#define BD_ENET_RX_CL  ((ushort)0x0001)
+#define BD_ENET_RX_TR  BD_ENET_RX_CL
+#define BD_ENET_RX_STATS   ((ushort)0x013f)/* All status bits */
+
+/* Buffer descriptor control/status used by Ethernet transmit */
+#define BD_ENET_TX_READY   ((ushort)0x8000)
+#define BD_ENET_TX_PAD ((ushort)0x4000)
+#define BD_ENET_TX_TO1 BD_ENET_TX_PAD
+#define BD_ENET_TX_WRAP((ushort)0x2000)
+#define BD_ENET_TX_INTR((ushort)0x1000)
+#define BD_ENET_TX_TO2 BD_ENET_TX_INTR_
+#define BD_ENET_TX_LAST((ushort)0x0800)
+#define BD_ENET_TX_TC  ((ushort)0x0400)
+#define BD_ENET_TX_DEF ((ushort)0x0200)
+#define BD_ENET_TX_ABC BD_ENET_TX_DEF
+#define BD_ENET_TX_HB  ((ushort)0x0100)
+#define BD_ENET_TX_LC  ((ushort)0x0080)
+#define BD_ENET_TX_RL  ((ushort)0x0040)
+#define BD_ENET_TX_RCMASK  ((ushort)0x003c)
+#define BD_ENET_TX_UN  ((ushort)0x0002)
+#define BD_ENET_TX_CSL ((ushort)0x0001)
+#define BD_ENET_TX_STATS   

Re: [U-Boot] [PATCH 5/5] vybrid: add ethernet driver support

2013-04-12 Thread Fabio Estevam
On Fri, Apr 12, 2013 at 3:53 AM, Alison Wang b18...@freescale.com wrote:
 This patch adds ethernet driver support for vybrid platform.

 Signed-off-by: TsiChung Liew tsicl...@gmail.com
 Signed-off-by: Jason Jin jason@freescale.com
 Signed-off-by: Alison Wang b18...@freescale.com
 ---
  arch/arm/include/asm/fec.h| 302 
 ++
  arch/arm/include/asm/u-boot.h |   3 +
  drivers/net/mcffec.c  |  18 ++-
  drivers/net/mcfmii.c  |   5 +-

Can't we use the mxc_fec driver here?

In the kernel we have only one FEC driver that is common to Coldfire,
imx and MPC.

Regards,

Fabio Estevam
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot