mbox series

[v2,00/10] Add Modem support on SC7280 SoCs

Message ID 1626775980-28637-1-git-send-email-sibis@codeaurora.org
Headers show
Series Add Modem support on SC7280 SoCs | expand

Message

Sibi Sankar July 20, 2021, 10:12 a.m. UTC
This patch series adds support for booting the Modem Q6 DSP found on
Qualcomm's SC7280 SoCs.

Depends on:
aoss yaml: https://patchwork.kernel.org/project/linux-arm-msm/cover/20210709174142.1274554-1-bjorn.andersson@linaro.org/
qmp_send: https://patchwork.kernel.org/project/linux-arm-msm/cover/1623237532-20829-1-git-send-email-sibis@codeaurora.org/
rproc qmp: https://patchwork.kernel.org/project/linux-arm-msm/cover/1626755807-11865-1-git-send-email-sibis@codeaurora.org/

V2:
 * Misc. typos {patch 3}. [Matthias]
 * Document the q-channel takedown procedure {patch 5}. [Matthias]
 * Split reserved memory updates between SoC and platform {patch 6}. [Matthias]

Sibi Sankar (10):
  dt-bindings: remoteproc: qcom: pas: Add SC7280 MPSS support
  remoteproc: qcom: pas: Add SC7280 Modem support
  dt-bindings: remoteproc: qcom: Update Q6V5 Modem PIL binding
  iommu/arm-smmu-qcom: Request direct mapping for modem device
  remoteproc: mss: q6v5-mss: Add modem support on SC7280
  arm64: dts: qcom: sc7280: Update reserved memory map
  arm64: dts: qcom: sc7280: Add/Delete/Update reserved memory nodes
  arm64: dts: qcom: sc7280: Add nodes to boot modem
  arm64: dts: qcom: sc7280: Add Q6V5 MSS node
  arm64: dts: qcom: sc7280: Update Q6V5 MSS node

 .../devicetree/bindings/remoteproc/qcom,adsp.yaml  |   6 +
 .../devicetree/bindings/remoteproc/qcom,q6v5.txt   |  32 ++-
 arch/arm64/boot/dts/qcom/sc7280-idp.dts            |  59 +++++
 arch/arm64/boot/dts/qcom/sc7280.dtsi               | 107 +++++++++
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c         |   1 +
 drivers/remoteproc/qcom_q6v5_mss.c                 | 252 ++++++++++++++++++++-
 drivers/remoteproc/qcom_q6v5_pas.c                 |   1 +
 7 files changed, 452 insertions(+), 6 deletions(-)

Comments

