<br><tt><font size=2>Dear Markus,</font></tt><br><tt><font size=2><br>&gt; Dear Christian,<br>&gt; <br>&gt; &quot;Christian Eggers&quot; &lt;ceggers@gmx.de&gt; writes:<br>&gt; <br>&gt; &gt; I've recognized that a lot of USB code in U-Boot uses the macros<br>&gt; &gt; swap_16() and swap_32() which are defined in usb.h. The behaviour<br>&gt; &gt; of the macros is controlled by the define LITTLEENDIAN.<br>&gt; &gt;<br>&gt; &gt; Is there a good reason NOT to use the macros provided in<br>&gt; &gt; asm/byteorder.h (as in the appropriate code in Linux-2.4 )? <br>&gt; <br>&gt; Largely not. But be carefull. Besides big and little endian CPUs we
also<br>&gt; have controllers that operate in big or little endian (see<br>&gt; CFG_OHCI_BE_CONTROLLER), and then there are PCI controllers whose<br>&gt; registers need to be accessed as little endian<br>&gt; (CFG_OHCI_SWAP_REG_ACCESS).<br></font></tt><br><tt><font size=2>I didn't change much in usb_ohci.c. But I think there
has been a small</font></tt><br><tt><font size=2>error with byteorder conversion (see patch).</font></tt><br><br><tt><font size=2>&gt; But your right, there is no real for LITTLEENDIAN.<br>&gt; <br>&gt; &gt; I think that switching to these functions might be useful in
order<br>&gt; &gt; to eliminate the need to use the LITTLEENDIAN define for<br>&gt; &gt; specifying the byteorder. It seems that LITTLEENDIAN is not<br>&gt; &gt; used outside the USB code.<br>&gt; <br>&gt; Right. Patches cleaning this up are more than welcome! Please note
that<br>&gt; cleaning up USB drivers under the cpu/ directory is a waste of time<br>&gt; though. Boards using these drivers should be converted to use the<br>&gt; generic infrastructure in drivers/usb/ instead.<br></font></tt><br><tt><font size=2>The main focus of my patch is on common/usb.c, common/usb_kbd.c
and</font></tt><br><tt><font size=2>common/usb_storage.c. Unfortunately I couldn't test
my changes in</font></tt><br><tt><font size=2>usb_kbd.c because I don't have such a device.</font></tt><br><br><tt><font size=2>Removing the LITTLEENDIAN define seems not to be as
easy as I thought</font></tt><br><tt><font size=2>first. A bunch of other modules use the swap_16()
and swap_32() defines</font></tt><br><tt><font size=2>from usb.h so I wasn't able to remove these for now.</font></tt><br><br><tt><font size=2>regards</font></tt><br><tt><font size=2>Christian Eggers</font></tt><br><br><br><font size=3>Signed-off-by: </font><tt><font size=2>Christian Eggers
&lt;christian.eggers@kathrein.de&gt;</font></tt><br><font face="sans-serif"><font size=1 face="sans-serif"><br>--<br>
Registergericht / Register court: Amtsgericht Traunstein, HRA 460 / local court Traunstein, certificate of registration no. 460<br>
Geschäftsführender persönlich haftender Gesellschafter / Personally liable managing partner: Prof. Dr. Dr. h.c. Anton Kathrein, Dipl.-Betriebswirt (MBA-equivalent)<br>
Erfüllungsort und Gerichtsstand / Place of performance and place of jurisdiction: Rosenheim<br>
<br>
This e-mail is confidential and may contain privileged information. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. We believe but do not warrant that this e-mail and any attachments are virus free. You must therefore take full responsibility for virus checking.<br></font></font>