Skip to content

USC-C not working in yocto build #2004

@razvanphp

Description

@razvanphp

As an initial status, when we first tried to flash the ConnecTech Boson board, the main device tree file had commented out the USB-C OTG functionality, otherwise flashing would get stuck. After modifying the commented section of the device tree with a few changes, the board now was able to flash with this section uncommented.
After being able to flash, when connecting the board’s USB-C to a peripheral or to a PC, the port does not configure either host or device mode. Possible cause: bug on driver code for USB-C mode management and/or missing device tree configuration

Replicate issue
For replicating the issue, boot the board without any USB-C connected to it.
Device mode.
Connecting USC-C port from board to PC.
Dmesg log:

[Sep 3 20:27] tegra-xudc 3550000.usb: XUDC: ROLE SWITCH DEVICE MODE On [ +0.006655] tegra-xudc 3550000.usb: device mode on
[ +0.000146] (null) usb2-0: tegra186_utmi_phy_set_mode: mode 11
[ +0.000173] tegra-xudc 3550000.usb: INSIDE DEVICE MODE ON

Important key points:

  • No “enable_regulator” called for cti-boson-otg-vbus.
  • (null) usb2-0: tegra186_utmi_phy_set_mode: mode 11 -> null references the port.

Disconnect USC-C cable from PC. Dmesg log:

Sep 3 20:38] tegra-xudc 3550000.usb: XUDC: ROLE SWITCH DEVICE MODE OFF
[ +0.000188] tegra-xudc 3550000.usb: device mode off
[ +0.000127] (null) usb2-0: tegra186_utmi_phy_set_mode: mode 11
[ +0.000148] (null) usb2-0: XUDC: INSIDE TEGRA186_UTMI_PHY_SET: MODE 11, PORT: 000000009b016b7f, SUBMODE: 0
[ +0.000258] USBC-REGULATOR: INSIDE REGULATOR_IS_ENABLED for cti-boson-otg-vbus, regulator always on: 1
[ +0.000254] USBC-REGULATOR: INSIDE _regulator_disable called on cti-boson-otg-vbus by regulator_disable+0x50/0xa0, enable_count=0, use_count=1
[ +0.000371] ------------[ cut here ]------------
[ +0.000107] unbalanced disables for cti-boson-otg-vbus
[ +0.000139] WARNING: CPU: 7 PID: 548 at /usr/src/kernel/drivers/regulator/core.c:3018 _regulator_disable+0x134/0x1f8

Important key points:

  • USBC-REGULATOR: INSIDE REGULATOR_IS_ENABLED for cti-boson-otg-vbus, regulator always on: 1 -> Suggest regulator is enabled but;
  • USBC-REGULATOR: INSIDE _regulator_disable called on cti-boson-otg-vbus by regulator_disable+0x50/0xa0, enable_count=0, use_count=1 -> enable_count=0 Hints that the regulator was never actually enabled.
  • This prompts the warning message -> unbalanced disables for cti-boson-otg-vbus Where the driver tried to disable a regulator that was never enabled.

Host mode.
Connect a peripheral (USC-C mouse for example) to the USB-C port on the board:

Dmesg log:

[Sep 3 20:46] (null) usb2-0: tegra186_utmi_phy_set_mode: mode 11
[ +0.000168] (null) usb2-0: XUDC: INSIDE TEGRA186_UTMI_PHY_SET: MODE 11, PORT: 000000009fa5d5a1, SUBMODE: 1
[ +0.000256] USBC-REGULATOR: INSIDE _regulator_enable called on cti-boson-otg-vbus by regulator_enable+0x50/0xa0, enable_count=0, use_count=1
[ +0.000366] [ +0.000118] [ +0.000079] [ +0.000007] [ +0.000359] [ +0.000041] [ +0.000061] [ +0.000195]
[ +0.000116] [ +0.000061] [ +0.000018] [ +0.000170]
tegra-xusb 3610000.usb: xHCI host controller not responding, assume dead CPU:0, Error: cbb-fabric@0x13a00000, irq=33
tegra-xusb 3610000.usb: HC died; cleaning up **************************************
CPU:0, Error:cbb-fabric, Errmon:2
tegra-xusb 3610000.usb: failed to set SS PP 0
Error Code Overflow
Error Code
tegra-xusb 3610000.usb: failed to set HS PP 0
MASTER_ID : CCPLEX Address : 0x3610420
: PWRDOWN_ERR
: Multiple PWRDOWN_ERR
: PWRDOWN_ERR
[ +0.000072] [ +0.000089] [ +0.000427] [ +0.000308] [ +0.000003] [ +0.000656] [ +0.000274] [ +0.000311] [ +0.000306] [ +0.000270] [ +0.000226] [ +0.000272] [ +0.000269] [ +0.000346] [ +0.002903]
Cache Protection Access_Type Access_ID Fabric Slave_Id Burst_length Burst_type Beat_size VQC GRPSEC FALCONSEC Slave
: 0x1 -- Bufferable
: 0x2 -- Unprivileged, Non-Secure, Data Access : Read
: 0x14
: cbb-fabric
: 0x22
: 0x0
: 0x1
: 0x2
: 0x0
: 0x7e
: 0x0
: AXI2APB_16
**************************************
usb-conn-gpio 3520000.padctl:ports:usb2-0:connector: repeated role: host

