Problem booting i.MX8MM from single USB-C port with hub attached

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem booting i.MX8MM from single USB-C port with hub attached

224 Views
AlexJLennon
Contributor II

Hi all,

We have a problem with an i.MX8MM based board we've designed based on the i.MX8MM EVK.

We've made minimal changes but one change is that we use a single USB-C connector for power and data rather than the two USB-C connectors on the EVK.

We found that booting the standard Yocto image it gets about 2.5s into the Linux kernel boot then resets.

I found this discussion on the forum and implemented these patches

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MP-USB-PD-realized/ta-p/1531209

With these changes I can power the board directly from a USB-C cable and it boots. 

However when I connect a hub to the board and power that hub (and thus the board) from a USB-C cable it gets about 2.5s through the boot again then resets without warning.

A good boot (USB-C directly connected) looks like this

```

[ 2.556356] tcpci 1-0050: Setting voltage/current limit 0 mV 0 mA
[ 2.556364] tcpci 1-0050: polarity 0
[ 2.557998] tcpci 1-0050: Requesting mux state 0, usb-role 0, orientation 0
[ 2.559340] tcpci 1-0050: state change INVALID_STATE -> SNK_UNATTACHED
[ 2.559685] random: fast init done
[ 2.560044] tcpci 1-0050: CC1: 0 -> 0, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, disconnected]
[ 2.560050] tcpci 1-0050: 1-0050: registered
[ 2.568676] imx6q-pcie 33800000.pcie: Link up
[ 2.570054] ALSA device list:
[ 2.570058] #0: imx-spdif
[ 2.570060] #1: imx-audio-micfil
[ 2.570063] #2: bt-sco-audio
[ 2.570065] #3: wm8524-audio
[ 2.575605] tcpci 1-0050: Setting voltage/current limit 0 mV 0 mA
[ 2.633046] tcpci 1-0050: polarity 0
[ 2.641245] tcpci 1-0050: Requesting mux state 0, usb-role 0, orientation 0
[ 2.650541] tcpci 1-0050: cc:=0
[ 2.654583] tcpci 1-0050: pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[ 2.665982] tcpci 1-0050: CC1: 0 -> 0, CC2: 0 -> 0 [state PORT_RESET, polarity 0, disconnected]
[ 2.677471] imx6q-pcie 33800000.pcie: Link up
[ 2.681841] imx6q-pcie 33800000.pcie: Link up, Gen2
[ 2.762788] tcpci 1-0050: state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[ 2.770991] tcpci 1-0050: pending state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED @ 920 ms
[ 2.793168] imx6q-pcie 33800000.pcie: PCI host bridge to bus 0000:00
[ 2.799538] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 2.805062] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 2.811270] pci_bus 0000:00: root bus resource [mem 0x18000000-0x1fefffff]
[ 2.818215] pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
[ 2.824248] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[ 2.830657] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[ 2.837395] pci 0000:00:00.0: supports D1
[ 2.841409] pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
[ 2.849459] pci 0000:01:00.0: [8086:2725] type 00 class 0x028000
[ 2.855560] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00003fff 64bit]
[ 2.862716] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[ 2.883328] pci 0000:00:00.0: BAR 0: assigned [mem 0x18000000-0x180fffff]
[ 2.890136] pci 0000:00:00.0: BAR 14: assigned [mem 0x18100000-0x181fffff]
[ 2.897058] pci 0000:00:00.0: BAR 6: assigned [mem 0x18200000-0x1820ffff pref]
[ 2.904310] pci 0000:01:00.0: BAR 0: assigned [mem 0x18100000-0x18103fff 64bit]
[ 2.911985] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[ 2.917348] pci 0000:00:00.0: bridge window [mem 0x18100000-0x181fffff]
[ 2.924572] pcieport 0000:00:00.0: PME: Signaling with IRQ 238
[ 2.940737] Freeing unused kernel memory: 26752K
[ 2.945478] Run /init as init process
Starting version 249.7+
[ 3.411637] zram0: detected capacity change from 0 to 1022136320
[ 3.699966] tcpci 1-0050: state change PORT_RESET_WAIT_OFF -> SNK_UNATTACHED [delayed 920 ms]
[ 3.708526] tcpci 1-0050: Start toggling
[ 3.726094] tcpci 1-0050: CC1: 0 -> 0, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected]
[ 3.734375] tcpci 1-0050: state change TOGGLING -> SNK_ATTACH_WAIT
[ 3.740568] tcpci 1-0050: pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 200 ms
[ 3.949095] tcpci 1-0050: state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 200 ms]
[ 3.957228] tcpci 1-0050: state change SNK_DEBOUNCED -> SNK_ATTACHED
[ 3.963593] tcpci 1-0050: cc:=2
[ 3.968654] tcpci 1-0050: polarity 1
[ 3.978986] tcpci 1-0050: Requesting mux state 1, usb-role 2, orientation 2
[ 3.988963] tcpci 1-0050: state change SNK_ATTACHED -> SNK_STARTUP
[ 3.995180] tcpci 1-0050: state change SNK_STARTUP -> SNK_DISCOVERY
[ 4.001457] tcpci 1-0050: Setting voltage/current limit 5000 mV 0 mA
[ 4.007822] tcpci 1-0050: vbus=0 charge:=1
[ 4.012902] tcpci 1-0050: state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[ 4.020374] tcpci 1-0050: pending state change SNK_WAIT_CAPABILITIES -> SOFT_RESET_SEND @ 310 ms
[ 4.029911] tcpci 1-0050: CC1: 0 -> 0, CC2: 3 -> 3 [state SNK_WAIT_CAPABILITIES, polarity 1, connected]
[ 4.339236] tcpci 1-0050: state change SNK_WAIT_CAPABILITIES -> SOFT_RESET_SEND [delayed 310 ms]
[ 4.348059] tcpci 1-0050: PD TX, header: 0x8d
[ 4.364856] tcpci 1-0050: PD TX complete, status: 2
[ 4.370056] tcpci 1-0050: state change SOFT_RESET_SEND -> HARD_RESET_SEND
[ 4.376867] tcpci 1-0050: PD TX, type: 0x5
[ 4.389564] tcpci 1-0050: PD TX complete, status: 0
[ 4.394785] tcpci 1-0050: state change HARD_RESET_SEND -> HARD_RESET_START
[ 4.403601] tcpci 1-0050: state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF
[ 4.411196] tcpci 1-0050: vconn:=0
[ 4.414978] tcpci 1-0050: Requesting mux state 1, usb-role 2, orientation 2
[ 4.422366] tcpci 1-0050: pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms
[ 5.082397] tcpci 1-0050: state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[ 5.093960] tcpci 1-0050: state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP
[ 5.101032] tcpci 1-0050: state change SNK_STARTUP -> SNK_DISCOVERY
[ 5.107311] tcpci 1-0050: Setting voltage/current limit 5000 mV 0 mA
[ 5.113688] tcpci 1-0050: state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[ 5.121577] tcpci 1-0050: pending state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND @ 310 ms
[ 5.440826] tcpci 1-0050: state change SNK_WAIT_CAPABILITIES -> HARD_RESET_SEND [delayed 310 ms]
[ 5.449649] tcpci 1-0050: PD TX, type: 0x5
[ 5.462207] tcpci 1-0050: PD TX complete, status: 0
[ 5.467402] tcpci 1-0050: state change HARD_RESET_SEND -> HARD_RESET_START
[ 5.480229] tcpci 1-0050: state change HARD_RESET_START -> SNK_HARD_RESET_SINK_OFF
[ 5.487814] tcpci 1-0050: vconn:=0
[ 5.492528] tcpci 1-0050: Requesting mux state 1, usb-role 2, orientation 2
[ 5.500184] tcpci 1-0050: pending state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON @ 650 ms
[ 6.160197] tcpci 1-0050: state change SNK_HARD_RESET_SINK_OFF -> SNK_HARD_RESET_SINK_ON [delayed 650 ms]
[ 6.170998] tcpci 1-0050: state change SNK_HARD_RESET_SINK_ON -> SNK_STARTUP
[ 6.178058] tcpci 1-0050: state change SNK_STARTUP -> SNK_DISCOVERY
[ 6.184330] tcpci 1-0050: Setting voltage/current limit 5000 mV 0 mA
[ 6.190694] tcpci 1-0050: state change SNK_DISCOVERY -> SNK_WAIT_CAPABILITIES
[ 6.199432] tcpci 1-0050: pending state change SNK_WAIT_CAPABILITIES -> SNK_READY @ 310 ms
[ 6.518144] tcpci 1-0050: state change SNK_WAIT_CAPABILITIES -> SNK_READY [delayed 310 ms]

```

