On Friday, February 14, 2014 6:11 AM, Dinh Nguyen wrote: > > From: Dinh Nguyen <dinguyen@xxxxxxxxxx> > > 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.470000] Number of LUNs=8 [ 302.470000] Mass Storage Function, version: 2009/09/11 [ 302.470000] LUN: removable file: (no medium) [ 302.475000] Number of LUNs=1 [ 302.480000] LUN: file: /tmp/gadgetdisk [ 302.480000] Number of LUNs=1 [ 302.485000] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 [ 302.490000] g_mass_storage gadget: userspace failed to provide iSerialNumber [ 302.500000] g_mass_storage gadget: g_mass_storage ready [ 302.505000] Unable to handle kernel paging request at virtual address 0a736749 [ 302.510000] pgd = c1224000 [ 302.515000] [0a736749] *pgd=00000000 [ 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 : [<c027ecc0>] lr : [<c028e920>] psr: 60000013 [ 302.515000] sp : ee1e3df8 ip : 00000000 fp : 00000000 [ 302.515000] r10: 00000001 r9 : ee1e2000 r8 : bf02b1dc [ 302.515000] r7 : 00000001 r6 : 00000000 r5 : bf029458 r4 : c10e4080 [ 302.515000] r3 : 0a73666d r2 : 00000000 r1 : ee9e5890 r0 : 00000002 [ 302.515000] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user [ 302.515000] Control: 10c5387d Table: 4122404a DAC: 00000015 [ 302.515000] Process insmod (pid: 1265, stack limit = 0xee1e2240) [ 302.515000] Stack: (0xee1e3df8 to 0xee1e4000) [ 302.515000] 3de0: c027ec68 eeb3e400 [ 302.515000] 3e00: bf029458 00000000 00000001 c028e920 bf029458 c05287a0 bf0294b4 c028e9d8 [ 302.515000] 3e20: 00000000 ee1e3f58 bf0294c0 c0008854 edfe7700 8040003f ef615580 00000001 [ 302.515000] 3e40: 00000000 00000001 c043eff8 8040003f ef615560 40000000 2ead4000 c00add3c [ 302.515000] 3e60: ef615560 c00a2fb8 00000000 8040003f 2ead4000 c00add3c 00000001 c00743a8 [ 302.515000] 3e80: c0071bf4 ee1e3f58 bf0294c0 bf0294b4 00000001 c1223040 c0071bf4 00000001 [ 302.515000] 3ea0: bf0294fc c00743dc bf0294c0 00007fff c0071e84 f0281000 c0007c10 00000000 [ 302.515000] 3ec0: c0071c4c bf0295fc bf0294c0 ee1e2000 00000000 bf0294c0 ffffffff 000000d2 [ 302.515000] 3ee0: ee1e2000 00000000 00000000 c00a2b7c ee1e2000 00000000 00000000 00000000 [ 302.515000] 3f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 302.515000] 3f20: 00000000 00000000 00000000 00000000 000000d2 0001959d 000b0028 000b0008 [ 302.515000] 3f40: 00000080 c000e664 ee1e2000 00000000 00000000 c0074afc f0267000 0001959d [ 302.515000] 3f60: f02795f8 f0279455 f027fcc8 0000062c 00000a2c 00000000 00000000 00000000 [ 302.515000] 3f80: 0000002b 0000002c 00000013 00000000 0000000a 00000000 00000000 00000000 [ 302.515000] 3fa0: 0001959d c000e4e0 00000000 00000000 000b0028 0001959d 000b0008 bec63c51 [ 302.515000] 3fc0: 00000000 00000000 0001959d 00000080 bec63c3f 00097c78 0009a694 00000000 [ 302.515000] 3fe0: bec63968 bec63958 00046714 b6e2c780 60000010 000b0028 00000000 00000000 [ 302.515000] [<c027ecc0>] (s3c_hsotg_udc_start) from [<c028e920>] (udc_bind_to_driver+0x84/0xd0) [ 302.515000] [<c028e920>] (udc_bind_to_driver) from [<c028e9d8>] (usb_gadget_probe_driver+0x6c/0xa0) [ 302.515000] [<c028e9d8>] (usb_gadget_probe_driver) from [<c0008854>] (do_one_initcall+0xe4/0x140) [ 302.515000] [<c0008854>] (do_one_initcall) from [<c00743dc>] (load_module+0x169c/0x1ce4) [ 302.515000] [<c00743dc>] (load_module) from [<c0074afc>] (SyS_init_module+0xd8/0xec) [ 302.515000] [<c0074afc>] (SyS_init_module) from [<c000e4e0>] (ret_fast_syscall+0x0/0x30) [ 302.515000] Code: e5143070 e3a00002 e5845168 e5141008 (e59330dc) [ 302.800000] ---[ end trace 88559040f8f26448 ]--- Best regards, Jingoo Han > > 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 <gregkh@xxxxxxxxxxxxxxxxxxx> > Cc: Paul Zimmerman <paulz@xxxxxxxxxxxx> > Cc: Felipe Balbi <balbi@xxxxxx> > Cc: Ben Dooks <ben-linux@xxxxxxxxx> > Cc: Matt Porter <mporter@xxxxxxxxxx> > Cc: Kukjin Kim <kgene.kim@xxxxxxxxxxx> > Cc: Stephen Warren <swarren@xxxxxxxxxxxxx> > Cc: Matthijs Kooijman <matthijs@xxxxxxxx> > Cc: Jingoo Han <jg1.han@xxxxxxxxxxx> > Cc: Sachin Kamat <sachin.kamat@xxxxxxxxxx> > Cc: Robert Baldyga <r.baldyga@xxxxxxxxxxx> > > -- > 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html