Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Fabio Estevam
On Fri, Oct 14, 2016 at 1:05 PM, Renato Caldas
 wrote:

> Regarding inclusion, I'm eager to do it, but there are other issues
> still pending (namely the PCI support...), plus a lot of cleanup to
> do.

Just a hint: even if the support is not complete (missing PCI support,
for example) you could submit the current patch and the board support
can be improved later.
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Otavio Salvador
On Fri, Oct 14, 2016 at 1:05 PM, Renato Caldas
 wrote:
> 2016-10-14 11:34 GMT-04:00 Otavio Salvador :
>> On Fri, Oct 14, 2016 at 12:28 PM, Fabio Estevam  wrote:
>>> On Fri, Oct 14, 2016 at 12:21 PM, Renato Caldas
>>>  wrote:
>>>
 I just found commit 40f737791d4dab26bf23a6331609c604142228bd for the
 sabresd board, which I think explains it all:

 ARM: imx6qdl-sabresd: set swbst_reg as vbus's parent reg

 USB vbus 5V is from PMIC SWBST, so set swbst_reg as vbus's
 parent reg, it fixed a bug that the voltage of vbus is incorrect
 due to swbst_reg is disabled after boots up.

 So THAT was the problem..
>>>
>>> Excellent! Glad you fixed it!
>>
>> It would be great if you could upgrade it to our 2.0.0 fork and submit
>> for inclusion on linux-imx-fslc.
>
> I'll test it with the 2.0.0 fork and report back.
>
> Regarding inclusion, I'm eager to do it, but there are other issues
> still pending (namely the PCI support...), plus a lot of cleanup to
> do.
>
> On the other hand, I'm basing my work on Kontron's fido-based layer,
> and without any kind of support from Kontron. I need to make sure I
> don't infringe any copyright, so I'll have to ask them and hope
> they'll reply.

There is no copyright infringement involved in porting the DeviceTree
file as it is under GPLv2 as kernel and U-Boot.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Renato Caldas
2016-10-14 11:34 GMT-04:00 Otavio Salvador :
> On Fri, Oct 14, 2016 at 12:28 PM, Fabio Estevam  wrote:
>> On Fri, Oct 14, 2016 at 12:21 PM, Renato Caldas
>>  wrote:
>>
>>> I just found commit 40f737791d4dab26bf23a6331609c604142228bd for the
>>> sabresd board, which I think explains it all:
>>>
>>> ARM: imx6qdl-sabresd: set swbst_reg as vbus's parent reg
>>>
>>> USB vbus 5V is from PMIC SWBST, so set swbst_reg as vbus's
>>> parent reg, it fixed a bug that the voltage of vbus is incorrect
>>> due to swbst_reg is disabled after boots up.
>>>
>>> So THAT was the problem..
>>
>> Excellent! Glad you fixed it!
>
> It would be great if you could upgrade it to our 2.0.0 fork and submit
> for inclusion on linux-imx-fslc.

I'll test it with the 2.0.0 fork and report back.

Regarding inclusion, I'm eager to do it, but there are other issues
still pending (namely the PCI support...), plus a lot of cleanup to
do.

On the other hand, I'm basing my work on Kontron's fido-based layer,
and without any kind of support from Kontron. I need to make sure I
don't infringe any copyright, so I'll have to ask them and hope
they'll reply.

>
> --
> Otavio Salvador O.S. Systems
> http://www.ossystems.com.brhttp://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Otavio Salvador
On Fri, Oct 14, 2016 at 12:28 PM, Fabio Estevam  wrote:
> On Fri, Oct 14, 2016 at 12:21 PM, Renato Caldas
>  wrote:
>
>> I just found commit 40f737791d4dab26bf23a6331609c604142228bd for the
>> sabresd board, which I think explains it all:
>>
>> ARM: imx6qdl-sabresd: set swbst_reg as vbus's parent reg
>>
>> USB vbus 5V is from PMIC SWBST, so set swbst_reg as vbus's
>> parent reg, it fixed a bug that the voltage of vbus is incorrect
>> due to swbst_reg is disabled after boots up.
>>
>> So THAT was the problem..
>
> Excellent! Glad you fixed it!

It would be great if you could upgrade it to our 2.0.0 fork and submit
for inclusion on linux-imx-fslc.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Fabio Estevam
On Fri, Oct 14, 2016 at 12:21 PM, Renato Caldas
 wrote:

> I just found commit 40f737791d4dab26bf23a6331609c604142228bd for the
> sabresd board, which I think explains it all:
>
> ARM: imx6qdl-sabresd: set swbst_reg as vbus's parent reg
>
> USB vbus 5V is from PMIC SWBST, so set swbst_reg as vbus's
> parent reg, it fixed a bug that the voltage of vbus is incorrect
> due to swbst_reg is disabled after boots up.
>
> So THAT was the problem..

Excellent! Glad you fixed it!
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Renato Caldas
2016-10-14 10:16 GMT-04:00 Renato Caldas :
> Hello all
>
> 2016-10-14 7:41 GMT-04:00 Renato Caldas :
>> Hi Fabio,
>>
>> Thank you very much for the suggestion!
>>
>> It doesn't fix the problem, but it modifies it a bit:
>>
>> If a USB device is plugged in at boot time, the hub still disconnect,
>> but after a few messages the reconnection attempts stop:
>>
>> (...)
>> [7.871127] usb 1-1: device not accepting address 7, error -71
>> [7.877133] systemd[1]: Started Journal Service.
>> [7.994119] usb 1-1: new high-speed USB device number 8 using ci_hdrc
>> [8.036702] systemd-journald[108]: Received request to flush
>> runtime journal from PID 1
>> [8.414104] usb 1-1: device not accepting address 8, error -71
>> [8.420157] usb usb1-port1: unable to enumerate USB device
>> [8.840514] random: nonblocking pool is initialized
>> ( END )
>>
>> If on the other end no device is plugged in, the hub now disconnects,
>> when it didn't before:
>>
>> (...)
>> [6.647828] V_5V0_S0: disabling
>> [6.651245] VGEN1: disabling
>> [6.654373] V_2V5_S0: disabling
>> [6.657735] CAN0_EN: disabling
>> [6.660816] CAN1_EN: disabling
>> [6.664139] ALSA device list:
>> [6.667145]   #0: imx-wm8093
>> [6.670215] usb 1-1: USB disconnect, device number 2
>> [6.675217] usb 1-1.1: USB disconnect, device number 3
>> [6.680385]   #1: imx-hdmi-soc
>> [6.691125] VFS: Mounted root (nfs filesystem) on device 0:15.
>> [6.697402] devtmpfs: mounted
>> (...)
>>
>> Cheers,
>>   Renato
>>
>> 2016-10-13 19:28 GMT-04:00 Fabio Estevam :
>>> Hi Renato,
>>>
>>> On Thu, Oct 13, 2016 at 7:42 PM, Renato Caldas
>>>  wrote:
>>>
 If I boot without any usb device connected (apart from the two
 internal USB hubs) it boots successfully, but as soon as I plug in a
 USB device, I get this:

 [  158.722735] usb 1-1: USB disconnect, device number 2
 [  158.727768] usb 1-1.1: USB disconnect, device number 3
 [  158.742031] usb usb1-port1: cannot reset (err = -32)
 [  158.747696] usb usb1-port1: cannot reset (err = -32)
 [  158.753047] usb usb1-port1: cannot reset (err = -32)
>>>
>>> Does it help if you pass 'usbcore.autosuspend=-1' in the kernel command 
>>> line?
>
> I think I found a workaround for the issue, I got very suspicious
> about the hub disconnecting right after the various regulators were
> disabled.
>
> It turns out that if I force the "swbst" regulator(named V_5V0_S0) to
> be always enabled (setting regulator-always-on on the dts file),
> everything works fine as before. What I don't understand is that this
> regulator was disabled on the 3.x kernel, and everything worked fine
> still. I really need the schematic for this board...
>
> Another thing that is bothering me is that I don't see any reference
> to the "anatop" regulator on the 4.x dmesg... Isn't this regulator
> supposed to be detected??

I just found commit 40f737791d4dab26bf23a6331609c604142228bd for the
sabresd board, which I think explains it all:

ARM: imx6qdl-sabresd: set swbst_reg as vbus's parent reg

USB vbus 5V is from PMIC SWBST, so set swbst_reg as vbus's
parent reg, it fixed a bug that the voltage of vbus is incorrect
due to swbst_reg is disabled after boots up.

So THAT was the problem..

>
> Thanks!!
> Cheers,
>   Renato
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Renato Caldas
Hello all

2016-10-14 7:41 GMT-04:00 Renato Caldas :
> Hi Fabio,
>
> Thank you very much for the suggestion!
>
> It doesn't fix the problem, but it modifies it a bit:
>
> If a USB device is plugged in at boot time, the hub still disconnect,
> but after a few messages the reconnection attempts stop:
>
> (...)
> [7.871127] usb 1-1: device not accepting address 7, error -71
> [7.877133] systemd[1]: Started Journal Service.
> [7.994119] usb 1-1: new high-speed USB device number 8 using ci_hdrc
> [8.036702] systemd-journald[108]: Received request to flush
> runtime journal from PID 1
> [8.414104] usb 1-1: device not accepting address 8, error -71
> [8.420157] usb usb1-port1: unable to enumerate USB device
> [8.840514] random: nonblocking pool is initialized
> ( END )
>
> If on the other end no device is plugged in, the hub now disconnects,
> when it didn't before:
>
> (...)
> [6.647828] V_5V0_S0: disabling
> [6.651245] VGEN1: disabling
> [6.654373] V_2V5_S0: disabling
> [6.657735] CAN0_EN: disabling
> [6.660816] CAN1_EN: disabling
> [6.664139] ALSA device list:
> [6.667145]   #0: imx-wm8093
> [6.670215] usb 1-1: USB disconnect, device number 2
> [6.675217] usb 1-1.1: USB disconnect, device number 3
> [6.680385]   #1: imx-hdmi-soc
> [6.691125] VFS: Mounted root (nfs filesystem) on device 0:15.
> [6.697402] devtmpfs: mounted
> (...)
>
> Cheers,
>   Renato
>
> 2016-10-13 19:28 GMT-04:00 Fabio Estevam :
>> Hi Renato,
>>
>> On Thu, Oct 13, 2016 at 7:42 PM, Renato Caldas
>>  wrote:
>>
>>> If I boot without any usb device connected (apart from the two
>>> internal USB hubs) it boots successfully, but as soon as I plug in a
>>> USB device, I get this:
>>>
>>> [  158.722735] usb 1-1: USB disconnect, device number 2
>>> [  158.727768] usb 1-1.1: USB disconnect, device number 3
>>> [  158.742031] usb usb1-port1: cannot reset (err = -32)
>>> [  158.747696] usb usb1-port1: cannot reset (err = -32)
>>> [  158.753047] usb usb1-port1: cannot reset (err = -32)
>>
>> Does it help if you pass 'usbcore.autosuspend=-1' in the kernel command line?

I think I found a workaround for the issue, I got very suspicious
about the hub disconnecting right after the various regulators were
disabled.

It turns out that if I force the "swbst" regulator(named V_5V0_S0) to
be always enabled (setting regulator-always-on on the dts file),
everything works fine as before. What I don't understand is that this
regulator was disabled on the 3.x kernel, and everything worked fine
still. I really need the schematic for this board...

Another thing that is bothering me is that I don't see any reference
to the "anatop" regulator on the 4.x dmesg... Isn't this regulator
supposed to be detected??

Thanks!!
Cheers,
  Renato
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-14 Thread Renato Caldas
Hi Fabio,

Thank you very much for the suggestion!

It doesn't fix the problem, but it modifies it a bit:

If a USB device is plugged in at boot time, the hub still disconnect,
but after a few messages the reconnection attempts stop:

(...)
[7.871127] usb 1-1: device not accepting address 7, error -71
[7.877133] systemd[1]: Started Journal Service.
[7.994119] usb 1-1: new high-speed USB device number 8 using ci_hdrc
[8.036702] systemd-journald[108]: Received request to flush
runtime journal from PID 1
[8.414104] usb 1-1: device not accepting address 8, error -71
[8.420157] usb usb1-port1: unable to enumerate USB device
[8.840514] random: nonblocking pool is initialized
( END )

If on the other end no device is plugged in, the hub now disconnects,
when it didn't before:

(...)
[6.647828] V_5V0_S0: disabling
[6.651245] VGEN1: disabling
[6.654373] V_2V5_S0: disabling
[6.657735] CAN0_EN: disabling
[6.660816] CAN1_EN: disabling
[6.664139] ALSA device list:
[6.667145]   #0: imx-wm8093
[6.670215] usb 1-1: USB disconnect, device number 2
[6.675217] usb 1-1.1: USB disconnect, device number 3
[6.680385]   #1: imx-hdmi-soc
[6.691125] VFS: Mounted root (nfs filesystem) on device 0:15.
[6.697402] devtmpfs: mounted
(...)

Cheers,
  Renato

2016-10-13 19:28 GMT-04:00 Fabio Estevam :
> Hi Renato,
>
> On Thu, Oct 13, 2016 at 7:42 PM, Renato Caldas
>  wrote:
>
>> If I boot without any usb device connected (apart from the two
>> internal USB hubs) it boots successfully, but as soon as I plug in a
>> USB device, I get this:
>>
>> [  158.722735] usb 1-1: USB disconnect, device number 2
>> [  158.727768] usb 1-1.1: USB disconnect, device number 3
>> [  158.742031] usb usb1-port1: cannot reset (err = -32)
>> [  158.747696] usb usb1-port1: cannot reset (err = -32)
>> [  158.753047] usb usb1-port1: cannot reset (err = -32)
>
> Does it help if you pass 'usbcore.autosuspend=-1' in the kernel command line?
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