Stephen Boyd July 21, 2021, 5:39 a.m. UTC | #1
Quoting Sibi Sankar (2021-07-20 03:12:54)
> The SID configuration requirement for Modem on SC7280 is similar to the
> ones found on SC7180/SDM845 SoCs. So, add the SC7280 modem compatible to
> the list to defer the programming of the modem SIDs to the kernel.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Stephen Boyd July 21, 2021, 5:42 a.m. UTC | #2
Quoting Sibi Sankar (2021-07-20 03:12:56)
> Add missing regions to the reserved memory map.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Stephen Boyd July 21, 2021, 5:43 a.m. UTC | #3
Quoting Sibi Sankar (2021-07-20 03:12:57)
> Add, delete and update platform specific reserved memory nodes.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Stephen Boyd July 21, 2021, 5:44 a.m. UTC | #4
Quoting Sibi Sankar (2021-07-20 03:12:58)
> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> index 5ed7a511bfc9..3fb6a6ef39f8 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> @@ -1219,6 +1224,21 @@
>                         };
>                 };
>
> +               imem@146aa000 {

is sram a more appropriate node name here? Is imem a generic node name
in DT spec?

> +                       compatible = "syscon", "simple-mfd";
> +                       reg = <0 0x146aa000 0 0x2000>;
> +
> +                       #address-cells = <2>;
> +                       #size-cells = <2>;
> +
> +                       ranges = <0 0x0 0 0x146aa000 0 0x2000>;
> +
> +                       pil-reloc@94c {
> +                               compatible = "qcom,pil-reloc-info";
> +                               reg = <0 0x94c 0 0xc8>;
> +                       };
> +               };
> +
Stephen Boyd July 21, 2021, 5:45 a.m. UTC | #5
Quoting Sibi Sankar (2021-07-20 03:12:59)
> This patch adds Q6V5 MSS PAS remoteproc node for SC7280 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Stephen Boyd July 21, 2021, 5:47 a.m. UTC | #6
Quoting Sibi Sankar (2021-07-20 03:13:00)
> Update MSS node to support MSA based modem boot on SC7280 SoCs.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  arch/arm64/boot/dts/qcom/sc7280-idp.dts |  7 +++++++
>  arch/arm64/boot/dts/qcom/sc7280.dtsi    | 19 ++++++++++++++++---
>  2 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dts b/arch/arm64/boot/dts/qcom/sc7280-idp.dts
> index 191e8a92d153..d66e3ca42ad5 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dts
> +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dts
> @@ -343,3 +343,10 @@
>                 bias-pull-up;
>         };
>  };
> +
> +&remoteproc_mpss {
> +       status = "okay";
> +       compatible = "qcom,sc7280-mss-pil";
> +       iommus = <&apps_smmu 0x124 0x0>, <&apps_smmu 0x488 0x7>;
> +       memory-region = <&mba_mem &mpss_mem>;
> +};

Can this go above the pinctrl zone in this file? Preferably sorted
alphabetically by phandle.

> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> index 56ea172f641f..6d3687744440 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> @@ -586,7 +586,8 @@
>
>                 remoteproc_mpss: remoteproc@4080000 {
>                         compatible = "qcom,sc7280-mpss-pas";
> -                       reg = <0 0x04080000 0 0x10000>;
> +                       reg = <0 0x04080000 0 0x10000>, <0 0x04180000 0 0x48>;
> +                       reg-names = "qdsp6", "rmb";
>
>                         interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_EDGE_RISING>,
>                                               <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
> @@ -597,8 +598,11 @@
>                         interrupt-names = "wdog", "fatal", "ready", "handover",
>                                           "stop-ack", "shutdown-ack";
>
> -                       clocks = <&rpmhcc RPMH_CXO_CLK>;
> -                       clock-names = "xo";
> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
> +                                <&gcc GCC_MSS_OFFLINE_AXI_CLK>,
> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
> +                                <&rpmhcc RPMH_CXO_CLK>;
> +                       clock-names = "iface", "offline", "snoc_axi", "xo";
>
>                         power-domains = <&rpmhpd SC7280_CX>,
>                                         <&rpmhpd SC7280_MSS>;
> @@ -611,6 +615,15 @@
>                         qcom,smem-states = <&modem_smp2p_out 0>;
>                         qcom,smem-state-names = "stop";
>
> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
> +                       reset-names = "mss_restart", "pdc_reset";
> +
> +                       qcom,halt-regs = <&tcsr_mutex 0x23000 0x25000 0x28000 0x33000>;
> +                       qcom,ext-regs = <&tcsr_regs 0x10000 0x10004
> +                                        &tcsr_mutex 0x26004 0x26008>;
> +                       qcom,qaccept-regs = <&tcsr_mutex 0x23030 0x23040 0x23020>;
> +
>                         status = "disabled";
>
>                         glink-edge {

Any reason to not combine this stuff with the previous patch?
Sibi Sankar July 21, 2021, 5:16 p.m. UTC | #7
On 2021-07-21 11:17, Stephen Boyd wrote:
> Quoting Sibi Sankar (2021-07-20 03:13:00)
>> Update MSS node to support MSA based modem boot on SC7280 SoCs.
>> 
>> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
>> ---
>>  arch/arm64/boot/dts/qcom/sc7280-idp.dts |  7 +++++++
>>  arch/arm64/boot/dts/qcom/sc7280.dtsi    | 19 ++++++++++++++++---
>>  2 files changed, 23 insertions(+), 3 deletions(-)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dts 
>> b/arch/arm64/boot/dts/qcom/sc7280-idp.dts
>> index 191e8a92d153..d66e3ca42ad5 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dts
>> +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dts
>> @@ -343,3 +343,10 @@
>>                 bias-pull-up;
>>         };
>>  };
>> +
>> +&remoteproc_mpss {
>> +       status = "okay";
>> +       compatible = "qcom,sc7280-mss-pil";
>> +       iommus = <&apps_smmu 0x124 0x0>, <&apps_smmu 0x488 0x7>;
>> +       memory-region = <&mba_mem &mpss_mem>;
>> +};
> 
> Can this go above the pinctrl zone in this file? Preferably sorted
> alphabetically by phandle.