Important key points:

  • USBC-REGULATOR: INSIDE _regulator_enable called on cti-boson-otg-vbus by regulator_enable+0x50/0xa0, enable_count=0, use_count=1 -> This is enabling the regulator but right after;
  • tegra-xusb 3610000.usb: xHCI host controller not responding, assume dead with an error code of: PWRDOWN_ERR. Meaning the xusb driver tried to access a regulator that was powered down.

Disconnecting the peripheral from the board’s USC-C port.

[Sep 3 21:15] (null) usb2-0: tegra186_utmi_phy_set_mode: mode 11
[ +0.000168] (null) usb2-0: XUDC: INSIDE TEGRA186_UTMI_PHY_SET: MODE 11, PORT: 000000009fa5d5a1, SUBMODE: 0
[ +0.000258] USBC-REGULATOR: INSIDE REGULATOR_IS_ENABLED for cti-boson-otg-vbus, regulator always on: 1
[ +0.000244] USBC-REGULATOR: INSIDE _regulator_disable called on cti-boson-otg-vbus by regulator_disable+0x50/0xa0, enable_count=1, use_count=2
[ +0.000619] [ +0.000137] [ +0.000112] [ +0.000098] [ +0.000076]
[ +0.000113] [ +0.000078] [ +0.000062] [ +0.000069] [ +0.000088] [ +0.000151] [ +0.000060] [ +0.000004]
CPU:0, Error: cbb-fabric@0x13a00000, irq=33 **************************************
CPU:0, Error:cbb-fabric, Errmon:2
Error Code Overflow
Error Code MASTER_ID Address Cache Protection Access_Type Access_ID Fabric
: PWRDOWN_ERR
: Multiple PWRDOWN_ERR
: PWRDOWN_ERR : CCPLEX
: 0x3610420
: 0x1 -- Bufferable
: 0x2 -- Unprivileged, Non-Secure, Data Access : Read
: 0x12
: cbb-fabric
[ +0.000121] [ +0.000057] [ +0.000057] [ +0.000239] [ +0.000270] [ +0.000233] [ +0.000268] [ +0.000275] [ +0.000349]
Slave_Id Burst_length Burst_type Beat_size VQC GRPSEC FALCONSEC Slave
: 0x22 : 0x0
: 0x1
: 0x2
: 0x0
: 0x7e
: 0x0
: AXI2APB_16
6.780809] tegra-xusb 3610000.usb: irq 147, io mem 0x03610000
6.785621] tegra-xusb 3610000.usb: xHCI Host Controller
6.789721] tegra-xusb 3610000.usb: new USB bus registered, assigned bus number 2 6.796024] tegra-xusb 3610000.usb: Host supports USB 3.1 Enhanced SuperSpeed
10.399630] tegra-xudc 3550000.usb: Adding to iommu group 7

Important key points:

  • USBC-REGULATOR: INSIDE REGULATOR_IS_ENABLED for cti-boson-otg-vbus, regulator always on: 1 -> Suggest regulator is enabled.
  • SBC-REGULATOR: INSIDE _regulator_disable called on cti-boson-otg-vbus by regulator_disable+0x50/0xa0, enable_count=1, use_count=2 -> enable_count=1 This confirms that driver wise the regulator was indeed enabled. But again a PWRDOWN_ERR. Meaning regulator was not powered on.

Relevant dmesg logs
The following logs show the behavior of the regulators when booting up. For reference we will use regulator called VDD_3V3_AO

[ 6.589905] tegra-xusb-padctl 3520000.padctl: failed to setup XUSB ports: -517
[ 6.730775] tegra-xusb 3610000.usb: Adding to iommu group 2
[ 6.767715] tegra-xusb 3610000.usb: Firmware timestamp: 2023-02-10 03:48:10 UTC
[ 6.767882] tegra-xusb 3610000.usb: xHCI Host Controller
[ 6.767995] tegra-xusb 3610000.usb: new USB bus registered, assigned bus number 1
[ 6.773464] tegra-xusb 3610000.usb: hcc params 0x0180ff05 hci version 0x120 quirks 0x0000000000000810
[ [ [ [ [
6.780809] tegra-xusb 3610000.usb: irq 147, io mem 0x03610000
6.785621] tegra-xusb 3610000.usb: xHCI Host Controller
6.789721] tegra-xusb 3610000.usb: new USB bus registered, assigned bus number 2 6.796024] tegra-xusb 3610000.usb: Host supports USB 3.1 Enhanced SuperSpeed
10.399630] tegra-xudc 3550000.usb: Adding to iommu group 7

Important key points:

  • tegra-xusb-padctl 3520000.padctl: failed to set up XUSB ports: -517 -> This is an error probing the padctl. Suggests that may be related to the regulator being powered down.
  • Rest of log confirms xHCI controller being set up. USB 3.1 Enhanced SuperSpeed is also enabled.

After all this investigation, we are out of ideas. It seems to be related to the power on the regulator, blocking the configuration for the device/host mode. But then... why it works with Jetpack and not with Yocto?

Can you please help us find the issue? We can provide more information if you tell us what exactly to look for.

Thank you for your time!
R

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions