From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Sat, 11 Jul 2015 15:01:19 +0200 Subject: [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG In-Reply-To: <559FE55F.90605@ti.com> References: <1436534204-26853-1-git-send-email-samuel.egli@siemens.com> <1436534204-26853-2-git-send-email-samuel.egli@siemens.com> <559FD6FC.4010606@redhat.com> <559FD87C.7060905@redhat.com> <27E9275BC1C8554E840881B19B62BE421A9ED3@DENBGAT9EI1MSX.ww902.siemens.net> <559FE0CF.60202@denx.de> <559FE55F.90605@ti.com> Message-ID: <55A1139F.1040201@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 10-07-15 17:31, Bin Liu wrote: > Hi, > > On 07/10/2015 10:12 AM, Heiko Schocher wrote: >> Hello Samuel, >> >> Am 10.07.2015 um 16:50 schrieb Egli, Samuel: >>> Hi Hans, >>> >>>> -----Original Message----- From: Hans de Goede >>>> [mailto:hdegoede at redhat.com] Sent: Freitag, 10. Juli 2015 16:37 >>>> To: Egli, Samuel; marex at denx.de Cc: u-boot at lists.denx.de; >>>> trini at konsulko.com; Bin Liu; Meier, Roger; Daniel Mack Subject: >>>> Re: [U-Boot] [PATCH] musb: set MUSB speed based on CONFIG >>>> >>>> Hi, >>>> >>>> On 10-07-15 16:30, Hans de Goede wrote: >>>>> Hi, >>>>> >>>>> On 10-07-15 15:16, Samuel Egli wrote: >>>>>> From: Bin Liu >>>>>> >>>>>> Do not config MUSB to highspeed mode if >>>>>> CONFIG_USB_GADGET_DUALSPEED is not set, in which case Ether >>>>>> gadget only operates in fullspeed. >>>>>> >>>>>> Note: This patch is necessary for devices like some siemens >>>>>> boards that allow only FULL SPEED USB 1.1, e.g. DFU >>>>>> download. >>>>>> >>>>>> Signed-off-by: Bin Liu Reviewed-by: Tom Rini >>>>>> Tested-by: Samuel Egli >>>>>> CC: Marek Vasut CC: >>>>>> Heiko Schocher CC: Daniel Mack >>>>>> CC: Roger Meier >>>>> >>>>> Nack this breaks highspeed mode on boards which use the musb in >>>>> host mode, and thus do not set CONFIG_USB_GADGET_DUALSPEED. > > My bad, I had a short thought about this when I was initially working on > this patch, but did not really think about it throughly. Thanks for > bring it up. > >>>> >>>> p.s. >>>> >>>> Given that you want to use this as a hack to work around the >>>> broken pcb design of your board I suggest adding a new option for >>>> this >>> >>> Well, lets not discuss the "broken" pcb design. It seems that >>> wiring protection is not that common. Unfortunately, such a >>> protection is too expensive for USB High speed :-(. > > Agreed, we have seen many cases that have nothing to do with hardware > design, but MUSB has to work in full-speed mode. > >>> >>>> titled: CONFIG_USB_MUSB_NO_HIGHSPEED and then do: >>>> >>>> +#ifndef CONFIG_USB_MUSB_NO_HIGHSPEED | MUSB_POWER_HSENAB >>>> +#endif >>>> >>> This would be good enough. The point is indeed to limit it to full >>> speed. >>> >>>> Using CONFIG_USB_GADGET_DUALSPEED for this seems wrong, since >>>> this has nothing to do with enabling dualspeed mode for the >>>> gadget code really. >>> >>> I agree that the name is confusing. >> >> Yes, I vote for Hans suggestion. > > *Adding* a new macro CONFIG_USB_MUSB_NO_HIGHSPEED for musb driver causes > CONFIG_USB_GADGET_DUALSPEED redundant, because both control for full-speed. > > I suggest to *rename* CONFIG_USB_GADGET_DUALSPEED to > CONFIG_USB_FULLSPEED_ONLY. So that we can use one macro for both gadget > and musb drivers. Considering supper-speed exists and future, I think > CONFIG_USB_NO_HIGHSPEED is confusing... This works for me, as long as the submitter of this change ensures that things do not regress for existing musb users, such as all sunxi boards, which would have regressed with the original patch. Regards, Hans