summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2015-06-24MLK-11137 usb: chipidea: host: add own hc_driver for each hcdPeter Chen
There are several benefits for doing like this: - hc_driver can be customized for each hcd - Other hcd hc_driver's initialization will not affect current one. We run out NULL pointer dereference problem when one hcd is started by module_init, and the other is started by otg thread at SMP platform. The reason for this problem is ehci_init_driver will do memory copy for current uniform hc_driver, and this memory copy will do memset (as 0) first, so when the first hcd is running usb_add_hcd, and the second hcd may clear the uniform hc_driver's space (at ehci_init_driver), then the first hcd will meet NULL pointer at the same time. See below two logs: LOG_1: ci_hdrc ci_hdrc.0: EHCI Host Controller ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1 ci_hdrc ci_hdrc.1: doesn't support gadget Unable to handle kernel NULL pointer dereference at virtual address 00000014 pgd = 80004000 [00000014] *pgd=00000000 Internal error: Oops: 805 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 108 Comm: kworker/u8:2 Not tainted 3.14.38-222193-g24b2734-dirty #25 Workqueue: ci_otg ci_otg_work task: d839ec00 ti: d8400000 task.ti: d8400000 PC is at ehci_run+0x4c/0x284 LR is at _raw_spin_unlock_irqrestore+0x28/0x54 pc : [<8041f9a0>] lr : [<8070ea84>] psr: 60000113 sp : d8401e30 ip : 00000000 fp : d8004400 r10: 00000001 r9 : 00000001 r8 : 00000000 r7 : 00000000 r6 : d8419940 r5 : 80dd24c0 r4 : d8419800 r3 : 8001d060 r2 : 00000000 r1 : 00000001 r0 : 00000000 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 1000404a DAC: 00000015 Process kworker/u8:2 (pid: 108, stack limit = 0xd8400238) Stack: (0xd8401e30 to 0xd8402000) 1e20: d87523c0 d8401e48 66667562 d8419800 1e40: 00000000 00000000 d8419800 00000000 00000000 00000000 d84198b0 8040fcdc 1e60: 00000000 80dd320c d8477610 d8419c00 d803d010 d8419800 00000000 00000000 1e80: d8004400 00000000 d8400008 80431494 80431374 d803d100 d803d010 d803d1ac 1ea0: 00000000 80432428 804323d4 d803d100 00000001 80435eb8 80e0d0bc d803d100 1ec0: 00000006 80436458 00000000 d803d100 80e92ec8 80436f44 d803d010 d803d100 1ee0: d83fde00 8043292c d8752710 d803d1f4 d803d010 8042ddfc 8042ddb8 d83f3b00 1f00: d803d1f4 80042b60 00000000 00000003 00000001 00000001 80054598 d83f3b00 1f20: d8004400 d83f3b18 d8004414 d8400000 80e3957b 00000089 d8004400 80043814 1f40: d839ec00 00000000 d83fcd80 d83f3b00 800436e4 00000000 00000000 00000000 1f60: 00000000 80048f34 00000000 00000000 00000000 d83f3b00 00000000 00000000 1f80: d8401f80 d8401f80 00000000 00000000 d8401f90 d8401f90 d8401fac d83fcd80 1fa0: 80048e68 00000000 00000000 8000e538 00000000 00000000 00000000 00000000 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [<8041f9a0>] (ehci_run) from [<8040fcdc>] (usb_add_hcd+0x248/0x6e8) [<8040fcdc>] (usb_add_hcd) from [<80431494>] (host_start+0x120/0x2e4) [<80431494>] (host_start) from [<80432428>] (ci_otg_start_host+0x54/0xbc) [<80432428>] (ci_otg_start_host) from [<80435eb8>] (otg_set_protocol+0xa4/0xd0) [<80435eb8>] (otg_set_protocol) from [<80436458>] (otg_set_state+0x574/0xc58) [<80436458>] (otg_set_state) from [<80436f44>] (otg_statemachine+0x408/0x46c) [<80436f44>] (otg_statemachine) from [<8043292c>] (ci_otg_fsm_work+0x3c/0x190) [<8043292c>] (ci_otg_fsm_work) from [<8042ddfc>] (ci_otg_work+0x44/0x1c4) [<8042ddfc>] (ci_otg_work) from [<80042b60>] (process_one_work+0xf4/0x35c) [<80042b60>] (process_one_work) from [<80043814>] (worker_thread+0x130/0x3bc) [<80043814>] (worker_thread) from [<80048f34>] (kthread+0xcc/0xe4) [<80048f34>] (kthread) from [<8000e538>] (ret_from_fork+0x14/0x3c) Code: e5953018 e3530000 0a000000 e12fff33 (e5878014) LOG_2: ci_hdrc ci_hdrc.0: EHCI Host Controller ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1 ci_hdrc ci_hdrc.1: doesn't support gadget Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = 80004000 [00000000] *pgd=00000000 In Online 00:00ternal e Offline rror: Oops: 80000005 [#1] PREEMPT SMP ARM Modules linked in: CPU: 0 PID: 108 Comm: kworker/u8:2 Not tainted 3.14.38-02007-g24b2734-dirty #127 Workque Online 00:00ue: ci_o Offline tg ci_otg_work Online 00:00task: d8 Offline 39ec00 ti: d83ea000 task.ti: d83ea000 PC is at 0x0 LR is at usb_add_hcd+0x248/0x6e8 pc : [<00000000>] lr : [<8040f644>] psr: 60000113 sp : d83ebe60 ip : 00000000 fp : d8004400 r10: 00000001 r9 : 00000001 r8 : d85fd4b0 r7 : 00000000 r6 : 00000000 r5 : 00000000 r4 : d85fd400 r3 : 00000000 r2 : d85fd4f4 r1 : 80410178 r0 : d85fd400 Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c53c7d Table: 1000404a DAC: 00000015 Process kworker/u8:2 (pid: 108, stack limit = 0xd83ea238) Stack: (0xd83ebe60 to 0xd83ec000) be60: 00000000 80dd920c d8654e10 d85fd800 d803e010 d85fd400 00000000 00000000 be80: d8004400 00000000 d83ea008 80430e34 80430d14 d803e100 d803e010 d803e1ac bea0: 00000000 80431dc8 80431d74 d803e100 00000001 80435858 80e130bc d803e100 bec0: 00000006 80435df8 00000000 d803e100 80e98ec8 804368e4 d803e010 d803e100 bee0: d86e8100 804322cc d86cf050 d803e1f4 d803e010 8042d79c 8042d758 d83cf900 bf00: d803e1f4 80042b78 00000000 00000003 00000001 00000001 800545e8 d83cf900 bf20: d8004400 d83cf918 d8004414 d83ea000 80e3f57b 00000089 d8004400 8004382c bf40: d839ec00 00000000 d8393780 d83cf900 800436fc 00000000 00000000 00000000 bf60: 00000000 80048f50 80e019f4 00000000 0000264c d83cf900 00000000 00000000 bf80: d83ebf80 d83ebf80 00000000 00000000 d83ebf90 d83ebf90 d83ebfac d8393780 bfa0: 80048e84 00000000 00000000 8000e538 00000000 00000000 00000000 00000000 bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ee66e85d 133ebd03 [<804 Online 00:000f644>] Offline (usb_add_hcd) from [<80430e34>] (host_start+0x120/0x2e4) [<80430e34>] (host_start) from [<80431dc8>] (ci_otg_start_host+0x54/0xbc) [<80431dc8>] (ci_otg_start_host) from [<80435858>] (otg_set_protocol+0xa4/0xd0) [<80435858>] (otg_set_protocol) from [<80435df8>] (otg_set_state+0x574/0xc58) [<80435df8>] (otg_set_state) from [<804368e4>] (otg_statemachine+0x408/0x46c) [<804368e4>] (otg_statemachine) from [<804322cc>] (ci_otg_fsm_work+0x3c/0x190) [<804322cc>] (ci_otg_fsm_work) from [<8042d79c>] (ci_otg_work+0x44/0x1c4) [<8042d79c>] (ci_otg_work) from [<80042b78>] (process_one_work+0xf4/0x35c) [<80042b78>] (process_one_work) from [<8004382c>] (worker_thread+0x130/0x3bc) [<8004382c>] (worker_thread) from [<80048f50>] (kthread+0xcc/0xe4) [<80048f50>] (kthread) from [<8000e538>] (ret_from_fork+0x14/0x3c) Code: bad PC value Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit 8d0ca70bdac986f5886ba8ccfff46a41e7a555ec)
2015-06-24MLK-11151 usb: chipidea: otg: drive vbus off if fsm.drv_vbus is truePeter Chen
The current condition may not true even we have driven vbus on already. The vbus drive operation may be async, eg through i2c gpio expendor, so the vbus may not be valid when we unload usb module. We meet this issue when we do fast load/unload usb module test. Signed-off-by: Peter Chen <peter.chen@freescale.com> (cherry picked from commit a4dec7730c98f2639fe250a1a67f782b6f73bdf5)
2015-06-24MLK-11132 usb: chipidea: otg: delay suspend for a_wait_vfallLi Jun
While A device as peripheral ends session by a_bus_drop, it will go back to host role by transition to a_wait_vfall state, then ehci host driver may access portsc status after controller enters suspend , this will result in system hang since its clock is gated off. This patch use existing autosuspend to delay the controller suspend if it comes to a_wait_vfall state. Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit b140fa6803ef6ececec17e435212a960a3169cc2)
2015-06-05MLK-11005-4 usb: chipidea: imx: add OTG ADP for imx usb driverLi Jun
Add usb otg ADP support for imx usb driver, and enable it on i.MX7D. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-06-05MLK-11005-3 usb: chipidea: add OTG ADP support for chipidea usb driverLi Jun
ADP(Attach Detection Protocol) is part of USB OTG 2.0 release, which can be used to find device attachment after session ends(vbus is off). This patch adds OTG ADP feature for chipdea usb driver. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-06-05MLK-11005-2 usb: common: usb-otg-fsm: remove ADP timers when ADP is not activeLi Jun
When otg fsm leaves a_idle or b_idle, ADP probe and sense should be stopped, therefore ADP timers should be removed. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-06-05MLK-11005-1 usb: common: add API to get if OTG ADP is support in device treeLi Jun
Check property of usb hardware to get if ADP is supported. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-06-04MLK-10994-5 usb: chipidea: otg: fix NULL pointer dereference when unload modulePeter Chen
With commit "95b62fe MLK-10750 usb: chipidea: otg: remove otg fsm before destory gdaget and host", the otg fsm will be removed first, but when the host is removing, it will trigger pcd interrupt, and otg work is still queued to ci_otg workqueue(otg state is OTG_STATE_A_HOST), but at that time, ci_otg workqueue has been destroyed. In this commit, we make sure the otg work is not queued if ci->wq is NULL, and keep otg state is OTG_STATE_UNDEFINED after otg fsm has been removed. The NULL pointer deference error like belows: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = a873c000 [00000000] *pgd=a90f9831, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#1] PREEMPT SMP ARM Modules linked in: usb_f_ecm u_ether libcomposite configfs ci_hdrc_imx(-) ci_hdrc udc_core ehci_hcd mxc_vadc mx6s_capture mxc_dcic ov5640_camera usbmisc_imx phy_mxs_usb evbug [last unloaded: usb_f_rndis] CPU: 0 PID: 162 Comm: udevd Not tainted 3.14.38-02187-g5639985-dirty #160 task: a863e880 ti: a872e000 task.ti: a872e000 PC is at __queue_work+0x68/0x268 LR is at __queue_work+0x68/0x268 pc : [<80045060>] lr : [<80045060>] psr: 600e0193 sp : a872fed0 ip : 00000000 fp : 00000000 r10: 00000004 r9 : a872e000 r8 : 0000004b r7 : 80e4c804 r6 : a9295000 r5 : a87f8294 r4 : 00000000 r3 : a80690e0 r2 : 00000000 r1 : a8069108 r0 : a8003400 Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c53c7d Table: a873c04a DAC: 00000015 Process udevd (pid: 162, stack limit = 0xa872e238) Stack: (0xa872fed0 to 0xa8730000) fec0: 00ff3d34 80743750 00000000 600e0193 fee0: a87f8294 a9295000 00000004 0000004b a8008900 80eb51ff 00ff3d34 800452a8 ff00: 00000000 a87f8010 00000000 00000000 00000000 7f060ac0 a8dfced0 a87f8010 ff20: 00002e20 7f059730 a8e7e2c0 a800895c 00000000 8006c1b4 80e46080 80e40458 ff40: a8008900 a800895c a8e7e2c0 c0802100 00fc40e8 00000000 00000048 8006c320 ff60: a8008900 a800895c 00000000 8006f1c4 8006f140 0000004b 0000004b 8006b92c ff80: 80e40e54 8000f9cc c080210c 80e4c970 a872ffb0 8000856c 00fc4308 76d9c890 ffa0: 600e0010 ffffffff 7edef480 800130bc 00fc4308 00ff3d70 00000000 000000ff ffc0: 00000671 00000000 00ff3b90 7edef480 00fc40e8 00000000 00000048 00ff3d34 ffe0: 000321b8 7edef140 000240a0 76d9c890 600e0010 ffffffff abf5e821 abf5ec21 [<80045060>] (__queue_work) from [<800452a8>] (queue_work_on+0x48/0x54) [<800452a8>] (queue_work_on) from [<7f060ac0>] (ci_otg_fsm_irq+0x108/0x310 [ci_hdrc]) [<7f060ac0>] (ci_otg_fsm_irq [ci_hdrc]) from [<7f059730>] (ci_irq+0x94/0x158 [ci_hdrc]) [<7f059730>] (ci_irq [ci_hdrc]) from [<8006c1b4>] (handle_irq_event_percpu+0x50/0x180) [<8006c1b4>] (handle_irq_event_percpu) from [<8006c320>] (handle_irq_event+0x3c/0x5c) [<8006c320>] (handle_irq_event) from [<8006f1c4>] (handle_fasteoi_irq+0x84/0x14c) [<8006f1c4>] (handle_fasteoi_irq) from [<8006b92c>] (generic_handle_irq+0x2c/0x3c) [<8006b92c>] (generic_handle_irq) from [<8000f9cc>] (handle_IRQ+0x40/0x90) [<8000f9cc>] (handle_IRQ) from [<8000856c>] (gic_handle_irq+0x2c/0x5c) [<8000856c>] (gic_handle_irq) from [<800130bc>] (__irq_usr+0x3c/0x60) Exception stack(0xa872ffb0 to 0xa872fff8) ffa0: 00fc4308 00ff3d70 00000000 000000ff ffc0: 00000671 00000000 00ff3b90 7edef480 00fc40e8 00000000 00000048 00ff3d34 ffe0: 000321b8 7edef140 000240a0 76d9c890 600e0010 ffffffff Code: e5964084 e0844003 e1a00005 ebfffa14 (e5943000) ---[ end trace 53dc25e918ff7216 ]--- Kernel panic - not syncing: Fatal exception in interrupt Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-06-04MLK-10994-4 usb: ehci: Keep portsc unchanging when power off portPeter Chen
If PORT_RWC_BITS is set, it will still be cleared by writing 1. portsc.ptw can only be changed when PHY clock is off and portsc.phcd is set, if not, the PHY will be error, so we keep portsc.ptw unchanging in this patch. Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-06-01MLK-10051-1 usb: host: don't break clear suspend feature if otg fsm is usedLi Jun
Current code just do not do reusme signaling for clear suspend feature if it's a OTG port with b_hnp_enable set, this result in OTG host cannot clear suspend and resume OTG device after system resume from sleep, then host will disconnect the OTG B-device and enumerate it again. To make OTG A-device in host state can do clear feature of suspend like an usual host, and also be compatible legacy OTG device, this patch adds another condition to check if OTG FSM driver is used ,as in OTG FSM driver, we need not do HNP in that case. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit f92731f787ca00ef8cd0ab9d591e4e24d5a40cc4)
2015-06-01MLK-9897-2 usb: otg-fsm: check B-device state before sending polling requestLi Jun
While system resume, the connected udev as B-device may not has been resumed, if HNP polling request is sent to it, HNP polling may fail, this patch adds check of the udev state to make sure it finished resume and to be configured state before sending host request message, otherwise try next HNP polling request. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit 2cff5eb7bd4feb70cd28ac4655e7433e57a17938)
2015-06-01MLK-9827 usb: core: clear OTG HNP flags when enumeration of new deviceLi Jun
We set b_hnp_enable and a_set_b_hnp_en when enumeration of HNP capable otg device, those 2 flags should be cleared beforehand for any new usb devices connected. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit e332229d38c15a83bb3ee0bfc3638a539a836b8a)
2015-06-01MLK-9824-1 usb: chipidea: otg: clear b_conn when ends sessionLi Jun
This patch is to clear the flag b_conn when turns off vbus to end a session. when otg fsm is a_host -> a_suspend -> a_wait_vfall -> a_idle, current otg fsm implementation does not handle disconnect event since the disconnection does not happen while a_host state, so the b_conn is still set when in a_idle, this patch clear b_conn flag after turn off vbus. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 043b79264051454de18488cb746ee617d86f3568)
2015-06-01MLK-9794-3 usb: common: otg: HNP polling condition update for b hostLi Jun
If it's A host and b_hnp_enable is set, or B host, we can do HNP polling because B host will not check OTG descriptor and set b_hnp_enable flag when enumeration. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 6148c9df6d1c68dfc91cfe274101058c8edf979b)
2015-06-01MLK-9618-10 usb: chipidea: otg: change TA_WAIT_VFAL to be 500msLi Jun
500ms is enough for vbus fall to VOTG_VBUS_LKG(0.7v, OTG device or EH Leakage Voltage). Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 41295ac496aa7697585e65223797e0cb4e5fb153)
2015-06-01MLK-9618-9 usb: chipidea: otg: change TA_BIDL_ADIS to be 160msLi Jun
This patch is to fix one OTG HNP timing requirement, TA_BIDL_ADIS should be in range of 155ms~200ms per OTG spec 2.0 reverion 1.1a. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit a6de1be200984b01d784f6558229adbb67fcb380)
2015-06-01MLK-9618-8 usb: chipidea: otg: add A idle to B disconnect timerLi Jun
B-device detects that bus is idle for more than TB_AIDL_BDIS min and begins HNP by turning off pullup on DP, this allows the bus to discharge to the SE0 state. This timer was missed and failed with one PET test, this patch is to fix this timing issue. Signed-off-by: Li Jun <b47624@freescale.com>
2015-06-01MLK-9618-6 usb: chipidea: otg: show message for b host HNP failsLi Jun
Show 'Device no response' message if A-device fails to connect as a peripheral. Signed-off-by: Li Jun <b47624@freescale.com>
2015-06-01MLK-9618-5 usb: chipidea: otg: show message device no response for SRP failLi Jun
If b device does not detect vbus on after TB_SRP_FAIL of data pulse, b device should show 'Device no response' message. Signed-off-by: Li Jun <b47624@freescale.com>
2015-06-01MLK-9618-4 usb: chipidea: otg: show message for a_wait_bcon time outLi Jun
When a host start a session and wait b device to connnect within TA_WAIT_BCON, if failed, should show a message 'Device no response' according to otg and EH compliance plan version 1.2 section 6.7.22 Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 1762592ead672d27b281df8becf90f8c7d7fe61c)
2015-06-01MLK-9617-19 usb: otg: test: show warning message for unsupported otg test devLi Jun
According to "USB On-The-Go and Embedded Host Automated Compliance Plan Version 1.2", chapter 6.7.23, unknown Device Not Supporting HNP:'Unsupported Device'; chapter 6.7.24 unknown Device Supporting HNP: 'Device No Response' Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 32df700386fff1d1eef90007604055f1d013aaf3)
2015-06-01MLK-9617-17 usb: common: otg: clear b_bus_req in b_peripheral stateLi Jun
This patch is clearing b_bus_req input to be 0 when entering b_peripheral state. b_bus_req is only TRUE when b device wants to use the bus and switch to be host role. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit eb610e73aa38bbb45aed6a79265cd79fe80cdd05)
2015-06-01MLK-9617-16 usb: common: otg: clear a_conn flag when leaves b hostLi Jun
This patch is clearing a_conn flag when b device leave b_host state. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit e511cc08879fa97035900ae8626051e473f30cd9)
2015-06-01MLK-9617-15 usb: gadget: composite: add get otg descriptor request handlingLi Jun
This patch adds response to getting OTG descriptor request from host. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 560690f1b24448b94806f390add9d91d602e3ef4)
2015-06-01MLK-9617-14 usb: core: otg: wait less hub power stable time for b hostLi Jun
This patch changes hub power stable wait time for root hub of b host from 100ms to 50ms to meet OTG HNP timing requirment. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 31889db617b7ecf4cdf9f9e98957ec9b6de49a4e)
2015-06-01MLK-9617-13 usb: core: otg: do quick bus reset after clear connection changeLi Jun
This patch changes bus reset time for B host enumuration, from entering B host to the time clear USB_PORT_FEAT_C_CONNECTION, a random time after B host detect port change for A peripheral connection may not work. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit b87d3bb0672ebcfb29c7db8708c586b2d38558d1)
2015-06-01MLK-9618-3 usb: chipidea: host: add port reset for USB OTG HNPLi Jun
This patch adds host port reset implementation for HNP timing requirement, which will be called when B host starts enumuration. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 5df2a65c073dcdf227f1eb340a686a589db5009b)
2015-06-01MLK-9617-11 usb: common: otg: use a_set_b_hnp_en instead of b_hnp_enableLi Jun
This patch replaces b_hnp_enable with a_set_b_hnp_en to comply with state diagram of USB and EH spec. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 4734ed1f813959a7544ad744d60ab119efb04ba9)
2015-06-01MLK-9617-10 usb: common: otg: update condition from a_host to a_suspendLi Jun
This patch updates condition from a_host to a_suspend according to On-The-Go and Embedded Host Supplement to the USB Revision 2.0 Specification Revision 2.0 version 1.1a. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit f3acf74150683d4555c82ad32b9c669d8a0a7fb5)
2015-06-01MLK-9617-9 usb: core: hub: use a_set_b_hnp_en and b_hnp_en for otg fsm modeLi Jun
Use a_set_b_hnp_en to identify if a host can succeed to set b_hnp_enable for B device, use b_hnp_enable flag to identify if the connected OTG device is HNP capable. So if the connected otg device is HNP capable but b_hnp_enable is not set for A host, the host which support HNP polling should continue enumeration to see if the B device can talk to it later by hnp polling. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit b715d0773eea212a25d6b8c5d94530e12935fdaf)
2015-06-01MLK-9618-3 usb: chipidea: otg: enable hnp_pollinig flagLi Jun
This patch enables hnp_polling flag for chipidea host driver in otg fsm mode. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit acb43a932263edd9b80c6d6d9ee858176c201542)
2015-06-01MLK-9617-6 usb: core: otg: do not break otg device enumerationLi Jun
If a HNP capable device STALL b_hnp_enable set feature request, A device as host should not break otg device enumeration, because this set feature failure only indicates the B device does not want to be host role for the moment, A device as host talk to it should be okay. see charpter 6.2.2.2 of OTG and EH 2.0: "If the a_hnp_support feature is set, but the b_hnp_enable feature is not set, then it is likely that b_hnp_enable will be set later when the A-device is finished using the bus." Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 51317577d16034ba151da8d502319f4befb91278)
2015-06-01MLK-9617-5 usb: core: otg: set a_hnp_support for legacy otg deviceLi Jun
This patch adds a_hnp_support feature to maintain compatibility with legacy B-devices.The A-device shall set this feature on any legacy B-device, complying with OTG supplement version 1.3 or earlier, that is attached to an A-device port that supports HNP. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 925980190a5f341ed1110239ea481b9452094f6c)
2015-06-01MLK-9617-4 usb: common: otg: test: do HNP for legacy otg test deviceLi Jun
Since legacy OTG test device which is only compliant with OTG supplement version 1.3 or earlier, cannot support HNP polling, so directly start role switch. Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 688bbca155159978cd520923f2c3029c7778fa9c)
2015-06-01MLK-9638-6 usb: common: otg: test: clear otg_hnp_reqd flag when it's invalidLi Jun
This patch clears otg_hnp_reqd feature related flags when the HNP test ends. There are two otg fsm paths to end this feature request: - b_peripheral --> b_wait_acon --> b_idle: we clear them when entering b_idle; - b_peripheral --> b_wait_acon --> b_host --> b_peripheral : we clear them when leaving b_host. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 39d25f04ed047e15f23b44e8465ce46257547df7)
2015-06-01MLK-9638-5 usb: chipidea: otg: test: timer for B host hands host role backLi Jun
This patch implements a timer for B host to start host role switch back to A device. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 139bcc46841f73199bdc3ca308e46a5af3dd2fc1)
2015-06-01MLK-9638-4 usb: ehset: test: start timer for B host switch role backLi Jun
After B device as host enumerates A peripheral and sets configuration, B host should start to hand host role back to A device when this timer expires. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 3f4a8c8a20ef69721f9e7886b8d245036d41d91a)
2015-06-01MLK-9638-3 usb: chipidea: udc: test: handle otg_hnp_req set feature requestLi Jun
This patch adds otg_hnp_reqd set feature request from A host for chipidea udc driver. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 450d4a1eb40ec4284661c1130bdcc4f4d2e6c527)
2015-06-01MLK-9637-4 usb: chipidea: otg: test: add otg_srp_reqd timer for start srpLi Jun
This patch adds a timer for chipidea otg fsm driver to start data pulse after A host ends the session. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 35e92b59080b58925c3b96e36511056cb51d4a00)
2015-06-01MLK-9637-3 usb: chipidea: udc: test: handle otg_srp_reqd set feature requestLi Jun
This patch adds otg_srp_reqd set feature request from A host for chipidea udc driver. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 5edca27c518e8a69accb429c946c19243e156656)
2015-06-01MLK-9606-5 usb: chipidea: otg: test: end test session if otg_vbus_off is setLi Jun
When the connected otg test device disconnects before test maintain timer expires, A device should end the session if otg_vbus_off is set; and do a_wait_bcon if otg_vbus_off is not set. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 204fa72fe4e2be468fe61f1ede555e072610c932)
2015-06-01MLK-9606-4 usb: chipidea: otg: test: tst_maint timer implementationLi Jun
This patch implements otg test device session maintain timer, if the timer expires, A device as host should end the session, and clear tst_maint flag when turn off vbus. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit c0d2dc56012a2308b0bf48429fefa559fc4c80e4)
2015-06-01MLK-9606-3 usb: otg: test: remove test maintain timer if HNP happensLi Jun
If B device set host request flag before test maintain timer expires, remove the timer and clear test maintain session flag, do HNP as a normal OTG device. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit d914c80921652419037d935f14545fe87f74a71c)
2015-06-01MLK-9606-2 usb: otg: test: start tst_maint timer and set otg_vbus_off flagLi Jun
This patch adds 2 variables: tst_maint and otg_vbus_off, tst_maint is to check if current session for test device; otg_vbus_off is to notify if A device need turn off vbus immediately after B device disconnects. The otg test device handling is added into ehset driver, for that device, A-device should start a timer for maintain the session, and set otg_vbus_off flag according to its bcdDevice value. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit 78a2c14bdea4b8e334c7e0afad074b61b71193cb)
2015-06-01MLK-9606-1 usb: otg: test: add otg test device into otg and EH TPLLi Jun
This patch add otg test device with VID(0x1a0a) and PID(0x0200) into otg and EH TPL. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit b88ee5e2cbf55aaed3b6c5dd0aff7f826f9e357d)
2015-06-01MLK-9618-2 usb: chipidea: otg: update is_b_host flag when setup&stop hostLi Jun
This patch sets and clear is_b_host flag of usb_bus when start and stop host in chipidea host driver. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <b47624@freescale.com> (cherry picked from commit c164e65922235efcacc3743a9719adc7a9ef7413)
2015-05-28MLK-9829 usb: core: print suggested message if failed to get device descriptorLi Jun
This is required for USB OTG and EH compliance test 6.7.22(A-UUT “Device No Response” for connection timeout). When the connected usb device(PET) does not response to transactions, host will fail to get device descriptor. Signed-off-by: Li Jun <jun.li@freescale.com> (cherry picked from commit 86d0bd661ecbbdf97dd9a8ddbaf0d3811de7f39e)
2015-05-28MLK-10718 usb: chipidea: udc: disable BSV irq when otg from undefined to a_idleLi Jun
After device power up, insert usb OTG ID cable, otg fsm from undefined state to a_idle, the BSV cannot be disabled, this will result BSV irq generated but which is actually only for B device. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-05-21MLK-10930-3 usb: chipidea: add delay if phy-clkgate-delay-us property is presentLi Jun
For some platforms, time delay is requried between putting PHY into low power mode and gate PHY clock. Signed-off-by: Li Jun <jun.li@freescale.com>
2015-05-08MLK-10823 usb: chipidea: imx: set b_sess_valid as wakeup source for imx7dPeter Chen
In some situations, we need vbus level which lower than vbus valid as wakeup source, eg, at the OTG certification test, the valid bus level for b device is from 4.0v to 6.0v. Signed-off-by: Peter Chen <peter.chen@freescale.com>