mbox series

[00/11] Add multipd remoteproc support

Message ID 1678164097-13247-1-git-send-email-quic_mmanikan@quicinc.com (mailing list archive)
Headers show
Series Add multipd remoteproc support | expand

Message

Manikanta Mylavarapu March 7, 2023, 4:41 a.m. UTC
This patch is based on the IPQ5018, IPQ9574 baseport patches available here
https://lore.kernel.org/linux-arm-msm/20220621161126.15883-1-quic_srichara@quicinc.com/
https://lore.kernel.org/linux-arm-msm/20230217142030.16012-1-quic_devipriy@quicinc.com/

APSS brings Q6 out of reset and then Q6 brings
WCSS block (wifi radio's) out of reset.

				   ---------------
			      -->  |WiFi 2G radio|
			      |	   --------------
			      |
--------	-------	      |
| APSS | --->   |QDSP6|  -----|
---------	-------       |
                              |
      			      |
			      |   --------------
			      --> |WiFi 5G radio|
				  --------------

Problem here is if any radio crashes, subsequently other
radio also should crash because Q6 crashed. Let's say
2G radio crashed, Q6 should pass this info to APSS. Only
Q6 processor interrupts registered with APSS. Obviously
Q6 should crash and raise fatal interrupt to APSS. Due
to this 5G radio also crashed. But no issue in 5G radio,
because of 2G radio crash 5G radio also impacted.

In multi pd model, this problem is resolved. Here WCSS
functionality (WiFi radio's) moved out from Q6 root pd
to a separate user pd. Due to this, radio's independently
pass their status info to APPS with out crashing Q6. So
other radio's won't be impacted.

						---------
					    	|WiFi    |
					    --> |2G radio|
					    | 	---------
------	Start Q6     		-------     |
|    |	------------------>     |     |     |
|    |  Start WCSS PD1 (2G)   	|     |	    |
|APSS|	----------------------->|QDSP6|-----|
|    |	Start WCSS PD1 (5G)	|     |
|    |	----------------------->|     |-----|
------		     		-------     |
					    |
					    |	-----------
					    |-->|WiFi	  |
						|5G radio |
						-----------
According to linux terminology, here consider Q6 as root
i.e it provide all services, WCSS (wifi radio's) as user
i.e it uses services provided by root.

Since Q6 root & WCSS user pd's able to communicate with
APSS individually, multipd remoteproc driver registers
each PD with rproc framework. Here clients (Wifi host drivers)
intrested on WCSS PD rproc, so multipd driver start's root
pd in the context of WCSS user pd rproc start. Similarly
on down path, root pd will be stopped after wcss user pd
stopped.

Here WCSS(user) PD is dependent on Q6(root) PD, so first
q6 pd should be up before wcss pd. After wcss pd goes down,
q6 pd should be turned off.

rproc->ops->start(userpd_rproc) {
	/* Boot root pd rproc */
	rproc_boot(upd_dev->parent);
	---
	/* user pd rproc start sequence */
	---
	---
}
With this way we ensure that root pd brought up before userpd.

rproc->ops->stop(userpd_rproc) {
	---
	---
	/* user pd rproc stop sequence */
	---
	---
	/* Shutdown root pd rproc */
	rproc_shutdown(upd_dev->parent);
}
After userpd rproc stops, root pd rproc will be stopped.
IPQ5018, IPQ9574 supports multipd remoteproc driver.

Manikanta Mylavarapu (11):
  dt-bindings: remoteproc: qcom: Add support for multipd model
  dt-bindings: mailbox: qcom: Add IPQ5018 APCS compatible
  dt-bindings: scm: Add compatible for IPQ5018
  dt-bindings: arm: qcom: Add ipq5018-mp03.5-c1
  dt-bindings: clock: qcom: gcc-ipq9574: Add Q6 gcc clock control
  clk: qcom: IPQ9574: Add q6/wcss clocks
  mailbox: qcom-apcs-ipc: Add IPQ5018 APCS IPC support
  remoteproc: qcom: Add Hexagon based multipd rproc driver
  arm64: dtsi: qcom: ipq5018: enable nodes required for multipd
  arm64: dts: qcom: ipq5018: Add MP03.5-c1 board support
  arm64: dtsi: qcom: ipq9574: Add nodes to bring up multipd

 .../devicetree/bindings/arm/qcom.yaml         |   1 +
 .../bindings/firmware/qcom,scm.yaml           |   1 +
 .../mailbox/qcom,apcs-kpss-global.yaml        |   2 +
 .../bindings/remoteproc/qcom,multipd-pil.yaml | 282 ++++++++
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../arm64/boot/dts/qcom/ipq5018-mp03.5-c1.dts |  64 ++
 arch/arm64/boot/dts/qcom/ipq5018.dtsi         | 130 ++++
 arch/arm64/boot/dts/qcom/ipq9574.dtsi         | 145 ++++
 drivers/clk/qcom/gcc-ipq9574.c                | 119 ++++
 drivers/firmware/qcom_scm.c                   | 114 +++
 drivers/firmware/qcom_scm.h                   |   6 +
 drivers/mailbox/qcom-apcs-ipc-mailbox.c       |   1 +
 drivers/remoteproc/Kconfig                    |  20 +
 drivers/remoteproc/Makefile                   |   1 +
 drivers/remoteproc/qcom_common.c              |  23 +
 drivers/remoteproc/qcom_common.h              |   1 +
 drivers/remoteproc/qcom_q6v5.c                |  41 +-
 drivers/remoteproc/qcom_q6v5.h                |  15 +-
 drivers/remoteproc/qcom_q6v5_adsp.c           |   5 +-
 drivers/remoteproc/qcom_q6v5_mpd.c            | 668 ++++++++++++++++++
 drivers/remoteproc/qcom_q6v5_mss.c            |   4 +-
 drivers/remoteproc/qcom_q6v5_pas.c            |   3 +-
 drivers/soc/qcom/mdt_loader.c                 | 314 ++++++++
 include/dt-bindings/clock/qcom,ipq9574-gcc.h  | 159 +++--
 include/linux/firmware/qcom/qcom_scm.h        |   3 +
 include/linux/soc/qcom/mdt_loader.h           |  19 +
 26 files changed, 2057 insertions(+), 85 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,multipd-pil.yaml
 create mode 100644 arch/arm64/boot/dts/qcom/ipq5018-mp03.5-c1.dts
 create mode 100644 drivers/remoteproc/qcom_q6v5_mpd.c

--
2.34.1