summaryrefslogtreecommitdiff
path: root/lib_blackfin
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-04-18 16:16:33 +0200
committerWolfgang Denk <wd@denx.de>2007-04-18 16:16:33 +0200
commit01ebbab0cc19d6a19fa70f40516864edc1e6625d (patch)
treecff2e0348a6c3b300664d944642eaf6488f1ab12 /lib_blackfin
parent0f5642d7322740ad008a4c5eb0a131d64a6f7a0a (diff)
parentc0707ce65677650b5ceab0500ee50ae5168afef2 (diff)
downloadu-boot-imx-01ebbab0cc19d6a19fa70f40516864edc1e6625d.zip
u-boot-imx-01ebbab0cc19d6a19fa70f40516864edc1e6625d.tar.gz
u-boot-imx-01ebbab0cc19d6a19fa70f40516864edc1e6625d.tar.bz2
Merge with /home/wd/git/u-boot/custodian/u-boot-blackfin
Diffstat (limited to 'lib_blackfin')
-rw-r--r--lib_blackfin/Makefile6
-rw-r--r--lib_blackfin/bf533_linux.c6
-rw-r--r--lib_blackfin/bf533_string.c90
-rw-r--r--lib_blackfin/blackfin_board.h6
-rw-r--r--lib_blackfin/board.c31
-rw-r--r--lib_blackfin/cache.c14
-rw-r--r--lib_blackfin/cache.h35
-rw-r--r--lib_blackfin/memcmp.S15
-rw-r--r--lib_blackfin/memcpy.S21
-rw-r--r--lib_blackfin/memmove.S15
-rw-r--r--lib_blackfin/memset.S16
-rw-r--r--lib_blackfin/muldi3.c6
12 files changed, 127 insertions, 134 deletions
diff --git a/lib_blackfin/Makefile b/lib_blackfin/Makefile
index 3197fe1..a7aaef7 100644
--- a/lib_blackfin/Makefile
+++ b/lib_blackfin/Makefile
@@ -1,7 +1,7 @@
#
# U-boot Makefile
#
-# Copyright (c) 2005 blackfin.uclinux.org
+# Copyright (c) 2005-2007 Analog Devices Inc.
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -21,8 +21,8 @@
#
# 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
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301 USA
#
include $(TOPDIR)/config.mk
diff --git a/lib_blackfin/bf533_linux.c b/lib_blackfin/bf533_linux.c
index 1b0d90a..3b9c4df 100644
--- a/lib_blackfin/bf533_linux.c
+++ b/lib_blackfin/bf533_linux.c
@@ -1,7 +1,7 @@
/*
* U-boot - bf533_linux.c
*
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -21,8 +21,8 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
*/
/* Dummy functions, currently not in Use */
diff --git a/lib_blackfin/bf533_string.c b/lib_blackfin/bf533_string.c
index 85b1150..1553f1b 100644
--- a/lib_blackfin/bf533_string.c
+++ b/lib_blackfin/bf533_string.c
@@ -1,7 +1,7 @@
/*
* U-boot - bf533_string.c Contains library routines.
*
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -21,22 +21,16 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
*/
#include <common.h>
#include <asm/setup.h>
-#include <asm/page.h>
#include <config.h>
#include <asm/blackfin.h>
#include <asm/io.h>
-
-extern void blackfin_icache_flush_range(const void *, const void *);
-extern void blackfin_dcache_flush_range(const void *, const void *);
-extern void *memcpy_ASM(void *dest, const void *src, size_t count);
-
-void *dma_memcpy(void *, const void *, size_t);
+#include "cache.h"
char *strcpy(char *dest, const char *src)
{
@@ -118,44 +112,7 @@ int strncmp(const char *cs, const char *ct, size_t count)
return __res1;
}
-/*
- * memcpy - Copy one area of memory to another
- * @dest: Where to copy to
- * @src: Where to copy from
- * @count: The size of the area.
- *
- * You should not use this function to access IO space, use memcpy_toio()
- * or memcpy_fromio() instead.
- */
-void *memcpy(void *dest, const void *src, size_t count)
-{
- char *tmp = (char *)dest, *s = (char *)src;
-
- /* L1_ISRAM can only be accessed via dma */
- if ((tmp >= (char *)L1_ISRAM) && (tmp < (char *)L1_ISRAM_END)) {
- /* L1 is the destination */
- dma_memcpy(dest, src, count);
-
- if (icache_status()) {
- blackfin_icache_flush_range(src, src + count);
- }
- } else if ((s >= (char *)L1_ISRAM) && (s < (char *)L1_ISRAM_END)) {
- /* L1 is the source */
- dma_memcpy(dest, src, count);
-
- if (icache_status()) {
- blackfin_icache_flush_range(dest, dest + count);
- }
- if (dcache_status()) {
- blackfin_dcache_flush_range(dest, dest + count);
- }
- } else {
- memcpy_ASM(dest, src, count);
- }
- return dest;
-}
-
-void *dma_memcpy(void *dest, const void *src, size_t count)
+static void *dma_memcpy(void *dest, const void *src, size_t count)
{
*pMDMA_D0_IRQ_STATUS = DMA_DONE | DMA_ERR;
@@ -189,3 +146,40 @@ void *dma_memcpy(void *dest, const void *src, size_t count)
src += count;
return dest;
}
+
+/*
+ * memcpy - Copy one area of memory to another
+ * @dest: Where to copy to
+ * @src: Where to copy from
+ * @count: The size of the area.
+ *
+ * You should not use this function to access IO space, use memcpy_toio()
+ * or memcpy_fromio() instead.
+ */
+extern void *memcpy_ASM(void *dest, const void *src, size_t count);
+void *memcpy(void *dest, const void *src, size_t count)
+{
+ char *tmp = (char *) dest, *s = (char *) src;
+
+ if (dcache_status()) {
+ blackfin_dcache_flush_range(src, src+count);
+ }
+ /* L1_ISRAM can only be accessed via dma */
+ if ((tmp >= (char *)L1_ISRAM) && (tmp < (char *)L1_ISRAM_END)) {
+ /* L1 is the destination */
+ dma_memcpy(dest,src,count);
+ } else if ((s >= (char *)L1_ISRAM) && (s < (char *)L1_ISRAM_END)) {
+ /* L1 is the source */
+ dma_memcpy(dest,src,count);
+
+ if (icache_status()) {
+ blackfin_icache_flush_range(dest, dest+count);
+ }
+ if (dcache_status()) {
+ blackfin_dcache_invalidate_range(dest, dest+count);
+ }
+ } else {
+ memcpy_ASM(dest,src,count);
+ }
+ return dest;
+}
diff --git a/lib_blackfin/blackfin_board.h b/lib_blackfin/blackfin_board.h
index e0b96da..1353421 100644
--- a/lib_blackfin/blackfin_board.h
+++ b/lib_blackfin/blackfin_board.h
@@ -1,7 +1,7 @@
/*
* U-boot - blackfin_board.h
*
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -21,8 +21,8 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
*/
#ifndef __BLACKFIN_BOARD_H__
diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c
index 1a0a282..1538da3 100644
--- a/lib_blackfin/board.c
+++ b/lib_blackfin/board.c
@@ -1,7 +1,7 @@
/*
* U-boot - board.c First C file to be called contains init routines
*
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -21,8 +21,8 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
*/
#include <common.h>
@@ -182,7 +182,7 @@ void init_cplbtables(void)
icplb_table[j][1] = L1_IMEMORY;
j++;
- for (i = 0; i <= CONFIG_MEM_SIZE / 4; i++) {
+ for (i = 0; i < CONFIG_MEM_SIZE / 4; i++) {
icplb_table[j][0] = (i * 4 * 1024 * 1024);
if (i * 4 * 1024 * 1024 <= CFG_MONITOR_BASE
&& (i + 1) * 4 * 1024 * 1024 >= CFG_MONITOR_BASE) {
@@ -193,14 +193,19 @@ void init_cplbtables(void)
j++;
}
#if defined(CONFIG_BF561)
+ /* MAC space */
+ icplb_table[j][0] = 0x2C000000;
+ icplb_table[j][1] = SDRAM_INON_CHBL;
+ j++;
/* Async Memory space */
for (i = 0; i < 3; i++) {
- icplb_table[j++][0] = 0x20000000 + i * 4 * 1024 * 1024;
- icplb_table[j++][1] = SDRAM_IGENERIC;
+ icplb_table[j][0] = 0x20000000 + i * 4 * 1024 * 1024;
+ icplb_table[j][1] = SDRAM_INON_CHBL;
+ j++;
}
#else
icplb_table[j][0] = 0x20000000;
- icplb_table[j][1] = SDRAM_IGENERIC;
+ icplb_table[j][1] = SDRAM_INON_CHBL;
#endif
j = 0;
dcplb_table[j][0] = 0xFF800000;
@@ -220,13 +225,15 @@ void init_cplbtables(void)
#if defined(CONFIG_BF561)
/* MAC space */
- dcplb_table[j++][0] = CONFIG_ASYNC_EBIU_BASE;
- dcplb_table[j++][1] = SDRAM_EBIU;
+ dcplb_table[j][0] = 0x2C000000;
+ dcplb_table[j][1] = SDRAM_EBIU;
+ j++;
/* Flash space */
- for (i = 0; i < 2; i++) {
- dcplb_table[j++][0] = 0x20000000 + i * 4 * 1024 * 1024;
- dcplb_table[j++][1] = SDRAM_EBIU;
+ for (i = 0; i < 3; i++) {
+ dcplb_table[j][0] = 0x20000000 + i * 4 * 1024 * 1024;
+ dcplb_table[j][1] = SDRAM_EBIU;
+ j++;
}
#else
dcplb_table[j][0] = 0x20000000;
diff --git a/lib_blackfin/cache.c b/lib_blackfin/cache.c
index a15914b..9d71bcb 100644
--- a/lib_blackfin/cache.c
+++ b/lib_blackfin/cache.c
@@ -1,7 +1,7 @@
/*
* U-boot - cache.c
*
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
*
* (C) Copyright 2000-2004
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
@@ -21,17 +21,15 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
*/
/* for now: just dummy functions to satisfy the linker */
#include <config.h>
#include <common.h>
#include <asm/blackfin.h>
-
-extern void blackfin_icache_flush_range(unsigned long, unsigned long);
-extern void blackfin_dcache_flush_range(unsigned long, unsigned long);
+#include "cache.h"
void flush_cache(unsigned long dummy1, unsigned long dummy2)
{
@@ -43,9 +41,9 @@ void flush_cache(unsigned long dummy1, unsigned long dummy2)
return;
if (icache_status())
- blackfin_icache_flush_range(dummy1, dummy1 + dummy2);
+ blackfin_icache_flush_range((void*)dummy1, (void*)(dummy1 + dummy2));
if (dcache_status())
- blackfin_dcache_flush_range(dummy1, dummy1 + dummy2);
+ blackfin_dcache_flush_range((void*)dummy1, (void*)(dummy1 + dummy2));
return;
}
diff --git a/lib_blackfin/cache.h b/lib_blackfin/cache.h
new file mode 100644
index 0000000..3ea6809
--- /dev/null
+++ b/lib_blackfin/cache.h
@@ -0,0 +1,35 @@
+/*
+ * U-boot - prototypes for cache handling functions.
+ *
+ * Copyright (c) 2005-2007 Analog Devices Inc.
+ *
+ * (C) Copyright 2000-2004
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * 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, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _LIB_BLACKFIN_CACHE_H_
+#define _LIB_BLACKFIN_CACHE_H_
+
+extern void blackfin_icache_flush_range(const void *, const void *);
+extern void blackfin_dcache_flush_range(const void *, const void *);
+extern void blackfin_dcache_invalidate_range(const void *, const void *);
+
+#endif
diff --git a/lib_blackfin/memcmp.S b/lib_blackfin/memcmp.S
index fcea5b3..9b58832 100644
--- a/lib_blackfin/memcmp.S
+++ b/lib_blackfin/memcmp.S
@@ -1,17 +1,8 @@
/*
- * File: arch/blackfin/lib/memcmp.S
- * Based on:
- * Author:
+ * File: memcmp.S
*
- * Created:
- * Description:
- *
- * Rev: $Id: memcmp.S 2386 2006-11-01 04:57:26Z magicyang $
- *
- * Modified:
- * Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ * Copyright 2004-2007 Analog Devices Inc.
+ * Enter bugs at http://blackfin.uclinux.org/
*
* 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
diff --git a/lib_blackfin/memcpy.S b/lib_blackfin/memcpy.S
index a73ff90..24577be 100644
--- a/lib_blackfin/memcpy.S
+++ b/lib_blackfin/memcpy.S
@@ -1,22 +1,8 @@
/*
- * File: arch/blackfin/lib/memcpy.S
- * Based on:
- * Author:
+ * File: memcpy.S
*
- * Created:
- * Description: internal version of memcpy(), issued by the compiler
- * to copy blocks of data around.
- * This is really memmove() - it has to be able to deal with
- * possible overlaps, because that ambiguity is when the compiler
- * gives up and calls a function. We have our own, internal version
- * so that we get something we trust, even if the user has redefined
- * the normal symbol.
- * Rev: $Id: memcpy.S 2775 2007-02-21 13:58:44Z hennerich $
- *
- * Modified:
- * Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ * Copyright 2004-2007 Analog Devices Inc.
+ * Enter bugs at http://blackfin.uclinux.org/
*
* 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
@@ -33,6 +19,7 @@
* to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
.align 2
.globl _memcpy_ASM;
diff --git a/lib_blackfin/memmove.S b/lib_blackfin/memmove.S
index 79558f9..46f79ed 100644
--- a/lib_blackfin/memmove.S
+++ b/lib_blackfin/memmove.S
@@ -1,17 +1,8 @@
/*
- * File: arch/blackfin/lib/memmove.S
- * Based on:
- * Author:
+ * File: memmove.S
*
- * Created:
- * Description:
- *
- * Rev: $Id: memmove.S 2205 2006-09-23 07:53:49Z vapier $
- *
- * Modified:
- * Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ * Copyright 2004-2007 Analog Devices Inc.
+ * Enter bugs at http://blackfin.uclinux.org/
*
* 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
diff --git a/lib_blackfin/memset.S b/lib_blackfin/memset.S
index 7e6ee19..c33c551 100644
--- a/lib_blackfin/memset.S
+++ b/lib_blackfin/memset.S
@@ -1,17 +1,8 @@
/*
- * File: arch/blackfin/lib/memset.S
- * Based on:
- * Author:
+ * File: memset.S
*
- * Created:
- * Description:
- *
- * Rev: $Id: memset.S 2769 2007-02-19 16:45:53Z hennerich $
- *
- * Modified:
- * Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs: Enter bugs at http://blackfin.uclinux.org/
+ * Copyright 2004-2007 Analog Devices Inc.
+ * Enter bugs at http://blackfin.uclinux.org/
*
* 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
@@ -29,7 +20,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
.align 2
/*
diff --git a/lib_blackfin/muldi3.c b/lib_blackfin/muldi3.c
index da55711..bf1ca53 100644
--- a/lib_blackfin/muldi3.c
+++ b/lib_blackfin/muldi3.c
@@ -1,7 +1,7 @@
/*
* U-boot - muldi3.c contains routines for mult and div
*
- * Copyright (c) 2005 blackfin.uclinux.org
+ * Copyright (c) 2005-2007 Analog Devices Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -18,8 +18,8 @@
*
* 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
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ * MA 02110-1301 USA
*/
/* Generic function got from GNU gcc package, libgcc2.c */