A bad boot (via a USB hub) looks like this

```

[ 2.573714] tcpci 1-0050: Setting voltage/current limit 0 mV 0 mA
[ 2.588084] tcpci 1-0050: polarity 0
[ 2.593368] random: fast init done
[ 2.597157] tcpci 1-0050: Requesting mux state 0, usb-role 0, orientation 0
[ 2.606898] tcpci 1-0050: state change INVALID_STATE -> SNK_UNATTACHED
[ 2.614139] tcpci 1-0050: CC1: 0 -> 4, CC2: 0 -> 0 [state SNK_UNATTACHED, polarity 0, connected]
[ 2.622935] tcpci 1-0050: state change SNK_UNATTACHED -> SNK_ATTACH_WAIT
[ 2.629648] tcpci 1-0050: state change SNK_ATTACH_WAIT -> PORT_RESET
[ 2.636015] tcpci 1-0050: 1-0050: registered
[ 2.645016] tcpci 1-0050: Setting voltage/current limit 0 mV 0 mA
[ 2.649889] ALSA device list:
[ 2.651137] tcpci 1-0050: polarity 0
[ 2.654108] #0: imx-spdif
[ 2.659325] tcpci 1-0050: Requesting mux state 0, usb-role 0, orientation 0
[ 2.660491] #1: imx-audio-micfil
[ 2.667628] imx6q-pcie 33800000.pcie: Link up
[ 2.670836] #2: bt-sco-audio
[ 2.675197] imx6q-pcie 33800000.pcie: Link up, Gen2
[ 2.678253] #3: wm8524-audio
[ 2.687083] tcpci 1-0050: cc:=0
[ 2.691422] tcpci 1-0050: pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms
[ 2.699612] tcpci 1-0050: state change PORT_RESET -> PORT_RESET_WAIT_OFF [delayed 100 ms]
[ 2.707795] tcpci 1-0050: 0
U-Boot SPL 2021.04-imx_v2021.04_5.10.35_2.0.0+g3463140881 (Jun 08 2021 - 01:39:44 +0000)

```

It feels like the USB hub being detected then results in some "reset" code flow which is resulting in the power being interrupted but this is just my guess at this time.

This is becoming a real time sink so would really appreciate any help and advice to move us along.

Thanks & Kind Regards,

Alex

0 Kudos
0 Replies