Re: [meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-13 Thread Fabio Estevam
Hi Renato,

On Thu, Oct 13, 2016 at 7:42 PM, Renato Caldas
 wrote:

> If I boot without any usb device connected (apart from the two
> internal USB hubs) it boots successfully, but as soon as I plug in a
> USB device, I get this:
>
> [  158.722735] usb 1-1: USB disconnect, device number 2
> [  158.727768] usb 1-1.1: USB disconnect, device number 3
> [  158.742031] usb usb1-port1: cannot reset (err = -32)
> [  158.747696] usb usb1-port1: cannot reset (err = -32)
> [  158.753047] usb usb1-port1: cannot reset (err = -32)

Does it help if you pass 'usbcore.autosuspend=-1' in the kernel command line?
-- 
___
meta-freescale mailing list
meta-freescale@yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


[meta-freescale] USB issues after moving to linux-fslc-imx_4.1-1.0.x

2016-10-13 Thread Renato Caldas
Hello,

I'm working with a Kontron SMARC-sAMX6i board, which is based on the
imx6q CPU. This board is very poorly supported by the manufacturer,
but I've managed to get a mostly-working port of the original 3.x
fido-based kernel to the most recent4.x  linux-fslc-imx kernel.

Unfortunately, after successfully testing the kernel in my "testbed"
board, I'm now having USB issues with the "production" board. The
kernel detects and enumerates all USB devices (two "internal" hubs and
in this case a USB flash drive), but right before mounting the rootfs
the usb devices get disconnected, and I get a continuous "new
high-speed USB device" stream:

[1.782114] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[1.782488] wm8903 0-001b: WM8903 revision C
[1.803203] imx-wm8903 ssi1_audio: wm8903-hifi <-> 2028000.ssi mapping ok
[1.924839] hub 1-1:1.0: USB hub found
[1.930606] hub 1-1:1.0: 2 ports detected
(...)
[2.214106] usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
[2.327359] hub 1-1.1:1.0: USB hub found
[2.331416] hub 1-1.1:1.0: 7 ports detected
(...)
[2.606128] usb 1-1.1.2: new high-speed USB device number 4 using
ci_hdrc
[2.724466] usb-storage 1-1.1.2:1.0: USB Mass Storage device detected
[2.731823] scsi host1: usb-storage 1-1.1.2:1.0
(... detected a USB storage device ...)
[5.392999] sd 1:0:0:0: [sda] Attached SCSI removable disk
(...)
[6.578140] Sending DHCP requests ., OK
(... preparing to boot from NFS rootfs ...)
[6.628199] V_3V3_SDCARD: disabling
[6.631760] V_5V0_S0: disabling
[6.635290] VGEN1: disabling
[6.638423] V_2V5_S0: disabling
[6.641788] CAN0_EN: disabling
[6.644870] CAN1_EN: disabling
[6.648188] ALSA device list:
[6.651326] usb 1-1: USB disconnect, device number 2
[6.656338] usb 1-1.1: USB disconnect, device number 3
[6.656348]   #0: imx-wm8093
[6.656352]   #1: imx-hdmi-soc
[6.667478] usb 1-1.1.2: USB disconnect, device number 4
[6.679995] VFS: Mounted root (nfs filesystem) on device 0:15.
[6.686854] devtmpfs: mounted
[6.690119] Freeing unused kernel memory: 256K (80796000 - 807d6000)
(...)
[6.930155] usb 1-1: new high-speed USB device number 5 using ci_hdrc
[7.174141] usb 1-1: new high-speed USB device number 6 using ci_hdrc
[7.414134] usb 1-1: new high-speed USB device number 7 using ci_hdrc
(...)
[7.838141] usb 1-1: device not accepting address 7, error -71
[7.954220] usb 1-1: new high-speed USB device number 8 using ci_hdrc
[8.378156] usb 1-1: device not accepting address 8, error -71
[8.384103] usb usb1-port1: unable to enumerate USB device
[8.630181] usb 1-1: new high-speed USB device number 9 using ci_hdrc

and it goes on and on. This happens with any kind of USB device
connected to either hub.

Going back to the 3.x kernel it works flawlessly, so it's definitely
software related (even if it may be a hardware issue).

If I boot without any usb device connected (apart from the two
internal USB hubs) it boots successfully, but as soon as I plug in a
USB device, I get this:

[  158.722735] usb 1-1: USB disconnect, device number 2
[  158.727768] usb 1-1.1: USB disconnect, device number 3
[  158.742031] usb usb1-port1: cannot reset (err = -32)
[  158.747696] usb usb1-port1: cannot reset (err = -32)
[  158.753047] usb usb1-port1: cannot reset (err = -32)
[  158.758381] usb usb1-port1: cannot reset (err = -32)
[  158.763686] usb usb1-port1: cannot reset (err = -32)
[  158.773159] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  158.780061] usb usb1-port1: cannot reset (err = -32)
[  158.785309] usb usb1-port1: cannot reset (err = -32)
[  158.790730] usb usb1-port1: cannot reset (err = -32)
[  158.795777] usb usb1-port1: cannot reset (err = -32)
[  158.800807] usb usb1-port1: cannot reset (err = -32)
[  158.805815] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  158.812508] usb usb1-port1: cannot reset (err = -32)
[  158.817564] usb usb1-port1: cannot reset (err = -32)
[  158.822619] usb usb1-port1: cannot reset (err = -32)
[  158.827655] usb usb1-port1: cannot reset (err = -32)
[  158.832683] usb usb1-port1: cannot reset (err = -32)
[  158.837688] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  158.844326] usb usb1-port1: cannot reset (err = -32)
[  158.849358] usb usb1-port1: cannot reset (err = -32)
[  158.854393] usb usb1-port1: cannot reset (err = -32)
[  158.859423] usb usb1-port1: cannot reset (err = -32)
[  158.864455] usb usb1-port1: cannot reset (err = -32)
[  158.869460] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  158.876053] usb usb1-port1: unable to enumerate USB device
[  163.050137] usb 1-1: new high-speed USB device number 8 using ci_hdrc
[  163.290132] usb 1-1: new high-speed USB device number 9 using ci_hdrc
[  163.530130] usb 1-1: new high-speed USB device number 10 using ci_hdrc
[  163.950128] usb 1-1: device not accepting address 10, error -71
[  164.066129] usb