[U-Boot-Users] IDE access swaps the bytes.

Wolfgang, Sorry, I didn't see that. I am resending it in plain text.
====== Hi, there, I am using the u-boot with a MPC855T based board, and I am trying to boot from a compact flash by using the diskboot command. After debugging the code, I found out that the u-boot does not detect a DOS partition in the compact flash because the bytes are swapped when data is read from the IDE. In the same way, when the IDE device information is gotten, they are shown as if they are swapped two by two.
As the processor is big-endian, I supposed the u-boot would automatically fix this swapping problem, though I could not understand how. The IDE interface is set in the CPU to have "16-bit" access. I don't know if I should set a "define" to fix this swapping problem, or if I should change the code (cmd_ide.c, I guess) using #ifdef <my platform>. Actually, the Compact flash data sheet specifies exactly that, for a big endian processor I should swap data when accessing a content inside it (because in the compact flash access the even address data is the least significant byte), and to not swap when reading the identification, exactly the opposite of what is done in the code (in my understanding, I could be wrong...) Could anyone please explain this to me?
Thanks,
Helio Fujimoto.

In message OF3F292F76.1C02E690-ON88256F5E.006658A6-88256F5E.006658AA@Cyclades.com you wrote:
I am using the u-boot with a MPC855T based board, and I am trying to boot from a compact flash by using the diskboot command.
I'm sorry, but my crystal ball is in dire need of an ectoplasmic up- grade - in it's current state I am unable to see how your CF card is attached to the system - is it through the PCMCIA controller, or directly on the bus, or what?
After debugging the code, I found out that the u-boot does not detect a DOS partition in the compact flash because the bytes are swapped when data is read from the IDE.
This is something that is specific to your hardware, then. It works fine on the systems we have here.
As the processor is big-endian, I supposed the u-boot would automatically fix this swapping problem, though I could not understand how. The IDE interface is set in
By use of appropriate access macros?
set a "define" to fix this swapping problem, or if I should change the code (cmd_ide.c, I guess) using #ifdef <my platform>.
Don't change the code as long as you don't understand what's going on. As mentioned before: the current code is working fine on several systems with both big- and little-endian architectures.
Could anyone please explain this to me?
Without studying the schematics of your board? That's not exactly a one-banana problem...
Best regards,
Wolfgang Denk
participants (2)
-
Helio Fujimoto
-
Wolfgang Denk