Resent-Date: Sat, 19 Sep 1998 23:13:49 +0200 (MET DST)
From: dorchain@meeting.hrz.uni-oldenburg.de
Subject: Geerts z2ram patch (solves my init problem)
To: Jes.Sorensen@cern.ch (Jes Sorensen)
Date: Sat, 19 Sep 1998 23:08:57 +0200 (MEST)
Cc: linux-m68k@phil.uni-sb.de (Linux Liste)
Resent-From: linux-m68k@phil.uni-sb.de

Hi,

this solves my problems with init in 2.1.120.

Thanks Geert!


Joerg


Index: arch/m68k/amiga/config.c
===================================================================
RCS file: /home/geert/cvs/linux/arch/m68k/amiga/config.c,v
retrieving revision 1.1.4.2.2.8
diff -u -r1.1.4.2.2.8 config.c
--- config.c	1998/09/19 15:55:50	1.1.4.2.2.8
+++ config.c	1998/09/19 16:18:50
@@ -398,6 +398,28 @@
   /* ensure that the DMA master bit is set */
   custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
 
+  /* don't use Z2 RAM as system memory on Z3 capable machines */
+  if (AMIGAHW_PRESENT(ZORRO3)) {
+    int i, j;
+    u32 disabled_z2mem = 0;
+    for (i = 0; i < m68k_num_memory; i++)
+      if (m68k_memory[i].addr < 16*1024*1024) {
+	if (i == 0) {
+	  /* don't cut off the branch we're sitting on */
+	  printk("Warning: kernel runs in Zorro II memory\n");
+	  continue;
+	}
+	disabled_z2mem += m68k_memory[i].size;
+	m68k_num_memory--;
+	for (j = i; j < m68k_num_memory; j++)
+	  m68k_memory[j] = m68k_memory[j+1];
+	i--;
+      }
+    if (disabled_z2mem)
+      printk("%dK of Zorro II memory will not be used as system memory\n",
+	     disabled_z2mem>>10);
+  }
+
   /* initialize chipram allocator */
   amiga_chip_init ();
 
Index: drivers/zorro/zorro.c
===================================================================
RCS file: /home/geert/cvs/linux/drivers/zorro/zorro.c,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 zorro.c
--- zorro.c	1998/08/31 20:12:40	1.1.2.3
+++ zorro.c	1998/09/19 16:18:33
@@ -185,8 +185,7 @@
 
 __initfunc(void zorro_init(void))
 {
-    u_int i, j;
-    u32 disabled_z2mem = 0;
+    u_int i;
 
     if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) {
 	printk("Zorro: No Zorro bus detected\n");
@@ -205,27 +204,8 @@
 
     /* Unmark all used Zorro II memory */
     for (i = 0; i < m68k_num_memory; i++)
-	if (m68k_memory[i].addr < 16*1024*1024) {
-	    if (AMIGAHW_PRESENT(ZORRO3)) {
-		/* don't use Zorro II RAM as system memory on Zorro III */
-		/* capable machines */
-		if (i == 0) {
-		    /* don't cut off the branch we're sitting on */
-		    printk("Warning: kernel runs in Zorro II memory\n");
-		} else {
-		    disabled_z2mem += m68k_memory[i].size;
-		    m68k_num_memory--;
-		    for (j = i; j < m68k_num_memory; j++)
-			m68k_memory[j] = m68k_memory[j+1];
-		    i--;
-		    continue;
-		}
-	    }
+	if (m68k_memory[i].addr < 16*1024*1024)
 	    mark_region(m68k_memory[i].addr, m68k_memory[i].size, 0);
-	}
-    if (disabled_z2mem)
-	printk("%dK of Zorro II memory will not be used as system memory\n",
-	       disabled_z2mem>>10);
 
 #ifdef CONFIG_PROC_FS
     zorro_proc_init();

