RE: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
> From: Dinh Nguyen [mailto:dingu...@altera.com] > Sent: Tuesday, February 18, 2014 1:14 PM > > On Fri, 2014-02-14 at 22:50 +, Paul Zimmerman wrote: > > > From: Jingoo Han [mailto:jg1@samsung.com] > > > Sent: Thursday, February 13, 2014 11:46 PM > > > > > > On Friday, February 14, 2014 2:27 PM, Peter Chen wrote: > > > > On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: > > > > > From: Dinh Nguyen > > > > > > > > > > Hello, > > > > > > > > > > This patch series combines the dwc2 host driver and the s3c-hsotg > > > > > peripheral > > > > > driver into a single dual-roler driver similar to the dwc3. > > > > > > > > Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should > > > > like ip driver + glue layer. If not, why needs to put them > > > > together, I am a little puzzled here. > > > > > > Yes, 's3c-hsotg' also uses DWC USB2 IP. > > > As DWC3 USB driver (./drivers/usb/dwc3/), 'IP driver + glue layer' > > > looks good. > > > > > > Best regards, > > > Jingoo Han > > > > Well, DWC3 is a little different. It has a standards-based host API, > > xHCI, that is (almost) completely independent from its non-standards- > > based device API (I say 'almost' because of the optional OTG > > functionality). This means the two drivers have to be separate, to > > support other xHCI implementations that don't have the device mode > > functionality. But it also complicates some things, like the > > implementation of OTG support, which perhaps can be seen by the fact > > that there is almost no OTG support yet in the DWC3 driver (except for > > role switching). > > > > Whereas the DWC2 host and device modes both use a proprietary API, so > > there is no need to have separate drivers, because there are no other > > implementations of the core except the Synopsys one. Also, quite a few > > of the registers are shared between host and device modes, so keeping > > the two drivers separate would mean duplicating some code that could > > be shared between them. > > > > That said, I would have no objection to keeping the two drivers > > separate, as long as it doesn't create significant difficulties with > > the implementation. > > > > Dinh, what do you think? Did you consider the possibility of keeping the > > two drivers separate, perhaps sharing some code in a library module? For > > example, you could have dwc2-lib.ko, dwc2.ko, and s3c-hsotg.ko. > > dwc2-lib.ko would always be loaded, and dwc2.ko or s3c-hsotg.ko (or both) > > would be loaded depending on which mode is selected. Each driver would > > have its own interrupt handler, both of them sharing the common IRQ. > > They would both have their own probe methods, too. > > > > No, I didn't think of this possibility. This initial patch was to try to > remove some duplicating of code between dwc2/s3c-hsotg without breaking > them too badly. But I think I failed in this aspect from the initial > testing. > > I like your suggestion of keeping the drivers separate with a library > module for the role-switching. Do you see this driver being able to go > full OTG in the future? And if so, will one method be more adaptable > than the other to enable OTG? I don't think having separate drivers should affect the ability to implement OTG, in fact I think a lot of the OTG-capable controllers have separate drivers for host and peripheral mode. > > I haven't thought too deeply about this, so maybe it's a bad idea. But > > you are the one doing the work, so I think the final decision should be > > yours. > > > > So let try your approach. But does moving s3c-hostg into the dwc2 folder > and sharing 1 define file still valid? I think it would be a little weird to have the peripheral driver in a different directory than the host, especially if they share a common library module. So I think that is still the best approach. -- Paul
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
Hi, On Tue, Feb 18, 2014 at 03:14:25PM -0600, Dinh Nguyen wrote: > On Fri, 2014-02-14 at 22:50 +, Paul Zimmerman wrote: > > > From: Jingoo Han [mailto:jg1@samsung.com] > > > Sent: Thursday, February 13, 2014 11:46 PM > > > > > > On Friday, February 14, 2014 2:27 PM, Peter Chen wrote: > > > > On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: > > > > > From: Dinh Nguyen > > > > > > > > > > Hello, > > > > > > > > > > This patch series combines the dwc2 host driver and the s3c-hsotg > > > > > peripheral > > > > > driver into a single dual-roler driver similar to the dwc3. > > > > > > > > Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should > > > > like ip driver + glue layer. If not, why needs to put them > > > > together, I am a little puzzled here. > > > > > > Yes, 's3c-hsotg' also uses DWC USB2 IP. > > > As DWC3 USB driver (./drivers/usb/dwc3/), 'IP driver + glue layer' > > > looks good. > > > > > > Best regards, > > > Jingoo Han > > > > Well, DWC3 is a little different. It has a standards-based host API, > > xHCI, that is (almost) completely independent from its non-standards- > > based device API (I say 'almost' because of the optional OTG > > functionality). This means the two drivers have to be separate, to > > support other xHCI implementations that don't have the device mode > > functionality. But it also complicates some things, like the > > implementation of OTG support, which perhaps can be seen by the fact > > that there is almost no OTG support yet in the DWC3 driver (except for > > role switching). I don't think having separate drivers is undermining OTG support. It's just that nobody has put down the effort to implement it ;-) > > Whereas the DWC2 host and device modes both use a proprietary API, so > > there is no need to have separate drivers, because there are no other > > implementations of the core except the Synopsys one. Also, quite a few > > of the registers are shared between host and device modes, so keeping > > the two drivers separate would mean duplicating some code that could > > be shared between them. > > > > That said, I would have no objection to keeping the two drivers > > separate, as long as it doesn't create significant difficulties with > > the implementation. > > > > Dinh, what do you think? Did you consider the possibility of keeping the > > two drivers separate, perhaps sharing some code in a library module? For > > example, you could have dwc2-lib.ko, dwc2.ko, and s3c-hsotg.ko. > > dwc2-lib.ko would always be loaded, and dwc2.ko or s3c-hsotg.ko (or both) > > would be loaded depending on which mode is selected. Each driver would > > have its own interrupt handler, both of them sharing the common IRQ. > > They would both have their own probe methods, too. > > > > No, I didn't think of this possibility. This initial patch was to try to > remove some duplicating of code between dwc2/s3c-hsotg without breaking > them too badly. But I think I failed in this aspect from the initial > testing. > > I like your suggestion of keeping the drivers separate with a library > module for the role-switching. Do you see this driver being able to go > full OTG in the future? And if so, will one method be more adaptable > than the other to enable OTG? > > > > I haven't thought too deeply about this, so maybe it's a bad idea. But > > you are the one doing the work, so I think the final decision should be > > yours. > > > > So let try your approach. But does moving s3c-hostg into the dwc2 folder > and sharing 1 define file still valid? I would say combining those driver is the best thing you guys can do for several reasons. It will make sure everybody uses a single generic driver, it'll help you avoid code duplication (how many other dwc2 implementations have we seen on linux-usb alone ?), it'll focus efforts to stabilize a single dwc2 driver etc. In fact, I have been asking Samsung folks to cleanup s3c-hsotg for quite a while now exactly so we could have a single dwc2 driver for host and device. cheers -- balbi signature.asc Description: Digital signature
RE: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Fri, 2014-02-14 at 22:50 +, Paul Zimmerman wrote: > > From: Jingoo Han [mailto:jg1@samsung.com] > > Sent: Thursday, February 13, 2014 11:46 PM > > > > On Friday, February 14, 2014 2:27 PM, Peter Chen wrote: > > > On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: > > > > From: Dinh Nguyen > > > > > > > > Hello, > > > > > > > > This patch series combines the dwc2 host driver and the s3c-hsotg > > > > peripheral > > > > driver into a single dual-roler driver similar to the dwc3. > > > > > > Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should > > > like ip driver + glue layer. If not, why needs to put them > > > together, I am a little puzzled here. > > > > Yes, 's3c-hsotg' also uses DWC USB2 IP. > > As DWC3 USB driver (./drivers/usb/dwc3/), 'IP driver + glue layer' > > looks good. > > > > Best regards, > > Jingoo Han > > Well, DWC3 is a little different. It has a standards-based host API, > xHCI, that is (almost) completely independent from its non-standards- > based device API (I say 'almost' because of the optional OTG > functionality). This means the two drivers have to be separate, to > support other xHCI implementations that don't have the device mode > functionality. But it also complicates some things, like the > implementation of OTG support, which perhaps can be seen by the fact > that there is almost no OTG support yet in the DWC3 driver (except for > role switching). > > Whereas the DWC2 host and device modes both use a proprietary API, so > there is no need to have separate drivers, because there are no other > implementations of the core except the Synopsys one. Also, quite a few > of the registers are shared between host and device modes, so keeping > the two drivers separate would mean duplicating some code that could > be shared between them. > > That said, I would have no objection to keeping the two drivers > separate, as long as it doesn't create significant difficulties with > the implementation. > > Dinh, what do you think? Did you consider the possibility of keeping the > two drivers separate, perhaps sharing some code in a library module? For > example, you could have dwc2-lib.ko, dwc2.ko, and s3c-hsotg.ko. > dwc2-lib.ko would always be loaded, and dwc2.ko or s3c-hsotg.ko (or both) > would be loaded depending on which mode is selected. Each driver would > have its own interrupt handler, both of them sharing the common IRQ. > They would both have their own probe methods, too. > No, I didn't think of this possibility. This initial patch was to try to remove some duplicating of code between dwc2/s3c-hsotg without breaking them too badly. But I think I failed in this aspect from the initial testing. I like your suggestion of keeping the drivers separate with a library module for the role-switching. Do you see this driver being able to go full OTG in the future? And if so, will one method be more adaptable than the other to enable OTG? > I haven't thought too deeply about this, so maybe it's a bad idea. But > you are the one doing the work, so I think the final decision should be > yours. > So let try your approach. But does moving s3c-hostg into the dwc2 folder and sharing 1 define file still valid? Thanks, Dinh -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On 02/17/2014 09:18 AM, Robert Baldyga wrote: > On 02/17/2014 01:37 AM, Jingoo Han wrote: >> On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: >>> On 02/13/2014 10:10 PM, dingu...@altera.com wrote: From: Dinh Nguyen Hello, This patch series combines the dwc2 host driver and the s3c-hsotg peripheral driver into a single dual-roler driver similar to the dwc3. >>> >>> Hi. >>> It looks like it doesn't work on Samsung platforms without device-tree >>> support. >> >> Hi Robert Baldyga, >> >> In order to test this patch, the current mainline kernel requires >> additional patches to support device-tree. The following patches >> are necessary. >> >> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179920.html >> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179921.html >> http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179922.html >> >> The last one should be modified for your machine. >> > > It will not help on platforms which never had and never will have > device-tree support. Hi, I have tested it also on device with device tree support. I got error: [2.10] dwc2/s3c-hsotg 1248.hsotg: dwc2_core_init(ee13f010) [2.10] dwc2/s3c-hsotg 1248.hsotg: dwc2_core_reset() [4.18] dwc2/s3c-hsotg 1248.hsotg: dwc2_core_reset() HANG! Soft Reset GRSTCTL=8001 [4.19] dwc2/s3c-hsotg 1248.hsotg: dwc2_core_init(): Reset failed, aborting [4.195000] dwc2/s3c-hsotg: probe of 1248.hsotg failed with error -16 Best regards Robert Baldyga Samsung R&D Institute Poland > >>> The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is the final location of the driver. When the driver is built as a kernel module, it will be dwc2.ko and dwc2_platform.ko. patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent patch. patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the s3c-hsotg driver will now be a Kconfig option under DWC2. Also replaces the s3c-hsotg.h header file for dwc2/hw.h. patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so that final DRD can use it. patch 4/7 : Add the gadget data structure to a common data structure, dwc2_hsotg, which is the data structure that will encapsulate host and peripheral modes for the final DRD. The bulk for this patch is edits the in s3c-hsotg.c to reference the new data structure. patch 5/7 : Replaces the s3c_hostg_irq handler with the dwc2_handle_common_intr in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg gadget functions for peripheral mode. patch 6/7 : Update the Kconfig and Makefile to enable building of the single DRD. At this stage the the driver is behaving as a dual-role driver. patch 7/7 : Decouple host/peripheral functionality when buildling the driver in host or peripheral mode only. This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform which has v2.93a of dual-role IP. Thanks, Dinh Nguyen (7): usb: dwc2: Add defines to support the s3c-hsotg driver usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder usb: s3c-hsotg: Move s3c-hsotg data structures usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data structure usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build dependency drivers/usb/dwc2/Kconfig | 28 + drivers/usb/dwc2/Makefile| 17 +- drivers/usb/dwc2/core.c |1 + drivers/usb/dwc2/core.h | 225 +++- drivers/usb/dwc2/core_intr.c | 108 +- drivers/usb/dwc2/hcd.c |7 +- drivers/usb/dwc2/hcd.h | 23 +- drivers/usb/dwc2/hw.h| 23 +- drivers/usb/dwc2/platform.c | 50 +- drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 +++--- drivers/usb/gadget/Kconfig |7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h | 378 --- 13 files changed, 1128 insertions(+), 1547 deletions(-) rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman >
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On 02/17/2014 01:37 AM, Jingoo Han wrote: > On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: >> On 02/13/2014 10:10 PM, dingu...@altera.com wrote: >>> From: Dinh Nguyen >>> >>> Hello, >>> >>> This patch series combines the dwc2 host driver and the s3c-hsotg peripheral >>> driver into a single dual-roler driver similar to the dwc3. >> >> Hi. >> It looks like it doesn't work on Samsung platforms without device-tree >> support. > > Hi Robert Baldyga, > > In order to test this patch, the current mainline kernel requires > additional patches to support device-tree. The following patches > are necessary. > > http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179920.html > http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179921.html > http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179922.html > > The last one should be modified for your machine. > It will not help on platforms which never had and never will have device-tree support. Best regards Robert Baldyga Samsung R&D Institute Poland >> >>> >>> The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is >>> the final location of the driver. When the driver is built as a kernel >>> module, >>> it will be dwc2.ko and dwc2_platform.ko. >>> >>> patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can >>> use >>> the defines in hw.h. So we can remove s3c-hsotg.h in a >>> subsequent >>> patch. >>> patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the >>> s3c-hsotg >>> driver will now be a Kconfig option under DWC2. Also replaces >>> the >>> s3c-hsotg.h header file for dwc2/hw.h. >>> patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, >>> so >>> that final DRD can use it. >>> patch 4/7 : Add the gadget data structure to a common data structure, >>> dwc2_hsotg, which is the data structure that will encapsulate >>> host >>> and peripheral modes for the final DRD. The bulk for this patch >>> is edits the in s3c-hsotg.c to reference the new data structure. >>> patch 5/7 : Replaces the s3c_hostg_irq handler with the >>> dwc2_handle_common_intr >>> in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg >>> gadget >>> functions for peripheral mode. >>> patch 6/7 : Update the Kconfig and Makefile to enable building of the single >>> DRD. At this stage the the driver is behaving as a dual-role >>> driver. >>> patch 7/7 : Decouple host/peripheral functionality when buildling the >>> driver in >>> host or peripheral mode only. >>> >>> This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA >>> platform >>> which has v2.93a of dual-role IP. >>> >>> Thanks, >>> >>> Dinh Nguyen (7): >>> usb: dwc2: Add defines to support the s3c-hsotg driver >>> usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder >>> usb: s3c-hsotg: Move s3c-hsotg data structures >>> usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data >>> structure >>> usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler >>> usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver >>> usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build >>> dependency >>> >>> drivers/usb/dwc2/Kconfig | 28 + >>> drivers/usb/dwc2/Makefile| 17 +- >>> drivers/usb/dwc2/core.c |1 + >>> drivers/usb/dwc2/core.h | 225 +++- >>> drivers/usb/dwc2/core_intr.c | 108 +- >>> drivers/usb/dwc2/hcd.c |7 +- >>> drivers/usb/dwc2/hcd.h | 23 +- >>> drivers/usb/dwc2/hw.h| 23 +- >>> drivers/usb/dwc2/platform.c | 50 +- >>> drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 >>> +++--- >>> drivers/usb/gadget/Kconfig |7 - >>> drivers/usb/gadget/Makefile |1 - >>> drivers/usb/gadget/s3c-hsotg.h | 378 --- >>> 13 files changed, 1128 insertions(+), 1547 deletions(-) >>> rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) >>> delete mode 100644 drivers/usb/gadget/s3c-hsotg.h >>> --- >>> Cc: Greg Kroah-Hartman >>> Cc: Paul Zimmerman >>> Cc: Felipe Balbi >>> Cc: Ben Dooks >>> Cc: Matt Porter >>> Cc: Kukjin Kim >>> Cc: Stephen Warren >>> Cc: Matthijs Kooijman >>> Cc: Jingoo Han >>> Cc: Sachin Kamat >>> Cc: Robert Baldyga >>> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Monday, February 17, 2014 10:56 AM, Stephen Warren wrote: >On 02/16/2014 05:37 PM, Jingoo Han wrote: >> On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: >>> On 02/13/2014 10:10 PM, dingu...@altera.com wrote: From: Dinh Nguyen Hello, This patch series combines the dwc2 host driver and the s3c-hsotg peripheral driver into a single dual-roler driver similar to the dwc3. >>> >>> Hi. >>> It looks like it doesn't work on Samsung platforms without device-tree >>> support. >> >> Hi Robert Baldyga, >> >> In order to test this patch, the current mainline kernel requires >> additional patches to support device-tree. The following patches >> are necessary. > > DT is supposed to be an ABI (old DTs must work with newer SW), so you > shouldn't/can't change the code in a way that requires changes to the > DT, at least for features that are working and stable and already have > sensible stable DT bindings. Right, we know it. We should keep DT bindings because these are Supposed to be an ABI. I didn't mean to change DT bindings that were already defined at ./Documentation/devicetree/bindings/usb/samsung-hsotg.txt and ./Documentation/devicetree/bindings/usb/samsung-usbphy.txt. I just suggest that ARCH-DT support code is necessary for Exynos HSOTG as below. --- a/arch/arm/boot/dts/exynos4.dtsi +++ b/arch/arm/boot/dts/exynos4.dtsi @@ -119,6 +119,15 @@ status = "disabled"; }; + hsotg at 1248 { + compatible = "samsung,s3c6400-hsotg"; + reg = <0x1248 0x2>; + interrupts = <0 71 0>; + clocks = <&clock 305>; + clock-names = "otg"; + status = "disabled"; + }; --- a/arch/arm/boot/dts/exynos4210.dtsi +++ b/arch/arm/boot/dts/exynos4210.dtsi @@ -114,6 +114,21 @@ interrupts = <2 4>; }; + usbphy at 125B { + compatible = "samsung,exynos4210-usb2phy"; + reg = <0x125B 0x100>; + clocks = <&clock 305>; + clock-names = "otg"; + status = "disabled"; + ranges; + #address-cells = <1>; + #size-cells = <1>; + + usbphy-sys { + reg = <0x10020704 0x8>; + }; + }; Best regards, Jingoo Han -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On 02/16/2014 05:37 PM, Jingoo Han wrote: > On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: >> On 02/13/2014 10:10 PM, dingu...@altera.com wrote: >>> From: Dinh Nguyen >>> >>> Hello, >>> >>> This patch series combines the dwc2 host driver and the s3c-hsotg peripheral >>> driver into a single dual-roler driver similar to the dwc3. >> >> Hi. >> It looks like it doesn't work on Samsung platforms without device-tree >> support. > > Hi Robert Baldyga, > > In order to test this patch, the current mainline kernel requires > additional patches to support device-tree. The following patches > are necessary. DT is supposed to be an ABI (old DTs must work with newer SW), so you shouldn't/can't change the code in a way that requires changes to the DT, at least for features that are working and stable and already have sensible stable DT bindings. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Friday, February 14, 2014 6:44 PM, Robert Baldyga wrote: > On 02/13/2014 10:10 PM, dingu...@altera.com wrote: > > From: Dinh Nguyen > > > > Hello, > > > > This patch series combines the dwc2 host driver and the s3c-hsotg peripheral > > driver into a single dual-roler driver similar to the dwc3. > > Hi. > It looks like it doesn't work on Samsung platforms without device-tree > support. Hi Robert Baldyga, In order to test this patch, the current mainline kernel requires additional patches to support device-tree. The following patches are necessary. http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179920.html http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179921.html http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/179922.html The last one should be modified for your machine. Best regards, Jingoo Han > > Best regards > Robert Baldyga > Samsung R&D Institute Poland > > > > > The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is > > the final location of the driver. When the driver is built as a kernel > > module, > > it will be dwc2.ko and dwc2_platform.ko. > > > > patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can > > use > > the defines in hw.h. So we can remove s3c-hsotg.h in a > > subsequent > > patch. > > patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the > > s3c-hsotg > > driver will now be a Kconfig option under DWC2. Also replaces > > the > > s3c-hsotg.h header file for dwc2/hw.h. > > patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, > > so > > that final DRD can use it. > > patch 4/7 : Add the gadget data structure to a common data structure, > > dwc2_hsotg, which is the data structure that will encapsulate > > host > > and peripheral modes for the final DRD. The bulk for this patch > > is edits the in s3c-hsotg.c to reference the new data structure. > > patch 5/7 : Replaces the s3c_hostg_irq handler with the > > dwc2_handle_common_intr > > in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg > > gadget > > functions for peripheral mode. > > patch 6/7 : Update the Kconfig and Makefile to enable building of the single > > DRD. At this stage the the driver is behaving as a dual-role > > driver. > > patch 7/7 : Decouple host/peripheral functionality when buildling the > > driver in > > host or peripheral mode only. > > > > This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA > > platform > > which has v2.93a of dual-role IP. > > > > Thanks, > > > > Dinh Nguyen (7): > > usb: dwc2: Add defines to support the s3c-hsotg driver > > usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder > > usb: s3c-hsotg: Move s3c-hsotg data structures > > usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data > > structure > > usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler > > usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver > > usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build > > dependency > > > > drivers/usb/dwc2/Kconfig | 28 + > > drivers/usb/dwc2/Makefile| 17 +- > > drivers/usb/dwc2/core.c |1 + > > drivers/usb/dwc2/core.h | 225 +++- > > drivers/usb/dwc2/core_intr.c | 108 +- > > drivers/usb/dwc2/hcd.c |7 +- > > drivers/usb/dwc2/hcd.h | 23 +- > > drivers/usb/dwc2/hw.h| 23 +- > > drivers/usb/dwc2/platform.c | 50 +- > > drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 > > +++--- > > drivers/usb/gadget/Kconfig |7 - > > drivers/usb/gadget/Makefile |1 - > > drivers/usb/gadget/s3c-hsotg.h | 378 --- > > 13 files changed, 1128 insertions(+), 1547 deletions(-) > > rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) > > delete mode 100644 drivers/usb/gadget/s3c-hsotg.h > > --- > > Cc: Greg Kroah-Hartman > > Cc: Paul Zimmerman > > Cc: Felipe Balbi > > Cc: Ben Dooks > > Cc: Matt Porter > > Cc: Kukjin Kim > > Cc: Stephen Warren > > Cc: Matthijs Kooijman > > Cc: Jingoo Han > > Cc: Sachin Kamat > > Cc: Robert Baldyga > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
> From: Jingoo Han [mailto:jg1@samsung.com] > Sent: Thursday, February 13, 2014 11:46 PM > > On Friday, February 14, 2014 2:27 PM, Peter Chen wrote: > > On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: > > > From: Dinh Nguyen > > > > > > Hello, > > > > > > This patch series combines the dwc2 host driver and the s3c-hsotg > > > peripheral > > > driver into a single dual-roler driver similar to the dwc3. > > > > Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should > > like ip driver + glue layer. If not, why needs to put them > > together, I am a little puzzled here. > > Yes, 's3c-hsotg' also uses DWC USB2 IP. > As DWC3 USB driver (./drivers/usb/dwc3/), 'IP driver + glue layer' > looks good. > > Best regards, > Jingoo Han Well, DWC3 is a little different. It has a standards-based host API, xHCI, that is (almost) completely independent from its non-standards- based device API (I say 'almost' because of the optional OTG functionality). This means the two drivers have to be separate, to support other xHCI implementations that don't have the device mode functionality. But it also complicates some things, like the implementation of OTG support, which perhaps can be seen by the fact that there is almost no OTG support yet in the DWC3 driver (except for role switching). Whereas the DWC2 host and device modes both use a proprietary API, so there is no need to have separate drivers, because there are no other implementations of the core except the Synopsys one. Also, quite a few of the registers are shared between host and device modes, so keeping the two drivers separate would mean duplicating some code that could be shared between them. That said, I would have no objection to keeping the two drivers separate, as long as it doesn't create significant difficulties with the implementation. Dinh, what do you think? Did you consider the possibility of keeping the two drivers separate, perhaps sharing some code in a library module? For example, you could have dwc2-lib.ko, dwc2.ko, and s3c-hsotg.ko. dwc2-lib.ko would always be loaded, and dwc2.ko or s3c-hsotg.ko (or both) would be loaded depending on which mode is selected. Each driver would have its own interrupt handler, both of them sharing the common IRQ. They would both have their own probe methods, too. I haven't thought too deeply about this, so maybe it's a bad idea. But you are the one doing the work, so I think the final decision should be yours. -- Paul -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On 02/13/2014 10:10 PM, dingu...@altera.com wrote: > From: Dinh Nguyen > > Hello, > > This patch series combines the dwc2 host driver and the s3c-hsotg peripheral > driver into a single dual-roler driver similar to the dwc3. Hi. It looks like it doesn't work on Samsung platforms without device-tree support. Best regards Robert Baldyga Samsung R&D Institute Poland > > The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is > the final location of the driver. When the driver is built as a kernel module, > it will be dwc2.ko and dwc2_platform.ko. > > patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use > the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent > patch. > patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the > s3c-hsotg > driver will now be a Kconfig option under DWC2. Also replaces the > s3c-hsotg.h header file for dwc2/hw.h. > patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so > that final DRD can use it. > patch 4/7 : Add the gadget data structure to a common data structure, > dwc2_hsotg, which is the data structure that will encapsulate host > and peripheral modes for the final DRD. The bulk for this patch > is edits the in s3c-hsotg.c to reference the new data structure. > patch 5/7 : Replaces the s3c_hostg_irq handler with the > dwc2_handle_common_intr > in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg > gadget > functions for peripheral mode. > patch 6/7 : Update the Kconfig and Makefile to enable building of the single > DRD. At this stage the the driver is behaving as a dual-role > driver. > patch 7/7 : Decouple host/peripheral functionality when buildling the driver > in > host or peripheral mode only. > > This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform > which has v2.93a of dual-role IP. > > Thanks, > > Dinh Nguyen (7): > usb: dwc2: Add defines to support the s3c-hsotg driver > usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder > usb: s3c-hsotg: Move s3c-hsotg data structures > usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data > structure > usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler > usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver > usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build > dependency > > drivers/usb/dwc2/Kconfig | 28 + > drivers/usb/dwc2/Makefile| 17 +- > drivers/usb/dwc2/core.c |1 + > drivers/usb/dwc2/core.h | 225 +++- > drivers/usb/dwc2/core_intr.c | 108 +- > drivers/usb/dwc2/hcd.c |7 +- > drivers/usb/dwc2/hcd.h | 23 +- > drivers/usb/dwc2/hw.h| 23 +- > drivers/usb/dwc2/platform.c | 50 +- > drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 > +++--- > drivers/usb/gadget/Kconfig |7 - > drivers/usb/gadget/Makefile |1 - > drivers/usb/gadget/s3c-hsotg.h | 378 --- > 13 files changed, 1128 insertions(+), 1547 deletions(-) > rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) > delete mode 100644 drivers/usb/gadget/s3c-hsotg.h > --- > Cc: Greg Kroah-Hartman > Cc: Paul Zimmerman > Cc: Felipe Balbi > Cc: Ben Dooks > Cc: Matt Porter > Cc: Kukjin Kim > Cc: Stephen Warren > Cc: Matthijs Kooijman > Cc: Jingoo Han > Cc: Sachin Kamat > Cc: Robert Baldyga > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Friday, February 14, 2014 2:27 PM, Peter Chen wrote: > On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: > > From: Dinh Nguyen > > > > Hello, > > > > This patch series combines the dwc2 host driver and the s3c-hsotg peripheral > > driver into a single dual-roler driver similar to the dwc3. > > Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should > like ip driver + glue layer. If not, why needs to put them > together, I am a little puzzled here. Yes, 's3c-hsotg' also uses DWC USB2 IP. As DWC3 USB driver (./drivers/usb/dwc3/), 'IP driver + glue layer' looks good. Best regards, Jingoo Han > > Peter > > > > > The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is > > the final location of the driver. When the driver is built as a kernel > > module, > > it will be dwc2.ko and dwc2_platform.ko. > > > > patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can > > use > > the defines in hw.h. So we can remove s3c-hsotg.h in a > > subsequent > > patch. > > patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the > > s3c-hsotg > > driver will now be a Kconfig option under DWC2. Also replaces > > the > > s3c-hsotg.h header file for dwc2/hw.h. > > patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, > > so > > that final DRD can use it. > > patch 4/7 : Add the gadget data structure to a common data structure, > > dwc2_hsotg, which is the data structure that will encapsulate > > host > > and peripheral modes for the final DRD. The bulk for this patch > > is edits the in s3c-hsotg.c to reference the new data structure. > > patch 5/7 : Replaces the s3c_hostg_irq handler with the > > dwc2_handle_common_intr > > in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg > > gadget > > functions for peripheral mode. > > patch 6/7 : Update the Kconfig and Makefile to enable building of the single > > DRD. At this stage the the driver is behaving as a dual-role > > driver. > > patch 7/7 : Decouple host/peripheral functionality when buildling the > > driver in > > host or peripheral mode only. > > > > This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA > > platform > > which has v2.93a of dual-role IP. > > > > Thanks, > > > > Dinh Nguyen (7): > > usb: dwc2: Add defines to support the s3c-hsotg driver > > usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder > > usb: s3c-hsotg: Move s3c-hsotg data structures > > usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data > > structure > > usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler > > usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver > > usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build > > dependency > > > > drivers/usb/dwc2/Kconfig | 28 + > > drivers/usb/dwc2/Makefile| 17 +- > > drivers/usb/dwc2/core.c |1 + > > drivers/usb/dwc2/core.h | 225 +++- > > drivers/usb/dwc2/core_intr.c | 108 +- > > drivers/usb/dwc2/hcd.c |7 +- > > drivers/usb/dwc2/hcd.h | 23 +- > > drivers/usb/dwc2/hw.h| 23 +- > > drivers/usb/dwc2/platform.c | 50 +- > > drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 > > +++--- > > drivers/usb/gadget/Kconfig |7 - > > drivers/usb/gadget/Makefile |1 - > > drivers/usb/gadget/s3c-hsotg.h | 378 --- > > 13 files changed, 1128 insertions(+), 1547 deletions(-) > > rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) > > delete mode 100644 drivers/usb/gadget/s3c-hsotg.h > > --- > > Cc: Greg Kroah-Hartman > > Cc: Paul Zimmerman > > Cc: Felipe Balbi > > Cc: Ben Dooks > > Cc: Matt Porter > > Cc: Kukjin Kim > > Cc: Stephen Warren > > Cc: Matthijs Kooijman > > Cc: Jingoo Han > > Cc: Sachin Kamat > > Cc: Robert Baldyga > > > > -- > > 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Thu, Feb 13, 2014 at 03:10:40PM -0600, dingu...@altera.com wrote: > From: Dinh Nguyen > > Hello, > > This patch series combines the dwc2 host driver and the s3c-hsotg peripheral > driver into a single dual-roler driver similar to the dwc3. Does s3c-hsotg use dwc usb2 ip too? If it is, the structure should like ip driver + glue layer. If not, why needs to put them together, I am a little puzzled here. Peter > > The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is > the final location of the driver. When the driver is built as a kernel module, > it will be dwc2.ko and dwc2_platform.ko. > > patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use > the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent > patch. > patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the > s3c-hsotg > driver will now be a Kconfig option under DWC2. Also replaces the > s3c-hsotg.h header file for dwc2/hw.h. > patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so > that final DRD can use it. > patch 4/7 : Add the gadget data structure to a common data structure, > dwc2_hsotg, which is the data structure that will encapsulate host > and peripheral modes for the final DRD. The bulk for this patch > is edits the in s3c-hsotg.c to reference the new data structure. > patch 5/7 : Replaces the s3c_hostg_irq handler with the > dwc2_handle_common_intr > in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg > gadget > functions for peripheral mode. > patch 6/7 : Update the Kconfig and Makefile to enable building of the single > DRD. At this stage the the driver is behaving as a dual-role > driver. > patch 7/7 : Decouple host/peripheral functionality when buildling the driver > in > host or peripheral mode only. > > This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform > which has v2.93a of dual-role IP. > > Thanks, > > Dinh Nguyen (7): > usb: dwc2: Add defines to support the s3c-hsotg driver > usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder > usb: s3c-hsotg: Move s3c-hsotg data structures > usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data > structure > usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler > usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver > usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build > dependency > > drivers/usb/dwc2/Kconfig | 28 + > drivers/usb/dwc2/Makefile| 17 +- > drivers/usb/dwc2/core.c |1 + > drivers/usb/dwc2/core.h | 225 +++- > drivers/usb/dwc2/core_intr.c | 108 +- > drivers/usb/dwc2/hcd.c |7 +- > drivers/usb/dwc2/hcd.h | 23 +- > drivers/usb/dwc2/hw.h| 23 +- > drivers/usb/dwc2/platform.c | 50 +- > drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 > +++--- > drivers/usb/gadget/Kconfig |7 - > drivers/usb/gadget/Makefile |1 - > drivers/usb/gadget/s3c-hsotg.h | 378 --- > 13 files changed, 1128 insertions(+), 1547 deletions(-) > rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) > delete mode 100644 drivers/usb/gadget/s3c-hsotg.h > --- > Cc: Greg Kroah-Hartman > Cc: Paul Zimmerman > Cc: Felipe Balbi > Cc: Ben Dooks > Cc: Matt Porter > Cc: Kukjin Kim > Cc: Stephen Warren > Cc: Matthijs Kooijman > Cc: Jingoo Han > Cc: Sachin Kamat > Cc: Robert Baldyga > > -- > 1.7.9.5 > Does -- Best Regards, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On 02/13/2014 02:10 PM, dingu...@altera.com wrote: > From: Dinh Nguyen > > Hello, > > This patch series combines the dwc2 host driver and the s3c-hsotg peripheral > driver into a single dual-roler driver similar to the dwc3. > > The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is > the final location of the driver. When the driver is built as a kernel module, > it will be dwc2.ko and dwc2_platform.ko. This series causes the DWC2 driver to fail to probe on the Raspberry Pi: > [0.953749] dwc2/s3c-hsotg 2098.usb: cannot get otg clock > [0.962250] dwc2/s3c-hsotg: probe of 2098.usb failed with error -2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
On Friday, February 14, 2014 6:11 AM, Dinh Nguyen wrote: > > From: Dinh Nguyen > > Hello, > > This patch series combines the dwc2 host driver and the s3c-hsotg peripheral > driver into a single dual-roler driver similar to the dwc3. > > The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is > the final location of the driver. When the driver is built as a kernel module, > it will be dwc2.ko and dwc2_platform.ko. > > patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use > the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent > patch. > patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the > s3c-hsotg > driver will now be a Kconfig option under DWC2. Also replaces the > s3c-hsotg.h header file for dwc2/hw.h. > patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so > that final DRD can use it. > patch 4/7 : Add the gadget data structure to a common data structure, > dwc2_hsotg, which is the data structure that will encapsulate host > and peripheral modes for the final DRD. The bulk for this patch > is edits the in s3c-hsotg.c to reference the new data structure. > patch 5/7 : Replaces the s3c_hostg_irq handler with the > dwc2_handle_common_intr > in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg > gadget > functions for peripheral mode. > patch 6/7 : Update the Kconfig and Makefile to enable building of the single > DRD. At this stage the the driver is behaving as a dual-role > driver. > patch 7/7 : Decouple host/peripheral functionality when buildling the driver > in > host or peripheral mode only. > > This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform > which has v2.93a of dual-role IP. > > Thanks, > > Dinh Nguyen (7): > usb: dwc2: Add defines to support the s3c-hsotg driver > usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder > usb: s3c-hsotg: Move s3c-hsotg data structures > usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data > structure > usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler > usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver > usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build > dependency Hi Dinh Nguyen, I tested these patches with Exynos4210 board based-on the latest usb tree. (commit e8fcbb6 "usb/misc/usbled: Add Riso Kagaku Webmail Notifier") However, when installing g_mass_storage.ko module, kernel oops happens as below. Current config setting: based-on exynos_defconfig CONFIG_USB_DWC2=y CONFIG_USB_S3C_HSOTG=y [root@Samsung tmp]# insmod g_mass_storage.ko file=./gadgetdisk [ 302.47] Number of LUNs=8 [ 302.47] Mass Storage Function, version: 2009/09/11 [ 302.47] LUN: removable file: (no medium) [ 302.475000] Number of LUNs=1 [ 302.48] LUN: file: /tmp/gadgetdisk [ 302.48] Number of LUNs=1 [ 302.485000] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 [ 302.49] g_mass_storage gadget: userspace failed to provide iSerialNumber [ 302.50] g_mass_storage gadget: g_mass_storage ready [ 302.505000] Unable to handle kernel paging request at virtual address 0a736749 [ 302.51] pgd = c1224000 [ 302.515000] [0a736749] *pgd= [ 302.515000] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 302.515000] Modules linked in: g_mass_storage(+) usb_f_mass_storage libcomposite configfs [ 302.515000] CPU: 0 PID: 1265 Comm: insmod Not tainted 3.14.0-rc1-00039-g151dc85 #53 [ 302.515000] task: eebe8000 ti: ee1e2000 task.ti: ee1e2000 [ 302.515000] PC is at s3c_hsotg_udc_start+0x58/0x144 [ 302.515000] LR is at udc_bind_to_driver+0x84/0xd0 [ 302.515000] pc : []lr : []psr: 6013 [ 302.515000] sp : ee1e3df8 ip : fp : [ 302.515000] r10: 0001 r9 : ee1e2000 r8 : bf02b1dc [ 302.515000] r7 : 0001 r6 : r5 : bf029458 r4 : c10e4080 [ 302.515000] r3 : 0a73666d r2 : r1 : ee9e5890 r0 : 0002 [ 302.515000] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 302.515000] Control: 10c5387d Table: 4122404a DAC: 0015 [ 302.515000] Process insmod (pid: 1265, stack limit = 0xee1e2240) [ 302.515000] Stack: (0xee1e3df8 to 0xee1e4000) [ 302.515000] 3de0: c027ec68 eeb3e400 [ 302.515000] 3e00: bf029458 0001 c028e920 bf029458 c05287a0 bf0294b4 c028e9d8 [ 302.515000] 3e20: ee1e3f58 bf0294c0 c0008854 edfe7700 8040003f ef615580 0001 [ 302.515000] 3e40: 0001 c043eff8 8040003f ef615560 4000 2ead4000 c00add3c [ 302.515000] 3e60: ef615560 c00a2fb8 8040003f 2ead4000 c00add3c 0001 c00743a8 [ 302.515000] 3e80: c0071bf4 ee1e3f58 bf0294c0 bf0294b4 0001 c1223040 c0071bf4 0001 [ 3
[PATCH 0/7] usb: dwc2/s3c-hsotg: Combine drivers into a single DRD
From: Dinh Nguyen Hello, This patch series combines the dwc2 host driver and the s3c-hsotg peripheral driver into a single dual-roler driver similar to the dwc3. The patch series moves the s3c-hsotg files into the /dwc2 folder, so this is the final location of the driver. When the driver is built as a kernel module, it will be dwc2.ko and dwc2_platform.ko. patch 1/7 : Edit the defines in dwc2/hw.h so that the s3c-hsotg driver can use the defines in hw.h. So we can remove s3c-hsotg.h in a subsequent patch. patch 2/7 : Moves the s3c-hsotg driver into /dwc2 folder. Building the s3c-hsotg driver will now be a Kconfig option under DWC2. Also replaces the s3c-hsotg.h header file for dwc2/hw.h. patch 3/7 : Moves the s3c-hsotg data structure into a common place, core.h, so that final DRD can use it. patch 4/7 : Add the gadget data structure to a common data structure, dwc2_hsotg, which is the data structure that will encapsulate host and peripheral modes for the final DRD. The bulk for this patch is edits the in s3c-hsotg.c to reference the new data structure. patch 5/7 : Replaces the s3c_hostg_irq handler with the dwc2_handle_common_intr in dwc2. Updates the dwc2 IRQ routines to call the s3c-hsotg gadget functions for peripheral mode. patch 6/7 : Update the Kconfig and Makefile to enable building of the single DRD. At this stage the the driver is behaving as a dual-role driver. patch 7/7 : Decouple host/peripheral functionality when buildling the driver in host or peripheral mode only. This patchset is based on 3.14-rc2. I have only tested on the SOCFPGA platform which has v2.93a of dual-role IP. Thanks, Dinh Nguyen (7): usb: dwc2: Add defines to support the s3c-hsotg driver usb: s3c-hsotg: Move s3c-hsotg into dwc2 folder usb: s3c-hsotg: Move s3c-hsotg data structures usb: dwc2: Add the s3c-hsotg data structures to main dwc2_hsotg data structure usb: dwc2: combine the dwc2 and s3c_hsotg to use a single IRQ handler usb: dwc2: Enable the dwc2/s3c-hsotg to be a single dual-role driver usb: dwc2: Split out the dwc2/sc3-hsotg driver mode's build dependency drivers/usb/dwc2/Kconfig | 28 + drivers/usb/dwc2/Makefile| 17 +- drivers/usb/dwc2/core.c |1 + drivers/usb/dwc2/core.h | 225 +++- drivers/usb/dwc2/core_intr.c | 108 +- drivers/usb/dwc2/hcd.c |7 +- drivers/usb/dwc2/hcd.h | 23 +- drivers/usb/dwc2/hw.h| 23 +- drivers/usb/dwc2/platform.c | 50 +- drivers/usb/{gadget => dwc2}/s3c-hsotg.c | 1807 +++--- drivers/usb/gadget/Kconfig |7 - drivers/usb/gadget/Makefile |1 - drivers/usb/gadget/s3c-hsotg.h | 378 --- 13 files changed, 1128 insertions(+), 1547 deletions(-) rename drivers/usb/{gadget => dwc2}/s3c-hsotg.c (57%) delete mode 100644 drivers/usb/gadget/s3c-hsotg.h --- Cc: Greg Kroah-Hartman Cc: Paul Zimmerman Cc: Felipe Balbi Cc: Ben Dooks Cc: Matt Porter Cc: Kukjin Kim Cc: Stephen Warren Cc: Matthijs Kooijman Cc: Jingoo Han Cc: Sachin Kamat Cc: Robert Baldyga -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html