Skip to content

Commit 7554d53

Browse files
kholkandersson
authored andcommitted
clk: qcom: gcc-msm8998: Add Q6 BIMC and LPASS core, ADSP SMMU clocks
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. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Marc Gonzalez <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 2cb4fcc commit 7554d53

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

drivers/clk/qcom/gcc-msm8998.c

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,6 +2922,43 @@ static struct clk_branch ssc_cnoc_ahbs_clk = {
29222922
},
29232923
};
29242924

2925+
static struct clk_branch hlos1_vote_lpass_core_smmu_clk = {
2926+
.halt_reg = 0x7D010,
2927+
.clkr = {
2928+
.enable_reg = 0x7D010,
2929+
.enable_mask = BIT(0),
2930+
.hw.init = &(struct clk_init_data) {
2931+
.name = "hlos1_vote_lpass_core_smmu_clk",
2932+
.ops = &clk_branch2_ops,
2933+
},
2934+
},
2935+
};
2936+
2937+
static struct clk_branch hlos1_vote_lpass_adsp_smmu_clk = {
2938+
.halt_reg = 0x7D014,
2939+
.clkr = {
2940+
.enable_reg = 0x7D014,
2941+
.enable_mask = BIT(0),
2942+
.hw.init = &(struct clk_init_data) {
2943+
.name = "hlos1_vote_lpass_adsp_smmu_clk",
2944+
.ops = &clk_branch2_ops,
2945+
},
2946+
},
2947+
};
2948+
2949+
static struct clk_branch gcc_mss_q6_bimc_axi_clk = {
2950+
.halt_reg = 0x8A040,
2951+
.clkr = {
2952+
.enable_reg = 0x8A040,
2953+
.enable_mask = BIT(0),
2954+
.hw.init = &(struct clk_init_data) {
2955+
.name = "gcc_mss_q6_bimc_axi_clk",
2956+
.flags = CLK_IS_CRITICAL,
2957+
.ops = &clk_branch2_ops,
2958+
},
2959+
},
2960+
};
2961+
29252962
static struct gdsc pcie_0_gdsc = {
29262963
.gdscr = 0x6b004,
29272964
.gds_hw_ctrl = 0x0,
@@ -2953,6 +2990,26 @@ static struct gdsc usb_30_gdsc = {
29532990
.flags = VOTABLE,
29542991
};
29552992

2993+
static struct gdsc hlos1_vote_lpass_adsp = {
2994+
.gdscr = 0x7d034,
2995+
.gds_hw_ctrl = 0x0,
2996+
.pd = {
2997+
.name = "lpass_adsp_gdsc",
2998+
},
2999+
.pwrsts = PWRSTS_OFF_ON,
3000+
.flags = VOTABLE,
3001+
};
3002+
3003+
static struct gdsc hlos1_vote_lpass_core = {
3004+
.gdscr = 0x7d038,
3005+
.gds_hw_ctrl = 0x0,
3006+
.pd = {
3007+
.name = "lpass_core_gdsc",
3008+
},
3009+
.pwrsts = PWRSTS_OFF_ON,
3010+
.flags = ALWAYS_ON,
3011+
};
3012+
29563013
static struct clk_regmap *gcc_msm8998_clocks[] = {
29573014
[BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,
29583015
[BLSP1_QUP1_SPI_APPS_CLK_SRC] = &blsp1_qup1_spi_apps_clk_src.clkr,
@@ -3133,12 +3190,17 @@ static struct clk_regmap *gcc_msm8998_clocks[] = {
31333190
[GCC_MMSS_GPLL0_DIV_CLK] = &gcc_mmss_gpll0_div_clk.clkr,
31343191
[GCC_GPU_GPLL0_DIV_CLK] = &gcc_gpu_gpll0_div_clk.clkr,
31353192
[GCC_GPU_GPLL0_CLK] = &gcc_gpu_gpll0_clk.clkr,
3193+
[HLOS1_VOTE_LPASS_CORE_SMMU_CLK] = &hlos1_vote_lpass_core_smmu_clk.clkr,
3194+
[HLOS1_VOTE_LPASS_ADSP_SMMU_CLK] = &hlos1_vote_lpass_adsp_smmu_clk.clkr,
3195+
[GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr,
31363196
};
31373197

31383198
static struct gdsc *gcc_msm8998_gdscs[] = {
31393199
[PCIE_0_GDSC] = &pcie_0_gdsc,
31403200
[UFS_GDSC] = &ufs_gdsc,
31413201
[USB_30_GDSC] = &usb_30_gdsc,
3202+
[LPASS_ADSP_GDSC] = &hlos1_vote_lpass_adsp,
3203+
[LPASS_CORE_GDSC] = &hlos1_vote_lpass_core,
31423204
};
31433205

31443206
static const struct qcom_reset_map gcc_msm8998_resets[] = {

0 commit comments

Comments
 (0)