Add LPASS SMMU to msm8998 DTSI
Subsystems (5)
cover Add LPASS SMMU to msm8998 DTSI
A few definitions and glue code to support the DT node describing the LPASS SMMU in qcom msm8998 SoC.
Thanks to Angelo.
---
AngeloGioacchino Del Regno (3):
dt-bindings: clock: gcc-msm8998: Add Q6 and LPASS clocks definitions
clk: qcom: gcc-msm8998: Add Q6 BIMC and LPASS core, ADSP SMMU clocks
arm64: dts: qcom: msm8998: Add disabled support for LPASS iommu for Q6
arch/arm64/boot/dts/qcom/msm8998.dtsi | 27 ++++++++++++ drivers/clk/qcom/gcc-msm8998.c | 62 ++++++++++++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-msm8998.h | 5 +++ 3 files changed, 94 insertions(+)
---
base-commit: 08d0fcf9db52b0ba09b07d5a0684c421d56be530
change-id: 20240814-lpass-686daa6106f8
Best regards,
Signature · 1 line
Marc Gonzalez <[email protected]>
PATCH 1/3 dt-bindings: clock: gcc-msm8998: Add Q6 and LPASS clocks definitions
From: AngeloGioacchino Del Regno <[email protected]>
Add definitions for the Q6 BIMC, LPASS core and adsp smmu clocks, required to enable audio functionality on MSM8998.
Add the GDSC definitions for the LPASS_ADSP_GDSC and LPASS_CORE_GDSC as a final step to enable the required clock tree for the lpass iommu and for the audio dsp itself.
--- include/dt-bindings/clock/qcom,gcc-msm8998.h | 5 +++++ 1 file changed, 5 insertions(+)
include/dt-bindings/clock/qcom,gcc-msm8998.h +5 -0
@@ -193,10 +193,15 @@#define GCC_MMSS_GPLL0_DIV_CLK 184#define GCC_GPU_GPLL0_DIV_CLK 185#define GCC_GPU_GPLL0_CLK 186 +#define HLOS1_VOTE_LPASS_CORE_SMMU_CLK 187 +#define HLOS1_VOTE_LPASS_ADSP_SMMU_CLK 188 +#define GCC_MSS_Q6_BIMC_AXI_CLK 189#define PCIE_0_GDSC 0#define UFS_GDSC 1#define USB_30_GDSC 2 +#define LPASS_ADSP_GDSC 3 +#define LPASS_CORE_GDSC 4#define GCC_BLSP1_QUP1_BCR 0#define GCC_BLSP1_QUP2_BCR 1
Signature · 1 line
2.34.1
Re: [PATCH 1/3] dt-bindings: clock: gcc-msm8998: Add Q6 and LPASS clocks definitions
Quoted 11 lines · Marc Gonzalez
From: AngeloGioacchino Del Regno <[email protected]>
Add definitions for the Q6 BIMC, LPASS core and adsp smmu clocks, required to enable audio functionality on MSM8998.
Add the GDSC definitions for the
LPASS_ADSP_GDSCandLPASS_CORE_GDSCas a final step to enable the required clock tree for the lpass iommu and for the audio dsp itself.Signed-off-by AngeloGioacchino Del Regno <[email protected]>Signed-off-by Marc Gonzalez <[email protected]>
PATCH 2/3 clk: qcom: gcc-msm8998: Add Q6 BIMC and LPASS core, ADSP SMMU clocks
In reply to Marc GonzalezFrom: AngeloGioacchino Del Regno <[email protected]>
Add the Q6 BIMC, LPASS core/adsp SMMU clocks to support audio related functionality on MSM8998 and APQ variants.
As a final step to entirely enable the required clock tree for the lpass iommu and audio dsp, add the lpass core/adsp GDSCs.
As a side note, it was found out that disabling the lpass core GDSC at any time would cause a system lockup (and reboot): disabling this GDSC will leave the lpass iommu completely unclocked, losing its state entirely - including the secure contexts that have been previously set-up from the bootloader/TrustZone.
Losing this IOMMU configuration will trigger a hypervisor fault, which will reboot the system; the only workaround for this issue is to declare the lpass core gdsc as always-on.
It should also not be forgotten that this is all about firmware and there may be a version of it that doesn't enable this GDSC at all before booting Linux, which is the reason why this specific declaration wasn't simply omitted.
--- drivers/clk/qcom/gcc-msm8998.c | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+)
drivers/clk/qcom/gcc-msm8998.c +62 -0
@@ -2922,6 +2922,43 @@ static struct clk_branch ssc_cnoc_ahbs_clk = { }, }; +static struct clk_branch hlos1_vote_lpass_core_smmu_clk = { + .halt_reg =0x7D010 , + .clkr = { + .enable_reg =0x7D010 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ) { + .name ="hlos1_vote_lpass_core_smmu_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch hlos1_vote_lpass_adsp_smmu_clk = { + .halt_reg =0x7D014 , + .clkr = { + .enable_reg =0x7D014 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ) { + .name ="hlos1_vote_lpass_adsp_smmu_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; + +static struct clk_branch gcc_mss_q6_bimc_axi_clk = { + .halt_reg =0x8A040 , + .clkr = { + .enable_reg =0x8A040 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ) { + .name ="gcc_mss_q6_bimc_axi_clk" , + .flags =CLK_IS_CRITICAL , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct gdsc pcie_0_gdsc = { .gdscr =0x6b004 , .gds_hw_ctrl =0x0 ,
@@ -2953,6 +2990,26 @@ static struct gdsc usb_30_gdsc = { .flags = VOTABLE, }; +static struct gdsc hlos1_vote_lpass_adsp = { + .gdscr =0x7d034 , + .gds_hw_ctrl =0x0 , + .pd = { + .name ="lpass_adsp_gdsc" , + }, + .pwrsts =PWRSTS_OFF_ON , + .flags =VOTABLE , +}; + +static struct gdsc hlos1_vote_lpass_core = { + .gdscr =0x7d038 , + .gds_hw_ctrl =0x0 , + .pd = { + .name ="lpass_core_gdsc" , + }, + .pwrsts =PWRSTS_OFF_ON , + .flags =ALWAYS_ON , +}; +static struct clk_regmap *gcc_msm8998_clocks[] = { [BLSP1_QUP1_I2C_APPS_CLK_SRC ] = &blsp1_qup1_i2c_apps_clk_src.clkr, [BLSP1_QUP1_SPI_APPS_CLK_SRC ] = &blsp1_qup1_spi_apps_clk_src.clkr,
@@ -3133,12 +3190,17 @@ static struct clk_regmap *gcc_msm8998_clocks[] = { [GCC_MMSS_GPLL0_DIV_CLK] = &gcc_mmss_gpll0_div_clk.clkr, [GCC_GPU_GPLL0_DIV_CLK] = &gcc_gpu_gpll0_div_clk.clkr, [GCC_GPU_GPLL0_CLK] = &gcc_gpu_gpll0_clk.clkr, + [HLOS1_VOTE_LPASS_CORE_SMMU_CLK] = &hlos1_vote_lpass_core_smmu_clk.clkr, + [HLOS1_VOTE_LPASS_ADSP_SMMU_CLK] = &hlos1_vote_lpass_adsp_smmu_clk.clkr, + [GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr, };static struct gdsc *gcc_msm8998_gdscs[] = { [PCIE_0_GDSC ] = &pcie_0_gdsc, [UFS_GDSC ] = &ufs_gdsc, [USB_30_GDSC ] = &usb_30_gdsc, + [LPASS_ADSP_GDSC ] = &hlos1_vote_lpass_adsp, + [LPASS_CORE_GDSC ] = &hlos1_vote_lpass_core, };static const struct qcom_reset_map gcc_msm8998_resets[] = {
Signature · 1 line
2.34.1
PATCH 3/3 arm64: dts: qcom: msm8998: Add disabled support for LPASS iommu for Q6
In reply to Marc GonzalezFrom: AngeloGioacchino Del Regno <[email protected]>
Add support for the LPASS (Q6) SMMU and keep it disabled as this is used only when the audio DSP is present and used, which is not mandatory to have.
It is expected for board-specific device-trees to enable this node if supported.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +27 -0
@@ -1615,6 +1615,33 @@ gpucc: clock-controller@5065000 { "gpll0"; }; + lpass_q6_smmu: iommu@5100000 { + compatible = "qcom,msm8998-smmu-v2", "qcom,smmu-v2"; + reg = <0x05100000 0x40000>; + clocks = <&gcc HLOS1_VOTE_LPASS_ADSP_SMMU_CLK>; + clock-names = "iface"; + + #global-interrupts = <0>; + #iommu-cells = <1>; + interrupts = + <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 393 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 396 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 397 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 398 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 399 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 401 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 402 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 403 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>; + + power-domains = <&gcc LPASS_ADSP_GDSC>; + status = "disabled"; + }; + remoteproc_slpi: remoteproc@5800000 { compatible = "qcom,msm8998-slpi-pas"; reg = <0x05800000 0x4040>;
Signature · 1 line
2.34.1
Quoted 5 lines · Marc Gonzalez
A few definitions and glue code to support the DT node describing the LPASS SMMU in qcom msm8998 SoC.
Thanks to Angelo.
Applied, thanks!
[1/3] dt-bindings: clock: gcc-msm8998: Add Q6 and LPASS clocks definitions
commit: 015dff12dfdeb8d94115ec829bc2e4b711075935
[2/3] clk: qcom: gcc-msm8998: Add Q6 BIMC and LPASS core, ADSP SMMU clocks
commit: 7554d532e03b4f3a9e294077d38fb2403f2b5f7d
[3/3] arm64: dts: qcom: msm8998: Add disabled support for LPASS iommu for Q6
commit: 1a9544b832256817a387f952eb0badcb6416df7fBest regards,
Signature · 1 line
Bjorn Andersson <[email protected]>