Sure, looks like I just added
it based on sort order. Didn't
notice that it fell below the
pinctrl zone.

> 
>> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi 
>> b/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> index 56ea172f641f..6d3687744440 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> @@ -586,7 +586,8 @@
>> 
>>                 remoteproc_mpss: remoteproc@4080000 {
>>                         compatible = "qcom,sc7280-mpss-pas";
>> -                       reg = <0 0x04080000 0 0x10000>;
>> +                       reg = <0 0x04080000 0 0x10000>, <0 0x04180000 
>> 0 0x48>;
>> +                       reg-names = "qdsp6", "rmb";
>> 
>>                         interrupts-extended = <&intc GIC_SPI 264 
>> IRQ_TYPE_EDGE_RISING>,
>>                                               <&modem_smp2p_in 0 
>> IRQ_TYPE_EDGE_RISING>,
>> @@ -597,8 +598,11 @@
>>                         interrupt-names = "wdog", "fatal", "ready", 
>> "handover",
>>                                           "stop-ack", "shutdown-ack";
>> 
>> -                       clocks = <&rpmhcc RPMH_CXO_CLK>;
>> -                       clock-names = "xo";
>> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
>> +                                <&gcc GCC_MSS_OFFLINE_AXI_CLK>,
>> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
>> +                                <&rpmhcc RPMH_CXO_CLK>;
>> +                       clock-names = "iface", "offline", "snoc_axi", 
>> "xo";
>> 
>>                         power-domains = <&rpmhpd SC7280_CX>,
>>                                         <&rpmhpd SC7280_MSS>;
>> @@ -611,6 +615,15 @@
>>                         qcom,smem-states = <&modem_smp2p_out 0>;
>>                         qcom,smem-state-names = "stop";
>> 
>> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
>> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
>> +                       reset-names = "mss_restart", "pdc_reset";
>> +
>> +                       qcom,halt-regs = <&tcsr_mutex 0x23000 0x25000 
>> 0x28000 0x33000>;
>> +                       qcom,ext-regs = <&tcsr_regs 0x10000 0x10004
>> +                                        &tcsr_mutex 0x26004 0x26008>;
>> +                       qcom,qaccept-regs = <&tcsr_mutex 0x23030 
>> 0x23040 0x23020>;
>> +
>>                         status = "disabled";
>> 
>>                         glink-edge {
> 
> Any reason to not combine this stuff with the previous patch?

I split it into two separate
patches just to show that sc7280
supports two ways of bringing
modem out of reset and method
used is determined by the platform.

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sibi Sankar July 21, 2021, 5:41 p.m. UTC | #8
On 2021-07-21 11:14, Stephen Boyd wrote:
> Quoting Sibi Sankar (2021-07-20 03:12:58)
>> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi 
>> b/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> index 5ed7a511bfc9..3fb6a6ef39f8 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> @@ -1219,6 +1224,21 @@
>>                         };
>>                 };
>> 
>> +               imem@146aa000 {
> 
> is sram a more appropriate node name here? Is imem a generic node name
> in DT spec?

binding check for qcom,pil-info.yaml
didn't complain so I just followed
it. AFAICS, sram isn't mentioned in
generic node names either.

> 
>> +                       compatible = "syscon", "simple-mfd";
>> +                       reg = <0 0x146aa000 0 0x2000>;
>> +
>> +                       #address-cells = <2>;
>> +                       #size-cells = <2>;
>> +
>> +                       ranges = <0 0x0 0 0x146aa000 0 0x2000>;
>> +
>> +                       pil-reloc@94c {
>> +                               compatible = "qcom,pil-reloc-info";
>> +                               reg = <0 0x94c 0 0xc8>;
>> +                       };
>> +               };
>> +
Stephen Boyd July 21, 2021, 10:53 p.m. UTC | #9
Quoting Sibi Sankar (2021-07-21 10:16:14)
> On 2021-07-21 11:17, Stephen Boyd wrote:
> > Quoting Sibi Sankar (2021-07-20 03:13:00)
> >
> >> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> >> b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> >> index 56ea172f641f..6d3687744440 100644
> >> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> >> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> >> @@ -586,7 +586,8 @@
> >>
> >>                 remoteproc_mpss: remoteproc@4080000 {
> >>                         compatible = "qcom,sc7280-mpss-pas";
> >> -                       reg = <0 0x04080000 0 0x10000>;
> >> +                       reg = <0 0x04080000 0 0x10000>, <0 0x04180000
> >> 0 0x48>;
> >> +                       reg-names = "qdsp6", "rmb";
> >>
> >>                         interrupts-extended = <&intc GIC_SPI 264
> >> IRQ_TYPE_EDGE_RISING>,
> >>                                               <&modem_smp2p_in 0
> >> IRQ_TYPE_EDGE_RISING>,
> >> @@ -597,8 +598,11 @@
> >>                         interrupt-names = "wdog", "fatal", "ready",
> >> "handover",
> >>                                           "stop-ack", "shutdown-ack";
> >>
> >> -                       clocks = <&rpmhcc RPMH_CXO_CLK>;
> >> -                       clock-names = "xo";
> >> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
> >> +                                <&gcc GCC_MSS_OFFLINE_AXI_CLK>,
> >> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
> >> +                                <&rpmhcc RPMH_CXO_CLK>;
> >> +                       clock-names = "iface", "offline", "snoc_axi",
> >> "xo";
> >>
> >>                         power-domains = <&rpmhpd SC7280_CX>,
> >>                                         <&rpmhpd SC7280_MSS>;
> >> @@ -611,6 +615,15 @@
> >>                         qcom,smem-states = <&modem_smp2p_out 0>;
> >>                         qcom,smem-state-names = "stop";
> >>
> >> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
> >> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
> >> +                       reset-names = "mss_restart", "pdc_reset";
> >> +
> >> +                       qcom,halt-regs = <&tcsr_mutex 0x23000 0x25000
> >> 0x28000 0x33000>;
> >> +                       qcom,ext-regs = <&tcsr_regs 0x10000 0x10004
> >> +                                        &tcsr_mutex 0x26004 0x26008>;
> >> +                       qcom,qaccept-regs = <&tcsr_mutex 0x23030
> >> 0x23040 0x23020>;
> >> +
> >>                         status = "disabled";
> >>
> >>                         glink-edge {
> >
> > Any reason to not combine this stuff with the previous patch?
>
> I split it into two separate
> patches just to show that sc7280
> supports two ways of bringing
> modem out of reset and method
> used is determined by the platform.
>

Ok. But if there are two methods do they work with the same node in
sc7280.dtsi? Because I was expecting to see the node introduced in the
SoC dtsi file in the final form instead of the half form and then be
amended in this patch.
Sibi Sankar July 22, 2021, 5:34 p.m. UTC | #10
On 2021-07-22 04:23, Stephen Boyd wrote:
> Quoting Sibi Sankar (2021-07-21 10:16:14)
>> On 2021-07-21 11:17, Stephen Boyd wrote:
>> > Quoting Sibi Sankar (2021-07-20 03:13:00)
>> >
>> >> diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> >> b/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> >> index 56ea172f641f..6d3687744440 100644
>> >> --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> >> +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
>> >> @@ -586,7 +586,8 @@
>> >>
>> >>                 remoteproc_mpss: remoteproc@4080000 {
>> >>                         compatible = "qcom,sc7280-mpss-pas";
>> >> -                       reg = <0 0x04080000 0 0x10000>;
>> >> +                       reg = <0 0x04080000 0 0x10000>, <0 0x04180000
>> >> 0 0x48>;
>> >> +                       reg-names = "qdsp6", "rmb";
>> >>
>> >>                         interrupts-extended = <&intc GIC_SPI 264
>> >> IRQ_TYPE_EDGE_RISING>,
>> >>                                               <&modem_smp2p_in 0
>> >> IRQ_TYPE_EDGE_RISING>,
>> >> @@ -597,8 +598,11 @@
>> >>                         interrupt-names = "wdog", "fatal", "ready",
>> >> "handover",
>> >>                                           "stop-ack", "shutdown-ack";
>> >>
>> >> -                       clocks = <&rpmhcc RPMH_CXO_CLK>;
>> >> -                       clock-names = "xo";
>> >> +                       clocks = <&gcc GCC_MSS_CFG_AHB_CLK>,
>> >> +                                <&gcc GCC_MSS_OFFLINE_AXI_CLK>,
>> >> +                                <&gcc GCC_MSS_SNOC_AXI_CLK>,
>> >> +                                <&rpmhcc RPMH_CXO_CLK>;
>> >> +                       clock-names = "iface", "offline", "snoc_axi",
>> >> "xo";
>> >>
>> >>                         power-domains = <&rpmhpd SC7280_CX>,
>> >>                                         <&rpmhpd SC7280_MSS>;
>> >> @@ -611,6 +615,15 @@
>> >>                         qcom,smem-states = <&modem_smp2p_out 0>;
>> >>                         qcom,smem-state-names = "stop";
>> >>
>> >> +                       resets = <&aoss_reset AOSS_CC_MSS_RESTART>,
>> >> +                                <&pdc_reset PDC_MODEM_SYNC_RESET>;
>> >> +                       reset-names = "mss_restart", "pdc_reset";
>> >> +
>> >> +                       qcom,halt-regs = <&tcsr_mutex 0x23000 0x25000
>> >> 0x28000 0x33000>;
>> >> +                       qcom,ext-regs = <&tcsr_regs 0x10000 0x10004
>> >> +                                        &tcsr_mutex 0x26004 0x26008>;
>> >> +                       qcom,qaccept-regs = <&tcsr_mutex 0x23030
>> >> 0x23040 0x23020>;
>> >> +
>> >>                         status = "disabled";
>> >>
>> >>                         glink-edge {
>> >
>> > Any reason to not combine this stuff with the previous patch?
>> 
>> I split it into two separate
>> patches just to show that sc7280
>> supports two ways of bringing
>> modem out of reset and method
>> used is determined by the platform.
>> 
> 
> Ok. But if there are two methods do they work with the same node in
> sc7280.dtsi? Because I was expecting to see the node introduced in the
> SoC dtsi file in the final form instead of the half form and then be
> amended in this patch.

Board files enables the mss node
and overloads the compatible depending
on the platform it is expected to
run on. So pretty much the same
node with just changing the compatible
and few additional properties support
both methods. Patch 9 is complete in
itself i.e. it is compliant with
the pas yaml, while patch 10 adds
the bits required to make alternate
method work.