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:
2017-02-04 11:02:25 +00:00
parent 1530cab6de
commit ff668859d2
+10 -9
View File
@@ -162,18 +162,19 @@ int main(int argc, char *argv[])
{ {
if ((argv[2][0] == '-') && (toupper(argv[2][1]) == 'E') && (toupper(argv[2][2]) == 'B')) 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.magic = conv_endian32(MAGIC);
pBuf32 = (uint32_t*)pBuf;
img_hdr.target_addr = conv_endian32(SDRAM_BASE); for (i=0; i < filesize/4; i ++)
img_hdr.img_size = conv_endian32(filesize); pBuf32[i] = pBuf32[i]; // don't convert data
img_hdr.img_offset = conv_endian32(FLASH_BASE_MEM + sizeof(flash_img_hdr_t)); }
img_hdr.hdr_next = conv_endian32(FLASH_BASE_MEM); else
{
pBuf32 = (uint32_t*)pBuf;
for (i=0; i < filesize/4; i ++)
pBuf32[i] = conv_endian32(pBuf32[i]); // convert data
} }
pBuf32 = (uint32_t*)pBuf;
for (i=0; i < filesize/4; i ++)
pBuf32[i] = pBuf32[i]; // don't convert data
} }
} }
fwrite(&img_hdr, sizeof(flash_img_hdr_t), 1, pFile); fwrite(&img_hdr, sizeof(flash_img_hdr_t), 1, pFile);