public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
Date: Fri, 20 Sep 2013 17:25:09 -0700	[thread overview]
Message-ID: <523CE765.1070104@boundarydevices.com> (raw)
In-Reply-To: <201309210001.54431.marex@denx.de>

On 9/20/2013 3:01 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 2:20 PM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> On 9/20/2013 12:53 PM, Marek Vasut wrote:
>>>>> Dear Troy Kisky,
>>>>>
>>>>>> On 9/20/2013 11:52 AM, Marek Vasut wrote:
>>>>>>> Dear Troy Kisky,
>>>>>>>
>>>>>>>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
>>>>>>>>> Dear Troy Kisky,
>>>>>>>>>
>>>>>>>>>> Move common definitions to udc.h
>>>>>>>>>> This allows musb_udc.h to be removed as well.
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>>>>>>>
>>>>>>>>>> ---
>>>>>>>>>> v4: updated commit message
>>>>>>>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
>>>>>>>>>> is the only legal value, it shouldn't be overridden.
>>>>>>>>> [...]
>>>>>>>>>
>>>>>>>>>>       #endif
>>>>>>>>>>
>>>>>>>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
>>>>>>>>>> new file mode 100644
>>>>>>>>>> index 0000000..3bcbbbc
>>>>>>>>>> --- /dev/null
>>>>>>>>>> +++ b/include/usb/udc.h
>>>>>>>>>> @@ -0,0 +1,61 @@
>>>>>>>>>> +/*
>>>>>>>>>> + * SPDX-License-Identifier:	GPL-2.0+
>>>>>>>>>> + */
>>>>>>>>>> +#ifndef USB_UDC_H
>>>>>>>>>> +#define USB_UDC_H
>>>>>>>>>> +
>>>>>>>>>> +#ifndef EP0_MAX_PACKET_SIZE
>>>>>>>>>> +#define EP0_MAX_PACKET_SIZE     64
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef EP_MAX_PACKET_SIZE
>>>>>>>>>> +#define EP_MAX_PACKET_SIZE	64
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_OUT_PACKET_SIZE
>>>>>>>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_IN_PACKET_SIZE
>>>>>>>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_INT_PACKET_SIZE
>>>>>>>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_BULK_PACKET_SIZE
>>>>>>>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>> Do you expect these values to change on per-controller basis? Or
>>>>>>>>> why do you have these ifndefs here ?
>>>>>>>> I don't know why they change but
>>>>>>>>
>>>>>>>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
>>>>>>>> EP_MIN_PACKET_SIZE    /* 8 */
>>>>>>>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
>>>>>>>>
>>>>>>>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
>>>>>>>> UDC_IN_PACKET_SIZE   /* 8 */
>>>>>>>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
>>>>>>>>
>>>>>>>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
>>>>>>>> EP_MIN_PACKET_SIZE    /* */
>>>>>>> Are you sure this is not OHCI ?
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Marek Vasut
>>>>>> I don't know.
>>>>>> I don't understand the relevance of the question. Can you explain the
>>>>>> issue a little more
>>>>>> for me.
>>>>> OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that
>>>>> seems to be the case as well. Therefore, in OHCI case, the max packet
>>>>> is 16 and in ehci it's 64 . Check the specs ;-)
>>>>>
>>>>> Best regards,
>>>>> Marek Vasut
>>>> Ok, I checked the spec for the OMAP1510, and found "Table 14?23.
>>>> Endpoint n Size Values"
>>>> lists maximum packet sizes of 8, 16, 32, or 64 bytes for Non-isochronous
>>>> endpoints, and 8, 16, 32, 64, 128, 256, 512 for Isochronous endpoints
>>>>
>>>> So, I still don't understand the limit of 16, but that isn't required.
>>>>
>>>>
>>>> So, are you saying I should edit omap1510_udc.h and add
>>>>
>>>> #define EP_MAX_PACKET_SIZE 16
>>>>
>>>>
>>>> and remove
>>>> #ifndef UDC_BULK_PACKET_SIZE
>>>>
>>>> in udc.h and do
>>>>
>>>> #define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>>
>>>> unconditionally?
>>> I'd say you should check if the controller is OHCI or EHCI , check what
>>> kind of endpoint it is and based on that , configure the max packet
>>> size. Or is this really controller specific ? What do the OHCI and EHCI
>>> specs say ?
>>>
>>> Best regards,
>>> Marek Vasut
>> The omap1510 does have an OHCI host controller, I don't know how that
>> relates to the device
>> controller so I think a check would just be confusing.
> I see the difference now. For EHCI UDC, the max packet sizes are as they are.
> For OMAP/MPC8xx, these are non-standard arbitrary values, it's just that the
> name is the same.
>
> This is pretty ugly and confusing, ick. I'd say you #ifdef this stuff like this:
> #ifdef OMAP1510 ...
> #elif MPC8xx
> #elif ....
> #endif
>
> And put a comment around it that the old UDCs simply follow no standard.
>
> Best regards,
>
I suspect omap1510 will work with a value of 64 for the sizes, since it 
and mpc8xx
were added by Bryan O'Donoghue - 29 May 2006

