[Mips]
Tools: adaptions to mips-elf toolchain git-svn-id: http://moon:8086/svn/mips@137 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -162,19 +162,20 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if ((argv[2][0] == '-') && (toupper(argv[2][1]) == 'E') && (toupper(argv[2][2]) == 'B'))
|
||||
{
|
||||
if (0 == IsEndianBig())
|
||||
if (1 == IsEndianBig())
|
||||
{
|
||||
img_hdr.magic = conv_endian32(MAGIC);
|
||||
|
||||
img_hdr.target_addr = conv_endian32(SDRAM_BASE);
|
||||
img_hdr.img_size = conv_endian32(filesize);
|
||||
img_hdr.img_offset = conv_endian32(FLASH_BASE_MEM + sizeof(flash_img_hdr_t));
|
||||
img_hdr.hdr_next = conv_endian32(FLASH_BASE_MEM);
|
||||
}
|
||||
pBuf32 = (uint32_t*)pBuf;
|
||||
for (i=0; i < filesize/4; i ++)
|
||||
pBuf32[i] = pBuf32[i]; // don't convert data
|
||||
}
|
||||
else
|
||||
{
|
||||
pBuf32 = (uint32_t*)pBuf;
|
||||
for (i=0; i < filesize/4; i ++)
|
||||
pBuf32[i] = conv_endian32(pBuf32[i]); // convert data
|
||||
}
|
||||
}
|
||||
}
|
||||
fwrite(&img_hdr, sizeof(flash_img_hdr_t), 1, pFile);
|
||||
fwrite(pBuf, 1, filesize, pFile);
|
||||
|
||||
Reference in New Issue
Block a user