lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251127-controller_scmi_upstream-v1-0-38bcca513c28@oss.qualcomm.com>
Date: Thu, 27 Nov 2025 16:01:43 +0530
From: Sriram Dash <sriram.dash@....qualcomm.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Wesley Cheng <quic_wcheng@...cinc.com>,
        Thinh Nguyen <Thinh.Nguyen@...opsys.com>
Cc: jack.pham@....qualcomm.com, faisal.hassan@....qualcomm.com,
        krishna.kurapati@....qualcomm.com, andersson@...nel.org,
        linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Sriram Dash <sriram.dash@....qualcomm.com>,
        Konrad Dybcio <konradybcio@...nel.org>,
        Shazad Hussain <shazad.hussain@....qualcomm.com>
Subject: [PATCH 0/2] usb: dwc3: qcom: Add support for firmware-managed
 resources

On Qualcomm automotive SoC sa8255p, platform resources like clocks,
interconnect, resets, regulators and GDSC are configured remotely by
firmware.

PM OPP is used to abstract these resources in firmware
and SCMI power protocol is used to request resource operations by using
runtime PM framework APIs such as pm_runtime_get/put_sync to invoke
power_on/_off calls from kernel respectively.

"qcom,snps-dwc3-fw-managed" compatible allows the driver to
determine if device resources are managed by firmware.
Additionally, it makes the power-domains property mandatory
and excludes the clocks property for the IPs where resources
are managed by firmware.

Macros are introduced to represent key lifecycle events:
initialization, system and runtime suspend/resume, and exit.
The driver sets the appropriate resource state during probe,
remove, suspend, and resume operations, enabling bulk ON/OFF
transitions of grouped resources according to the
controller's operational state.

Below architecture diagram explains the firmware managed resource
abstraction:

                                         +--------------------+
                                         |   Shared Memory    |
                                         |                    |
                                         | +----------------+ |       +--------------------+
  +----------------------------+       +-+->  usb-shmem     <-+---+   |    Linux VM        |
  |        Firmware VM         |       | | +----------------+ |   |   |   +----------+     |
  |                            |       | |                    |   |   |   |   USB    |     |
  | +---------+ f +----------+ |       | |                    |   |   |   |  Driver  |     |
  | |Drivers  <---+  SCMI    | |   e   | |         |          |   |   |   +--+----^--+     |
  | | (clks,  | g | Server   +-+-------+ |                    |   |   |      |    |        |
  | |  GDSC,  +--->          | |   h     |         |          |  b|k  |     a|   l|        |
  | |  gpio,  |   +--^-----+-+ |         |                    |   |   |      |    |        |
  | |  resets,|      |     |   |         |         |          |   |   |  +---v----+----+   |
  | |  etc.)  |      |     |   |         |                    |   +---+--+  USB SCMI   |   |
  | +---------+      |     |   |         |                    |       |  |  INSTANCE   |   |
  |                  |     |   |         |  +---------------+ |       |  +-^-----+-----+   |
  |                  |     |   |         |  |  pcie-shmem   | |       |    |     |         |
  +------------------+-----+---+         |  +---------------+ |       +----+-----+---------+
                     |     |             |                    |            |     |
                     |     |             +--------------------+            |     |
                    d|IRQ i|HVC                                           j|IRQ c|HVC
                     |     |                                               |     |
                     |     |                                               |     |
+--------------------+-----v-----------------------------------------------+-----v---------+
|                                              HYPERVISOR                                  |
+------------------------------------------------------------------------------------------+

     +--------+   +--------+                                           +----------+
     | CLOCK  |   |  Reset |                                           |   USB    |
     +--------+   +--------+                                           +----------+

Below architecture diagram explains the PM suspend and resume
sequences (the runtime suspend or resume also will follow similar
flow, using different levels to signal the firmware for managing
respective resources for the operational states):

PM Suspend Sequence

+-----------+    +-----------+    +-----------+    +-------+    +-----------+    +----------------+    +----------+
|Kernel_PM  |    |DWC3_QCOM  |    |DWC3_CORE  |    |  PHY  |    |   PMOPP   |    | SCMI_Transport |    | Firmware |
+-----------+    +-----------+    +-----------+    +-------+    +-----------+    +----------------+    +----------+
     |                |                |              |              |                  |                  |
     | Call suspend   |                |              |              |                  |                  |
     |--------------->|                |              |              |                  |                  |
     |                | Notify core    |              |              |                  |                  |
     |                | for suspend    |              |              |                  |                  |
     |                |--------------->|              |              |                  |                  |
     |                |                | Trigger PHY  |              |                  |                  |
     |                |                | exit         |              |                  |                  |
     |                |                |------------->|              |                  |                  |
     |                |                | Ack PHY exit |              |                  |                  |
     |                |                |<-------------|              |                  |                  |
     |                |                |              |              |                  |                  |
     |                |  core Suspend  |              |              |                  |                  |
     |                |    complete    |              |              |                  |                  |
     |                |<---------------|              |              |                  |                  |
     |                |                |              |              |                  |                  |
     |                |                | dev_pm_set_level(SYSTEM_SUSPEND)               |                  |
     |                |--------------------------------------------->|                  |                  |
     |                |                |              |              |                  |                  |
     |                |                |              |              |                  |                  |
     |                |                |              |              | Forward set_level|                  |
     |                |                |              |              | (channel A,      |                  |
     |                |                |              |              | domain B,        |                  |
     |                |                |              |              | SYSTEM_SUSPEND)  |                  |
     |                |                |              |              |----------------->|                  |
     |                |                |              |              |                  | Pass suspend info|
     |                |                |              |              |                  | (channel A,      |
     |                |                |              |              |                  | domain B,        |
     |                |                |              |              |                  | SYSTEM_SUSPEND)  |
     |                |                |              |              |                  |----------------->|
     |                |                |              |              |                  |                  | Switch off clocks
     |                |                |              |              |                  |                  |  interconnects,
     |                |                |              |              |                  |                  |  disable GDSC,
     |                |                |              |              |                  |                  |  disable VBUS
     |                |                |              |              |                  |                  |
     |                |                |              |              |                  | Ack              |
     |                |                |              |              |                  |<-----------------|
     |                |                |              |              | Ack              |                  |
     |                |                |              |              |<-----------------|                  |
     |                |                |              | Ack          |                  |                  |
     |                |<---------------------------------------------|                  |                  |
     |                |                |              |              |                  |                  |
     |                |                |              |              |                  |                  |
     |<---------------|                |              |              |                  |                  |
     | Suspend        |                |              |              |                  |                  |
     | complete       |                |              |              |                  |                  |
