Commit 3335d555 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'microblaze-v5.19' of git://git.monstr.eu/linux-2.6-microblaze

Pull microblaze updates from Michal Simek:

 - Fix issues with freestanding

 - Wire memblock_dump_all()

 - Add support for memory reservation from DT

* tag 'microblaze-v5.19' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: fix typos in comments
  microblaze: Add support for reserved memory defined by DT
  microblaze: Wire memblock_dump_all()
  microblaze: Use simple memmove/memcpy implementation from lib/string.c
  microblaze: Do loop unrolling for optimized memset implementation
  microblaze: Use simple memset implementation from lib/string.c
parents 8ab2afa2 78b5f52a
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifdef CONFIG_OPT_LIB_FUNCTION
#define __HAVE_ARCH_MEMSET #define __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMCPY #define __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMMOVE #define __HAVE_ARCH_MEMMOVE
...@@ -15,6 +16,7 @@ ...@@ -15,6 +16,7 @@
extern void *memset(void *, int, __kernel_size_t); extern void *memset(void *, int, __kernel_size_t);
extern void *memcpy(void *, const void *, __kernel_size_t); extern void *memcpy(void *, const void *, __kernel_size_t);
extern void *memmove(void *, const void *, __kernel_size_t); extern void *memmove(void *, const void *, __kernel_size_t);
#endif
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define GDB_RTLBLO 55 #define GDB_RTLBLO 55
#define GDB_RTLBHI 56 #define GDB_RTLBHI 56
/* keep pvr separately because it is unchangeble */ /* keep pvr separately because it is unchangeable */
static struct pvr_s pvr; static struct pvr_s pvr;
void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
......
...@@ -31,20 +31,7 @@ ...@@ -31,20 +31,7 @@
#include <linux/string.h> #include <linux/string.h>
#ifdef __HAVE_ARCH_MEMCPY #ifdef CONFIG_OPT_LIB_FUNCTION
#ifndef CONFIG_OPT_LIB_FUNCTION
void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
{
const char *src = v_src;
char *dst = v_dst;
/* Simple, byte oriented memcpy. */
while (c--)
*dst++ = *src++;
return v_dst;
}
#else /* CONFIG_OPT_LIB_FUNCTION */
void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
{ {
const char *src = v_src; const char *src = v_src;
...@@ -188,6 +175,5 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -188,6 +175,5 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
return v_dst; return v_dst;
} }
#endif /* CONFIG_OPT_LIB_FUNCTION */
EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memcpy);
#endif /* __HAVE_ARCH_MEMCPY */ #endif /* CONFIG_OPT_LIB_FUNCTION */
...@@ -30,31 +30,7 @@ ...@@ -30,31 +30,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/string.h> #include <linux/string.h>
#ifdef __HAVE_ARCH_MEMMOVE #ifdef CONFIG_OPT_LIB_FUNCTION
#ifndef CONFIG_OPT_LIB_FUNCTION
void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
{
const char *src = v_src;
char *dst = v_dst;
if (!c)
return v_dst;
/* Use memcpy when source is higher than dest */
if (v_dst <= v_src)
return memcpy(v_dst, v_src, c);
/* copy backwards, from end to beginning */
src += c;
dst += c;
/* Simple, byte oriented memmove. */
while (c--)
*--dst = *--src;
return v_dst;
}
#else /* CONFIG_OPT_LIB_FUNCTION */
void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
{ {
const char *src = v_src; const char *src = v_src;
...@@ -102,7 +78,7 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -102,7 +78,7 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
i_dst = (void *)dst; i_dst = (void *)dst;
/* Choose a copy scheme based on the source */ /* Choose a copy scheme based on the source */
/* alignment relative to dstination. */ /* alignment relative to destination. */
switch ((unsigned long)src & 3) { switch ((unsigned long)src & 3) {
case 0x0: /* Both byte offsets are aligned */ case 0x0: /* Both byte offsets are aligned */
...@@ -215,6 +191,5 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c) ...@@ -215,6 +191,5 @@ void *memmove(void *v_dst, const void *v_src, __kernel_size_t c)
} }
return v_dst; return v_dst;
} }
#endif /* CONFIG_OPT_LIB_FUNCTION */
EXPORT_SYMBOL(memmove); EXPORT_SYMBOL(memmove);
#endif /* __HAVE_ARCH_MEMMOVE */ #endif /* CONFIG_OPT_LIB_FUNCTION */
...@@ -30,22 +30,7 @@ ...@@ -30,22 +30,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/string.h> #include <linux/string.h>
#ifdef __HAVE_ARCH_MEMSET #ifdef CONFIG_OPT_LIB_FUNCTION
#ifndef CONFIG_OPT_LIB_FUNCTION
void *memset(void *v_src, int c, __kernel_size_t n)
{
char *src = v_src;
/* Truncate c to 8 bits */
c = (c & 0xFF);
/* Simple, byte oriented memset or the rest of count. */
while (n--)
*src++ = c;
return v_src;
}
#else /* CONFIG_OPT_LIB_FUNCTION */
void *memset(void *v_src, int c, __kernel_size_t n) void *memset(void *v_src, int c, __kernel_size_t n)
{ {
char *src = v_src; char *src = v_src;
...@@ -89,11 +74,21 @@ void *memset(void *v_src, int c, __kernel_size_t n) ...@@ -89,11 +74,21 @@ void *memset(void *v_src, int c, __kernel_size_t n)
} }
/* Simple, byte oriented memset or the rest of count. */ /* Simple, byte oriented memset or the rest of count. */
while (n--) switch (n) {
case 3:
*src++ = c;
fallthrough;
case 2:
*src++ = c; *src++ = c;
fallthrough;
case 1:
*src++ = c;
break;
default:
break;
}
return v_src; return v_src;
} }
#endif /* CONFIG_OPT_LIB_FUNCTION */
EXPORT_SYMBOL(memset); EXPORT_SYMBOL(memset);
#endif /* __HAVE_ARCH_MEMSET */ #endif /* CONFIG_OPT_LIB_FUNCTION */
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> /* mem_init */ #include <linux/mm.h> /* mem_init */
#include <linux/initrd.h> #include <linux/initrd.h>
#include <linux/of_fdt.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/pfn.h> #include <linux/pfn.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -261,8 +262,12 @@ asmlinkage void __init mmu_init(void) ...@@ -261,8 +262,12 @@ asmlinkage void __init mmu_init(void)
parse_early_param(); parse_early_param();
early_init_fdt_scan_reserved_mem();
/* CMA initialization */ /* CMA initialization */
dma_contiguous_reserve(memory_start + lowmem_size - 1); dma_contiguous_reserve(memory_start + lowmem_size - 1);
memblock_dump_all();
} }
void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask) void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment