* Re: UDC support for MIPS/AU1200 and Geode/CS5536
[not found] <20060109180356.GA8855@cosmic.amd.com>
@ 2006-01-09 18:21 ` Jordan Crouse
2006-01-09 22:44 ` [linux-usb-devel] [PATCH] " Oliver Neukum
1 sibling, 0 replies; 6+ messages in thread
From: Jordan Crouse @ 2006-01-09 18:21 UTC (permalink / raw)
To: linux-usb-devel; +Cc: linux-mips, linux-kernel, info-linux, thomas.dahlmann
On 09/01/06 11:03 -0700, Jordan Crouse wrote:
> From the "two-birds-one-stone" department, I am pleased to present USB UDC
> support for both the MIPS Au1200 SoC and the Geode CS5535 south bridge.
^^^^^^
Of course, I meant the CS5536 - this *won't* work for the CS5535.
Jordan
--
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS5536
[not found] <20060109180356.GA8855@cosmic.amd.com>
2006-01-09 18:21 ` UDC support for MIPS/AU1200 and Geode/CS5536 Jordan Crouse
@ 2006-01-09 22:44 ` Oliver Neukum
2006-01-10 11:02 ` Thomas Dahlmann
1 sibling, 1 reply; 6+ messages in thread
From: Oliver Neukum @ 2006-01-09 22:44 UTC (permalink / raw)
To: linux-usb-devel
Cc: Jordan Crouse, linux-mips, linux-kernel, info-linux, thomas.dahlmann
Am Montag, 9. Januar 2006 19:03 schrieb Jordan Crouse:
> >From the "two-birds-one-stone" department, I am pleased to present USB UDC
> support for both the MIPS Au1200 SoC and the Geode CS5535 south bridge.
> Also, coming soon (in the next few days), OTG, which has been removed from
> the usb_host patch, and put into its own patch (as per David's comments).
>
> This patch is against current linux-mips git, but it should apply for Linus's
> tree as well.
>
> Regards,
> Jordan
>
+ VDBG("udc_read_bytes(): %d bytes\n", bytes);
+
+ /* dwords first */
+ for (i = 0; i < bytes / UDC_DWORD_BYTES; i++) {
+ *((u32*) (buf + (i<<2))) = readl(dev->rxfifo);
+ }
Is there any reason you don't increment by 4?
Regards
Oliver
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS5536
2006-01-09 22:44 ` [linux-usb-devel] [PATCH] " Oliver Neukum
@ 2006-01-10 11:02 ` Thomas Dahlmann
2006-01-10 13:16 ` David Vrabel
2006-01-10 13:40 ` Oliver Neukum
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Dahlmann @ 2006-01-10 11:02 UTC (permalink / raw)
To: Oliver Neukum
Cc: linux-usb-devel, Jordan Crouse, linux-mips, linux-kernel, info-linux
Oliver Neukum wrote:
>Am Montag, 9. Januar 2006 19:03 schrieb Jordan Crouse:
>
>
>>>From the "two-birds-one-stone" department, I am pleased to present USB UDC
>>support for both the MIPS Au1200 SoC and the Geode CS5535 south bridge.
>>Also, coming soon (in the next few days), OTG, which has been removed from
>>the usb_host patch, and put into its own patch (as per David's comments).
>>
>>This patch is against current linux-mips git, but it should apply for Linus's
>>tree as well.
>>
>>Regards,
>>Jordan
>>
>>
>>
>+ VDBG("udc_read_bytes(): %d bytes\n", bytes);
>+
>+ /* dwords first */
>+ for (i = 0; i < bytes / UDC_DWORD_BYTES; i++) {
>+ *((u32*) (buf + (i<<2))) = readl(dev->rxfifo);
>+ }
>
>Is there any reason you don't increment by 4?
>
> Regards
> Oliver
>
>
>
>
>
The loop is for reading dwords only, so "i < bytes / UDC_DWORD_BYTES" cuts
off remaining 1,2 or 3 bytes which are handled by the next loop.
But you are right, incrementing by 4 may look better, as
for (i = 0; i < bytes - bytes % UDC_DWORD_BYTES; i+=4) {
*((u32*) (buf + i)) = readl(dev->rxfifo);
}
Thanks,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS5536
2006-01-10 11:02 ` Thomas Dahlmann
@ 2006-01-10 13:16 ` David Vrabel
2006-01-10 13:40 ` Oliver Neukum
1 sibling, 0 replies; 6+ messages in thread
From: David Vrabel @ 2006-01-10 13:16 UTC (permalink / raw)
To: Thomas Dahlmann
Cc: Oliver Neukum, linux-usb-devel, Jordan Crouse, linux-mips,
linux-kernel, info-linux
Thomas Dahlmann wrote:
>
> The loop is for reading dwords only, so "i < bytes / UDC_DWORD_BYTES" cuts
> off remaining 1,2 or 3 bytes which are handled by the next loop.
> But you are right, incrementing by 4 may look better, as
>
> for (i = 0; i < bytes - bytes % UDC_DWORD_BYTES; i+=4) {
for (i = 0; i <= bytes - UDC_DWORD_BYTES; i += 4) {
?
David Vrabel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS5536
2006-01-10 11:02 ` Thomas Dahlmann
2006-01-10 13:16 ` David Vrabel
@ 2006-01-10 13:40 ` Oliver Neukum
2006-01-13 10:08 ` Thomas Dahlmann
1 sibling, 1 reply; 6+ messages in thread
From: Oliver Neukum @ 2006-01-10 13:40 UTC (permalink / raw)
To: Thomas Dahlmann
Cc: linux-usb-devel, Jordan Crouse, linux-mips, linux-kernel, info-linux
Am Dienstag, 10. Januar 2006 12:02 schrieb Thomas Dahlmann:
>
> Oliver Neukum wrote:
>
> >Am Montag, 9. Januar 2006 19:03 schrieb Jordan Crouse:
> >
> >
> >>>From the "two-birds-one-stone" department, I am pleased to present USB UDC
> >>support for both the MIPS Au1200 SoC and the Geode CS5535 south bridge.
> >>Also, coming soon (in the next few days), OTG, which has been removed from
> >>the usb_host patch, and put into its own patch (as per David's comments).
> >>
> >>This patch is against current linux-mips git, but it should apply for Linus's
> >>tree as well.
> >>
> >>Regards,
> >>Jordan
> >>
> >>
> >>
> >+ VDBG("udc_read_bytes(): %d bytes\n", bytes);
> >+
> >+ /* dwords first */
> >+ for (i = 0; i < bytes / UDC_DWORD_BYTES; i++) {
> >+ *((u32*) (buf + (i<<2))) = readl(dev->rxfifo);
> >+ }
> >
> >Is there any reason you don't increment by 4?
> >
> > Regards
> > Oliver
> >
> >
> >
> >
> >
> The loop is for reading dwords only, so "i < bytes / UDC_DWORD_BYTES" cuts
> off remaining 1,2 or 3 bytes which are handled by the next loop.
> But you are right, incrementing by 4 may look better, as
>
> for (i = 0; i < bytes - bytes % UDC_DWORD_BYTES; i+=4) {
> *((u32*) (buf + i)) = readl(dev->rxfifo);
> }
Not only will it look better, but it'll save you a shift operation.
You might even compute start and finish values before the loop and
save an addition in the body.
Regards
Oliver
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [linux-usb-devel] [PATCH] UDC support for MIPS/AU1200 and Geode/CS5536
2006-01-10 13:40 ` Oliver Neukum
@ 2006-01-13 10:08 ` Thomas Dahlmann
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Dahlmann @ 2006-01-13 10:08 UTC (permalink / raw)
To: Oliver Neukum
Cc: linux-usb-devel, Jordan Crouse, linux-mips, linux-kernel, info-linux
Oliver Neukum wrote:
>Am Dienstag, 10. Januar 2006 12:02 schrieb Thomas Dahlmann:
>
>
>>Oliver Neukum wrote:
>>
>>
>>
>>>Am Montag, 9. Januar 2006 19:03 schrieb Jordan Crouse:
>>>
>>>
>>>
>>>
>>>>>From the "two-birds-one-stone" department, I am pleased to present USB UDC
>>>>support for both the MIPS Au1200 SoC and the Geode CS5535 south bridge.
>>>>Also, coming soon (in the next few days), OTG, which has been removed from
>>>>the usb_host patch, and put into its own patch (as per David's comments).
>>>>
>>>>This patch is against current linux-mips git, but it should apply for Linus's
>>>>tree as well.
>>>>
>>>>Regards,
>>>>Jordan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>+ VDBG("udc_read_bytes(): %d bytes\n", bytes);
>>>+
>>>+ /* dwords first */
>>>+ for (i = 0; i < bytes / UDC_DWORD_BYTES; i++) {
>>>+ *((u32*) (buf + (i<<2))) = readl(dev->rxfifo);
>>>+ }
>>>
>>>Is there any reason you don't increment by 4?
>>>
>>> Regards
>>> Oliver
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>The loop is for reading dwords only, so "i < bytes / UDC_DWORD_BYTES" cuts
>>off remaining 1,2 or 3 bytes which are handled by the next loop.
>>But you are right, incrementing by 4 may look better, as
>>
>> for (i = 0; i < bytes - bytes % UDC_DWORD_BYTES; i+=4) {
>> *((u32*) (buf + i)) = readl(dev->rxfifo);
>> }
>>
>>
>
>Not only will it look better, but it'll save you a shift operation.
>You might even compute start and finish values before the loop and
>save an addition in the body.
>
> Regards
> Oliver
>
>
>
>
>
I have changed this for the next patch release. Thanks for the input !
Regards,
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-01-13 10:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20060109180356.GA8855@cosmic.amd.com>
2006-01-09 18:21 ` UDC support for MIPS/AU1200 and Geode/CS5536 Jordan Crouse
2006-01-09 22:44 ` [linux-usb-devel] [PATCH] " Oliver Neukum
2006-01-10 11:02 ` Thomas Dahlmann
2006-01-10 13:16 ` David Vrabel
2006-01-10 13:40 ` Oliver Neukum
2006-01-13 10:08 ` Thomas Dahlmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).