--- ecos-2.0/packages/devs/eth/rdc/r6040/v2_0/src/if_r6040.c	2008-02-16 14:20:28.000000000 +0100
+++ ecos-2.0-mgb100/packages/devs/eth/rdc/r6040/v2_0/src/if_r6040.c	2005-05-19 13:35:48.000000000 +0200
@@ -1,6 +1,6 @@
 //==========================================================================
 //
-//      if_r6040.c V0.9B 02-15-2005
+//      if_r6040.c V0.9C 03-17-2005	For Amit
 //
 //	RDC R6040 ethernet driver
 //
@@ -61,6 +61,10 @@
 //
 //####DESCRIPTIONEND####
 //
+//#### Modification ####
+//
+// 03-17-2005 17:17	Sten, Swap MAC0/1 finding sequence for AMIT board
+//			modify pci_init_find_6040s(), first is MAC1, then MAC0
 //==========================================================================
 
 #include <pkgconf/system.h>
@@ -78,6 +82,7 @@
 #include <cyg/hal/drv_api.h>
 #include <cyg/io/eth/netdev.h>
 #include <cyg/io/eth/eth_drv.h>
+#include <pkgconf/r8610.h>
 
 #ifdef CYGPKG_NET
 #include <pkgconf/net.h>
@@ -1179,11 +1184,11 @@
 static int
 pci_init_find_6040s( void )
 {
-    cyg_pci_device_id devid;
+    cyg_pci_device_id devid, tmp_id[CYGNUM_DEVS_ETH_RDC_R6040_DEV_COUNT];
     cyg_pci_device dev_info;
     cyg_uint16 cmd;
     int device_index;
-    int found_devices = 0;
+    int found_devices = 0, all_device = 0;
 
 #ifdef CYGNUM_DEVS_ETH_RDC_R6040_SEPARATE_MUX_INTERRUPT
     static cyg_handle_t mux_interrupt_handle = 0;
@@ -1202,7 +1207,23 @@
 #endif
 
     devid = CYG_PCI_NULL_DEVID;
-
+    for (device_index = 0; 
+         device_index < CYGNUM_DEVS_ETH_RDC_R6040_DEV_COUNT;
+         device_index++) {
+	tmp_id[device_index] = 0;
+        if (cyg_pci_find_matching( &find_6040s_match_func, NULL, &devid )) {
+		all_device++;
+		tmp_id[device_index] = devid;
+	}
+    }
+#ifdef UPGRADE_BY_MAC1
+    /* Swap MAC0/1 sequence for Amit board */
+    if (all_device == 2) {
+    	devid = tmp_id[0];
+    	tmp_id[0] = tmp_id[1];
+    	tmp_id[1] = devid;
+    }
+#endif    
     for (device_index = 0; 
          device_index < CYGNUM_DEVS_ETH_RDC_R6040_DEV_COUNT;
          device_index++) {
@@ -1213,7 +1234,7 @@
         // See above for find_6040s_match_func - it selects any of several
         // variants.  This is necessary in case we have multiple mixed-type
         // devices on one board in arbitrary orders.
-        if (cyg_pci_find_matching( &find_6040s_match_func, NULL, &devid )) {
+        if ((devid = tmp_id[device_index])) {
 #ifdef DEBUG
             diag_printf("eth%d = 6040\n", device_index);
 #endif
--- ecos-2.0/packages/devs/eth/i386/pc/r6040/v2_0/cdl/i386_pc_r6040_eth_drivers.cdl	2008-02-16 14:20:28.000000000 +0100
+++ ecos-2.0-mgb100/packages/devs/eth/i386/pc/r6040/v2_0/cdl/i386_pc_r6040_eth_drivers.cdl	2005-05-19 13:28:24.000000000 +0200
@@ -47,6 +47,10 @@
 #
 #####DESCRIPTIONEND####
 #
+##### Modification ####
+# 03-17-2005 12:05	Sten, Support two R6040 devices
+#
+#
 # ====================================================================
 
 cdl_package CYGPKG_DEVS_ETH_I386_PC_R6040 {
@@ -106,4 +110,40 @@
             }
         }
     }
+
+    cdl_component CYGPKG_DEVS_ETH_I386_PC_R6040_ETH1 {
+        display       "Ethernet port 1 driver"
+        flavor        bool
+        default_value 1
+
+        implements CYGHWR_NET_DRIVERS
+        implements CYGHWR_NET_DRIVER_ETH1
+        implements CYGINT_DEVS_ETH_RDC_R6040_REQUIRED
+
+        cdl_option CYGDAT_DEVS_ETH_I386_PC_R6041_ETH0_NAME {
+            display       "Device name for the ETH1 ethernet port 1 driver"
+            flavor        data
+            default_value {"\"eth1\""}
+            description   "
+                This option sets the name of the ethernet device for the
+                r6040 ethernet port 1."
+        }
+
+        cdl_component CYGSEM_DEVS_ETH_I386_PC_R6040_ETH1_SET_ESA {
+            display       "Set the ethernet station address"
+            flavor        bool
+	    default_value 0
+            description   "Enabling this option will allow the ethernet
+            station address to be forced to the value set by the
+            configuration.  This may be required if the hardware does
+            not include a serial EEPROM for the ESA."
+            
+            cdl_option CYGDAT_DEVS_ETH_I386_PC_R6040_ETH1_ESA {
+                display       "The ethernet station address"
+                flavor        data
+                default_value {"{0x08, 0x00, 0x00, 0x00, 0x00, 0x02}"}
+                description   "The ethernet station address"
+            }
+        }
+    }
 }
