**************************************************************
*DENM 1.2 ecoreex definitions
*NZG
*09/04/2007
*EMAC.Inc
**************************************************************
diff -uprN linux-2.6.20-at92_e1.1/drivers/ioex/Kconfig linux-2.6.20-at92_e1.1_dirty/drivers/ioex/Kconfig
--- linux-2.6.20-at92_e1.1/drivers/ioex/Kconfig	2007-09-04 16:24:42.000000000 -0400
+++ linux-2.6.20-at92_e1.1_dirty/drivers/ioex/Kconfig	2007-08-30 12:47:10.000000000 -0400
@@ -28,7 +28,13 @@ config ECOREEX_GCMB
         bool "GCMB expansion I/O"
         ---help---
         Provides autodetection and support for the GCMB expansion
-        
+
+config ECOREEX_DENM
+		depends on ECOREEX
+        bool "DENM expansion I/O"
+        ---help---
+        Provides autodetection and support for the DENM expansion        
+
 config BOARDSPEC
         tristate "board devices"
         ---help---
diff -uprN linux-2.6.20-at92_e1.1/drivers/ioex/ecoreex.c linux-2.6.20-at92_e1.1_dirty/drivers/ioex/ecoreex.c
--- linux-2.6.20-at92_e1.1/drivers/ioex/ecoreex.c	2007-09-04 16:24:42.000000000 -0400
+++ linux-2.6.20-at92_e1.1_dirty/drivers/ioex/ecoreex.c	2007-08-30 12:47:10.000000000 -0400
@@ -137,6 +137,42 @@ return 0;
 
 #endif //CONFIG_ECOREEX_GCMB
 
+//---------------------------------------------------------------------------------
+#ifdef CONFIG_ECOREEX_DENM
+#define CPLD_DENM_NAME_12 "DENM CPLD expansion R1.2"
+#define CPLD_DENM 0x92
+
+static inline int CPLD_DENM_map(unsigned long phys_addr,u8 *virt_addr,unsigned long size,const char *name){
+	
+	if(request_mem_region(phys_addr,size,name)==NULL){
+		printk("could not obtain physical memory at %lx for EMAC core\n",phys_addr);
+		iounmap(virt_addr);
+		return -1;
+		}
+	
+	printk("%s detected at %lx\n",name,phys_addr);			
+	//add appropriate class devices for this version to the system
+
+#ifdef CONFIG_GPIOCLASS	
+	gpio_declare();
+	gpi_device_create(&virt_addr[2],"counter0");
+	gpi_device_create(&virt_addr[4],"counter1");
+	gpi_device_create(&virt_addr[5],"counter2");
+	gpi_device_create(&virt_addr[8],"counter3");
+	gpi_device_create(&virt_addr[10],"counter4");
+	gpi_device_create(&virt_addr[12],"counter5");
+	gpi_device_create(&virt_addr[14],"ct543210");
+	
+	gpo_device_create(&virt_addr[16],"oxrs4321");
+	gpo_device_create(&virt_addr[17],"xxrt321b");
+	
+	gpio_device_create(&virt_addr[3], NULL,"rollover");
+#endif	//CONFIG_GPIOCLASS
+
+return 0;
+}
+
+#endif //CONFIG_ECOREEX_DENM
 
 /************************************************************
  * core mappings based upon a key
@@ -178,6 +214,13 @@ static inline void map_core(unsigned lon
 			break;
 			#endif //CONFIG_ECOREEX_GCMB
 			//-----------------------------------------------------------			
+			#ifdef CONFIG_ECOREEX_DENM
+			case CPLD_DENM:
+				CPLD_DENM_map(phys_addr,virt_addr,size,CPLD_DENM_NAME_12);
+			break;
+			#endif //CONFIG_ECOREEX_DENM
+			//--------------------------------------------------------
+			
 			default://unrecognized CPLD or no CPLD available, silently fail and the physical memory region
 				iounmap(virt_addr);
 			}
