summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/trab/flash.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/board/trab/flash.c b/board/trab/flash.c
index 27c2a5b..1550e17 100644
--- a/board/trab/flash.c
+++ b/board/trab/flash.c
@@ -431,7 +431,15 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
* handle word aligned part
*/
while (cnt >= 4) {
- data = *((vu_long *) src);
+ if (((ulong)src) & 0x3) {
+ for (i = 0; i < 4; i++) {
+ ((char *)&data)[i] = ((vu_char *)src)[i];
+ }
+ }
+ else {
+ data = *((vu_long *) src);
+ }
+
if ((rc = write_word (info, wp, data)) != 0) {
return (rc);
}