summaryrefslogtreecommitdiffstats
path: root/board/dave/common
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-02-24 00:16:43 +0000
committerwdenk <wdenk>2004-02-24 00:16:43 +0000
commit074cff0d2863bab21b065cf283eccd728f4fecaa (patch)
tree9ab218f6e0fc44cc450d32c1d0978f98449e220d /board/dave/common
parent028ab6b598b628326116acd88e0f35aa9f526d12 (diff)
downloadu-boot-074cff0d2863bab21b065cf283eccd728f4fecaa.tar.gz
u-boot-074cff0d2863bab21b065cf283eccd728f4fecaa.tar.xz
u-boot-074cff0d2863bab21b065cf283eccd728f4fecaa.zip
* Patch by Andrea Scian, 17 Feb 2004:
Add support for S3C44B0 processor and DAVE B2 board * Patch by Steven Scholz, 20 Feb 2004: - Add support for MII commands on AT91RM9200 boards - some cleanup in AT91RM9200 ethernet code
Diffstat (limited to 'board/dave/common')
-rw-r--r--board/dave/common/flash.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/board/dave/common/flash.c b/board/dave/common/flash.c
index feea093710..b0e411617f 100644
--- a/board/dave/common/flash.c
+++ b/board/dave/common/flash.c
@@ -22,7 +22,6 @@
*/
#include <common.h>
-#include <ppc4xx.h>
#include <asm/processor.h>
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
@@ -578,15 +577,27 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
if ((l = addr - wp) != 0) {
data = 0;
for (i=0, cp=wp; i<l; ++i, ++cp) {
+#ifdef CONFIG_B2
+ data = data | ((*(uchar *)cp)<<(8*i));
+#else
data = (data << 8) | (*(uchar *)cp);
+#endif
}
for (; i<4 && cnt>0; ++i) {
+#ifdef CONFIG_B2
+ data = data | ((*src++)<<(8*i));
+#else
data = (data << 8) | *src++;
+#endif
--cnt;
++cp;
}
for (; cnt==0 && i<4; ++i, ++cp) {
+#ifdef CONFIG_B2
+ data = data | ((*(uchar *)cp)<<(8*i));
+#else
data = (data << 8) | (*(uchar *)cp);
+#endif
}
if ((rc = write_word(info, wp, data)) != 0) {
@@ -600,9 +611,14 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
*/
while (cnt >= 4) {
data = 0;
+#ifdef CONFIG_B2
+ data = (*(ulong*)src);
+ src += 4;
+#else
for (i=0; i<4; ++i) {
data = (data << 8) | *src++;
}
+#endif
if ((rc = write_word(info, wp, data)) != 0) {
return (rc);
}
@@ -619,11 +635,19 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
*/
data = 0;
for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) {
+#ifdef CONFIG_B2
+ data = data | ((*src++)<<(8*i));
+#else
data = (data << 8) | *src++;
+#endif
--cnt;
}
for (; i<4; ++i, ++cp) {
+#ifdef CONFIG_B2
+ data = data | ((*(uchar *)cp)<<(8*i));
+#else
data = (data << 8) | (*(uchar *)cp);
+#endif
}
return (write_word(info, wp, data));