From 6bcb651e34ecd064f80a10f3b77a9292f1139a08 Mon Sep 17 00:00:00 2001
From: Thomas Chou <thomas@wytron.com.tw>
Date: Mon, 24 Dec 2007 23:46:04 +0800
Subject: [PATCH] nios2: allow allocating memory blocks up to 32MB fix

The CONFIG_LARGE_ALLOCS is still needed for slab.c to allocate large
memory block for this kernel version, linux-2.6.19.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>

diff --git a/linux-2.6.x/arch/nios2nommu/Kconfig b/linux-2.6.x/arch/nios2nommu/Kconfig
index ea8b6ed..88915cb 100644
--- a/linux-2.6.x/arch/nios2nommu/Kconfig
+++ b/linux-2.6.x/arch/nios2nommu/Kconfig
@@ -198,6 +198,15 @@ config BREAK_ON_START
 	  before the kernel starts initialization. This allows you to
 	  debug the kernel startup.
 
+config LARGE_ALLOCS
+	bool "Allow allocating large blocks (> 1MB) of memory"
+	default y
+	help
+	  Allow the slab memory allocator to keep chains for very large
+	  memory sizes - upto 32MB. You may need this if your system has
+	  a lot of RAM, and you need to able to allocate very large
+	  contiguous chunks. If unsure, say N.
+
 config FORCE_MAX_ZONEORDER
 	int
 	default "14"
diff --git a/linux-2.6.x/arch/nios2nommu/defconfig b/linux-2.6.x/arch/nios2nommu/defconfig
index 2bf89dd..4fc81c1 100644
--- a/linux-2.6.x/arch/nios2nommu/defconfig
+++ b/linux-2.6.x/arch/nios2nommu/defconfig
@@ -114,6 +114,7 @@ CONFIG_NIOS2_HW_MUL=y
 #
 CONFIG_EXCALIBUR=y
 # CONFIG_BREAK_ON_START is not set
+CONFIG_LARGE_ALLOCS=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_RAMKERNEL=y
 CONFIG_PREEMPT=y
diff --git a/vendors/Altera/nios2nommu/config.linux-2.6.x b/vendors/Altera/nios2nommu/config.linux-2.6.x
index 93a70c3..72d77af 100644
--- a/vendors/Altera/nios2nommu/config.linux-2.6.x
+++ b/vendors/Altera/nios2nommu/config.linux-2.6.x
@@ -116,6 +116,7 @@ CONFIG_NIOS2_HW_MUL=y
 #
 CONFIG_EXCALIBUR=y
 # CONFIG_BREAK_ON_START is not set
+CONFIG_LARGE_ALLOCS=y
 CONFIG_FORCE_MAX_ZONEORDER=14
 CONFIG_RAMKERNEL=y
 CONFIG_PREEMPT=y
-- 
1.5.3.5