I've added him to the CC.
Bryan, can you test changing

include/usb/omap1510_udc.h
#define UDC_INT_PACKET_SIZE     16
#define UDC_BULK_PACKET_SIZE 16
--------
or on a very old u-boot
include/usbdcore_omap1510.h
#define UDC_INT_PKTSIZE        16
#define UDC_BULK_PKTSIZE 16


from 16 to 64? Or maybe you remember the reason 16 was needed?
Also, do your remember anything about the MPC885 family and why
endpoint 0 could be 16 bytes, but bulk endpoints are limited to 8?

Thanks, I'd like my comments to be accurate...

Troy

  reply	other threads:[~2013-09-21  0:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT Troy Kisky
2013-09-20 10:45   ` Marek Vasut
2013-09-20 18:18     ` Troy Kisky
2013-09-23  0:05       ` Marek Vasut
2013-09-23 20:23         ` Troy Kisky
2013-09-23 20:55           ` Troy Kisky
2013-09-23 21:17             ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port Troy Kisky
2013-09-20 10:51   ` Marek Vasut
2013-09-20 18:27     ` Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize Troy Kisky
2013-09-20 10:52   ` Marek Vasut
2013-09-20 18:34     ` Troy Kisky
2013-09-23  0:04       ` Marek Vasut
2013-09-23 19:51         ` Troy Kisky
2013-09-23 21:22           ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request Troy Kisky
2013-09-20 10:52   ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 05/17] usb: gadget: mv_udc: split mv_udc.h file Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file Troy Kisky
2013-09-20 10:55   ` Marek Vasut
2013-09-20 18:46     ` Troy Kisky
2013-09-20 18:52       ` Marek Vasut
2013-09-20 19:37         ` Troy Kisky
2013-09-20 19:53           ` Marek Vasut
2013-09-20 21:15             ` Troy Kisky
2013-09-20 21:20               ` Marek Vasut
2013-09-20 21:33                 ` Troy Kisky
2013-09-20 22:01                   ` Marek Vasut
2013-09-21  0:25                     ` Troy Kisky [this message]
2013-09-20  3:29 ` [U-Boot] [PATCH V4 07/17] usb: gadget: mv_udc: fix typo in error message Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 08/17] usb: gadget: mv_udc: set is_dualspeed = 1 Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 09/17] usb: gadget: mv_udc: fix full speed connections Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce Troy Kisky
2013-09-20 10:58   ` Marek Vasut
2013-09-20 18:58     ` Troy Kisky
2013-09-23  0:02       ` Marek Vasut
2013-09-23 19:12         ` Troy Kisky
2013-09-23 21:23           ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 11/17] usb: gadget: mv_udc: flush item before head Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 12/17] usb: gadget: mv_udc: optimize ep_enable Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 13/17] usb: gadget: mv_udc: zero transfer descriptor memory on probe Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 14/17] usb: gadget: mv_udc: clear desc upon ep_disable Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 15/17] mx6: iomux: add GPR1 defines for use with nitrogen6x Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support Troy Kisky
2013-09-20  4:08   ` Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 17/17] nitrogen6x: add CONFIG_MV_UDC Troy Kisky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523CE765.1070104@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox