#include <asm/errno.h>
#include <malloc.h>
+extern void *memcpy32(void *dst, const void *src, int len);
+
/* It should access 16-bit instead of 8-bit */
static inline void *memcpy_16(void *dst, const void *src, unsigned int len)
{
short *d = dst;
const short *s = src;
+ if (len > 32 && (len & (32 - 1)) == 0)
+ return memcpy32(dst, src, len);
+
len >>= 1;
while (len-- > 0)
*d++ = *s++;
--- /dev/null
+/*
+ * Copyright (C) 2005-2009 Samsung Electronics
+ * Kyungmin Park <kyungmin.park@samsung.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+ .text
+
+ .global memcpy32
+ .align 0
+memcpy32:
+ mov ip, sp
+ stmfd sp!, {r0, r4 - r9, fp, ip, lr, pc}
+ sub fp, ip, #4
+1:
+ ldmia r1!, {r3 - r9, ip}
+ subges r2, r2, #32
+ stmgeia r0!, {r3 - r9, ip}
+ bge 1b
+2:
+ ldmea fp, {r0, r4 - r9, fp, sp, pc}
LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot-onenand.lds
LDFLAGS = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
AFLAGS += -DCONFIG_ONENAND_IPL -g -UTEXT_BASE -DTEXT_BASE=$(TEXT_BASE)
-CFLAGS += -DCONFIG_ONENAND_IPL -g
+CFLAGS += -DCONFIG_ONENAND_IPL -g -D__HAVE_ARCH_MEMCPY32
OBJCFLAGS += --gap-fill=0x00
SOBJS := lowlevel_init.o mem_setup.o
-SOBJS += start.o
+SOBJS += start.o _memcpy32.o
COBJS += onenand_read.o samsung_read.o
COBJS += onenand_boot.o
$(obj)lowlevel_init.S:
ln -sf $(SRCTREE)/board/$(BOARDDIR)/lowlevel_init.S $@
+# from lib_arm
+$(obj)_memcpy32.S:
+ ln -sf $(SRCTREE)/lib_arm/_memcpy32.S $@
+
# from onenand_ipl directory
$(obj)onenand_ipl.h:
@rm -f $@