Skip to content

Commit 8757ae2

Browse files
committed
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
2 parents 1660a76 + 101646a commit 8757ae2

File tree

5 files changed

+8
-64
lines changed

5 files changed

+8
-64
lines changed

arch/microblaze/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ config MICROBLAZE
2424
select HAVE_FTRACE_MCOUNT_RECORD
2525
select HAVE_FUNCTION_GRAPH_TRACER
2626
select HAVE_FUNCTION_TRACER
27+
select NO_BOOTMEM
2728
select HAVE_MEMBLOCK
2829
select HAVE_MEMBLOCK_NODE_MAP
2930
select HAVE_OPROFILE

arch/microblaze/Kconfig.platform

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ menu "Platform options"
88

99
config OPT_LIB_FUNCTION
1010
bool "Optimalized lib function"
11-
depends on CPU_LITTLE_ENDIAN
1211
default y
1312
help
1413
Allows turn on optimalized library function (memcpy and memmove).
@@ -21,6 +20,7 @@ config OPT_LIB_FUNCTION
2120
config OPT_LIB_ASM
2221
bool "Optimalized lib function ASM"
2322
depends on OPT_LIB_FUNCTION && (XILINX_MICROBLAZE0_USE_BARREL = 1)
23+
depends on CPU_BIG_ENDIAN
2424
default n
2525
help
2626
Allows turn on optimalized library function (memcpy and memmove).

arch/microblaze/include/asm/setup.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ void machine_shutdown(void);
4444
void machine_halt(void);
4545
void machine_power_off(void);
4646

47-
extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
4847
extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
4948

5049
# endif /* __ASSEMBLY__ */

arch/microblaze/lib/fastcopy.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
* between mem locations with size of xfer spec'd in bytes
3030
*/
3131

32-
#ifdef __MICROBLAZEEL__
33-
#error Microblaze LE not support ASM optimized lib func. Disable OPT_LIB_ASM.
34-
#endif
35-
3632
#include <linux/linkage.h>
3733
.text
3834
.globl memcpy

arch/microblaze/mm/init.c

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ int mem_init_done;
3232
#ifndef CONFIG_MMU
3333
unsigned int __page_offset;
3434
EXPORT_SYMBOL(__page_offset);
35-
36-
#else
37-
static int init_bootmem_done;
3835
#endif /* CONFIG_MMU */
3936

4037
char *klimit = _end;
@@ -117,7 +114,6 @@ static void __init paging_init(void)
117114

118115
void __init setup_memory(void)
119116
{
120-
unsigned long map_size;
121117
struct memblock_region *reg;
122118

123119
#ifndef CONFIG_MMU
@@ -174,17 +170,6 @@ void __init setup_memory(void)
174170
pr_info("%s: max_low_pfn: %#lx\n", __func__, max_low_pfn);
175171
pr_info("%s: max_pfn: %#lx\n", __func__, max_pfn);
176172

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-
188173
/* Add active regions with valid PFNs */
189174
for_each_memblock(memory, reg) {
190175
unsigned long start_pfn, end_pfn;
@@ -196,32 +181,9 @@ void __init setup_memory(void)
196181
&memblock.memory, 0);
197182
}
198183

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-
219184
/* XXX need to clip this if using highmem? */
220185
sparse_memory_present_with_active_regions(0);
221186

222-
#ifdef CONFIG_MMU
223-
init_bootmem_done = 1;
224-
#endif
225187
paging_init();
226188
}
227189

@@ -398,30 +360,16 @@ asmlinkage void __init mmu_init(void)
398360
/* This is only called until mem_init is done. */
399361
void __init *early_get_page(void)
400362
{
401-
void *p;
402-
if (init_bootmem_done) {
403-
p = alloc_bootmem_pages(PAGE_SIZE);
404-
} else {
405-
/*
406-
* Mem start + kernel_tlb -> here is limit
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;
363+
/*
364+
* Mem start + kernel_tlb -> here is limit
365+
* because of mem mapping from head.S
366+
*/
367+
return __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
368+
memory_start + kernel_tlb));
413369
}
414370

415371
#endif /* CONFIG_MMU */
416372

417-
void * __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-
425373
void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
426374
{
427375
void *p;

0 commit comments

Comments
 (0)