]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - arch/powerpc/cpu/mpc8260/ether_fcc.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc8260 / ether_fcc.c
index c82958db1b69a920dddcbd8c84222dbd2fe809d6..f9f15b59e539cba75c143cb486a0a01a1b43a35f 100644 (file)
@@ -6,23 +6,7 @@
  * (C) Copyright 2000 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  * Marius Groeger <mgroeger@sysgo.de>
  *
- * 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
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -53,8 +37,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET) && \
-       defined(CONFIG_NET_MULTI)
+#if defined(CONFIG_ETHER_ON_FCC) && defined(CONFIG_CMD_NET)
 
 static struct ether_fcc_info_s
 {
@@ -143,7 +126,7 @@ static RTXBD rtx __attribute__ ((aligned(8)));
 #error "rtx must be 64-bit aligned"
 #endif
 
-static int fec_send(struct eth_device* dev, volatile void *packet, int length)
+static int fec_send(struct eth_device *dev, void *packet, int length)
 {
     int i;
     int result = 0;
@@ -662,32 +645,7 @@ eth_loopback_test (void)
 
        /* 28.9 - (1-2): ioports have been set up already */
 
-#if defined(CONFIG_HYMOD)
-       /*
-        * Attention: this is board-specific
-        * 0, FCC1
-        * 1, FCC2
-        * 2, FCC3
-        */
-#       define FCC_START_LOOP 0
-#       define FCC_END_LOOP   2
-
-       /*
-        * Attention: this is board-specific
-        * - FCC1 Rx-CLK is CLK10
-        * - FCC1 Tx-CLK is CLK11
-        * - FCC2 Rx-CLK is CLK13
-        * - FCC2 Tx-CLK is CLK14
-        * - FCC3 Rx-CLK is CLK15
-        * - FCC3 Tx-CLK is CLK16
-        */
-
-       /* 28.9 - (3): connect FCC's tx and rx clocks */
-       immr->im_cpmux.cmx_uar = 0;
-       immr->im_cpmux.cmx_fcr = CMXFCR_RF1CS_CLK10|CMXFCR_TF1CS_CLK11|\
-           CMXFCR_RF2CS_CLK13|CMXFCR_TF2CS_CLK14|\
-           CMXFCR_RF3CS_CLK15|CMXFCR_TF3CS_CLK16;
-#elif defined(CONFIG_SBC8260) || defined(CONFIG_SACSng)
+#if defined(CONFIG_SACSng)
        /*
         * Attention: this is board-specific
         * 1, FCC2
@@ -1050,11 +1008,11 @@ eth_loopback_test (void)
                                        }
                                        else {
                                                ushort datlen = bdp->cbd_datlen;
-                                               Ethernet_t *ehp;
+                                               struct ethernet_hdr *ehp;
                                                ushort prot;
                                                int ours, tb, n, nbytes;
 
-                                               ehp = (Ethernet_t *) \
+                                               ehp = (struct ethernet_hdr *) \
                                                        &ecp->rxbufs[i][0];
 
                                                ours = memcmp (ehp->et_src, \
@@ -1064,9 +1022,8 @@ eth_loopback_test (void)
                                                tb = prot & 0x8000;
                                                n = prot & 0x7fff;
 
-                                               nbytes = ELBT_BUFSZ - \
-                                                       offsetof (Ethernet_t, \
-                                                               et_dsap) - \
+                                               nbytes = ELBT_BUFSZ -
+                                                       ETHER_HDR_SIZE -
                                                        ELBT_CRCSZ;
 
                                                /* check the frame is correct */
@@ -1081,10 +1038,10 @@ eth_loopback_test (void)
                                                                patwords[n];
                                                        uint nbb;
 
-                                                       nbb = badbits ( \
-                                                               &ehp->et_dsap, \
-                                                               nbytes, \
-                                                               patword);
+                                                       nbb = badbits(
+                                                           ((uchar *)&ehp) +
+                                                           ETHER_HDR_SIZE,
+                                                           nbytes, patword);
 
                                                        ecp->rxeacc.badbit += \
                                                                nbb;