Commit 7288f972 authored by Sebastian Siewior's avatar Sebastian Siewior Committed by Wolfgang Denk

cfi_flash: make the command u32 only

This got changed by commit 93c56f21
[cfi_flash: support of long cmd in U-boot.]

Long is the wrong type because it will behave differently on 64bit
machines in a way that is probably not expected. u32 should be

Cc: Alexey Korolev <[email protected]>
Cc: Vasiliy Leonenko <[email protected]>
Signed-off-by: default avatarSebastian Siewior <[email protected]>
parent 31cfe574
......@@ -301,7 +301,7 @@ static inline void flash_unmap(flash_info_t *info, flash_sect_t sect,
* make a proper sized command based on the port and chip widths
static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf)
static void flash_make_cmd(flash_info_t *info, u32 cmd, void *cmdbuf)
int i;
int cword_offset;
......@@ -316,9 +316,9 @@ static void flash_make_cmd (flash_info_t * info, ulong cmd, void *cmdbuf)
val = *((uchar*)&cmd + cword_offset);
cp_offset = i - 1;
val = *((uchar*)&cmd + sizeof(ulong) - cword_offset - 1);
val = *((uchar*)&cmd + sizeof(u32) - cword_offset - 1);
cp[cp_offset] = (cword_offset >= sizeof(ulong)) ? 0x00 : val;
cp[cp_offset] = (cword_offset >= sizeof(u32)) ? 0x00 : val;
......@@ -433,7 +433,7 @@ static ulong flash_read_long (flash_info_t * info, flash_sect_t sect,
* Write a proper sized command to the correct address
static void flash_write_cmd (flash_info_t * info, flash_sect_t sect,
uint offset, ulong cmd)
uint offset, u32 cmd)
void *addr;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment