aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-03-16 16:27:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-03-16 16:27:34 -0400
commit8757ae23a33d312bd09bd3b8c7824b3323954608 (patch)
tree5b069bbd753090eaa8e89d33d3ab325124b57484
parent1660a76a87ffae74ad18b09e17ce4dcc5aa7308f (diff)
parent101646a24a2f9cdb61d7732459fbf068a7bbb542 (diff)
Merge tag 'microblaze-4.16-rc6' of git://git.monstr.eu/linux-2.6-microblaze
Pull microblaze fixes from Michal Simek: - Use NO_BOOTMEM to fix boot issue - Fix opt lib endian dependencies * tag 'microblaze-4.16-rc6' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: switch to NO_BOOTMEM microblaze: remove unused alloc_maybe_bootmem microblaze: Setup dependencies for ASM optimized lib functions
-rw-r--r--arch/microblaze/Kconfig1
-rw-r--r--arch/microblaze/Kconfig.platform2
-rw-r--r--arch/microblaze/include/asm/setup.h1
-rw-r--r--arch/microblaze/lib/fastcopy.S4
-rw-r--r--arch/microblaze/mm/init.c64
5 files changed, 8 insertions, 64 deletions
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 4f798aa671dd..3817a3e2146c 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -24,6 +24,7 @@ config MICROBLAZE
24 select HAVE_FTRACE_MCOUNT_RECORD 24 select HAVE_FTRACE_MCOUNT_RECORD
25 select HAVE_FUNCTION_GRAPH_TRACER 25 select HAVE_FUNCTION_GRAPH_TRACER
26 select HAVE_FUNCTION_TRACER 26 select HAVE_FUNCTION_TRACER
27 select NO_BOOTMEM
27 select HAVE_MEMBLOCK 28 select HAVE_MEMBLOCK
28 select HAVE_MEMBLOCK_NODE_MAP 29 select HAVE_MEMBLOCK_NODE_MAP
29 select HAVE_OPROFILE 30 select HAVE_OPROFILE
diff --git a/arch/microblaze/Kconfig.platform b/arch/microblaze/Kconfig.platform
index 6996f397c16c..f7f1739c11b9 100644
--- a/arch/microblaze/Kconfig.platform
+++ b/arch/microblaze/Kconfig.platform
@@ -8,7 +8,6 @@ menu "Platform options"
8 8
9config OPT_LIB_FUNCTION 9config OPT_LIB_FUNCTION
10 bool "Optimalized lib function" 10 bool "Optimalized lib function"
11 depends on CPU_LITTLE_ENDIAN
12 default y 11 default y
13 help 12 help
14 Allows turn on optimalized library function (memcpy and memmove). 13 Allows turn on optimalized library function (memcpy and memmove).
@@ -21,6 +20,7 @@ config OPT_LIB_FUNCTION
21config OPT_LIB_ASM 20config OPT_LIB_ASM
22 bool "Optimalized lib function ASM" 21 bool "Optimalized lib function ASM"
23 depends on OPT_LIB_FUNCTION && (XILINX_MICROBLAZE0_USE_BARREL = 1) 22 depends on OPT_LIB_FUNCTION && (XILINX_MICROBLAZE0_USE_BARREL = 1)
23 depends on CPU_BIG_ENDIAN
24 default n 24 default n
25 help 25 help
26 Allows turn on optimalized library function (memcpy and memmove). 26 Allows turn on optimalized library function (memcpy and memmove).
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index be84a4d3917f..7c968c1d1729 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -44,7 +44,6 @@ void machine_shutdown(void);
44void machine_halt(void); 44void machine_halt(void);
45void machine_power_off(void); 45void machine_power_off(void);
46 46
47extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
48extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); 47extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
49 48
50# endif /* __ASSEMBLY__ */ 49# endif /* __ASSEMBLY__ */
diff --git a/arch/microblaze/lib/fastcopy.S b/arch/microblaze/lib/fastcopy.S
index 62021d7e249e..fdc48bb065d8 100644
--- a/arch/microblaze/lib/fastcopy.S
+++ b/arch/microblaze/lib/fastcopy.S
@@ -29,10 +29,6 @@
29 * between mem locations with size of xfer spec'd in bytes 29 * between mem locations with size of xfer spec'd in bytes
30 */ 30 */
31 31
32#ifdef __MICROBLAZEEL__
33#error Microblaze LE not support ASM optimized lib func. Disable OPT_LIB_ASM.
34#endif
35
36#include <linux/linkage.h> 32#include <linux/linkage.h>
37 .text 33 .text
38 .globl memcpy 34 .globl memcpy
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 434639f9a3a6..df6de7ccdc2e 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -32,9 +32,6 @@ int mem_init_done;
32#ifndef CONFIG_MMU 32#ifndef CONFIG_MMU
33unsigned int __page_offset; 33unsigned int __page_offset;
34EXPORT_SYMBOL(__page_offset); 34EXPORT_SYMBOL(__page_offset);
35
36#else
37static int init_bootmem_done;
38#endif /* CONFIG_MMU */ 35#endif /* CONFIG_MMU */
39 36
40char *klimit = _end; 37char *klimit = _end;
@@ -117,7 +114,6 @@ static void __init paging_init(void)
117 114
118void __init setup_memory(void) 115void __init setup_memory(void)
119{ 116{
120 unsigned long map_size;
121 struct memblock_region *reg; 117 struct memblock_region *reg;
122 118
123#ifndef CONFIG_MMU 119#ifndef CONFIG_MMU
@@ -174,17 +170,6 @@ void __init setup_memory(void)
174 pr_info("%s: max_low_pfn: %#lx\n", __func__, max_low_pfn); 170 pr_info("%s: max_low_pfn: %#lx\n", __func__, max_low_pfn);
175 pr_info("%s: max_pfn: %#lx\n", __func__, max_pfn); 171 pr_info("%s: max_pfn: %#lx\n", __func__, max_pfn);
176 172
177 /*
178 * Find an area to use for the bootmem bitmap.
179 * We look for the first area which is at least
180 * 128kB in length (128kB is enough for a bitmap
181 * for 4GB of memory, using 4kB pages), plus 1 page
182 * (in case the address isn't page-aligned).
183 */
184 map_size = init_bootmem_node(NODE_DATA(0),
185 PFN_UP(TOPHYS((u32)klimit)), min_low_pfn, max_low_pfn);
186 memblock_reserve(PFN_UP(TOPHYS((u32)klimit)) << PAGE_SHIFT, map_size);
187
188 /* Add active regions with valid PFNs */ 173 /* Add active regions with valid PFNs */
189 for_each_memblock(memory, reg) { 174 for_each_memblock(memory, reg) {
190 unsigned long start_pfn, end_pfn; 175 unsigned long start_pfn, end_pfn;
@@ -196,32 +181,9 @@ void __init setup_memory(void)
196 &memblock.memory, 0); 181 &memblock.memory, 0);
197 } 182 }
198 183
199 /* free bootmem is whole main memory */
200 free_bootmem_with_active_regions(0, max_low_pfn);
201
202 /* reserve allocate blocks */
203 for_each_memblock(reserved, reg) {
204 unsigned long top = reg->base + reg->size - 1;
205
206 pr_debug("reserved - 0x%08x-0x%08x, %lx, %lx\n",
207 (u32) reg->base, (u32) reg->size, top,
208 memory_start + lowmem_size - 1);
209
210 if (top <= (memory_start + lowmem_size - 1)) {
211 reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
212 } else if (reg->base < (memory_start + lowmem_size - 1)) {
213 unsigned long trunc_size = memory_start + lowmem_size -
214 reg->base;
215 reserve_bootmem(reg->base, trunc_size, BOOTMEM_DEFAULT);
216 }
217 }
218
219 /* XXX need to clip this if using highmem? */ 184 /* XXX need to clip this if using highmem? */
220 sparse_memory_present_with_active_regions(0); 185 sparse_memory_present_with_active_regions(0);
221 186
222#ifdef CONFIG_MMU
223 init_bootmem_done = 1;
224#endif
225 paging_init(); 187 paging_init();
226} 188}
227 189
@@ -398,30 +360,16 @@ asmlinkage void __init mmu_init(void)
398/* This is only called until mem_init is done. */ 360/* This is only called until mem_init is done. */
399void __init *early_get_page(void) 361void __init *early_get_page(void)
400{ 362{
401 void *p; 363 /*
402 if (init_bootmem_done) { 364 * Mem start + kernel_tlb -> here is limit
403 p = alloc_bootmem_pages(PAGE_SIZE); 365 * because of mem mapping from head.S
404 } else { 366 */
405 /* 367 return __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
406 * Mem start + kernel_tlb -> here is limit 368 memory_start + kernel_tlb));
407 * because of mem mapping from head.S
408 */
409 p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
410 memory_start + kernel_tlb));
411 }
412 return p;
413} 369}
414 370
415#endif /* CONFIG_MMU */ 371#endif /* CONFIG_MMU */
416 372
417void * __ref alloc_maybe_bootmem(size_t size, gfp_t mask)
418{
419 if (mem_init_done)
420 return kmalloc(size, mask);
421 else
422 return alloc_bootmem(size);
423}
424
425void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask) 373void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
426{ 374{
427 void *p; 375 void *p;