summaryrefslogtreecommitdiff
path: root/cleopatre/u-boot-1.1.6/lib_generic
diff options
context:
space:
mode:
authorsave2009-06-30 15:56:32 +0000
committersave2009-06-30 15:56:32 +0000
commiteab2ce0ee89496e33f5a5ac724045e744740d9c9 (patch)
treee3fef0fe2777d9597248b1f343a10a1b80de95f1 /cleopatre/u-boot-1.1.6/lib_generic
parent8de14a53bab8d16b37abed3c83332acf5b2393b9 (diff)
[CLEO][U-BOOT]Corrected environnement variables accesses because 8bits read is not allowed with SPI direct
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4866 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cleopatre/u-boot-1.1.6/lib_generic')
-rw-r--r--cleopatre/u-boot-1.1.6/lib_generic/crc32.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cleopatre/u-boot-1.1.6/lib_generic/crc32.c b/cleopatre/u-boot-1.1.6/lib_generic/crc32.c
index 3d99b69296..cd95155cd3 100644
--- a/cleopatre/u-boot-1.1.6/lib_generic/crc32.c
+++ b/cleopatre/u-boot-1.1.6/lib_generic/crc32.c
@@ -144,7 +144,17 @@ const uLongf * ZEXPORT get_crc_table()
#endif
/* ========================================================================= */
+#ifdef CONFIG_ARCH_SPC300
+#define DO1(buf) do { \
+ uIntf *align = (uIntf*)(((uIntf)buf) & 0xFFFFFFFC); \
+ uIntf rest = (uIntf)(((uIntf)buf) & 0x3); \
+ Bytef val = (Bytef)(((*align) >> rest*8) & 0xFF); \
+ crc = crc_table[((int)crc ^ val) & 0xff] ^ (crc >> 8); \
+ buf++; \
+}while(0)
+#else
#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
+#endif
#define DO2(buf) DO1(buf); DO1(buf);
#define DO4(buf) DO2(buf); DO2(buf);
#define DO8(buf) DO4(buf); DO4(buf);