diff --git a/lib_m68k/bootm.c b/lib_m68k/bootm.c
index dac5276..3fd38e9 100644
--- a/lib_m68k/bootm.c
+++ b/lib_m68k/bootm.c
@@ -44,16 +44,16 @@
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
+static ulong get_sp (void);
+
 void do_bootm_linux(cmd_tbl_t * cmdtp, int flag,
 		    int argc, char *argv[],
 		    image_header_t *hdr, int verify)
 {
-	ulong sp;
+	ulong sp_limit;
 
 	ulong rd_data_start, rd_data_end, rd_len;
-	ulong initrd_high;
 	ulong initrd_start, initrd_end;
-	int initrd_copy_to_ram = 1;
 
 	ulong cmd_start, cmd_end;
 	char *cmdline;
@@ -61,25 +61,6 @@
 	bd_t *kbd;
 	void (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
 
-	if ((s = getenv("initrd_high")) != NULL) {
-		/* a value of "no" or a similar string will act like 0,
-		 * turning the "load high" feature off. This is intentional.
-		 */
-		initrd_high = simple_strtoul(s, NULL, 16);
-		if (initrd_high == ~0)
-			initrd_copy_to_ram = 0;
-	} else {		/* not set, no restrictions to load high */
-		initrd_high = ~0;
-	}
-
-#ifdef CONFIG_LOGBUFFER
-	kbd = gd->bd;
-	/* Prevent initrd from overwriting logbuffer */
-	if (initrd_high < (kbd->bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD))
-		initrd_high = kbd->bi_memsize - LOGBUFF_LEN - LOGBUFF_OVERHEAD;
-	debug("## Logbuffer at 0x%08lX ", kbd->bi_memsize - LOGBUFF_LEN);
-#endif
-
 	/*
 	 * Booting a (Linux) kernel image
 	 *
@@ -89,19 +70,18 @@
 	 * memory, which means far enough below the current stack
 	 * pointer.
 	 */
-	asm("movel %%a7, %%d0\n"
-	    "movel %%d0, %0\n": "=d"(sp): :"%d0");
+	sp_limit = get_sp();
 
-	debug("## Current stack ends at 0x%08lX ", sp);
+	debug("## Current stack ends at 0x%08lX ", sp_limit);
 
-	sp -= 2048;		/* just to be sure */
-	if (sp > CFG_BOOTMAPSZ)
-		sp = CFG_BOOTMAPSZ;
-	sp &= ~0xF;
+	sp_limit -= 2048;		/* just to be sure */
+	if (sp_limit > CFG_BOOTMAPSZ)
+		sp_limit = CFG_BOOTMAPSZ;
+	sp_limit &= ~0xF;
 
-	debug("=> set upper limit to 0x%08lX\n", sp);
+	debug("=> set upper limit to 0x%08lX\n", sp_limit);
 
-	cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
+	cmdline = (char *)((sp_limit - CFG_BARGSIZE) & ~0xF);
 	kbd = (bd_t *) (((ulong) cmdline - sizeof(bd_t)) & ~0xF);
 
 	if ((s = getenv("bootargs")) == NULL)
@@ -126,69 +106,17 @@
 		kbd->bi_busfreq /= 1000000L;
 	}
 
+	/* find kernel */
 	kernel =
 	    (void (*)(bd_t *, ulong, ulong, ulong, ulong))image_get_ep (hdr);
 
+	/* find ramdisk */
 	get_ramdisk (cmdtp, flag, argc, argv, hdr, verify,
 			IH_ARCH_M68K, &rd_data_start, &rd_data_end);
+
 	rd_len = rd_data_end - rd_data_start;
-
-	if (rd_data_start) {
-		if (!initrd_copy_to_ram) {	/* zero-copy ramdisk support */
-			initrd_start = rd_data_start;
-			initrd_end = rd_data_end;
-		} else {
-			initrd_start = (ulong) kbd - rd_len;
-			initrd_start &= ~(4096 - 1);	/* align on page */
-
-			if (initrd_high) {
-				ulong nsp;
-
-				/*
-				 * the inital ramdisk does not need to be within
-				 * CFG_BOOTMAPSZ as it is not accessed until after
-				 * the mm system is initialised.
-				 *
-				 * do the stack bottom calculation again and see if
-				 * the initrd will fit just below the monitor stack
-				 * bottom without overwriting the area allocated
-				 * above for command line args and board info.
-				 */
-				asm("movel %%a7, %%d0\n"
-				    "movel %%d0, %0\n": "=d"(nsp): :"%d0");
-
-				nsp -= 2048;	/* just to be sure */
-				nsp &= ~0xF;
-
-				if (nsp > initrd_high)	/* limit as specified */
-					nsp = initrd_high;
-
-					nsp -= rd_len;
-				nsp &= ~(4096 - 1);	/* align on page */
-
-				if (nsp >= sp)
-					initrd_start = nsp;
-			}
-
-			SHOW_BOOT_PROGRESS(12);
-
-			debug
-			    ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
-			     rd_data_start, rd_data_end - 1, rd_len, rd_len);
-
-			initrd_end = initrd_start + rd_len;
-			printf("   Loading Ramdisk to %08lx, end %08lx ... ",
-			       initrd_start, initrd_end);
-
-			memmove_wd((void *)initrd_start,
-				   (void *)rd_data_start, rd_len, CHUNKSZ);
-
-			puts("OK\n");
-		}
-	} else {
-		initrd_start = 0;
-		initrd_end = 0;
-	}
+	ramdisk_high (rd_data_start, rd_len, kdb, sp_limit, get_sp (),
+			&initrd_start, &initrd_end);
 
 	debug("## Transferring control to Linux (at address %08lx) ...\n",
 	      (ulong) kernel);
@@ -206,3 +134,13 @@
 	(*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
 	/* does not return */
 }
+
+static ulong get_sp (void)
+{
+	ulong sp;
+
+	asm("movel %%a7, %%d0\n"
+	    "movel %%d0, %0\n": "=d"(sp): :"%d0");
+
+	return sp;
+}
