Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1338935 > unrolled thread

Re: Nokia N900: musb is in wrong state after boot

Started byPali Rohár <pali.rohar@gmail.com>
First post2016-02-21 19:30 +0100
Last post2016-02-22 16:50 +0100
Articles 7 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Nokia N900: musb is in wrong state after boot Pali Rohár <pali.rohar@gmail.com> - 2016-02-21 19:30 +0100
    Re: Nokia N900: musb is in wrong state after boot Felipe Balbi <balbi@kernel.org> - 2016-02-22 08:40 +0100
      Re: Nokia N900: musb is in wrong state after boot Pali Rohár <pali.rohar@gmail.com> - 2016-02-22 09:40 +0100
        Re: Nokia N900: musb is in wrong state after boot Felipe Balbi <balbi@kernel.org> - 2016-02-22 10:00 +0100
        Re: Nokia N900: musb is in wrong state after boot Felipe Balbi <balbi@kernel.org> - 2016-02-22 10:00 +0100
          Re: Nokia N900: musb is in wrong state after boot Bin Liu <b-liu@ti.com> - 2016-02-22 16:40 +0100
            Re: Nokia N900: musb is in wrong state after boot Adam Ford <aford173@gmail.com> - 2016-02-22 16:50 +0100

#1338935 — Re: Nokia N900: musb is in wrong state after boot

FromPali Rohár <pali.rohar@gmail.com>
Date2016-02-21 19:30 +0100
SubjectRe: Nokia N900: musb is in wrong state after boot
Message-ID<r4GVA-1CR-27@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
> > > > > Do you have some pointer
> > > > > to the "certain resistor value on ID to GND" spec? Is it
> > > > > maybe part of the carkit related parts of the USB spec?
> > > > 
> > > > ""Three additional ID pin states are defined[4] at the nominal
> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
> > > > to the ground pin. These permit the device to work with USB
> > > > Accessory Charger Adapters that allows the OTG device to be
> > > > attached to both a charger and another device simultaneously.
> > > > [6]""
> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
> > > 
> > > OK thanks. So it's the "accessory charger" part of the
> > > battery charging specification 1.1.
> > 
> > So, Tony, do you have some idea what needs to be changed and how to
> > fix peripheral mode after boot on Nokia N900?
> 
> No, I'm waiting to hear an educated guess from Felipe on this one.

PING! Still no answer.
Felipe changed email address.

> > First I would like to have fully working peripheral mode on Nokia
> > N900 and then we can try to hack host mode (if possible).
> > 
> > But peripheral mode is a must due to development, because it
> > provides usb network or usb tty.
> 
> Totally.
> 
> Regards,
> 
> Tony

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [next] | [standalone]


#1339171

FromFelipe Balbi <balbi@kernel.org>
Date2016-02-22 08:40 +0100
Message-ID<r4Tg6-2j1-25@gated-at.bofh.it>
In reply to#1338935

[Multipart message — attachments visible in raw view] — view raw

Pali Rohár <pali.rohar@gmail.com> writes:

> On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
>> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
>> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
>> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
>> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
>> > > > > Do you have some pointer
>> > > > > to the "certain resistor value on ID to GND" spec? Is it
>> > > > > maybe part of the carkit related parts of the USB spec?
>> > > > 
>> > > > ""Three additional ID pin states are defined[4] at the nominal
>> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
>> > > > to the ground pin. These permit the device to work with USB
>> > > > Accessory Charger Adapters that allows the OTG device to be
>> > > > attached to both a charger and another device simultaneously.
>> > > > [6]""
>> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
>> > > 
>> > > OK thanks. So it's the "accessory charger" part of the
>> > > battery charging specification 1.1.
>> > 
>> > So, Tony, do you have some idea what needs to be changed and how to
>> > fix peripheral mode after boot on Nokia N900?
>> 
>> No, I'm waiting to hear an educated guess from Felipe on this one.

about why peripheral mode doesn't work on n900 ? No idea. that's always
the default role of MUSB and last I checked, before stopping working on
this, BBB was working just fine.

N900 is odd in that it has two PHYs (1701 handles data lines while
twl4030 handles power lines, IIRC), but peripheral should be working.

