[Skyeye-developer] SF.net SVN: skyeye: [301] skyeye-v1/trunk/misc/linux_driver/rtl8019

Michael.Kang blackfin.kang at gmail.com
Thu Aug 30 10:34:48 CST 2007


Revision: 301
          http://skyeye.svn.sourceforge.net/skyeye/?rev=301&view=rev
Author:   kangsh
Date:     2007-08-29 19:33:15 -0700 (Wed, 29 Aug 2007)

Log Message:
-----------
commit the patch anthony_20070830_rtl8019-driver.patch from anthony, the
original patch can be found at :
http://lists.gro.clinux.org/pipermail/skyeye-developer/2007-August/001487.html

Modified Paths:
--------------
    skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.c
    skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.h

Modified: skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.c
===================================================================
--- skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.c 2007-08-30
02:31:36 UTC (rev 300)
+++ skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.c 2007-08-30
02:33:15 UTC (rev 301)
@@ -3,6 +3,9 @@
  * linux/deriver/net/Rtl8019as.c
  * Ethernet driver for Samsung 44B0
  * Copyright (C) 2003 antiscle <hzh12 at 163.net>
+ *
+ * Modified by Skyeye Develop Group 2007
+ *
  */

 #include <linux/config.h>
@@ -22,10 +25,9 @@
 #include <linux/skbuff.h>
 #include <linux/types.h>
 #include <asm/irq.h>
+
 #include "rtl8019.h"

-#define RTL8019_OP_16   1
-
 #undef  DEBUG
 //#define DEBUG        1
 #ifdef DEBUG
@@ -80,7 +82,11 @@
        u8 RxPageBeg, RxPageEnd;
        u8 RxNextPage;
        u8 RxStatus;
+#ifdef RTL8019_OP_16
        u16 *data,temp;
+#else
+       u8 *data;
+#endif
        u16 i, RxLength,RxLen;

        struct sk_buff *skb;
@@ -153,7 +159,12 @@
                skb->dev = dev;
                skb_reserve(skb, 2);
                skb_put(skb, RxLength);
+
+#ifdef RTL8019_OP_16
                data = ( u16 *)skb->data;
+#else
+               data = ( u8 *)skb->data;
+#endif

                //              eth_copy_and_sum(skb, data, len, 0);
                outportb(RSAR0, 4);
@@ -251,7 +262,11 @@
        outportb(TPSR, SPSTART);        /* SPSTART page start register, 0x40 */
        outportb(RCR, 0xcc);            /* set RCR 0xcc */
        outportb(TCR, 0xe0);            /* set TCR 0xe0 */
+#ifdef RTL8019_OP_16
        outportb(DCR, 0xc9);            /* set DCR 0xc9, 16bit DMA */
+#else
+       outportb(DCR, 0xc8);            /* set DCR 0xc8, 8bit DMA */
+#endif

        outportb(IMR, 0x03);            /* set IMR 0x03, enable tx rx int */
        outportb(ISR, 0xff);            /* clear ISR */
@@ -297,15 +312,22 @@
 {
        int i;
        u16 len,TxLen;
+#ifdef RTL8019_OP_16
        u16 *data;
+#else
+       u8 *data;
+#endif
        struct nic_8019_priv *priv = (struct nic_8019_priv *) dev->priv;

        TRACE("start_xmit\n");

        len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
        TRACE("\nTx Length = %i,%x,%x\n", len, skb->data[12], skb->data[13]);
+#ifdef RTL8019_OP_16
        data =(u16*) skb->data;
-
+#else
+       data =(u8*) skb->data;
+#endif
        outportb(BaseAddr,0x22);        //switch to page 0 and stop remote dma
        if (inportb(BaseAddr)&4)        // last remote dma not
complete,return 1 echo busy(error),retransmit next
                return 1;

Modified: skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.h
===================================================================
--- skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.h 2007-08-30
02:31:36 UTC (rev 300)
+++ skyeye-v1/trunk/misc/linux_driver/rtl8019/rtl8019.h 2007-08-30
02:33:15 UTC (rev 301)
@@ -1,14 +1,46 @@
-
 #ifndef __RTL8019_H__
 #define __RTL8019_H__

-#define SHIFT(x)       (x<<1)
+#ifdef CONFIG_RTL8019_OP_8_EXTRA
+       #define RTL8019_OP_8_EXTRA
+#elif defined(CONFIG_RTL8019_OP_8)
+       #define RTL8019_OP_8
+#else
+       #define RTL8019_OP_16
+#endif

-//#define      BaseAddr        0x6000000
+#ifdef RTL8019_OP_16
+       #define SHIFT(x)        (x<<1)
+#elif defined(RTL8019_OP_8_EXTRA)
+       #define SHIFT(x)        (x<<8)
+#else /* RTL8019_OP_8 */
+       #define SHIFT(x)        (x)
+#endif

-#define BaseAddr       0xfffa0000
-#define IRQ_NUM                16
+#ifdef CONFIG_ARCH_S3C44B0X
+       #ifdef RTL8019_OP_16
+               #define BaseAddr        0x6000000
+       #elif defined(RTL8019_OP_8_EXTRA)
+               #define BaseAddr        0x3000000
+       #else /* RTL8019_OP_8 */
+               #define BaseAddr        0x8000000
+       #endif
+       #define IRQ_NUM 22
+#else /* for AT91 or others */
+       #define BaseAddr        0xfffa0000
+       #define IRQ_NUM 16
+#endif

+#ifdef CONFIG_RTL8019_BASE_ADDRESS
+       #undef BaseAddr
+       #define BaseAddr        CONFIG_RTL8019_BASE_ADDRESS
+#endif
+
+#ifdef CONFIG_RTL8019_IRQ
+       #undef IRQ_NUM
+       #define IRQ_NUM CONFIG_RTL8019_IRQ
+#endif
+
 #define        RWPORT  (BaseAddr+SHIFT(0x10))  /* dma read write
address, form 0x10 - 0x17 */
 #define        RstAddr (BaseAddr+SHIFT(0x18))  /* reset register,
0x18, 0x1a, 0x1c, 0x1e even address is recommanded */



This was sent by the SourceForge.net collaborative development
platform, the world's largest Open Source development site.


-- 
www.skyeye.org



More information about the Skyeye-developer mailing list