<br><tt><font size=2>Dear Markus,</font></tt><br><tt><font size=2><br>> Dear Christian,<br>> <br>> "Christian Eggers" <ceggers@gmx.de> writes:<br>> <br>> > I've recognized that a lot of USB code in U-Boot uses the macros<br>> > swap_16() and swap_32() which are defined in usb.h. The behaviour<br>> > of the macros is controlled by the define LITTLEENDIAN.<br>> ><br>> > Is there a good reason NOT to use the macros provided in<br>> > asm/byteorder.h (as in the appropriate code in Linux-2.4 )? <br>> <br>> Largely not. But be carefull. Besides big and little endian CPUs we
also<br>> have controllers that operate in big or little endian (see<br>> CFG_OHCI_BE_CONTROLLER), and then there are PCI controllers whose<br>> registers need to be accessed as little endian<br>> (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>> But your right, there is no real for LITTLEENDIAN.<br>> <br>> > I think that switching to these functions might be useful in
order<br>> > to eliminate the need to use the LITTLEENDIAN define for<br>> > specifying the byteorder. It seems that LITTLEENDIAN is not<br>> > used outside the USB code.<br>> <br>> Right. Patches cleaning this up are more than welcome! Please note
that<br>> cleaning up USB drivers under the cpu/ directory is a waste of time<br>> though. Boards using these drivers should be converted to use the<br>> 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
<christian.eggers@kathrein.de></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>