The only reason for MUSB to not start would be that it's not detecting
VBUS being above session valid threshold, however twl4030 should have an
IRQ for that.

What happens when cable is attached ? Any IRQs anywhere firing ?

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1339221

FromPali Rohár <pali.rohar@gmail.com>
Date2016-02-22 09:40 +0100
Message-ID<r4Uca-2Vw-13@gated-at.bofh.it>
In reply to#1339171
On Monday 22 February 2016 09:31:50 Felipe Balbi wrote:
> Pali Rohár <pali.rohar@gmail.com> writes:
> 
> > On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
> >> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
> >> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
> >> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
> >> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
> >> > > > > Do you have some pointer
> >> > > > > to the "certain resistor value on ID to GND" spec? Is it
> >> > > > > maybe part of the carkit related parts of the USB spec?
> >> > > > 
> >> > > > ""Three additional ID pin states are defined[4] at the nominal
> >> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
> >> > > > to the ground pin. These permit the device to work with USB
> >> > > > Accessory Charger Adapters that allows the OTG device to be
> >> > > > attached to both a charger and another device simultaneously.
> >> > > > [6]""
> >> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
> >> > > 
> >> > > OK thanks. So it's the "accessory charger" part of the
> >> > > battery charging specification 1.1.
> >> > 
> >> > So, Tony, do you have some idea what needs to be changed and how to
> >> > fix peripheral mode after boot on Nokia N900?
> >> 
> >> No, I'm waiting to hear an educated guess from Felipe on this one.
> 
> about why peripheral mode doesn't work on n900 ? No idea. that's always
> the default role of MUSB and last I checked, before stopping working on
> this, BBB was working just fine.
> 
> N900 is odd in that it has two PHYs (1701 handles data lines while
> twl4030 handles power lines, IIRC), but peripheral should be working.
> 
> The only reason for MUSB to not start would be that it's not detecting
> VBUS being above session valid threshold, however twl4030 should have an
> IRQ for that.
> 
> What happens when cable is attached ? Any IRQs anywhere firing ?
> 

Just to note, when I call echo peripheral > mode then detecting usb
cable starts working and usb peripheral mode also works fine (also after
disconnecting and connecting usb cable again). Read my first post in
this thread, there are also some logs: https://lkml.org/lkml/2016/1/9/69

-- 
Pali Rohár
pali.rohar@gmail.com

[toc] | [prev] | [next] | [standalone]


#1339227

FromFelipe Balbi <balbi@kernel.org>
Date2016-02-22 10:00 +0100
Message-ID<r4Uvw-32j-5@gated-at.bofh.it>
In reply to#1339221

[Multipart message — attachments visible in raw view] — view raw

Hi,

Pali Rohár <pali.rohar@gmail.com> writes:
> On Monday 22 February 2016 09:31:50 Felipe Balbi wrote:
>> Pali Rohár <pali.rohar@gmail.com> writes:
>> 
>> > On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
>> >> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
>> >> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
>> >> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
>> >> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
>> >> > > > > Do you have some pointer
>> >> > > > > to the "certain resistor value on ID to GND" spec? Is it
>> >> > > > > maybe part of the carkit related parts of the USB spec?
>> >> > > > 
>> >> > > > ""Three additional ID pin states are defined[4] at the nominal
>> >> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
>> >> > > > to the ground pin. These permit the device to work with USB
>> >> > > > Accessory Charger Adapters that allows the OTG device to be
>> >> > > > attached to both a charger and another device simultaneously.
>> >> > > > [6]""
>> >> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
>> >> > > 
>> >> > > OK thanks. So it's the "accessory charger" part of the
>> >> > > battery charging specification 1.1.
>> >> > 
>> >> > So, Tony, do you have some idea what needs to be changed and how to
>> >> > fix peripheral mode after boot on Nokia N900?
>> >> 
>> >> No, I'm waiting to hear an educated guess from Felipe on this one.
>> 
>> about why peripheral mode doesn't work on n900 ? No idea. that's always
>> the default role of MUSB and last I checked, before stopping working on
>> this, BBB was working just fine.
>> 
>> N900 is odd in that it has two PHYs (1701 handles data lines while
>> twl4030 handles power lines, IIRC), but peripheral should be working.
>> 
>> The only reason for MUSB to not start would be that it's not detecting
>> VBUS being above session valid threshold, however twl4030 should have an
>> IRQ for that.
>> 
>> What happens when cable is attached ? Any IRQs anywhere firing ?
>> 
>
> Just to note, when I call echo peripheral > mode then detecting usb
> cable starts working and usb peripheral mode also works fine (also
> after disconnecting and connecting usb cable again). Read my first
> post in this thread, there are also some logs:
> https://lkml.org/lkml/2016/1/9/69

interesting... that softconnect interface looks odd. We _know_ the value
of softconnect from musb->softconnect. /me reads commit which added
it... Oh okay, that's only valid for host mode. Argh!

Okay, the session bit is _NOT_ set when it should be. Note that DevCtl
reads as 0x98. Bit 0 is Session bit and that's not set. MUSB _is_ in the
device mode (bit 7 set).

For some reason DevCtl didn't get set. Care to add a print to
musb_gadget_pullup() to see when/if it's called ?

BTW, Bin will be maintaining MUSB going forward.

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1339228

FromFelipe Balbi <balbi@kernel.org>
Date2016-02-22 10:00 +0100
Message-ID<r4Uvx-32j-9@gated-at.bofh.it>
In reply to#1339221

[Multipart message — attachments visible in raw view] — view raw

Hi,

Pali Rohár <pali.rohar@gmail.com> writes:
> On Monday 22 February 2016 09:31:50 Felipe Balbi wrote:
>> Pali Rohár <pali.rohar@gmail.com> writes:
>> 
>> > On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
>> >> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
>> >> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
>> >> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
>> >> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
>> >> > > > > Do you have some pointer
>> >> > > > > to the "certain resistor value on ID to GND" spec? Is it
>> >> > > > > maybe part of the carkit related parts of the USB spec?
>> >> > > > 
>> >> > > > ""Three additional ID pin states are defined[4] at the nominal
>> >> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
>> >> > > > to the ground pin. These permit the device to work with USB
>> >> > > > Accessory Charger Adapters that allows the OTG device to be
>> >> > > > attached to both a charger and another device simultaneously.
>> >> > > > [6]""
>> >> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
>> >> > > 
>> >> > > OK thanks. So it's the "accessory charger" part of the
>> >> > > battery charging specification 1.1.
>> >> > 
>> >> > So, Tony, do you have some idea what needs to be changed and how to
>> >> > fix peripheral mode after boot on Nokia N900?
>> >> 
>> >> No, I'm waiting to hear an educated guess from Felipe on this one.
>> 
>> about why peripheral mode doesn't work on n900 ? No idea. that's always
>> the default role of MUSB and last I checked, before stopping working on
>> this, BBB was working just fine.
>> 
>> N900 is odd in that it has two PHYs (1701 handles data lines while
>> twl4030 handles power lines, IIRC), but peripheral should be working.
>> 
>> The only reason for MUSB to not start would be that it's not detecting
>> VBUS being above session valid threshold, however twl4030 should have an
>> IRQ for that.
>> 
>> What happens when cable is attached ? Any IRQs anywhere firing ?
>> 
>
> Just to note, when I call echo peripheral > mode then detecting usb
> cable starts working and usb peripheral mode also works fine (also
> after disconnecting and connecting usb cable again). Read my first
> post in this thread, there are also some logs:
> https://lkml.org/lkml/2016/1/9/69

interesting... that softconnect interface looks odd. We _know_ the value
of softconnect from musb->softconnect. /me reads commit which added
it... Oh okay, that's only valid for host mode. Argh!

Okay, the session bit is _NOT_ set when it should be. Note that DevCtl
reads as 0x98. Bit 0 is Session bit and that's not set. MUSB _is_ in the
device mode (bit 7 set).

For some reason DevCtl didn't get set. Care to add a print to
musb_gadget_pullup() to see when/if it's called ?

BTW, Bin will be maintaining MUSB going forward.

-- 
balbi

[toc] | [prev] | [next] | [standalone]


#1339654

FromBin Liu <b-liu@ti.com>
Date2016-02-22 16:40 +0100
Message-ID<r50KC-7Jl-3@gated-at.bofh.it>
In reply to#1339228
Hi,

On Mon, Feb 22, 2016 at 10:54:21AM +0200, Felipe Balbi wrote:
> 
> Hi,
> 
> Pali Rohár <pali.rohar@gmail.com> writes:
> > On Monday 22 February 2016 09:31:50 Felipe Balbi wrote:
> >> Pali Rohár <pali.rohar@gmail.com> writes:
> >> 
> >> > On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
> >> >> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
> >> >> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
> >> >> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
> >> >> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
> >> >> > > > > Do you have some pointer
> >> >> > > > > to the "certain resistor value on ID to GND" spec? Is it
> >> >> > > > > maybe part of the carkit related parts of the USB spec?
> >> >> > > > 
> >> >> > > > ""Three additional ID pin states are defined[4] at the nominal
> >> >> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
> >> >> > > > to the ground pin. These permit the device to work with USB
> >> >> > > > Accessory Charger Adapters that allows the OTG device to be
> >> >> > > > attached to both a charger and another device simultaneously.
> >> >> > > > [6]""
> >> >> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
> >> >> > > 
> >> >> > > OK thanks. So it's the "accessory charger" part of the
> >> >> > > battery charging specification 1.1.
> >> >> > 
> >> >> > So, Tony, do you have some idea what needs to be changed and how to
> >> >> > fix peripheral mode after boot on Nokia N900?
> >> >> 
> >> >> No, I'm waiting to hear an educated guess from Felipe on this one.
> >> 
> >> about why peripheral mode doesn't work on n900 ? No idea. that's always
> >> the default role of MUSB and last I checked, before stopping working on
> >> this, BBB was working just fine.
> >> 
> >> N900 is odd in that it has two PHYs (1701 handles data lines while
> >> twl4030 handles power lines, IIRC), but peripheral should be working.
> >> 
> >> The only reason for MUSB to not start would be that it's not detecting
> >> VBUS being above session valid threshold, however twl4030 should have an
> >> IRQ for that.
> >> 
> >> What happens when cable is attached ? Any IRQs anywhere firing ?
> >> 
> >
> > Just to note, when I call echo peripheral > mode then detecting usb
> > cable starts working and usb peripheral mode also works fine (also
> > after disconnecting and connecting usb cable again). Read my first
> > post in this thread, there are also some logs:
> > https://lkml.org/lkml/2016/1/9/69
> 
> interesting... that softconnect interface looks odd. We _know_ the value
> of softconnect from musb->softconnect. /me reads commit which added
> it... Oh okay, that's only valid for host mode. Argh!

softconnet bit is only valid for *peripheral* mode, but the bit is not
set in this case, so the host will not be able to detect the device.

Pali,

Is this never worked or just broken recently? If latter, possible to
git-bisect to find out which patch causes softconnect bit not set?

Regards,
-Bin.

> 
> Okay, the session bit is _NOT_ set when it should be. Note that DevCtl
> reads as 0x98. Bit 0 is Session bit and that's not set. MUSB _is_ in the
> device mode (bit 7 set).
> 
> For some reason DevCtl didn't get set. Care to add a print to
> musb_gadget_pullup() to see when/if it's called ?
> 
> BTW, Bin will be maintaining MUSB going forward.
> 
> -- 
> balbi

[toc] | [prev] | [next] | [standalone]


#1339667

FromAdam Ford <aford173@gmail.com>
Date2016-02-22 16:50 +0100
Message-ID<r50Ui-7Ny-19@gated-at.bofh.it>
In reply to#1339654
For what it's worth, I tried running the MUSB via the twl4030 on
Linux-Next (I don't remember which snapshot), and it was broken for me
on a DM3730 (OMAP 3630), but Kernel 4.4.2 worked.  Are you using
Linux-Next or one of the stable kernels?

I can try again later this week with a newer linux-next when I have
more time to see if it's still there.  Once I realized the stable
kernel worked, I stoped since I was just testing some device tree
stuff.

adam



On Mon, Feb 22, 2016 at 9:36 AM, Bin Liu <b-liu@ti.com> wrote:
> Hi,
>
> On Mon, Feb 22, 2016 at 10:54:21AM +0200, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Pali Rohár <pali.rohar@gmail.com> writes:
>> > On Monday 22 February 2016 09:31:50 Felipe Balbi wrote:
>> >> Pali Rohár <pali.rohar@gmail.com> writes:
>> >>
>> >> > On Tuesday 26 January 2016 18:26:32 Tony Lindgren wrote:
>> >> >> * Pali Rohár <pali.rohar@gmail.com> [160126 06:35]:
>> >> >> > On Thursday 21 January 2016 12:30:13 Tony Lindgren wrote:
>> >> >> > > * joerg Reisenweber <joerg@openmoko.org> [160121 11:35]:
>> >> >> > > > On Thu 21 January 2016 11:21:13 Tony Lindgren wrote:
>> >> >> > > > > Do you have some pointer
>> >> >> > > > > to the "certain resistor value on ID to GND" spec? Is it
>> >> >> > > > > maybe part of the carkit related parts of the USB spec?
>> >> >> > > >
>> >> >> > > > ""Three additional ID pin states are defined[4] at the nominal
>> >> >> > > > resistance values of 124 kΩ, 68 kΩ, and 36.5 kΩ, with respect
>> >> >> > > > to the ground pin. These permit the device to work with USB
>> >> >> > > > Accessory Charger Adapters that allows the OTG device to be
>> >> >> > > > attached to both a charger and another device simultaneously.
>> >> >> > > > [6]""
>> >> >> > > > https://en.wikipedia.org/wiki/USB_On-The-Go#OTG_micro_plugs
>> >> >> > >
>> >> >> > > OK thanks. So it's the "accessory charger" part of the
>> >> >> > > battery charging specification 1.1.
>> >> >> >
>> >> >> > So, Tony, do you have some idea what needs to be changed and how to
>> >> >> > fix peripheral mode after boot on Nokia N900?
>> >> >>
>> >> >> No, I'm waiting to hear an educated guess from Felipe on this one.
>> >>
>> >> about why peripheral mode doesn't work on n900 ? No idea. that's always
>> >> the default role of MUSB and last I checked, before stopping working on
>> >> this, BBB was working just fine.
>> >>
>> >> N900 is odd in that it has two PHYs (1701 handles data lines while
>> >> twl4030 handles power lines, IIRC), but peripheral should be working.
>> >>
>> >> The only reason for MUSB to not start would be that it's not detecting
>> >> VBUS being above session valid threshold, however twl4030 should have an
>> >> IRQ for that.
>> >>
>> >> What happens when cable is attached ? Any IRQs anywhere firing ?
>> >>
>> >
>> > Just to note, when I call echo peripheral > mode then detecting usb
>> > cable starts working and usb peripheral mode also works fine (also
>> > after disconnecting and connecting usb cable again). Read my first
>> > post in this thread, there are also some logs:
>> > https://lkml.org/lkml/2016/1/9/69
>>
>> interesting... that softconnect interface looks odd. We _know_ the value
>> of softconnect from musb->softconnect. /me reads commit which added
>> it... Oh okay, that's only valid for host mode. Argh!
>
> softconnet bit is only valid for *peripheral* mode, but the bit is not
> set in this case, so the host will not be able to detect the device.
>
> Pali,
>
> Is this never worked or just broken recently? If latter, possible to
> git-bisect to find out which patch causes softconnect bit not set?
>
> Regards,
> -Bin.
>
>>
>> Okay, the session bit is _NOT_ set when it should be. Note that DevCtl
>> reads as 0x98. Bit 0 is Session bit and that's not set. MUSB _is_ in the
>> device mode (bit 7 set).
>>
>> For some reason DevCtl didn't get set. Care to add a print to
>> musb_gadget_pullup() to see when/if it's called ?
>>
>> BTW, Bin will be maintaining MUSB going forward.
>>
>> --
>> balbi
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web