]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - drivers/net/tsi108_eth.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / drivers / net / tsi108_eth.c
index 524e9daa4cb4a79ec99a4ffaaf5bcfb7afbda8f4..079354aaff361dd9f18301b3fc2a7d7e7466be98 100644 (file)
@@ -27,9 +27,6 @@
 
 #include <config.h>
 
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI) \
-       && defined(CONFIG_TSI108_ETH)
-
 #if !defined(CONFIG_TSI108_ETH_NUM_PORTS) || (CONFIG_TSI108_ETH_NUM_PORTS > 2)
 #error "CONFIG_TSI108_ETH_NUM_PORTS must be defined as 1 or 2"
 #endif
@@ -37,6 +34,7 @@
 #include <common.h>
 #include <malloc.h>
 #include <net.h>
+#include <netdev.h>
 #include <asm/cache.h>
 
 #ifdef DEBUG
@@ -56,7 +54,7 @@ printf ("%s %d: " fmt, __FUNCTION__, __LINE__, ##args)
 #define RX_PRINT_ERRORS
 #define TX_PRINT_ERRORS
 
-#define ETH_BASE       (CFG_TSI108_CSR_BASE + 0x6000)
+#define ETH_BASE       (CONFIG_SYS_TSI108_CSR_BASE + 0x6000)
 
 #define ETH_PORT_OFFSET        0x400
 
@@ -792,7 +790,7 @@ static int tsi108_eth_probe (struct eth_device *dev, bd_t * bis)
            (dev->enetaddr[0] << 16);
 
        if (marvell_88e_phy_config(dev, &speed, &duplex) == 0)
-               return 0;
+               return -1;
 
        value =
            MAC_CONFIG_2_PREAMBLE_LENGTH(7) | MAC_CONFIG_2_PAD_CRC |
@@ -864,7 +862,7 @@ static int tsi108_eth_probe (struct eth_device *dev, bd_t * bis)
        /* enable TX queue */
        reg_TX_CONTROL(base) = TX_CONTROL_GO | 0x01;
 
-       return 1;
+       return 0;
 }
 
 /*
@@ -902,7 +900,7 @@ static int tsi108_eth_send (struct eth_device *dev,
        status = le32_to_cpu(tx_descr->config_status);
        if ((status & DMA_DESCR_TX_OK) == 0) {
 #ifdef TX_PRINT_ERRORS
-               printf ("TX packet error: 0x%08x\n    %s%s%s%s\n", status,
+               printf ("TX packet error: 0x%08lx\n    %s%s%s%s\n", status,
                       status & DMA_DESCR_TX_OK ? "tx error, " : "",
                       status & DMA_DESCR_TX_RETRY_LIMIT ?
                       "retry limit reached, " : "",
@@ -962,7 +960,7 @@ static int tsi108_eth_recv (struct eth_device *dev)
                status = le32_to_cpu(rx_descr->config_status);
                if (status & DMA_DESCR_RX_BAD_FRAME) {
 #ifdef RX_PRINT_ERRORS
-                       printf ("RX packet error: 0x%08x\n    %s%s%s%s%s%s\n",
+                       printf ("RX packet error: 0x%08lx\n    %s%s%s%s%s%s\n",
                               status,
                               status & DMA_DESCR_RX_FRAME_IS_TYPE ? "too big, "
                               : "",
@@ -1032,5 +1030,3 @@ static void tsi108_eth_halt (struct eth_device *dev)
        /* Put MAC into reset state. */
        reg_MAC_CONFIG_1(base) = MAC_CONFIG_1_SOFT_RESET;
 }
-
-#endif