aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2014-04-24 06:24:48 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2014-05-28 04:11:54 -0400
commit486df8bc4627bdfc032d11bedcd056cc5343ee62 (patch)
tree758edca69ce10df13802ae2035f3f677552c61f4 /arch/m68k
parent44074e892cc2e5579b8d75c37612fcf8d023554a (diff)
m68k: Increase initial mapping to 8 or 16 MiB if possible
If the size of the first memory chunk is at least 8 or 16 MiB increase the initial mapping to 8 resp. 16 MiB instead of 4 MiB. This makes it possible to 1. Map more memory in the first node without running out of space for the page tables, 2. Boot kernels that don't fit in 4 MiB (e.g. multi_defconfig). Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> - Add support for 8 MiB, - Store initial mapping size in head.S for later reuse, - Add comment about large kernels. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/head.S19
-rw-r--r--arch/m68k/mm/motorola.c10
2 files changed, 23 insertions, 6 deletions
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index 15c8f55e4835..dbb118e1a4e0 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -292,6 +292,7 @@
292 292
293.globl kernel_pg_dir 293.globl kernel_pg_dir
294.globl availmem 294.globl availmem
295.globl m68k_init_mapped_size
295.globl m68k_pgtable_cachemode 296.globl m68k_pgtable_cachemode
296.globl m68k_supervisor_cachemode 297.globl m68k_supervisor_cachemode
297#ifdef CONFIG_MVME16x 298#ifdef CONFIG_MVME16x
@@ -907,10 +908,21 @@ L(nocon):
907 * 908 *
908 * This block of code does what's necessary to map in the various kinds 909 * This block of code does what's necessary to map in the various kinds
909 * of machines for execution of Linux. 910 * of machines for execution of Linux.
910 * First map the first 4 MB of kernel code & data 911 * First map the first 4, 8, or 16 MB of kernel code & data
911 */ 912 */
912 913
913 mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),#4*1024*1024,\ 914 get_bi_record BI_MEMCHUNK
915 movel %a0@(4),%d0
916 movel #16*1024*1024,%d1
917 cmpl %d0,%d1
918 jls 1f
919 lsrl #1,%d1
920 cmpl %d0,%d1
921 jls 1f
922 lsrl #1,%d1
9231:
924 movel %d1,m68k_init_mapped_size
925 mmu_map #PAGE_OFFSET,%pc@(L(phys_kernel_start)),%d1,\
914 %pc@(m68k_supervisor_cachemode) 926 %pc@(m68k_supervisor_cachemode)
915 927
916 putc 'C' 928 putc 'C'
@@ -3730,6 +3742,9 @@ func_return console_plot_pixel
3730__INITDATA 3742__INITDATA
3731 .align 4 3743 .align 4
3732 3744
3745m68k_init_mapped_size:
3746 .long 0
3747
3733#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \ 3748#if defined(CONFIG_ATARI) || defined(CONFIG_AMIGA) || \
3734 defined(CONFIG_HP300) || defined(CONFIG_APOLLO) 3749 defined(CONFIG_HP300) || defined(CONFIG_APOLLO)
3735L(custom): 3750L(custom):
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 7d4024432163..b958916e5eac 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -45,7 +45,7 @@ EXPORT_SYMBOL(mm_cachebits);
45#endif 45#endif
46 46
47/* size of memory already mapped in head.S */ 47/* size of memory already mapped in head.S */
48#define INIT_MAPPED_SIZE (4UL<<20) 48extern __initdata unsigned long m68k_init_mapped_size;
49 49
50extern unsigned long availmem; 50extern unsigned long availmem;
51 51
@@ -271,10 +271,12 @@ void __init paging_init(void)
271 */ 271 */
272 addr = m68k_memory[0].addr; 272 addr = m68k_memory[0].addr;
273 size = m68k_memory[0].size; 273 size = m68k_memory[0].size;
274 free_bootmem_node(NODE_DATA(0), availmem, min(INIT_MAPPED_SIZE, size) - (availmem - addr)); 274 free_bootmem_node(NODE_DATA(0), availmem,
275 min(m68k_init_mapped_size, size) - (availmem - addr));
275 map_node(0); 276 map_node(0);
276 if (size > INIT_MAPPED_SIZE) 277 if (size > m68k_init_mapped_size)
277 free_bootmem_node(NODE_DATA(0), addr + INIT_MAPPED_SIZE, size - INIT_MAPPED_SIZE); 278 free_bootmem_node(NODE_DATA(0), addr + m68k_init_mapped_size,
279 size - m68k_init_mapped_size);
278 280
279 for (i = 1; i < m68k_num_memory; i++) 281 for (i = 1; i < m68k_num_memory; i++)
280 map_node(i); 282 map_node(i);