net: sh-eth: Add support R8A7790
[oweals/u-boot.git] / drivers / net / inca-ip_sw.c
index d852a150fa913a4dfb8c478f94ce500a6a0f386e..cdfbfa67d89d32d0e53e804e66a79a28ba74aa57 100644 (file)
@@ -4,23 +4,7 @@
  * (C) Copyright 2003-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.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+
  */
 
 
@@ -28,6 +12,7 @@
 
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/inca-ip.h>
 #include <asm/addrspace.h>
 
@@ -157,7 +142,7 @@ static int initialized      = 0;
 
 
 static int inca_switch_init(struct eth_device *dev, bd_t * bis);
-static int inca_switch_send(struct eth_device *dev, volatile void *packet, int length);
+static int inca_switch_send(struct eth_device *dev, void *packet, int length);
 static int inca_switch_recv(struct eth_device *dev);
 static void inca_switch_halt(struct eth_device *dev);
 static void inca_init_switch_chip(void);
@@ -199,7 +184,7 @@ int inca_switch_initialize(bd_t * bis)
        printf("Leaving inca_switch_initialize()\n");
 #endif
 
-       return 1;
+       return 0;
 }
 
 
@@ -290,9 +275,7 @@ static int inca_switch_init(struct eth_device *dev, bd_t * bis)
        /* Initialize RxDMA.
         */
        DMA_READ_REG(INCA_IP_DMA_DMA_RXISR, v);
-#if 0
-       printf("RX status = 0x%08X\n", v);
-#endif
+       debug("RX status = 0x%08X\n", v);
 
        /* Writing to the FRDA of CHANNEL.
         */
@@ -305,9 +288,7 @@ static int inca_switch_init(struct eth_device *dev, bd_t * bis)
        /* Initialize TxDMA.
         */
        DMA_READ_REG(INCA_IP_DMA_DMA_TXISR, v);
-#if 0
-       printf("TX status = 0x%08X\n", v);
-#endif
+       debug("TX status = 0x%08X\n", v);
 
        /* Writing to the FRDA of CHANNEL.
         */
@@ -337,7 +318,7 @@ static int inca_switch_init(struct eth_device *dev, bd_t * bis)
 }
 
 
-static int inca_switch_send(struct eth_device *dev, volatile void *packet, int length)
+static int inca_switch_send(struct eth_device *dev, void *packet, int length)
 {
        int                    i;
        int                    res      = -1;
@@ -755,7 +736,7 @@ static int inca_amdix(void)
                                        (0x1 << 31) |   /* RA           */
                                        (0x0 << 30) |   /* Read         */
                                        (0x6 << 21) |   /* LAN          */
-                                       (6   << 16));   /* PHY_ANER     */
+                                       (6   << 16));   /* MII_EXPANSION        */
                                do {
                                        SW_READ_REG(INCA_IP_Switch_MDIO_ACC, phyReg6);
                                } while (phyReg6 & (1 << 31));
@@ -768,7 +749,7 @@ static int inca_amdix(void)
                                                (0x1 << 31) |   /* RA           */
                                                (0x0 << 30) |   /* Read         */
                                                (0x6 << 21) |   /* LAN          */
-                                               (4   << 16));   /* PHY_ANAR     */
+                                               (4   << 16));   /* MII_ADVERTISE        */
                                        do {
                                                SW_READ_REG(INCA_IP_Switch_MDIO_ACC, phyReg4);
                                        } while (phyReg4 & (1 << 31));
@@ -781,7 +762,7 @@ static int inca_amdix(void)
                                                        (0x1 << 31) |   /* RA           */
                                                        (0x0 << 30) |   /* Read         */
                                                        (0x6 << 21) |   /* LAN          */
-                                                       (5   << 16));   /* PHY_ANLPAR   */
+                                                       (5   << 16));   /* MII_LPA      */
                                                do {
                                                        SW_READ_REG(INCA_IP_Switch_MDIO_ACC, phyReg5);
                                                } while (phyReg5 & (1 << 31));