remoteproc: qcom_q6v5_wcss: add native ipq9574 support
Subsystems (6)
v2 cover remoteproc: qcom_q6v5_wcss: add native ipq9574 support
Support loading remoteproc firmware on IPQ9574 with the qcom_q6v5_wcss driver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.
When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced, and believe there is justification for a native remoteproc loader. Besides, this series has improvements to the existing code.
Changes since v1:
- Improve bindings following review feedback
- disable clocks on init failures in q6v7_wcss_reset()
- review-suggetsed readability improvements of qcom_q6v5_wcss
Alexandru Gagniuc (9):
remoteproc: qcom_q6v5_wcss: drop unused clocks from q6v5 struct
dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema
dt-bindings: clock: gcc-ipq9574: add wcss remoteproc clocks
dt-bindings: remoteproc: qcom: add IPQ9574 image loader
arm64: dts: qcom: ipq9574: add wcss remoteproc nodes
clk: qcom: gcc-ipq9574: add wcss remoteproc clocks
remoteproc: qcom_q6v5_wcss: support IPQ9574
remoteproc: qcom_q6v5_wcss: support m3 firmware
remoteproc: qcom_q6v5_wcss: use bulk clk API for q6 clocks in QCS404
.../remoteproc/qcom,ipq8074-wcss-pil.yaml | 268 ++++++++++++ .../bindings/remoteproc/qcom,q6v5.txt | 102 ----- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 101 +++++ drivers/clk/qcom/gcc-ipq9574.c | 378 +++++++++++++++++ drivers/remoteproc/qcom_q6v5_wcss.c | 398 ++++++++++++++---- include/dt-bindings/clock/qcom,ipq9574-gcc.h | 22 + 6 files changed, 1082 insertions(+), 187 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.yaml delete mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
--
2.45.1
PATCH v2 1/9 remoteproc: qcom_q6v5_wcss: drop unused clocks from q6v5 struct
Three of the clocks from struct q6v5_wcss are not populated, and are not used. Remove them.
---
Changes since v1:
- no changes. Moved patch to the start of series.
--- drivers/remoteproc/qcom_q6v5_wcss.c | 3 --- 1 file changed, 3 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +0 -3
@@ -123,10 +123,7 @@ struct q6v5_wcss {struct clk *ahbs_cbcr;struct clk *tcm_slave_cbcr;struct clk *qdsp6ss_abhm_cbcr; -struct clk *qdsp6ss_sleep_cbcr;struct clk *qdsp6ss_axim_cbcr; -struct clk *qdsp6ss_xo_cbcr; -struct clk *qdsp6ss_core_gfmux;struct clk *lcc_bcr_sleep;struct regulator *cx_supply;struct qcom_sysmon *sysmon;
Signature · 1 line
2.45.1
Re: [PATCH v2 1/9] remoteproc: qcom_q6v5_wcss: drop unused clocks from q6v5 struct
Quoted 5 lines · Alexandru Gagniuc
Three of the clocks from struct
q6v5_wcssare not populated, and are not used. Remove them.Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
Drop blank line. There are no spacers between tags.
Quoted 2 lines
Signed-off-by Alexandru Gagniuc <[email protected]>---
Best regards,
Krzysztof
Re: [PATCH v2 1/9] remoteproc: qcom_q6v5_wcss: drop unused clocks from q6v5 struct
In reply to Alexandru GagniucQuoted 7 lines · Alexandru Gagniuc
Three of the clocks from struct
q6v5_wcssare not populated, and are not used. Remove them.Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")Signed-off-by Alexandru Gagniuc <[email protected]>---
Konrad
PATCH v2 2/9 dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema
In reply to Alexandru GagniucConvert the QCS404 and IPQ WCSS Peripheral Image Loader bindings to DT schema. The text bindngs incorrectly implied that IPQ8074 needs only one qcom,smem-states entry. This is only true for QCS404. IPQ8074 requires both "stop" and "shutdown".
The example is to be added in a subsequent commit that adds the IPQ9574 binding.
---
Changes since RFC
- Add Bjorn (SOC maintainer) as maintaner for binding
- rename binding from ipq9574 to ipq8074
- use a real person instead of placeholder as maintainer
- drop redundant minItems and descriptions
- merge if: clauses as suggested by Krzysztof
- various other fixes suggested by Krzysztof
--- .../remoteproc/qcom,ipq8074-wcss-pil.yaml | 157 ++++++++++++++++++ .../bindings/remoteproc/qcom,q6v5.txt | 102 ------------ 2 files changed, 157 insertions(+), 102 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.yaml delete mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.yaml new file +157 -0
@@ -0,0 +1,157 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/remoteproc/qcom,ipq8074-wcss-pil.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm IPQ WCSS Peripheral Image Loader + +maintainers: + - Bjorn Andersson <[email protected]> + - Alexandru Gagniuc <[email protected]> + +description: + The IPQ WCSS peripheral image loader is used to load firmware on the Qualcomm + Q6 processor that exposes WiFi-6 devices to the OS via the AHB bus. It is + generally used by ath11k to start up the wireless firmware. + +properties: + compatible: + enum: + - qcom,ipq8074-wcss-pil + - qcom,qcs404-wcss-pil + + reg: + maxItems: 2 + + reg-names: + items: + - const: qdsp6 + - const: rmb + + interrupts: + maxItems: 5 + + interrupt-names: + items: + - const: wdog + - const: fatal + - const: ready + - const: handover + - const: stop-ack + + resets: + maxItems: 3 + + reset-names: + items: + - const: wcss_aon_reset + - const: wcss_reset + - const: wcss_q6_reset + + clocks: + maxItems: 10 + + clock-names: + maxItems: 10 + + cx-supply: + description: + reference to the regulators used for the booting of the Hexagon core + + memory-region: + maxItems: 1 + + qcom,halt-regs: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + A phandle reference to a syscon representing TCSR followed by the three + offsets within syscon for q6, wcss and nc halt registers. + items: + - items: + - description: phandle to TCSR_MUTEX registers + - description: offset to the Q6 halt register + - description: offset to the wcss halt register + - description: offset to the nc halt register + + qcom,smem-states: + $ref: /schemas/types.yaml#/definitions/phandle-array + maxItems: 2 + description: States used by the AP to signal the remote processor + + qcom,smem-state-names: + maxItems: 2 + description: + Names of the states used by the AP to signal the remote processor + + glink-edge: + $ref: /schemas/remoteproc/qcom,glink-edge.yaml# + description: + Qualcomm G-Link subnode which represents communication edge, channels + and devices related to the Modem. + +required: + - compatible + - reg + - reg-names + - interrupts-extended + - interrupt-names + - memory-region + - qcom,halt-regs + - qcom,smem-states + - qcom,smem-state-names + +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq8074-wcss-pil + then: + properties: + qcom,smem-states: + items: + - description: Shutdown Q6 + - description: Stop Q6 + qcom,smem-state-names: + items: + - const: shutdown + - const: stop + clock-names: false + clocks: false + + - if: + properties: + compatible: + contains: + enum: + - qcom,qcs404-wcss-pil + then: + properties: + qcom,smem-states: + maxItems: 1 + qcom,smem-state-names: + items: + - const: stop + clocks: + minItems: 10 + maxItems: 10 + clock-names: + items: + - const: xo + - const: gcc_abhs_cbcr + - const: gcc_axim_cbcr + - const: lcc_ahbfabric_cbc + - const: tcsr_lcc_cbc + - const: lcc_abhs_cbc + - const: lcc_tcm_slave_cbc + - const: lcc_abhm_cbc + - const: lcc_axim_cbc + - const: lcc_bcr_sleep + required: + - clocks + - clock-names + - cx-supply + +additionalProperties: false
Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt deleted +0 -102
102 lines not on this page · raw message
Signature · 1 line
2.45.1
Re: [PATCH v2 2/9] dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema
Quoted 10 lines · Alexandru Gagniuc
Convert the QCS404 and IPQ WCSS Peripheral Image Loader bindings to DT schema. The text bindngs incorrectly implied that IPQ8074 needs only one qcom,smem-states entry. This is only true for QCS404. IPQ8074 requires both "stop" and "shutdown".
The example is to be added in a subsequent commit that adds the IPQ9574 binding.
Signed-off-by Alexandru Gagniuc <[email protected]>
Best regards,
Krzysztof
PATCH v2 3/9 dt-bindings: clock: gcc-ipq9574: add wcss remoteproc clocks
In reply to Alexandru GagniucCommit da040d560319 ("dt-bindings: clock: qcom: gcc-ipq9574: remove q6 bring up clock macros") removed these clocks on the idea that Q6 firmware is responsible for clock bringup. That statement seems incorrect, as these clocks need to be enabled before the Q6 is booted. Otherwise, the host CPU core that starts the Q6 hangs.
Perhaps the statement meant that the TrustZone firmware will start the clocks. This only happens in PAS mode. Under native OS loading, the host needs these clocks, so add them back.
Besides the clocks that were erroneously removed, also add defines for GCC_WCSS_AHB_S_CLK, GCC_WCSS_AXI_M_CLK, and GCC_Q6_AXIM2_CLK, as all these clocks are required to operate the remoteproc.
--- include/dt-bindings/clock/qcom,ipq9574-gcc.h | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+)
include/dt-bindings/clock/qcom,ipq9574-gcc.h +22 -0
@@ -132,8 +132,16 @@#define GCC_NSSNOC_SNOC_1_CLK 123#define GCC_QDSS_ETR_USB_CLK 124#define WCSS_AHB_CLK_SRC 125 +#define GCC_Q6_AHB_CLK 126 +#define GCC_Q6_AHB_S_CLK 127 +#define GCC_WCSS_ECAHB_CLK 128 +#define GCC_WCSS_ACMT_CLK 129 +#define GCC_SYS_NOC_WCSS_AHB_CLK 130#define WCSS_AXI_M_CLK_SRC 131 +#define GCC_ANOC_WCSS_AXI_M_CLK 132#define QDSS_AT_CLK_SRC 133 +#define GCC_Q6SS_ATBM_CLK 134 +#define GCC_WCSS_DBG_IFC_ATB_CLK 135#define GCC_NSSNOC_ATB_CLK 136#define GCC_QDSS_AT_CLK 137#define GCC_SYS_NOC_AT_CLK 138
@@ -146,18 +154,27 @@#define QDSS_TRACECLKIN_CLK_SRC 145#define GCC_QDSS_TRACECLKIN_CLK 146#define QDSS_TSCTR_CLK_SRC 147 +#define GCC_Q6_TSCTR_1TO2_CLK 148 +#define GCC_WCSS_DBG_IFC_NTS_CLK 149#define GCC_QDSS_TSCTR_DIV2_CLK 150#define GCC_QDSS_TS_CLK 151#define GCC_QDSS_TSCTR_DIV4_CLK 152#define GCC_NSS_TS_CLK 153#define GCC_QDSS_TSCTR_DIV8_CLK 154#define GCC_QDSS_TSCTR_DIV16_CLK 155 +#define GCC_Q6SS_PCLKDBG_CLK 156 +#define GCC_Q6SS_TRIG_CLK 157 +#define GCC_WCSS_DBG_IFC_APB_CLK 158 +#define GCC_WCSS_DBG_IFC_DAPBUS_CLK 159#define GCC_QDSS_DAP_CLK 160#define GCC_QDSS_APB2JTAG_CLK 161#define GCC_QDSS_TSCTR_DIV3_CLK 162#define QPIC_IO_MACRO_CLK_SRC 163#define GCC_QPIC_IO_MACRO_CLK 164#define Q6_AXI_CLK_SRC 165 +#define GCC_Q6_AXIM_CLK 166 +#define GCC_WCSS_Q6_TBU_CLK 167 +#define GCC_MEM_NOC_Q6_AXI_CLK 168#define Q6_AXIM2_CLK_SRC 169#define NSSNOC_MEMNOC_BFDCD_CLK_SRC 170#define GCC_NSSNOC_MEMNOC_CLK 171
@@ -182,6 +199,7 @@#define GCC_UNIPHY2_SYS_CLK 190#define GCC_CMN_12GPLL_SYS_CLK 191#define GCC_NSSNOC_XO_DCD_CLK 192 +#define GCC_Q6SS_BOOT_CLK 193#define UNIPHY_SYS_CLK_SRC 194#define NSS_TS_CLK_SRC 195#define GCC_ANOC_PCIE0_1LANE_M_CLK 196
@@ -203,4 +221,8 @@#define GCC_PCIE2_PIPE_CLK 212#define GCC_PCIE3_PIPE_CLK 213#define GPLL0_OUT_AUX 214 +#define GCC_WCSS_AHB_S_CLK 215 +#define GCC_WCSS_AXI_M_CLK 216 +#define GCC_Q6_AXIM2_CLK 217 +#endif
Signature · 1 line
2.45.1
Re: [PATCH v2 3/9] dt-bindings: clock: gcc-ipq9574: add wcss remoteproc clocks
Quoted 10 lines · Alexandru Gagniuc
Commit
da040d560319("dt-bindings: clock: qcom: gcc-ipq9574: remove q6 bring up clock macros") removed these clocks on the idea that Q6 firmware is responsible for clock bringup. That statement seems incorrect, as these clocks need to be enabled before the Q6 is booted. Otherwise, the host CPU core that starts the Q6 hangs.Perhaps the statement meant that the TrustZone firmware will start the clocks. This only happens in PAS mode. Under native OS loading, the host needs these clocks, so add them back.
Quoted 8 lines
Besides the clocks that were erroneously removed, also add defines for
GCC_WCSS_AHB_S_CLK,GCC_WCSS_AXI_M_CLK, andGCC_Q6_AXIM2_CLK, as all these clocks are required to operate the remoteproc.Signed-off-by Alexandru Gagniuc <[email protected]>--- include/dt-bindings/clock/qcom,ipq9574-gcc.h | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+)
Best regards,
Krzysztof
PATCH v2 4/9 dt-bindings: remoteproc: qcom: add IPQ9574 image loader
In reply to Alexandru GagniucDocument the IPQ9574 native (non-PAS) WCSS image loader. It is similar to IPQ8074 WCSS, but requires several new clocks. These clocks must be enabled by the host in non-PAS mode, and are not optional.
This binding did not have an example, so add one which uses the "qcom,ipq9574-wcss-pil" binding.
---
Changes since v1:
- Fixed order of clock-names
- Also use minItems: for clocks and clock-names
- Explained why example is added to binding.
--- .../remoteproc/qcom,ipq8074-wcss-pil.yaml | 116 +++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.yaml +114 -2
@@ -19,6 +19,7 @@ properties: compatible: enum: - qcom,ipq8074-wcss-pil + - qcom,ipq9574-wcss-pil - qcom,qcs404-wcss-pil reg:
@@ -50,10 +51,12 @@ properties: - const: wcss_q6_reset clocks: - maxItems: 10 + minItems: 10 + maxItems: 13 clock-names: - maxItems: 10 + minItems: 10 + maxItems: 13 cx-supply: description:
@@ -121,6 +124,44 @@ allOf: clock-names: false clocks: false + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq9574-wcss-pil + then: + properties: + clocks: + minItems: 13 + clock-names: + items: + - const: anoc_wcss_axi_m + - const: q6_ahb + - const: q6_ahb_s + - const: q6_axim + - const: q6ss_boot + - const: mem_noc_q6_axi + - const: sys_noc_wcss_ahb + - const: wcss_acmt + - const: wcss_ecahb + - const: wcss_q6_tbu + - const: q6_axim2 + - const: wcss_ahb_s + - const: wcss_axi_m + qcom,smem-states: + items: + - description: Shutdown Q6 + - description: Stop Q6 + qcom,smem-state-names: + items: + - const: shutdown + - const: stop + + required: + - clocks + - clock-names + - if: properties: compatible:
@@ -155,3 +196,74 @@ allOf: - cx-supply additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,ipq9574-gcc.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/reset/qcom,ipq9574-gcc.h> + + q6v5_wcss: remoteproc@cd00000 { + compatible = "qcom,ipq9574-wcss-pil"; + reg = <0x0cd00000 0x4040>, + <0x004ab000 0x20>; + reg-names = "qdsp6", "rmb"; + + interrupts-extended = <&intc GIC_SPI 325 IRQ_TYPE_EDGE_RISING>, + <&wcss_smp2p_in 0 IRQ_TYPE_NONE>, + <&wcss_smp2p_in 1 IRQ_TYPE_NONE>, + <&wcss_smp2p_in 2 IRQ_TYPE_NONE>, + <&wcss_smp2p_in 3 IRQ_TYPE_NONE>; + interrupt-names = "wdog", "fatal", "ready", + "handover", "stop-ack"; + + resets = <&gcc GCC_WCSSAON_RESET>, + <&gcc GCC_WCSS_BCR>, + <&gcc GCC_WCSS_Q6_BCR>; + reset-names = "wcss_aon_reset", + "wcss_reset", + "wcss_q6_reset"; + + clocks = <&gcc GCC_ANOC_WCSS_AXI_M_CLK>, + <&gcc GCC_Q6_AHB_CLK>, + <&gcc GCC_Q6_AHB_S_CLK>, + <&gcc GCC_Q6_AXIM_CLK>, + <&gcc GCC_Q6SS_BOOT_CLK>, + <&gcc GCC_MEM_NOC_Q6_AXI_CLK>, + <&gcc GCC_SYS_NOC_WCSS_AHB_CLK>, + <&gcc GCC_WCSS_ACMT_CLK>, + <&gcc GCC_WCSS_ECAHB_CLK>, + <&gcc GCC_WCSS_Q6_TBU_CLK>, + <&gcc GCC_WCSS_AHB_S_CLK>, + <&gcc GCC_Q6_AXIM2_CLK>, + <&gcc GCC_WCSS_AXI_M_CLK>; + + clock-names = "anoc_wcss_axi_m", + "q6_ahb", + "q6_ahb_s", + "q6_axim", + "q6ss_boot", + "mem_noc_q6_axi", + "sys_noc_wcss_ahb", + "wcss_acmt", + "wcss_ecahb", + "wcss_q6_tbu", + "q6_axim2", + "wcss_ahb_s", + "wcss_axi_m"; + + qcom,halt-regs = <&tcsr 0x18000 0x1b000 0xe000>; + + qcom,smem-states = <&wcss_smp2p_out 0>, + <&wcss_smp2p_out 1>; + qcom,smem-state-names = "shutdown", + "stop"; + memory-region = <&q6_region>; + + glink-edge { + interrupts = <GIC_SPI 321 IRQ_TYPE_EDGE_RISING>; + label = "rtr"; + qcom,remote-pid = <1>; + mboxes = <&apcs_glb 8>; + }; + };
Signature · 1 line
2.45.1
Re: [PATCH v2 4/9] dt-bindings: remoteproc: qcom: add IPQ9574 image loader
Quoted 8 lines · Alexandru Gagniuc
Document the IPQ9574 native (non-PAS) WCSS image loader. It is similar to IPQ8074 WCSS, but requires several new clocks. These clocks must be enabled by the host in non-PAS mode, and are not optional.
This binding did not have an example, so add one which uses the "qcom,ipq9574-wcss-pil" binding.
Signed-off-by Alexandru Gagniuc <[email protected]>
Best regards,
Krzysztof
PATCH v2 5/9 arm64: dts: qcom: ipq9574: add wcss remoteproc nodes
In reply to Alexandru GagniucThe WCSS remoteproc is typically used by ath11k to load wifi firmware to the Hexagon q6 procesor. Add the nodes required to bring up this processor.
--- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 101 ++++++++++++++++++++++++++ 1 file changed, 101 insertions(+)
arch/arm64/boot/dts/qcom/ipq9574.dtsi +101 -0
@@ -226,6 +226,37 @@ smem@4aa00000 { hwlocks = <&tcsr_mutex 3>; no-map; }; + + + q6_region: wcnss@4ab00000 { + no-map; + reg = <0x0 0x4ab00000 0x0 0x02b00000>; + }; + }; + + wcss: smp2p-wcss { + compatible = "qcom,smp2p"; + qcom,smem = <435>, <428>; + + interrupt-parent = <&intc>; + interrupts = <GIC_SPI 322 IRQ_TYPE_EDGE_RISING>; + + mboxes = <&apcs_glb 9>; + + qcom,local-pid = <0>; + qcom,remote-pid = <1>; + + wcss_smp2p_out: master-kernel { + qcom,entry-name = "master-kernel"; + qcom,smp2p-feature-ssr-ack; + #qcom,smem-state-cells = <1>; + }; + + wcss_smp2p_in: slave-kernel { + qcom,entry-name = "slave-kernel"; + interrupt-controller; + #interrupt-cells = <2>; + }; }; soc: soc@0 {
@@ -903,6 +934,76 @@ frame@b128000 { }; }; + q6v5_wcss: remoteproc@cd00000 { + compatible = "qcom,ipq9574-wcss-pil"; + reg = <0x0cd00000 0x4040>, + <0x004ab000 0x20>; + reg-names = "qdsp6", + "rmb"; + + interrupts-extended = <&intc GIC_SPI 325 IRQ_TYPE_EDGE_RISING>, + <&wcss_smp2p_in 0 IRQ_TYPE_NONE>, + <&wcss_smp2p_in 1 IRQ_TYPE_NONE>, + <&wcss_smp2p_in 2 IRQ_TYPE_NONE>, + <&wcss_smp2p_in 3 IRQ_TYPE_NONE>; + interrupt-names = "wdog", + "fatal", + "ready", + "handover", + "stop-ack"; + + resets = <&gcc GCC_WCSSAON_RESET>, + <&gcc GCC_WCSS_BCR>, + <&gcc GCC_WCSS_Q6_BCR>; + reset-names = "wcss_aon_reset", + "wcss_reset", + "wcss_q6_reset"; + + clocks = <&gcc GCC_ANOC_WCSS_AXI_M_CLK>, + <&gcc GCC_Q6_AHB_CLK>, + <&gcc GCC_Q6_AHB_S_CLK>, + <&gcc GCC_Q6_AXIM_CLK>, + <&gcc GCC_Q6SS_BOOT_CLK>, + <&gcc GCC_MEM_NOC_Q6_AXI_CLK>, + <&gcc GCC_SYS_NOC_WCSS_AHB_CLK>, + <&gcc GCC_WCSS_ACMT_CLK>, + <&gcc GCC_WCSS_ECAHB_CLK>, + <&gcc GCC_WCSS_Q6_TBU_CLK>, + <&gcc GCC_WCSS_AHB_S_CLK>, + <&gcc GCC_Q6_AXIM2_CLK>, + <&gcc GCC_WCSS_AXI_M_CLK>; + + clock-names = "anoc_wcss_axi_m", + "q6_ahb", + "q6_ahb_s", + "q6_axim", + "q6ss_boot", + "mem_noc_q6_axi", + "sys_noc_wcss_ahb", + "wcss_acmt", + "wcss_ecahb", + "wcss_q6_tbu", + "q6_axim2", + "wcss_ahb_s", + "wcss_axi_m"; + + qcom,halt-regs = <&tcsr 0x18000 0x1b000 0xe000>; + + qcom,smem-states = <&wcss_smp2p_out 0>, + <&wcss_smp2p_out 1>; + qcom,smem-state-names = "shutdown", + "stop"; + + memory-region = <&q6_region>; + + glink-edge { + interrupts = <GIC_SPI 321 IRQ_TYPE_EDGE_RISING>; + label = "rtr"; + qcom,remote-pid = <1>; + mboxes = <&apcs_glb 8>; + }; + }; + pcie1: pcie@10000000 { compatible = "qcom,pcie-ipq9574"; reg = <0x10000000 0xf1d>,
Signature · 1 line
2.45.1
PATCH v2 6/9 clk: qcom: gcc-ipq9574: add wcss remoteproc clocks
In reply to Alexandru GagniucCommit fa1d525404b6 ("clk: qcom: ipq9574: remove q6 bring up clocks") removed these clocks on the idea that Q6 firmware is responsible for clock bringup. That statement seems incorrect, as these clocks need to be enabled before the Q6 is booted. Otherwise, the host CPU core that starts the Q6 hangs.
Perhaps the statement meant that the TrustZone firmware will start the clocks. This only happens in PAS mode. Under native OS loading, the host needs to enable these clocks, so add them back.
Besides the clocks that were erroneously removed, also add defines for GCC_WCSS_AHB_S_CLK, GCC_WCSS_AXI_M_CLK, and GCC_Q6_AXIM2_CLK. These clocks are required in order to operate the remoteproc.
--- drivers/clk/qcom/gcc-ipq9574.c | 378 +++++++++++++++++++++++++++++++++ 1 file changed, 378 insertions(+)
drivers/clk/qcom/gcc-ipq9574.c +378 -0
@@ -2659,6 +2659,24 @@ static struct clk_rcg2 system_noc_bfdcd_clk_src = { }, }; +static struct clk_branch gcc_q6ss_boot_clk = { + .halt_reg =0x25080 , + .halt_check =BRANCH_HALT_SKIP , + .clkr = { + .enable_reg =0x25080 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6ss_boot_clk" , + .parent_hws = (const struct clk_hw *[]) { + &system_noc_bfdcd_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_nssnoc_snoc_clk = { .halt_reg =0x17028 , .clkr = {
@@ -2729,6 +2747,108 @@ static struct clk_rcg2 wcss_ahb_clk_src = { }, }; +static struct clk_branch gcc_q6_ahb_clk = { + .halt_reg =0x25014 , + .clkr = { + .enable_reg =0x25014 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6_ahb_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_ahb_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_q6_ahb_s_clk = { + .halt_reg =0x25018 , + .clkr = { + .enable_reg =0x25018 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6_ahb_s_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_ahb_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_ecahb_clk = { + .halt_reg =0x25058 , + .clkr = { + .enable_reg =0x25058 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_ecahb_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_ahb_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_acmt_clk = { + .halt_reg =0x2505c , + .clkr = { + .enable_reg =0x2505c , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_acmt_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_ahb_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + + +static struct clk_branch gcc_wcss_ahb_s_clk = { + .halt_reg =0x25060 , + .clkr = { + .enable_reg =0x25060 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ) { + .name ="gcc_wcss_ahb_s_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_ahb_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_sys_noc_wcss_ahb_clk = { + .halt_reg =0x2e030 , + .clkr = { + .enable_reg =0x2e030 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_sys_noc_wcss_ahb_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_ahb_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static const struct freq_tbl ftbl_wcss_axi_m_clk_src[] = {F (24000000 ,P_XO ,1 ,0 ,0 ),F (133333333 ,P_GPLL0 ,6 ,0 ,0 ),
@@ -2749,6 +2869,39 @@ static struct clk_rcg2 wcss_axi_m_clk_src = { }, }; +static struct clk_branch gcc_wcss_axi_m_clk = { + .halt_reg =0x25064 , + .clkr = { + .enable_reg =0x25064 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ) { + .name ="gcc_wcss_axi_m_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_axi_m_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_anoc_wcss_axi_m_clk = { + .halt_reg =0x2e0a8 , + .clkr = { + .enable_reg =0x2e0a8 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_anoc_wcss_axi_m_clk" , + .parent_hws = (const struct clk_hw *[]) { + &wcss_axi_m_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static const struct freq_tbl ftbl_qdss_at_clk_src[] = {F (240000000 ,P_GPLL4 ,5 ,0 ,0 ), { }
@@ -2767,6 +2920,40 @@ static struct clk_rcg2 qdss_at_clk_src = { }, }; +static struct clk_branch gcc_q6ss_atbm_clk = { + .halt_reg =0x2501c , + .clkr = { + .enable_reg =0x2501c , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6ss_atbm_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_at_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_dbg_ifc_atb_clk = { + .halt_reg =0x2503c , + .clkr = { + .enable_reg =0x2503c , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_dbg_ifc_atb_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_at_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_nssnoc_atb_clk = { .halt_reg =0x17014 , .clkr = {
@@ -3003,6 +3190,40 @@ static struct clk_fixed_factor qdss_tsctr_div2_clk_src = { }, }; +static struct clk_branch gcc_q6_tsctr_1to2_clk = { + .halt_reg =0x25020 , + .clkr = { + .enable_reg =0x25020 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6_tsctr_1to2_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_tsctr_div2_clk_src.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_dbg_ifc_nts_clk = { + .halt_reg =0x25040 , + .clkr = { + .enable_reg =0x25040 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_dbg_ifc_nts_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_tsctr_div2_clk_src.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_qdss_tsctr_div2_clk = { .halt_reg =0x2d044 , .clkr = {
@@ -3177,6 +3398,74 @@ static struct clk_branch gcc_qdss_tsctr_div16_clk = { }, }; +static struct clk_branch gcc_q6ss_pclkdbg_clk = { + .halt_reg =0x25024 , + .clkr = { + .enable_reg =0x25024 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6ss_pclkdbg_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_dap_sync_clk_src.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_q6ss_trig_clk = { + .halt_reg =0x25068 , + .clkr = { + .enable_reg =0x25068 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6ss_trig_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_dap_sync_clk_src.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_dbg_ifc_apb_clk = { + .halt_reg =0x25038 , + .clkr = { + .enable_reg =0x25038 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_dbg_ifc_apb_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_dap_sync_clk_src.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_dbg_ifc_dapbus_clk = { + .halt_reg =0x25044 , + .clkr = { + .enable_reg =0x25044 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_dbg_ifc_dapbus_clk" , + .parent_hws = (const struct clk_hw *[]) { + &qdss_dap_sync_clk_src.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_qdss_dap_clk = { .halt_reg =0x2d058 , .clkr = {
@@ -3298,6 +3587,58 @@ static struct clk_rcg2 q6_axi_clk_src = { }, }; +static struct clk_branch gcc_q6_axim_clk = { + .halt_reg =0x2500c , + .clkr = { + .enable_reg =0x2500c , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_q6_axim_clk" , + .parent_hws = (const struct clk_hw *[]) { + &q6_axi_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_wcss_q6_tbu_clk = { + .halt_reg =0x12050 , + .halt_check =BRANCH_HALT_DELAY , + .clkr = { + .enable_reg =0xb00c , + .enable_mask =BIT (6 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_wcss_q6_tbu_clk" , + .parent_hws = (const struct clk_hw *[]) { + &q6_axi_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_mem_noc_q6_axi_clk = { + .halt_reg =0x19010 , + .clkr = { + .enable_reg =0x19010 , + .enable_mask =BIT (0 ), + .hw.init = &(const struct clk_init_data ) { + .name ="gcc_mem_noc_q6_axi_clk" , + .parent_hws = (const struct clk_hw *[]) { + &q6_axi_clk_src.clkr.hw + }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static const struct freq_tbl ftbl_q6_axim2_clk_src[] = {F (342857143 ,P_GPLL4 ,3.5 ,0 ,0 ), { }
@@ -3323,6 +3664,22 @@ static struct clk_rcg2 q6_axim2_clk_src = { }, }; +static struct clk_branch gcc_q6_axim2_clk = { + .halt_reg =0x25010 , + .clkr = { + .enable_reg =0x25010 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ) { + .name ="gcc_q6_axim2_clk" , + .parent_hws = (const struct clk_hw *[]) { + &q6_axim2_clk_src.clkr.hw }, + .num_parents =1 , + .flags =CLK_SET_RATE_PARENT , + .ops = &clk_branch2_ops, + }, + }, +}; +static const struct freq_tbl ftbl_nssnoc_memnoc_bfdcd_clk_src[] = {F (533333333 ,P_GPLL0 ,1.5 ,0 ,0 ), { }
@@ -3847,8 +4204,18 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [GCC_NSSNOC_SNOC_1_CLK] = &gcc_nssnoc_snoc_1_clk.clkr, [GCC_QDSS_ETR_USB_CLK] = &gcc_qdss_etr_usb_clk.clkr, [WCSS_AHB_CLK_SRC] = &wcss_ahb_clk_src.clkr, + [GCC_Q6_AHB_CLK] = &gcc_q6_ahb_clk.clkr, + [GCC_Q6_AHB_S_CLK] = &gcc_q6_ahb_s_clk.clkr, + [GCC_WCSS_ECAHB_CLK] = &gcc_wcss_ecahb_clk.clkr, + [GCC_WCSS_ACMT_CLK] = &gcc_wcss_acmt_clk.clkr, + [GCC_WCSS_AHB_S_CLK] = &gcc_wcss_ahb_s_clk.clkr, + [GCC_SYS_NOC_WCSS_AHB_CLK] = &gcc_sys_noc_wcss_ahb_clk.clkr, [WCSS_AXI_M_CLK_SRC] = &wcss_axi_m_clk_src.clkr, + [GCC_WCSS_AXI_M_CLK] = &gcc_wcss_axi_m_clk.clkr, + [GCC_ANOC_WCSS_AXI_M_CLK] = &gcc_anoc_wcss_axi_m_clk.clkr, [QDSS_AT_CLK_SRC] = &qdss_at_clk_src.clkr, + [GCC_Q6SS_ATBM_CLK] = &gcc_q6ss_atbm_clk.clkr, + [GCC_WCSS_DBG_IFC_ATB_CLK] = &gcc_wcss_dbg_ifc_atb_clk.clkr, [GCC_NSSNOC_ATB_CLK] = &gcc_nssnoc_atb_clk.clkr, [GCC_QDSS_AT_CLK] = &gcc_qdss_at_clk.clkr, [GCC_SYS_NOC_AT_CLK] = &gcc_sys_noc_at_clk.clkr,
@@ -3861,19 +4228,29 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [QDSS_TRACECLKIN_CLK_SRC] = &qdss_traceclkin_clk_src.clkr, [GCC_QDSS_TRACECLKIN_CLK] = &gcc_qdss_traceclkin_clk.clkr, [QDSS_TSCTR_CLK_SRC] = &qdss_tsctr_clk_src.clkr, + [GCC_Q6_TSCTR_1TO2_CLK] = &gcc_q6_tsctr_1to2_clk.clkr, + [GCC_WCSS_DBG_IFC_NTS_CLK] = &gcc_wcss_dbg_ifc_nts_clk.clkr, [GCC_QDSS_TSCTR_DIV2_CLK] = &gcc_qdss_tsctr_div2_clk.clkr, [GCC_QDSS_TS_CLK] = &gcc_qdss_ts_clk.clkr, [GCC_QDSS_TSCTR_DIV4_CLK] = &gcc_qdss_tsctr_div4_clk.clkr, [GCC_NSS_TS_CLK] = &gcc_nss_ts_clk.clkr, [GCC_QDSS_TSCTR_DIV8_CLK] = &gcc_qdss_tsctr_div8_clk.clkr, [GCC_QDSS_TSCTR_DIV16_CLK] = &gcc_qdss_tsctr_div16_clk.clkr, + [GCC_Q6SS_PCLKDBG_CLK] = &gcc_q6ss_pclkdbg_clk.clkr, + [GCC_Q6SS_TRIG_CLK] = &gcc_q6ss_trig_clk.clkr, + [GCC_WCSS_DBG_IFC_APB_CLK] = &gcc_wcss_dbg_ifc_apb_clk.clkr, + [GCC_WCSS_DBG_IFC_DAPBUS_CLK] = &gcc_wcss_dbg_ifc_dapbus_clk.clkr, [GCC_QDSS_DAP_CLK] = &gcc_qdss_dap_clk.clkr, [GCC_QDSS_APB2JTAG_CLK] = &gcc_qdss_apb2jtag_clk.clkr, [GCC_QDSS_TSCTR_DIV3_CLK] = &gcc_qdss_tsctr_div3_clk.clkr, [QPIC_IO_MACRO_CLK_SRC] = &qpic_io_macro_clk_src.clkr, [GCC_QPIC_IO_MACRO_CLK] = &gcc_qpic_io_macro_clk.clkr, [Q6_AXI_CLK_SRC] = &q6_axi_clk_src.clkr, + [GCC_Q6_AXIM_CLK] = &gcc_q6_axim_clk.clkr, + [GCC_WCSS_Q6_TBU_CLK] = &gcc_wcss_q6_tbu_clk.clkr, + [GCC_MEM_NOC_Q6_AXI_CLK] = &gcc_mem_noc_q6_axi_clk.clkr, [Q6_AXIM2_CLK_SRC] = &q6_axim2_clk_src.clkr, + [GCC_Q6_AXIM2_CLK] = &gcc_q6_axim2_clk.clkr, [NSSNOC_MEMNOC_BFDCD_CLK_SRC] = &nssnoc_memnoc_bfdcd_clk_src.clkr, [GCC_NSSNOC_MEMNOC_CLK] = &gcc_nssnoc_memnoc_clk.clkr, [GCC_NSSNOC_MEM_NOC_1_CLK] = &gcc_nssnoc_mem_noc_1_clk.clkr,
@@ -3896,6 +4273,7 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [GCC_UNIPHY1_SYS_CLK] = &gcc_uniphy1_sys_clk.clkr, [GCC_UNIPHY2_SYS_CLK] = &gcc_uniphy2_sys_clk.clkr, [GCC_CMN_12GPLL_SYS_CLK] = &gcc_cmn_12gpll_sys_clk.clkr, + [GCC_Q6SS_BOOT_CLK] = &gcc_q6ss_boot_clk.clkr, [UNIPHY_SYS_CLK_SRC] = &uniphy_sys_clk_src.clkr, [NSS_TS_CLK_SRC] = &nss_ts_clk_src.clkr, [GCC_ANOC_PCIE0_1LANE_M_CLK] = &gcc_anoc_pcie0_1lane_m_clk.clkr,
Signature · 1 line
2.45.1
PATCH v2 7/9 remoteproc: qcom_q6v5_wcss: support IPQ9574
In reply to Alexandru GagniucQ6 based firmware loading is also present on IPQ9574, when coupled with a wifi-6 device, such as QCN5024. Populate driver data for IPQ9574 with values from the downstream 5.4 kerrnel.
Add the new sequences for the WCSS reset and stop. The downstream 5.4 kernel calls these "Q6V7", so keep the name. This is still worth using with the "q6v5" driver because all other parts of the driver can be seamlessly reused.
The IPQ9574 uses two sets of clocks. the first, dubbed "pre_boot_clks" must be enabled before the Q6 is started by writing the Q6SS_RST_EVB register. The second set of clocks, "clks" should only be enabled after the Q6 is placed out of reset. Otherwise, the host CPU core that tries to start the remoteproc will hang.
The shutdown path requires a small delay between asserting the Q6 and WCSS resets. The delay is handled in q6v7_q6_powerdown(). Also add it in the error path of q6v5_wcss_start().
The downstream kernel had a funny comment, "Pray god and wait for reset to complete", which I decided to keep for entertainment value.
---
Changes since v1:
- rename "q6_clks" to "pre_boot_clks"
- drop step numbers from q6v7_wcss_reset() comments
- disable clocks on init failures in q6v7_wcss_reset()
- Add Q6SS_CBCR_CLKEN macro
--- drivers/remoteproc/qcom_q6v5_wcss.c | 253 +++++++++++++++++++++++++++- 1 file changed, 246 insertions(+), 7 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +246 -7
@@ -31,6 +31,9 @@#define Q6SS_MEM_PWR_CTL 0x0B0#define Q6SS_STRAP_ACC 0x110#define Q6SS_CGC_OVERRIDE 0x034 +#define Q6SS_BOOT_CORE_START 0x400 +#define Q6SS_BOOT_CMD 0x404 +#define Q6SS_BOOT_STATUS 0x408#define Q6SS_BCR_REG 0x6000/* AXI Halt Register Offsets */
@@ -48,7 +51,11 @@/* Q6SS_BRC_RESET */ #define Q6SS_BRC_BLK_ARES BIT(0) +/* QDSP6SS CBCR */ +#define Q6SS_CBCR_CLKEN BIT(0) +/* Q6SS_GFMUX_CTL */ +#define Q6SS_CLK_SRC_MUX BIT(0)#define Q6SS_CLK_ENABLE BIT(1)#define Q6SS_SWITCH_CLK_SRC BIT(8)
@@ -67,6 +74,7 @@#define HALT_CHECK_MAX_LOOPS 200#define Q6SS_XO_CBCR GENMASK(5, 3)#define Q6SS_SLEEP_CBCR GENMASK(5, 2) +#define Q6SS_CORE_CBCR BIT(5)/* Q6SS config/status registers */ #define TCSR_GLOBAL_CFG0 0x0
@@ -77,9 +85,11 @@#define Q6SS_RST_EVB 0x10#define BHS_EN_REST_ACK BIT(0) +#define WCSS_HM_RET BIT(1)#define SSCAON_ENABLE BIT(13)#define SSCAON_BUS_EN BIT(15)#define SSCAON_BUS_MUX_MASK GENMASK(18, 16) +#define SSCAON_MASK GENMASK(17, 15)#define MEM_BANKS 19#define TCSR_WCSS_CLK_MASK 0x1F
@@ -88,6 +98,7 @@#define MAX_HALT_REG 4enum {WCSS_IPQ8074 , +WCSS_IPQ9574 ,WCSS_QCS404 , };
@@ -125,6 +136,12 @@ struct q6v5_wcss {struct clk *qdsp6ss_abhm_cbcr;struct clk *qdsp6ss_axim_cbcr;struct clk *lcc_bcr_sleep; +struct clk_bulk_data *clks; +/* clocks that must be started before the Q6 is booted */ +struct clk_bulk_data *pre_boot_clks; +int num_clks; +int num_pre_boot_clks; +struct regulator *cx_supply;struct qcom_sysmon *sysmon;
@@ -233,6 +250,97 @@ static int q6v5_wcss_reset(struct q6v5_wcss *wcss)return 0 ; } +static int q6v7_wcss_reset (struct q6v5_wcss *wcss,struct rproc *rproc) +{ +int ret; +u32 val; + + ret =regmap_update_bits (wcss->halt_map, + wcss->halt_nc +TCSR_GLOBAL_CFG1 , +0xff00 ,0x1100 ); +if (ret) { +dev_err (wcss->dev,"TCSR_GLOBAL_CFG1 failed\n" ); +return ret; + } + + ret =clk_bulk_prepare_enable (wcss->num_pre_boot_clks, + wcss->pre_boot_clks); +if (ret) { +dev_err (wcss->dev,"failed to enable clocks, err=%d\n" , ret); +return ret; + }; + +/* Write bootaddr to Q6WCSS */ +writel (rproc->bootaddr >>4 , wcss->reg_base +Q6SS_RST_EVB ); + +/* Deassert AON Reset */ + ret =reset_control_deassert (wcss->wcss_aon_reset); +if (ret) { +dev_err (wcss->dev,"wcss_aon_reset failed\n" ); + goto disable_pre_boot_clocks; +return ret; + } + +/* Set MPM configs*/ +/*set CFG[18:15]=1*/ + val =readl (wcss->rmb_base +SSCAON_CONFIG ); + val &= ~SSCAON_MASK ; + val |=SSCAON_BUS_EN ; +writel (val, wcss->rmb_base +SSCAON_CONFIG ); + +/* Wait for SSCAON_STATUS, up to 1 second */ + ret =readl_poll_timeout (wcss->rmb_base +SSCAON_STATUS , + val, (val &0xffff ) ==0x10 ,1000 ,1000000 ); +if (ret) { +dev_err (wcss->dev," Boot Error, SSCAON=0x%08X\n" , val); + goto assert_aon_reset; + } + +/* BHS require xo cbcr to be enabled */ + val =readl (wcss->reg_base +Q6SS_XO_CBCR ); + val |=Q6SS_CBCR_CLKEN ; +writel (val, wcss->reg_base +Q6SS_XO_CBCR ); + +/* Enable core cbcr */ + val =readl (wcss->reg_base +Q6SS_CORE_CBCR ); + val |=Q6SS_CBCR_CLKEN ; +writel (val, wcss->reg_base +Q6SS_CORE_CBCR ); + +/* Enable sleep cbcr */ + val =readl (wcss->reg_base +Q6SS_SLEEP_CBCR ); + val |=Q6SS_CBCR_CLKEN ; +writel (val, wcss->reg_base +Q6SS_SLEEP_CBCR ); + +/* Boot core start */ +writel (0x1 , wcss->reg_base +Q6SS_BOOT_CORE_START ); +writel (0x1 , wcss->reg_base +Q6SS_BOOT_CMD ); + +/* Pray god and wait for reset to complete */ + ret =readl_poll_timeout (wcss->reg_base +Q6SS_BOOT_STATUS , val, + (val &BIT (0 )),1000 ,20000 ); +if (ret) { +dev_err (wcss->dev,"WCSS boot timed out\n" ); + ret = -ETIMEDOUT ; + goto assert_aon_reset; + } + +/* Enable post-boot clocks */ + ret =clk_bulk_prepare_enable (wcss->num_clks, wcss->clks); +if (ret) { +dev_err (wcss->dev,"failed to enable clocks, err=%d\n" , ret); + goto assert_aon_reset; + }; + +return 0 ; + +assert_aon_reset: +reset_control_assert (wcss->wcss_aon_reset); +disable_pre_boot_clocks: +clk_bulk_disable_unprepare (wcss->num_pre_boot_clks, + wcss->pre_boot_clks); +return ret; +} +static int q6v5_wcss_start (struct rproc *rproc) {struct q6v5_wcss *wcss = rproc->priv;
@@ -267,10 +375,18 @@ static int q6v5_wcss_start(struct rproc *rproc)if (ret) goto wcss_q6_reset; -/* Write bootaddr to EVB so that Q6WCSS will jump there after reset */ -writel (rproc->bootaddr >>4 , wcss->reg_base +Q6SS_RST_EVB ); +switch (wcss->version) { +case WCSS_QCS404 : +case WCSS_IPQ8074 : +/* Write bootaddr to Q6WCSS */ +writel (rproc->bootaddr >>4 , wcss->reg_base +Q6SS_RST_EVB ); + ret =q6v5_wcss_reset (wcss); +break ; +case WCSS_IPQ9574 : + ret =q6v7_wcss_reset (wcss, rproc); +break ; + } - ret =q6v5_wcss_reset (wcss);if (ret) goto wcss_q6_reset;
@@ -282,6 +398,7 @@ static int q6v5_wcss_start(struct rproc *rproc) wcss_q6_reset:reset_control_assert (wcss->wcss_q6_reset); +usleep_range (1000 ,2000 ); wcss_reset:reset_control_assert (wcss->wcss_reset);
@@ -635,6 +752,41 @@ static int q6v5_wcss_powerdown(struct q6v5_wcss *wcss)return 0 ; } +static int q6v7_wcss_powerdown (struct q6v5_wcss *wcss) +{ +u32 val; +int ret; + +q6v5_wcss_halt_axi_port (wcss, wcss->halt_map, wcss->halt_wcss); + + val =readl (wcss->rmb_base +SSCAON_CONFIG ); + val &= ~SSCAON_MASK ; + val |=SSCAON_BUS_EN ; +writel (val, wcss->rmb_base +SSCAON_CONFIG ); + + val |=WCSS_HM_RET ; +writel (val, wcss->rmb_base +SSCAON_CONFIG ); + + ret =readl_poll_timeout (wcss->rmb_base +SSCAON_STATUS , + val, (val &0xffff ) ==0x400 ,1000 , +HALT_CHECK_MAX_LOOPS ); +if (ret) { +dev_err (wcss->dev, +"can't get SSCAON_STATUS rc:%d)\n" , ret); +return ret; + } + +usleep_range (2000 ,4000 ); + +reset_control_assert (wcss->wcss_aon_reset); + + val =readl (wcss->rmb_base +SSCAON_CONFIG ); + val &= ~WCSS_HM_RET ; +writel (val, wcss->rmb_base +SSCAON_CONFIG ); + +return 0 ; +} +static int q6v5_q6_powerdown (struct q6v5_wcss *wcss) {int ret;
@@ -702,6 +854,26 @@ static int q6v5_q6_powerdown(struct q6v5_wcss *wcss)return 0 ; } +static void q6v7_q6_powerdown (struct q6v5_wcss *wcss) +{ +u32 val; + +q6v5_wcss_halt_axi_port (wcss, wcss->halt_map, wcss->halt_q6); + +/* Disable Q6 Core clock */ + val =readl (wcss->reg_base +Q6SS_GFMUX_CTL_REG ); + val &= ~Q6SS_CLK_SRC_MUX ; +writel (val, wcss->reg_base +Q6SS_GFMUX_CTL_REG ); + +clk_bulk_disable_unprepare (wcss->num_clks, wcss->clks); +clk_bulk_disable_unprepare (wcss->num_pre_boot_clks, + wcss->pre_boot_clks); + +reset_control_assert (wcss->wcss_q6_reset); +usleep_range (1000 ,2000 ); +reset_control_assert (wcss->wcss_reset); +} +static int q6v5_wcss_stop (struct rproc *rproc) {struct q6v5_wcss *wcss = rproc->priv;
@@ -716,11 +888,21 @@ static int q6v5_wcss_stop(struct rproc *rproc) } } -if (wcss->version ==WCSS_QCS404 ) { +switch (wcss->version) { +case WCSS_QCS404 : ret =q6v5_qcs404_wcss_shutdown (wcss);if (ret)return ret; - }else { +break ; +case WCSS_IPQ9574 : + ret =q6v7_wcss_powerdown (wcss); +if (ret) +return ret; + +q6v7_q6_powerdown (wcss); + +break ; +default : ret =q6v5_wcss_powerdown (wcss);if (ret)return ret;
@@ -729,6 +911,7 @@ static int q6v5_wcss_stop(struct rproc *rproc) ret =q6v5_q6_powerdown (wcss);if (ret)return ret; +break ; }qcom_q6v5_unprepare (&wcss->q6v5);
@@ -835,7 +1018,9 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,if (!wcss->reg_base)return -ENOMEM ; -if (wcss->version ==WCSS_IPQ8074 ) { +switch (wcss->version) { +case WCSS_IPQ8074 : +case WCSS_IPQ9574 : wcss->rmb_base =devm_platform_ioremap_resource_byname (pdev,"rmb" );if (IS_ERR (wcss->rmb_base))return PTR_ERR (wcss->rmb_base);
@@ -962,6 +1147,43 @@ static int q6v5_wcss_init_regulator(struct q6v5_wcss *wcss)return 0 ; } +static int ipq9574_init_clocks (struct q6v5_wcss *wcss) +{ +static const char *const pre_boot_clks[] = { +"anoc_wcss_axi_m" ,"q6_ahb" ,"q6_ahb_s" ,"q6_axim" ,"q6ss_boot" , +"mem_noc_q6_axi" ,"sys_noc_wcss_ahb" ,"wcss_acmt" ,"wcss_ecahb" , +"wcss_q6_tbu" }; +static const char *const clks[] = { +"q6_axim2" ,"wcss_ahb_s" ,"wcss_axi_m" }; +int i, ret; + + wcss->num_clks =ARRAY_SIZE (clks); + wcss->num_pre_boot_clks =ARRAY_SIZE (pre_boot_clks); + + wcss->pre_boot_clks =devm_kcalloc (wcss->dev, wcss->num_pre_boot_clks, +sizeof (*wcss->pre_boot_clks),GFP_KERNEL ); +if (!wcss->pre_boot_clks) +return -ENOMEM ; + + wcss->clks =devm_kcalloc (wcss->dev, wcss->num_clks, +sizeof (*wcss->clks),GFP_KERNEL ); +if (!wcss->clks) +return -ENOMEM ; + +for (i =0 ; i < wcss->num_pre_boot_clks; i++) + wcss->pre_boot_clks[i].id = pre_boot_clks[i]; + +for (i =0 ; i < wcss->num_clks; i++) + wcss->clks[i].id = clks[i]; + + ret =devm_clk_bulk_get (wcss->dev, wcss->num_pre_boot_clks, + wcss->pre_boot_clks); +if (ret <0 ) +return ret; + +return devm_clk_bulk_get (wcss->dev, wcss->num_clks, wcss->clks); +} +static int q6v5_wcss_probe (struct platform_device *pdev) {const struct wcss_data *desc;
@@ -994,7 +1216,8 @@ static int q6v5_wcss_probe(struct platform_device *pdev)if (ret)return ret; -if (wcss->version ==WCSS_QCS404 ) { +switch (wcss->version) { +case WCSS_QCS404 : ret =q6v5_wcss_init_clock (wcss);if (ret)return ret;
@@ -1002,6 +1225,11 @@ static int q6v5_wcss_probe(struct platform_device *pdev) ret =q6v5_wcss_init_regulator (wcss);if (ret)return ret; +break ; +case WCSS_IPQ9574 : + ret =ipq9574_init_clocks (wcss); +if (ret) +return ret; } ret =q6v5_wcss_init_reset (wcss, desc);
@@ -1064,6 +1292,16 @@ static const struct wcss_data wcss_ipq8074_res_init = { .requires_force_stop = true, }; +static const struct wcss_data wcss_ipq9574_res_init = { + .firmware_name ="IPQ9574/q6_fw.mdt" , + .version =WCSS_IPQ9574 , + .crash_reason_smem =WCSS_CRASH_REASON , + .aon_reset_required = true, + .ssr_name ="q6wcss" , + .ops = &q6v5_wcss_ipq8074_ops, + .requires_force_stop = true, +}; +static const struct wcss_data wcss_qcs404_res_init = { .crash_reason_smem =WCSS_CRASH_REASON , .firmware_name ="wcnss.mdt" ,
@@ -1079,6 +1317,7 @@ static const struct wcss_data wcss_qcs404_res_init = {static const struct of_device_id q6v5_wcss_of_match[] = { { .compatible ="qcom,ipq8074-wcss-pil" , .data = &wcss_ipq8074_res_init }, + { .compatible ="qcom,ipq9574-wcss-pil" , .data = &wcss_ipq9574_res_init }, { .compatible ="qcom,qcs404-wcss-pil" , .data = &wcss_qcs404_res_init }, { }, };
Signature · 1 line
2.45.1
PATCH v2 8/9 remoteproc: qcom_q6v5_wcss: support m3 firmware
In reply to Alexandru GagniucIPQ8074, IPQ6018, and IPQ9574 support an m3 firmware image in addtion to the q6 firmware. The firmware releases from qcom provide both q6 and m3 firmware for these SoCs. Support loading the m3 firmware image.
---
Changes since v1:
- Check for -ENOENT from q6v5_wcss_load_aux()
--- drivers/remoteproc/qcom_q6v5_wcss.c | 45 +++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +40 -5
@@ -103,7 +103,8 @@ enum { };struct wcss_data { -const char *firmware_name; +const char *q6_firmware_name; +const char *m3_firmware_name;unsigned int crash_reason_smem;u32 version;bool aon_reset_required;
@@ -160,6 +161,7 @@ struct q6v5_wcss {unsigned int crash_reason_smem;u32 version;bool requires_force_stop; +const char *m3_firmware_name;struct qcom_rproc_glink glink_subdev;struct qcom_rproc_pdm pdm_subdev;
@@ -931,11 +933,41 @@ static void *q6v5_wcss_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *ireturn wcss->mem_region + offset; } +static int q6v5_wcss_load_aux (struct q6v5_wcss *wcss,const char *fw_name) +{ +const struct firmware *extra_fw; +int ret; + +dev_info (wcss->dev,"loading additional firmware image %s\n" , fw_name); + + ret =request_firmware (&extra_fw, fw_name, wcss->dev); +if (ret) +return ret; + + ret =qcom_mdt_load_no_init (wcss->dev, extra_fw, fw_name, + wcss->mem_region, wcss->mem_phys, + wcss->mem_size, &wcss->mem_reloc); + +release_firmware (extra_fw); + +if (ret) +dev_err (wcss->dev,"can't load %s\n" , fw_name); + +return ret; +} +static int q6v5_wcss_load (struct rproc *rproc,const struct firmware *fw) {struct q6v5_wcss *wcss = rproc->priv;int ret; +if (wcss->m3_firmware_name) { + ret =q6v5_wcss_load_aux (wcss, wcss->m3_firmware_name); +/* Continue if M3 firmware does not exist */ +if (ret && (ret != -ENOENT )) +return ret; + } + ret =qcom_mdt_load_no_init (wcss->dev, fw, rproc->firmware, wcss->mem_region, wcss->mem_phys, wcss->mem_size, &wcss->mem_reloc);
@@ -1196,7 +1228,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev)return -EINVAL ; rproc =devm_rproc_alloc (&pdev->dev, pdev->name, desc->ops, - desc->firmware_name,sizeof (*wcss)); + desc->q6_firmware_name,sizeof (*wcss));if (!rproc) {dev_err (&pdev->dev,"failed to allocate rproc\n" );return -ENOMEM ;
@@ -1207,6 +1239,7 @@ static int q6v5_wcss_probe(struct platform_device *pdev) wcss->version = desc->version; wcss->requires_force_stop = desc->requires_force_stop; + wcss->m3_firmware_name = desc->m3_firmware_name; ret =q6v5_wcss_init_mmio (wcss, pdev);if (ret)
@@ -1284,7 +1317,8 @@ static void q6v5_wcss_remove(struct platform_device *pdev) }static const struct wcss_data wcss_ipq8074_res_init = { - .firmware_name ="IPQ8074/q6_fw.mdt" , + .q6_firmware_name ="IPQ8074/q6_fw.mdt" , + .m3_firmware_name ="IPQ8074/m3_fw.mdt" , .crash_reason_smem =WCSS_CRASH_REASON , .aon_reset_required = true, .wcss_q6_reset_required = true,
@@ -1293,7 +1327,8 @@ static const struct wcss_data wcss_ipq8074_res_init = { };static const struct wcss_data wcss_ipq9574_res_init = { - .firmware_name ="IPQ9574/q6_fw.mdt" , + .q6_firmware_name ="IPQ9574/q6_fw.mdt" , + .m3_firmware_name ="IPQ9574/m3_fw.mdt" , .version =WCSS_IPQ9574 , .crash_reason_smem =WCSS_CRASH_REASON , .aon_reset_required = true,
@@ -1304,7 +1339,7 @@ static const struct wcss_data wcss_ipq9574_res_init = {static const struct wcss_data wcss_qcs404_res_init = { .crash_reason_smem =WCSS_CRASH_REASON , - .firmware_name ="wcnss.mdt" , + .q6_firmware_name ="wcnss.mdt" , .version =WCSS_QCS404 , .aon_reset_required = false, .wcss_q6_reset_required = false,
Signature · 1 line
2.45.1
PATCH v2 9/9 remoteproc: qcom_q6v5_wcss: use bulk clk API for q6 clocks in QCS404
In reply to Alexandru GagniucFive of the clocks on QCS404 are consistently enabled and disabled together. Use the bulk clock API to get and enable them. They are enabled after the Q6 reset is deasserted, implying that pre_boot is not the appropriate designator. Store them in wcss->clks.
---
Changes since v1:
- Use wcss->clks, since wcss->q6_clks has been renamed.
--- drivers/remoteproc/qcom_q6v5_wcss.c | 99 ++++++++--------------------- 1 file changed, 28 insertions(+), 71 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +28 -71
@@ -128,14 +128,9 @@ struct q6v5_wcss {u32 halt_nc;struct clk *xo; -struct clk *ahbfabric_cbcr_clk;struct clk *gcc_abhs_cbcr;struct clk *gcc_axim_cbcr; -struct clk *lcc_csr_cbcr;struct clk *ahbs_cbcr; -struct clk *tcm_slave_cbcr; -struct clk *qdsp6ss_abhm_cbcr; -struct clk *qdsp6ss_axim_cbcr;struct clk *lcc_bcr_sleep;struct clk_bulk_data *clks;/* clocks that must be started before the Q6 is booted */
@@ -427,35 +422,16 @@ static int q6v5_wcss_qcs404_power_on(struct q6v5_wcss *wcss)/* Remove reset to the WCNSS QDSP6SS */ reset_control_deassert (wcss->wcss_q6_bcr_reset); -/* Enable Q6SSTOP_AHBFABRIC_CBCR clock */ - ret =clk_prepare_enable (wcss->ahbfabric_cbcr_clk); -if (ret) + ret =clk_bulk_prepare_enable (wcss->num_clks, wcss->clks); +if (ret) { +dev_err (wcss->dev,"failed to enable q6 clocks, err=%d\n" , ret); goto disable_gcc_abhs_cbcr_clk; - -/* Enable the LCCCSR CBC clock, Q6SSTOP_Q6SSTOP_LCC_CSR_CBCR clock */ - ret =clk_prepare_enable (wcss->lcc_csr_cbcr); -if (ret) - goto disable_ahbfabric_cbcr_clk; + };/* Enable the Q6AHBS CBC, Q6SSTOP_Q6SS_AHBS_CBCR clock */ ret =clk_prepare_enable (wcss->ahbs_cbcr);if (ret) - goto disable_csr_cbcr_clk; - -/* Enable the TCM slave CBC, Q6SSTOP_Q6SS_TCM_SLAVE_CBCR clock */ - ret =clk_prepare_enable (wcss->tcm_slave_cbcr); -if (ret) - goto disable_ahbs_cbcr_clk; - -/* Enable the Q6SS AHB master CBC, Q6SSTOP_Q6SS_AHBM_CBCR clock */ - ret =clk_prepare_enable (wcss->qdsp6ss_abhm_cbcr); -if (ret) - goto disable_tcm_slave_cbcr_clk; - -/* Enable the Q6SS AXI master CBC, Q6SSTOP_Q6SS_AXIM_CBCR clock */ - ret =clk_prepare_enable (wcss->qdsp6ss_axim_cbcr); -if (ret) - goto disable_abhm_cbcr_clk; + goto disable_clks;/* Enable the Q6SS XO CBC */ val =readl (wcss->reg_base +Q6SS_XO_CBCR );
@@ -538,17 +514,9 @@ static int q6v5_wcss_qcs404_power_on(struct q6v5_wcss *wcss) val =readl (wcss->reg_base +Q6SS_XO_CBCR ); val &= ~Q6SS_CLK_ENABLE ;writel (val, wcss->reg_base +Q6SS_XO_CBCR ); -clk_disable_unprepare (wcss->qdsp6ss_axim_cbcr); -disable_abhm_cbcr_clk: -clk_disable_unprepare (wcss->qdsp6ss_abhm_cbcr); -disable_tcm_slave_cbcr_clk: -clk_disable_unprepare (wcss->tcm_slave_cbcr); -disable_ahbs_cbcr_clk:clk_disable_unprepare (wcss->ahbs_cbcr); -disable_csr_cbcr_clk: -clk_disable_unprepare (wcss->lcc_csr_cbcr); -disable_ahbfabric_cbcr_clk: -clk_disable_unprepare (wcss->ahbfabric_cbcr_clk); +disable_clks: +clk_bulk_disable_unprepare (wcss->num_clks, wcss->clks); disable_gcc_abhs_cbcr_clk:clk_disable_unprepare (wcss->gcc_abhs_cbcr);
@@ -666,11 +634,7 @@ static int q6v5_qcs404_wcss_shutdown(struct q6v5_wcss *wcss) val &= ~Q6SS_BHS_ON ;writel (val, wcss->reg_base +Q6SS_PWR_CTL_REG ); -clk_disable_unprepare (wcss->ahbfabric_cbcr_clk); -clk_disable_unprepare (wcss->lcc_csr_cbcr); -clk_disable_unprepare (wcss->tcm_slave_cbcr); -clk_disable_unprepare (wcss->qdsp6ss_abhm_cbcr); -clk_disable_unprepare (wcss->qdsp6ss_axim_cbcr); +clk_bulk_disable_unprepare (wcss->num_clks, wcss->clks); val =readl (wcss->reg_base +Q6SS_SLEEP_CBCR ); val &= ~BIT (0 );
@@ -1112,6 +1076,20 @@ static int q6v5_alloc_memory_region(struct q6v5_wcss *wcss)static int q6v5_wcss_init_clock (struct q6v5_wcss *wcss) { +static const char *const bulk_clks[] = { +"lcc_ahbfabric_cbc" ,"tcsr_lcc_cbc" ,"lcc_tcm_slave_cbc" , +"lcc_abhm_cbc" ,"lcc_axim_cbc" }; +int ret, i; + + wcss->num_clks =ARRAY_SIZE (bulk_clks); + wcss->clks =devm_kcalloc (wcss->dev, wcss->num_clks, +sizeof (*wcss->clks),GFP_KERNEL ); +if (!wcss->clks) +return -ENOMEM ; + +for (i =0 ; i < wcss->num_clks; i++) + wcss->clks[i].id = bulk_clks[i]; + wcss->xo =devm_clk_get (wcss->dev,"xo" );if (IS_ERR (wcss->xo)) return dev_err_probe(wcss->dev, PTR_ERR(wcss->xo),
@@ -1127,44 +1105,23 @@ static int q6v5_wcss_init_clock(struct q6v5_wcss *wcss)return dev_err_probe (wcss->dev,PTR_ERR (wcss->gcc_axim_cbcr),"failed to get gcc axim clock\n" ); - wcss->ahbfabric_cbcr_clk =devm_clk_get (wcss->dev, -"lcc_ahbfabric_cbc" ); -if (IS_ERR (wcss->ahbfabric_cbcr_clk)) -return dev_err_probe (wcss->dev,PTR_ERR (wcss->ahbfabric_cbcr_clk), -"failed to get ahbfabric clock\n" ); - - wcss->lcc_csr_cbcr =devm_clk_get (wcss->dev,"tcsr_lcc_cbc" ); -if (IS_ERR (wcss->lcc_csr_cbcr)) -return dev_err_probe (wcss->dev,PTR_ERR (wcss->lcc_csr_cbcr), -"failed to get csr cbcr clk\n" ); - wcss->ahbs_cbcr =devm_clk_get (wcss->dev,"lcc_abhs_cbc" );if (IS_ERR (wcss->ahbs_cbcr))return dev_err_probe (wcss->dev,PTR_ERR (wcss->ahbs_cbcr),"failed to get ahbs_cbcr clk\n" ); - wcss->tcm_slave_cbcr =devm_clk_get (wcss->dev, -"lcc_tcm_slave_cbc" ); -if (IS_ERR (wcss->tcm_slave_cbcr)) -return dev_err_probe (wcss->dev,PTR_ERR (wcss->tcm_slave_cbcr), -"failed to get tcm cbcr clk\n" ); - - wcss->qdsp6ss_abhm_cbcr =devm_clk_get (wcss->dev,"lcc_abhm_cbc" ); -if (IS_ERR (wcss->qdsp6ss_abhm_cbcr)) -return dev_err_probe (wcss->dev,PTR_ERR (wcss->qdsp6ss_abhm_cbcr), -"failed to get abhm cbcr clk\n" ); - - wcss->qdsp6ss_axim_cbcr =devm_clk_get (wcss->dev,"lcc_axim_cbc" ); -if (IS_ERR (wcss->qdsp6ss_axim_cbcr)) -return dev_err_probe (wcss->dev,PTR_ERR (wcss->qdsp6ss_axim_cbcr), -"failed to get axim cbcr clk\n" ); - wcss->lcc_bcr_sleep =devm_clk_get (wcss->dev,"lcc_bcr_sleep" );if (IS_ERR (wcss->lcc_bcr_sleep))return dev_err_probe (wcss->dev,PTR_ERR (wcss->lcc_bcr_sleep),"failed to get bcr cbcr clk\n" ); + ret =devm_clk_bulk_get (wcss->dev, wcss->num_clks, wcss->clks); +if (ret <0 ) { +return dev_err_probe (wcss->dev, ret, +"failed to bulk get q6 clocks\n" ); + } +return 0 ; }
Signature · 1 line
2.45.1
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 7 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced, and believe there is justification for a native remoteproc loader. Besides, this series has improvements to the existing code.
Changes since v1:
- Improve bindings following review feedback
This is not specific enough.
With such vague changelog you could at least make it easy for us to compare with older version, but not:
$ b4 diff '[email protected]' Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz Checking for older revisions Grabbing search results from lore.kernel.org Nothing matching that query. --- Analyzing 10 messages in the thread Could not find lower series to compare against.
Best regards,
Krzysztof
Quoted 15 lines · Krzysztof Kozlowski
Quoted 14 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced, and believe there is justification for a native remoteproc loader. Besides, this series has improvements to the existing code.
Quoted 4 lines
Quoted 2 lines
Changes since v1:
- Improve bindings following review feedbackThis is not specific enough.
I saw now detailed changelogs in individual patches, so it's fine.
Quoted 4 lines
With such vague changelog you could at least make it easy for us to compare with older version, but not:
Quoted 8 lines
$ b4 diff '[email protected]' Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz Checking for older revisions Grabbing search results from lore.kernel.org Nothing matching that query. --- Analyzing 10 messages in the thread Could not find lower series to compare against.
Best regards,
Krzysztof
Rob Herring
maintainerQuoted 40 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced, and believe there is justification for a native remoteproc loader. Besides, this series has improvements to the existing code.
Changes since v1:
- Improve bindings following review feedback
- disable clocks on init failures inq6v7_wcss_reset()
- review-suggetsed readability improvements ofqcom_q6v5_wcssAlexandru Gagniuc (9):
remoteproc:qcom_q6v5_wcss: drop unused clocks from q6v5 struct
dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema
dt-bindings: clock: gcc-ipq9574: add wcss remoteproc clocks
dt-bindings: remoteproc: qcom: add IPQ9574 image loader
arm64: dts: qcom: ipq9574: add wcss remoteproc nodes
clk: qcom: gcc-ipq9574: add wcss remoteproc clocks
remoteproc:qcom_q6v5_wcss: support IPQ9574
remoteproc:qcom_q6v5_wcss: support m3 firmware
remoteproc:qcom_q6v5_wcss: use bulk clk API for q6 clocks in QCS404.../remoteproc/qcom,ipq8074-wcss-pil.yaml | 268 ++++++++++++ .../bindings/remoteproc/qcom,q6v5.txt | 102 ----- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 101 +++++ drivers/clk/qcom/gcc-ipq9574.c | 378 +++++++++++++++++ drivers/remoteproc/qcom_q6v5_wcss.c | 398 ++++++++++++++---- include/dt-bindings/clock/qcom,ipq9574-gcc.h | 22 + 6 files changed, 1082 insertions(+), 187 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.yaml delete mode 100644 Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt
Quoted 5 lines
--
2.45.1
My bot found new DTB warnings on the .dts files added or changed in this series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:
pip3 install dtschema --upgrade
This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/v6.19-rc2-7-ge190ecec2fdf (exact match)
Base: tags/v6.19-rc2-7-ge190ecec2fdf (use --merge-base to override)
If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically)
New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/qcom/' for [email protected]:
arch/arm64/boot/dts/qcom/ipq9574-rdp454.dtb: smp2p-wcss (qcom,smp2p): master-kernel: 'qcom,smp2p-feature-ssr-ack' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/soc/qcom/qcom,smp2p.yamlarch/arm64/boot/dts/qcom/ipq9574-rdp433.dtb: smp2p-wcss (qcom,smp2p): master-kernel: 'qcom,smp2p-feature-ssr-ack' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/soc/qcom/qcom,smp2p.yamlarch/arm64/boot/dts/qcom/ipq9574-rdp453.dtb: smp2p-wcss (qcom,smp2p): master-kernel: 'qcom,smp2p-feature-ssr-ack' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/soc/qcom/qcom,smp2p.yamlarch/arm64/boot/dts/qcom/ipq9574-rdp449.dtb: smp2p-wcss (qcom,smp2p): master-kernel: 'qcom,smp2p-feature-ssr-ack' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/soc/qcom/qcom,smp2p.yamlarch/arm64/boot/dts/qcom/ipq9574-rdp418.dtb: smp2p-wcss (qcom,smp2p): master-kernel: 'qcom,smp2p-feature-ssr-ack' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/soc/qcom/qcom,smp2p.yaml
Quoted 11 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
Konrad
Quoted 10 lines · CST Konrad Dybcio
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
To answer your question, I think the TZ initialization is an afterthought of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.
Alex
Quoted 19 lines · Alex G.
Quoted 10 lines · CST Konrad Dybcio
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
Quoted 7 lines
To answer your question, I think the TZ initialization is an afterthought of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.
Exactly, the TZ interface is present to address the security concerns. Also, as I mentioned in [1], on some platforms, TZ might access protect the clocks and registers which might prevent the remoteproc bringup and throw an access violation.
We can keep this support added for IPQ9574, as it is good to have, but can we keep the default compatible in ipq9574 DTSI to use the TZ interface, which has already picked up an R-b in this series [2].
[1] https://lore.kernel.org/linux-remoteproc/[email protected]/T/#m688033ab79c63a8953e38f5575d1c0ff6b37b13a
[2] https://lore.kernel.org/linux-remoteproc/[email protected]/T/#t
Quoted 8 lines
Alex
Quoted 29 lines · CST Vignesh Viswanathan
Quoted 20 lines · Alex G.
Quoted 10 lines · CST Konrad Dybcio
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
Quoted 7 lines
To answer your question, I think the TZ initialization is an afterthought of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.
Quoted 8 lines
Exactly, the TZ interface is present to address the security concerns. Also, as I mentioned in [1], on some platforms, TZ might access protect the clocks and registers which might prevent the remoteproc bringup and throw an access violation.
We can keep this support added for IPQ9574, as it is good to have, but can we keep the default compatible in ipq9574 DTSI to use the TZ interface, which has already picked up an R-b in this series [2].
I think that's an acceptable plan. For the TZ case, we'd have to keep the clock framework from disabling the "unused" remoteproc clocks. Do you think "protected-clocks" property is the right way to do it? Which series should add it?
Alex
Quoted 7 lines
[1]
https://lore.kernel.org/linux-remoteproc/21468f66-56df-43ea-99c2-7257d8d6bb
[email protected]/T/#m688033ab79c63a8953e38f5575d1c0ff6b37b13a [2]
https://lore.kernel.org/linux-remoteproc/20260113092021.1887980-1-varadaraj
[email protected]/T/#tQuoted 1 line
Alex
Quoted 19 lines · Alex G.
Quoted 10 lines · CST Konrad Dybcio
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
Quoted 7 lines
To answer your question, I think the TZ initialization is an afterthought of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.
I wouldn't exactly call it an afterthought.. Image authentication (as in, verifying the signature of the ELF) has always been part of TZ, because doing so in a user-modifiable context would be absolutely nonsensical
qcom_scm_pas_auth_and_reset() which configures and powers up the rproc has been there for a really long time too (at least since the 2012 SoCs like MSM8974) and I would guesstimate it's been there for a reason - not all clocks can or should be accessible from the OS (from a SW standpoint it would be convenient to have a separate SECURE_CC block where all the clocks we shouldn't care about are moved, but the HW design makes more sense as-is, for the most part), plus there is additional access control hardware on the platform that must be configured from a secure context (by design) which I assume could be part of this sequence, based on the specifics of a given SoC
Konrad
Quoted 33 lines · CST Konrad Dybcio
Quoted 20 lines · Alex G.
Quoted 10 lines · CST Konrad Dybcio
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
Quoted 7 lines
To answer your question, I think the TZ initialization is an afterthought of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.
I wouldn't exactly call it an afterthought.. Image authentication (as in, verifying the signature of the ELF) has always been part of TZ, because doing so in a user-modifiable context would be absolutely nonsensical
Quoted 10 lines
qcom_scm_pas_auth_and_reset()which configures and powers up the rproc has been there for a really long time too (at least since the 2012 SoCs like MSM8974) and I would guesstimate it's been there for a reason - not all clocks can or should be accessible from the OS (from a SW standpoint it would be convenient to have a separateSECURE_CCblock where all the clocks we shouldn't care about are moved, but the HW design makes more sense as-is, for the most part), plus there is additional access control hardware on the platform that must be configured from a secure context (by design) which I assume could be part of this sequence, based on the specifics of a given SoC
What was the original use case for the Q6 remoteproc? I see today's use case is as a conduit for ath11k firmware to control PCIe devices. Was that always the case? I imagine a more modern design would treat the remoteproc as untrusted by putting it under a bridge or IOMMU with more strict memory access control, so that firmware couldn't access OS memory.
Quoted 1 line
Konrad
Quoted 45 lines · Alex G.
Quoted 33 lines · CST Konrad Dybcio
Quoted 20 lines · Alex G.
Quoted 10 lines · CST Konrad Dybcio
Quoted 9 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
Quoted 7 lines
To answer your question, I think the TZ initialization is an afterthought of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.
I wouldn't exactly call it an afterthought.. Image authentication (as in, verifying the signature of the ELF) has always been part of TZ, because doing so in a user-modifiable context would be absolutely nonsensical
Quoted 10 lines
qcom_scm_pas_auth_and_reset()which configures and powers up the rproc has been there for a really long time too (at least since the 2012 SoCs like MSM8974) and I would guesstimate it's been there for a reason - not all clocks can or should be accessible from the OS (from a SW standpoint it would be convenient to have a separateSECURE_CCblock where all the clocks we shouldn't care about are moved, but the HW design makes more sense as-is, for the most part), plus there is additional access control hardware on the platform that must be configured from a secure context (by design) which I assume could be part of this sequence, based on the specifics of a given SoC
Quoted 5 lines
What was the original use case for the Q6 remoteproc? I see today's use case is as a conduit for ath11k firmware to control PCIe devices. Was that always the case? I imagine a more modern design would treat the remoteproc as untrusted by putting it under a bridge or IOMMU with more strict memory access control, so that firmware couldn't access OS memory.
There is an SMMU on this SoC.
I don't know the original backstory, but if anything, the through-Q6 approach is probably *more* secure, since there's additional access control hardware inbetween
Konrad
Quoted 54 lines · Central Daylight Time Konrad Dybcio
Quoted 47 lines · Alex G.
Quoted 35 lines · CST Konrad Dybcio
Quoted 21 lines · Alex G.
Quoted 11 lines · CST Konrad Dybcio
Quoted 10 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable
wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
Quoted 4 lines
Quoted 2 lines
Qualcomm tries to assure us that the TZ firmware will always do the right thing (TM), but I am not fully convinced
Why else do you think it's there in the firmware? :(
A more relevant question is, why do some contributors sincerely believe that the TZ initialization of Q6 firmware is not a good idea for their use case?
Quoted 8 lines
To answer your question, I think the TZ initialization is an afterthought
of the SoC design. I think it was only after ther the design stage that it was brought up that a remoteproc on AHB has out-of-band access to system memory, which poses security concerns to some customers. I think authentication was implemented in TZ to address that. I also think that in order to prevent clock glitching from bypassing such verification, they had to move the initialization sequence in TZ as well.I wouldn't exactly call it an afterthought.. Image authentication (as in, verifying the signature of the ELF) has always been part of TZ, because doing so in a user-modifiable context would be absolutely nonsensical
Quoted 10 lines
qcom_scm_pas_auth_and_reset()which configures and powers up the rproc has been there for a really long time too (at least since the 2012 SoCs like MSM8974) and I would guesstimate it's been there for a reason - not all clocks can or should be accessible from the OS (from a SW standpoint it would be convenient to have a separateSECURE_CCblock where all the clocks we shouldn't care about are moved, but the HW design makes more sense as-is, for the most part), plus there is additional access control hardware on the platform that must be configured from a secure context (by design) which I assume could be part of this sequence, based on the specifics of a given SoCQuoted 5 lines
What was the original use case for the Q6 remoteproc? I see today's use case is as a conduit for ath11k firmware to control PCIe devices. Was that always the case? I imagine a more modern design would treat the remoteproc as untrusted by putting it under a bridge or IOMMU with more strict memory access control, so that firmware couldn't access OS memory.
Quoted 5 lines
There is an SMMU on this SoC.
I don't know the original backstory, but if anything, the through-Q6 approach is probably *more* secure, since there's additional access control hardware inbetween
My question is what to do with this series? I think I present a valid approach which has its use cases, irrespective of which approach is better for a given use case.
Alex
Quoted 1 line
Konrad
Re: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
In reply to Alexandru GagniucQuoted 10 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
[...]
Applied, thanks!
[1/9] remoteproc: qcom_q6v5_wcss: drop unused clocks from q6v5 struct
commit: 22afc6163c0c7a144d24a09352b87719d64d5f65
[2/9] dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema
commit: 2a756ac4d98efc97503629fcaddb2e7c46255824
[4/9] dt-bindings: remoteproc: qcom: add IPQ9574 image loader
commit: bc33b5b5e23a389e660c3d696cd2e043fdf33ef7
[7/9] remoteproc: qcom_q6v5_wcss: support IPQ9574
commit: 0149254e603f1fd89cb08aec36174ba7c2f198e3
[8/9] remoteproc: qcom_q6v5_wcss: support m3 firmware
commit: 67804d8274d478ba8d1a84e9437fb340a8d3c26f
[9/9] remoteproc: qcom_q6v5_wcss: use bulk clk API for q6 clocks in QCS404
commit: 920aa0298197a9a116210ac6057f1e880b9edd99Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>
Rob Herring
maintainerRe: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
Quoted 13 lines · Bjorn Andersson
Quoted 10 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
[...]
Quoted 8 lines
Applied, thanks!
[1/9] remoteproc:
qcom_q6v5_wcss: drop unused clocks from q6v5 structcommit: 22afc6163c0c7a144d24a09352b87719d64d5f65 [2/9] dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema commit: 2a756ac4d98efc97503629fcaddb2e7c46255824 [4/9] dt-bindings: remoteproc: qcom: add IPQ9574 image loader commit: bc33b5b5e23a389e660c3d696cd2e043fdf33ef7
Why is a 6 month old patchset with reported errors being applied? Anyways, linux-next is now broken. Please fix.
Rob
A message that is not in the archive (sent off-list or not yet received): CADi83T6kdqo-x0bcCGspni_e6ysEY6sud1AmZ4-utveA0rpLQA@mail.gmail.com
Rob Herring
maintainerRe: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
Quoted 29 lines · Alexandru Gagniuc
Hi Rob
Quoted 24 lines · On Tue, Jul 14, 2026, 17:45 Rob Herring <[email protected]> wrote:
Quoted 21 lines · Bjorn Andersson
Quoted 10 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
[...]
Applied, thanks!
[1/9] remoteproc:
qcom_q6v5_wcss: drop unused clocks from q6v5 structcommit: 22afc6163c0c7a144d24a09352b87719d64d5f65 [2/9] dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema commit: 2a756ac4d98efc97503629fcaddb2e7c46255824 [4/9] dt-bindings: remoteproc: qcom: add IPQ9574 image loader commit: bc33b5b5e23a389e660c3d696cd2e043fdf33ef7
Quoted 5 lines
Quoted 2 lines
Why is a 6 month old patchset with reported errors being applied? Anyways, linux-next is now broken. Please fix.
I must have missed the error reports. Can you please point me in the right direction? I'll get on this ASAP.
"make dt_binding_check" on linux-next.
Rob
Re: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
Quoted 31 lines · Rob Herring
Quoted 29 lines · Alexandru Gagniuc
Hi Rob
Quoted 24 lines · On Tue, Jul 14, 2026, 17:45 Rob Herring <[email protected]> wrote:
Quoted 21 lines · Bjorn Andersson
Quoted 10 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
[...]
Applied, thanks!
[1/9] remoteproc:
qcom_q6v5_wcss: drop unused clocks from q6v5 structcommit: 22afc6163c0c7a144d24a09352b87719d64d5f65 [2/9] dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema commit: 2a756ac4d98efc97503629fcaddb2e7c46255824 [4/9] dt-bindings: remoteproc: qcom: add IPQ9574 image loader commit: bc33b5b5e23a389e660c3d696cd2e043fdf33ef7
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Why is a 6 month old patchset with reported errors being applied? Anyways, linux-next is now broken. Please fix.
I must have missed the error reports. Can you please point me in the right direction? I'll get on this ASAP.
"make
dt_binding_check" on linux-next.
I see the issue:
DTC [C] Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.example.dtb
Lexical error:
Documentation/devicetree/bindings/remoteproc/qcom,ipq8074-wcss-pil.example.dts:49.28-51 Unexpected 'GCC_ANOC_WCSS_AXI_M_CLK'
...
This is easily fixed by applying PATCH 3/9 of this series ("dt-bindings:
clock: gcc-ipq9574: add wcss remoteproc clocks") [1]. It defines the clocks used in the yaml example, which resolves the issues. make dt_binding_check is clean afterwards.
Would you like me to resubmit this patch for linux-next?
Alex
[1] lkml.org/lkml/2026/1/8/2278
Quoted 1 line
Rob
Bjorn Andersson
maintainerRe: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
In reply to Rob HerringQuoted 16 lines · Rob Herring
Quoted 15 lines · Bjorn Andersson
Quoted 10 lines · Alexandru Gagniuc
Support loading remoteproc firmware on IPQ9574 with the
qcom_q6v5_wcssdriver. This firmware is usually used to run ath11k firmware and enable wifi with chips such as QCN5024.When submitting v1, I learned that the firmware can also be loaded by the trustzone firmware. Since TZ is not shipped with the kernel, it makes sense to have the option of a native init sequence, as not all devices come with the latest TZ firmware.
[...]
Applied, thanks!
Quoted 8 lines
Quoted 6 lines
[1/9] remoteproc:
qcom_q6v5_wcss: drop unused clocks from q6v5 structcommit: 22afc6163c0c7a144d24a09352b87719d64d5f65 [2/9] dt-bindings: remoteproc: qcom,ipq8074-wcss-pil: convert to DT schema commit: 2a756ac4d98efc97503629fcaddb2e7c46255824 [4/9] dt-bindings: remoteproc: qcom: add IPQ9574 image loader commit: bc33b5b5e23a389e660c3d696cd2e043fdf33ef7Why is a 6 month old patchset with reported errors being applied?
I did some needed cleaning in the patchwork inbox, but not sure why I didn't see your feedback.
Quoted 2 lines
Anyways, linux-next is now broken. Please fix.
Done, I've dropped the changes from the branch again.
Regards,
Bjorn
Quoted 1 line
Rob
Re: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
In reply to Bjorn AnderssonBjorn, Alexandru,
there is another, much newer series by Varadarajan adding ipq9574 to wcss PIL driver,
https://lore.kernel.org/linux-remoteproc/[email protected]/
I suspect these two series are incompatible.
Marek
Re: (subset) [PATCH v2 0/9] remoteproc: qcom_q6v5_wcss: add native ipq9574 support
Hi Marek,
Quoted 9 lines · Marek Behún
Bjorn, Alexandru,
there is another, much newer series by Varadarajan adding ipq9574 to wcss PIL driver,
https://lore.kernel.org/linux-remoteproc/[email protected]/
I suspect these two series are incompatible.
The compatibility of the two series was discussed [1] with the Qualcomm folk, with agreement that "it is good to have [native IPQ9574]". I don't see an incompatibility with how Bjorn applied this subset.
[1] https://lkml.org/lkml/2026/1/14/300
Alex