--- ecos-2.0/packages/hal/i386/arch/v2_0/src/redboot_linux_exec.c	2008-02-16 16:20:22.000000000 +0100
+++ ecos-2.0-rdc/packages/hal/i386/arch/v2_0/src/redboot_linux_exec.c	2006-04-20 07:58:40.000000000 +0200
@@ -14,7 +14,7 @@
 #include CYGHWR_MEMORY_LAYOUT_H
 
 #include <cyg/hal/hal_io.h>
-
+#include <pkgconf/r8610.h>
 /* 
  * Code to launch a Linux image directly in protected mode.
  *
@@ -179,44 +179,37 @@
     }
 
     // hlin
-#define TSOP_FLASH 1
-    mem_size = HAL_MEM_REAL_REGION_TOP(0x2000000);  // hlin 16M -> 32M
-    //mem_size = HAL_MEM_REAL_REGION_TOP(0x1000000);  // hlin 16M -> 32M
+    //mem_size = HAL_MEM_REAL_REGION_TOP(SDRAM_SIZE);  // hlin 16M -> 32M
+    mem_size = SDRAM_SIZE;
+    //diag_printf("<SDRAM_SIZE=%x,mem_size=%x,ramdisk_size=%x>",SDRAM_SIZE,mem_size,ramdisk_size);
+    //mem_size = HAL_MEM_REAL_REGION_TOP(0x1000000);  // hlin 16M -> 16M
     // hlin
     diag_printf("\nmem_size: %04x\n",mem_size) ;
-    // mem_size = 0x2000000 ;  // hlin 16M -> 32M
     mem_size >>= 10;   // convert from bytes to kilobytes.
     // Result of int15 ax=0xe801
     int15_e801 = mem_size - 1024 ; // 1M+ only
     off = (cyg_uint32)( ((mem_size<<10)-ramdisk_size-(128<<10)) & 0xfffff000 ) ;
-#ifdef TSOP_FLASH
+
+    
+// Sten, Reset MAC ------------------------
+#if 0
     asm volatile (
-	"	movw	$0xcf8, %%dx;\n"
-	"	movl	$0x80003840, %%eax;\n"
-	"	outl	%%eax, %%dx;\n"
-	"	movb	$0xfc, %%dl;\n"
-	"	inl	%%dx, %%eax;\n"
-	"	orl	$0x07ff0000, %%eax;\n"
-	"	outl	%%eax, %%dx;\n"
-       	: : : "eax","edx" ) ;
-    // copy kernel to 0x400000
-    memcpy( (char *)base_addr,(char *)0xffc00000,0x200000 ) ;
-    // copy initrd to high memory
-    memcpy( (char *)off,(char *)0xffe00000,ramdisk_size ) ;
+	"	movw	$0xe804, %%dx;\n"
+	"	movw	$0x0001, %%ax;\n"
+	"	out	%%ax, %%dx;\n"
+	: : : "eax","edx" ) ;
+
     asm volatile (
-	"	movw	$0xcf8, %%dx;\n"
-	"	movl	$0x80003840, %%eax;\n"
-	"	outl	%%eax, %%dx;\n"
-	"	movb	$0xfc, %%dl;\n"
-	"	inl	%%dx, %%eax;\n"
-	"	andl	$0xf000ffff, %%eax;\n"
-	"	orl	$0x00010000, %%eax;\n"
-	"	outl	%%eax, %%dx;\n"
+	"	movw	$0xe904, %%dx;\n"
+	"	movw	$0x0001, %%ax;\n"
+	"	out	%%ax, %%dx;\n"
 	: : : "eax","edx" ) ;
-#endif TSOP_FLASH
+#endif
+// ----------------------------------------
     bs_header = (struct bootsect_header *)base_addr;
     s_header = (struct setup_header *)(base_addr + SECTSIZE);
 
+
     if (bs_header->boot_flag != 0xAA55) {
         diag_printf("Bootsector magic not found (0x%04x @ 0x%04x)\n", bs_header->boot_flag, &bs_header->boot_flag);
         return;
