All of lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <foss+kernel@0leil.net>
To: Minas Harutyunyan <hminas@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	William Wu <william.wu@rock-chips.com>,
	Bin Yang <yangbin@rock-chips.com>,
	Frank Wang <frank.wang@rock-chips.com>
Subject: [PATCH 0/3] usb: dwc2: fix USB peripheral role in dual-role mode on PX30
Date: Wed,  7 Dec 2022 14:19:15 +0100	[thread overview]
Message-ID: <20221206-dwc2-gadget-dual-role-v1-0-36515e1092cd@theobroma-systems.com> (raw)

From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

On Theobroma Ringneck SoM, USB peripheral role when in dual-role mode does not
work and displays the following error message:
dwc2 ff300000.usb: dwc2_core_reset: HANG! Soft Reset timeout GRSTCTL_CSFTRST

The USB sniffer shows nothing and dumping the host registers is stuck on
HCDMA(0) register.

Note that for some reason it works "fine" on PX30-EVB (there's another issue but
not related to/fixed in this patch series).

Since there's no documentation available for this IP, this patch series is
basically just slightly adapted downstream BSP vendor kernel patches and I
cannot unfortunately give more information than what I have.

This patch series was tested on Theobroma Ringneck SoM on Haikou devkit and PX30
EVB. It fixes Ringneck support and does not break PX30-EVB's.

For reference, the content of those commits can be found in tag
linux-5.10-gen-rkr1, and the following commits have been used:
964d50060bf53a8defd1fc561b9261424f25ddad
ad81c375602819a538ad68d979906c05663046e2
6e6adab8f735bc4fe27a67bdc3144d8fa89250d4
7c3a4e60247fd7f7b04d95d15cb12c63a5c20408

Note that Rockchip kernel called a slightly different implementation of
__dwc2_lowlevel_hw_enable instead of dwc2_lowlevel_hw_enable but it seemed more
right to me to call dwc2_lowlevel_hw_enable as done for the forced peripheral
mode.

I'm assuming the patch disabling phy initialization might need to be made
Rockchip-specific?

To: Minas Harutyunyan <hminas@synopsys.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: William Wu <william.wu@rock-chips.com>
Cc: Frank Wang <frank.wang@rock-chips.com>
Cc: Bin Yang <yangbin@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>

---
Bin Yang (1):
      usb: dwc2: prevent core phy initialisation

Quentin Schulz (2):
      usb: dwc2: disable lpm feature on Rockchip SoCs
      usb: dwc2: power on/off phy for peripheral mode in dual-role mode

 drivers/usb/dwc2/gadget.c   | 6 ++++--
 drivers/usb/dwc2/hcd.c      | 7 +++++++
 drivers/usb/dwc2/params.c   | 4 ++++
 drivers/usb/dwc2/platform.c | 3 ++-
 4 files changed, 17 insertions(+), 3 deletions(-)
---
base-commit: 76dcd734eca23168cb008912c0f69ff408905235
change-id: 20221206-dwc2-gadget-dual-role-aac67e6d42fd

Best regards,
-- 
Quentin Schulz <quentin.schulz@theobroma-systems.com>

             reply	other threads:[~2022-12-07 13:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 13:19 Quentin Schulz [this message]
2022-12-07 13:19 ` [PATCH 1/3] usb: dwc2: disable lpm feature on Rockchip SoCs Quentin Schulz
2022-12-07 13:19 ` [PATCH 2/3] usb: dwc2: power on/off phy for peripheral mode in dual-role mode Quentin Schulz
2022-12-07 13:19 ` [PATCH 3/3] usb: dwc2: prevent core phy initialisation Quentin Schulz
2022-12-08 15:30   ` Greg Kroah-Hartman
2022-12-08 15:53   ` Greg Kroah-Hartman
2022-12-09 11:15     ` Quentin Schulz
2022-12-09 12:13       ` Greg Kroah-Hartman
2022-12-09 12:38         ` Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221206-dwc2-gadget-dual-role-v1-0-36515e1092cd@theobroma-systems.com \
    --to=foss+kernel@0leil.net \
    --cc=frank.wang@rock-chips.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hminas@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=william.wu@rock-chips.com \
    --cc=yangbin@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.