[ECOS] flash byteorder

Jacek Poplawski jacekp@s3group.com
Fri Jul 21 19:23:00 GMT 2006


I am porting RedBoot to ixdp2801 board. I have working version of old
Intel's port - RedBoot v1.24 (I call it the "old" RedBoot) and current CVS
from ecos (I call it the "new" RedBoot").

I was able to put board initialization from old RedBoot to new one. So
board starts. I was also able to put UART Tx function to the new RedBoot
and hack diag_printf to use it, so I can see what is going on. Then I
changed _rb_gets function to use UART Rx and now I can also give commands.
And for instance "reset" command works.

My current problem is access to the flash. Please look at this short code:

        #define SLOW_PORT_BASE     0xC4000000
        ROM = (unsigned char *)FLASH_BASE;
        ROM[3] = FLASH_Read_ID;
        for (i=0;i<16;i++)
                diag_printf("%x ",ROM[i]);

On old RedBoot this code shows:

89 89 18 18 fc fc fc fc 89 89 c7 c7 c7 c7 c7 c7

on new one:

18 18 89 89 fc fc fc fc c7 c7 89 89 c7 c7 c7 c7

This code is from flash_query function, and only two values from this
array are used, so I was able to swap the pointers, and flash
initialization works now, but all data on flash is swapped (for example
"fis list" shows incorrect names).

I spend few days trying to find how old RedBoot defines byteorder on flash
- but couldn't find anything. I am sure that endianess of system is set to
big endian (this is first thing which platform_setup does), code is
compiled with -mbig-endian. Both old and new RedBoot binaries have byte
swapped with swapbytes utility. Endianess of code must be correct, because
it works and text messages are displayed correctly.

I found definition of CYGOPT_REDBOOT_FLASH_BYTEORDER, but it is not used
by flash_query or any earlier code. I also don't see any references to
CYG_BYTEORDER in this part of flash code.

And there is no code which swaps bytes in 0xC4000000 memory. So how it is
possible that on old redboot data is different? Do you have any ideas
where to search? Any tips what may be wrong?

Is there any common way to define how flash memory is accessible on low

Jacek Poplawski
Software Engineer
Silicon and Software Systems

The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
Please direct any additional queries to: communications@s3group.com.
Thank You.

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list