+-----------+    +-----------+    +-----------+    +-------+    +-----------+    +----------------+    +--------+

PM Resume Sequence

+-----------+    +-----------+    +-----------+    +-------+    +-----------+    +----------------+    +----------+
|Kernel_PM  |    |DWC3_QCOM  |    |DWC3_CORE  |    |  PHY  |    |   PMOPP   |    | SCMI_Transport |    | Firmware |
+-----------+    +-----------+    +-----------+    +-------+    +-----------+    +----------------+    +----------+
     |                |                |              |              |                  |                  |
     | Call resume    |                |              |              |                  |                  |
     |--------------->|                |              |              |                  |                  |
     |                | Notify core    |              |              |                  |                  |
     |                | for resume     |              |              |                  |                  |
     |                |--------------->|              |              |                  |                  |
     |                |                | Trigger PHY  |              |                  |                  |
     |                |                | init         |              |                  |                  |
     |                |                |------------->|              |                  |                  |
     |                |                | Ack PHY init |              |                  |                  |
     |                |                |<-------------|              |                  |                  |
     |                |                |              |              |                  |                  |
     |                |  core Resume   |              |              |                  |                  |
     |                |    complete    |              |              |                  |                  |
     |                |<---------------|              |              |                  |                  |
     |                |                |              |              |                  |                  |
     |                |                |              |              |                  |                  |
     |                |                | dev_pm_set_level(SYSTEM_RESUME)                |                  |
     |                |--------------------------------------------->|                  |                  |
     |                |                |              |              | Forward set_level|                  |
     |                |                |              |              | (channel A,      |                  |
     |                |                |              |              | domain B,        |                  |
     |                |                |              |              | SYSTEM_RESUME)   |                  |
     |                |                |              |              |----------------->|                  |
     |                |                |              |              |                  | Pass resume info |
     |                |                |              |              |                  | (channel A,      |
     |                |                |              |              |                  | domain B,        |
     |                |                |              |              |                  | SYSTEM_RESUME)   |
     |                |                |              |              |                  |----------------->|
     |                |                |              |              |                  |                  | Enable VBUS,
     |                |                |              |              |                  |                  | enable GDSC,
     |                |                |              |              |                  |                  | switch ON clocks,
     |                |                |              |              |                  |                  | interconnects
     |                |                |              |              |                  |                  |
     |                |                |              |              |                  | Ack              |
     |                |                |              |              |                  |<-----------------|
     |                |                |              |              | Ack              |                  |
     |                |                |              |              |<-----------------|                  |
     |                |                |              | Ack          |                  |                  |
     |                |<---------------------------------------------|                  |                  |
     |                |                |              |              |                  |                  |
     |                |                |              |              |                  |                  |
     |<---------------|                |              |              |                  |                  |
     | Resume         |                |              |              |                  |                  |
     | complete       |                |              |              |                  |                  |
+-----------+    +-----------+    +-----------+    +-------+    +-----------+    +----------------+    +--------+

Signed-off-by: Sriram Dash <sriram.dash@....qualcomm.com>
---
Depends-on: https://lore.kernel.org/all/20250422231249.871995-1-quic_djaggi@quicinc.com/

---
Sriram Dash (2):
      dt-bindings: usb: qcom,snps-dwc3: Add support for firmware-managed resources
      usb: dwc3: qcom: Support firmware-managed resource states for power management

 .../devicetree/bindings/usb/qcom,snps-dwc3.yaml    | 173 +++++++++++++--------
 drivers/usb/dwc3/dwc3-qcom.c                       |  97 ++++++++++--
 2 files changed, 199 insertions(+), 71 deletions(-)
---
base-commit: c77a6544d8a2364e4bee1b52890f577be27b7296
change-id: 20251127-controller_scmi_upstream-a344bad23bcc

Best regards,
-- 
Sriram Dash <sriram.dash@....qualcomm.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