Enable GPU for SM8150 and SM8250
Subsystems (5)
PATCH RESEND v2 1/13 clk: qcom: gcc: fix sm8150 GPU and NPU clocks
In reply to Jonathan MarekFix the parents and set BRANCH_HALT_SKIP. From the downstream driver it should be a 500us delay and not skip, however this matches what was done for other clocks that had 500us delay in downstream.
--- drivers/clk/qcom/gcc-sm8150.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clk/qcom/gcc-sm8150.c +6 -2
@@ -1617,6 +1617,7 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = { };static struct clk_branch gcc_gpu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x52004 , .enable_mask =BIT (15 ),
@@ -1632,13 +1633,14 @@ static struct clk_branch gcc_gpu_gpll0_clk_src = { };static struct clk_branch gcc_gpu_gpll0_div_clk_src = { + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x52004 , .enable_mask =BIT (16 ), .hw.init = &(struct clk_init_data ){ .name ="gcc_gpu_gpll0_div_clk_src" , .parent_hws = (const struct clk_hw *[]){ - &gcc_gpu_gpll0_clk_src.clkr.hw }, + &gpll0_out_even.clkr.hw }, .num_parents =1 , .flags =CLK_SET_RATE_PARENT , .ops = &clk_branch2_ops,
@@ -1729,6 +1731,7 @@ static struct clk_branch gcc_npu_cfg_ahb_clk = { };static struct clk_branch gcc_npu_gpll0_clk_src = { + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x52004 , .enable_mask =BIT (18 ),
@@ -1744,13 +1747,14 @@ static struct clk_branch gcc_npu_gpll0_clk_src = { };static struct clk_branch gcc_npu_gpll0_div_clk_src = { + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x52004 , .enable_mask =BIT (19 ), .hw.init = &(struct clk_init_data ){ .name ="gcc_npu_gpll0_div_clk_src" , .parent_hws = (const struct clk_hw *[]){ - &gcc_npu_gpll0_clk_src.clkr.hw }, + &gpll0_out_even.clkr.hw }, .num_parents =1 , .flags =CLK_SET_RATE_PARENT , .ops = &clk_branch2_ops,
Signature · 1 line
2.26.1
PATCH RESEND v2 2/13 clk: qcom: clk-alpha-pll: remove unused/incorrect PLL_CAL_VAL
In reply to Jonathan Marek0x44 isn't a register offset, it is the value that goes into CAL_L_VAL.
--- drivers/clk/qcom/clk-alpha-pll.c | 2 -- 1 file changed, 2 deletions(-)
drivers/clk/qcom/clk-alpha-pll.c +0 -2
@@ -56,7 +56,6 @@#define PLL_STATUS (p) ((p)->offset + (p)->regs[PLL_OFF_STATUS])#define PLL_OPMODE (p) ((p)->offset + (p)->regs[PLL_OFF_OPMODE])#define PLL_FRAC (p) ((p)->offset + (p)->regs[PLL_OFF_FRAC]) -#define PLL_CAL_VAL (p) ((p)->offset + (p)->regs[PLL_OFF_CAL_VAL])const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS ] = { [CLK_ALPHA_PLL_TYPE_DEFAULT ] = {
@@ -115,7 +114,6 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { [PLL_OFF_STATUS] = 0x30, [PLL_OFF_OPMODE] = 0x38, [PLL_OFF_ALPHA_VAL ] =0x40 , - [PLL_OFF_CAL_VAL ] =0x44 , }, [CLK_ALPHA_PLL_TYPE_LUCID] = { [PLL_OFF_L_VAL ] =0x04 ,
Signature · 1 line
2.26.1
PATCH RESEND v2 3/13 clk: qcom: clk-alpha-pll: same regs and ops for trion and lucid
In reply to Jonathan MarekFixed ops were already identical, this adds support for non-fixed ops by sharing between trion and lucid.
This also changes the names for trion ops to be consistent with the rest.
Note LUCID_PCAL_DONE is renamed to TRION_PCAL_DONE because it is wrong for lucid, LUCID_PCAL_DONE should be BIT(27). Next patch will address this.
--- drivers/clk/qcom/clk-alpha-pll.c | 58 ++++++++++---------------------- drivers/clk/qcom/clk-alpha-pll.h | 17 ++++++---- drivers/clk/qcom/gcc-sm8150.c | 8 ++--- 3 files changed, 32 insertions(+), 51 deletions(-)
drivers/clk/qcom/clk-alpha-pll.c +17 -41
@@ -101,21 +101,6 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { [PLL_OFF_FRAC ] =0x38 , }, [CLK_ALPHA_PLL_TYPE_TRION] = { - [PLL_OFF_L_VAL ] =0x04 , - [PLL_OFF_CAL_L_VAL ] =0x08 , - [PLL_OFF_USER_CTL ] =0x0c , - [PLL_OFF_USER_CTL_U ] =0x10 , - [PLL_OFF_USER_CTL_U1 ] =0x14 , - [PLL_OFF_CONFIG_CTL ] =0x18 , - [PLL_OFF_CONFIG_CTL_U ] =0x1c , - [PLL_OFF_CONFIG_CTL_U1 ] =0x20 , - [PLL_OFF_TEST_CTL ] =0x24 , - [PLL_OFF_TEST_CTL_U ] =0x28 , - [PLL_OFF_STATUS ] =0x30 , - [PLL_OFF_OPMODE ] =0x38 , - [PLL_OFF_ALPHA_VAL ] =0x40 , - }, - [CLK_ALPHA_PLL_TYPE_LUCID ] = { [PLL_OFF_L_VAL ] =0x04 , [PLL_OFF_CAL_L_VAL ] =0x08 , [PLL_OFF_USER_CTL ] =0x0c ,
@@ -154,9 +139,9 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);#define PLL_OUT_MASK 0x7#define PLL_RATE_MARGIN 500 -/* LUCID PLL specific settings and offsets */ -#define LUCID_PLL_CAL_VAL 0x44 -#define LUCID_PCAL_DONE BIT(26) +/* TRION PLL specific settings and offsets */ +#define TRION_PLL_CAL_VAL 0x44 +#define TRION_PCAL_DONE BIT(26)#define pll_alpha_width (p) \ ((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \
@@ -910,14 +895,14 @@ const struct clk_ops clk_alpha_pll_hwfsm_ops = { };EXPORT_SYMBOL_GPL (clk_alpha_pll_hwfsm_ops); -const struct clk_ops clk_trion_fixed_pll_ops = { +const struct clk_ops clk_alpha_pll_fixed_trion_ops = { .enable = clk_trion_pll_enable, .disable = clk_trion_pll_disable, .is_enabled = clk_trion_pll_is_enabled, .recalc_rate = clk_trion_pll_recalc_rate, .round_rate = clk_alpha_pll_round_rate, }; -EXPORT_SYMBOL_GPL (clk_trion_fixed_pll_ops); +EXPORT_SYMBOL_GPL (clk_alpha_pll_fixed_trion_ops);static unsigned long clk_alpha_pll_postdiv_recalc_rate (struct clk_hw *hw,unsigned long parent_rate)
@@ -1337,12 +1322,12 @@ clk_trion_pll_postdiv_set_rate(struct clk_hw *hw, unsigned long rate, val << PLL_POST_DIV_SHIFT); } -const struct clk_ops clk_trion_pll_postdiv_ops = { +const struct clk_ops clk_alpha_pll_postdiv_trion_ops = { .recalc_rate = clk_trion_pll_postdiv_recalc_rate, .round_rate = clk_trion_pll_postdiv_round_rate, .set_rate = clk_trion_pll_postdiv_set_rate, }; -EXPORT_SYMBOL_GPL (clk_trion_pll_postdiv_ops); +EXPORT_SYMBOL_GPL (clk_alpha_pll_postdiv_trion_ops);static long clk_alpha_pll_postdiv_fabia_round_rate (struct clk_hw *hw,unsigned long rate,unsigned long *prate)
@@ -1397,13 +1382,13 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_postdiv_fabia_ops);* @regmap: register map * @config: configuration to apply for pll */ -void clk_lucid_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap, +void clk_trion_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config) {if (config->l)regmap_write (regmap,PLL_L_VAL (pll), config->l); -regmap_write (regmap,PLL_CAL_L_VAL (pll),LUCID_PLL_CAL_VAL ); +regmap_write (regmap,PLL_CAL_L_VAL (pll),TRION_PLL_CAL_VAL );if (config->alpha)regmap_write (regmap,PLL_ALPHA_VAL (pll), config->alpha);
@@ -1456,13 +1441,13 @@ void clk_lucid_pll_configure(struct clk_alpha_pll *pll, struct regmap *regmap,/* Place the PLL in STANDBY mode */ regmap_update_bits (regmap,PLL_MODE (pll),PLL_RESET_N ,PLL_RESET_N ); } -EXPORT_SYMBOL_GPL (clk_lucid_pll_configure); +EXPORT_SYMBOL_GPL (clk_trion_pll_configure);/* -* The Lucid PLL requires a power-on self-calibration which happens when the +* The TRION PLL requires a power-on self-calibration which happens when the * PLL comes out of reset. Calibrate in case it is not completed. */ -static int alpha_pll_lucid_prepare (struct clk_hw *hw) +static int alpha_pll_trion_prepare (struct clk_hw *hw) {struct clk_alpha_pll *pll =to_clk_alpha_pll (hw);u32 regval;
@@ -1470,7 +1455,7 @@ static int alpha_pll_lucid_prepare(struct clk_hw *hw)/* Return early if calibration is not needed. */ regmap_read (pll->clkr.regmap,PLL_STATUS (pll), ®val); -if (regval &LUCID_PCAL_DONE ) +if (regval &TRION_PCAL_DONE )return 0 ;/* On/off to calibrate */
@@ -1481,7 +1466,7 @@ static int alpha_pll_lucid_prepare(struct clk_hw *hw)return ret; } -static int alpha_pll_lucid_set_rate (struct clk_hw *hw,unsigned long rate, +static int alpha_pll_trion_set_rate (struct clk_hw *hw,unsigned long rate,unsigned long prate) {struct clk_alpha_pll *pll =to_clk_alpha_pll (hw);
@@ -1535,26 +1520,17 @@ static int alpha_pll_lucid_set_rate(struct clk_hw *hw, unsigned long rate,return 0 ; } -const struct clk_ops clk_alpha_pll_lucid_ops = { - .prepare = alpha_pll_lucid_prepare, +const struct clk_ops clk_alpha_pll_trion_ops = { + .prepare = alpha_pll_trion_prepare, .enable = clk_trion_pll_enable, .disable = clk_trion_pll_disable, .is_enabled = clk_trion_pll_is_enabled, .recalc_rate = clk_trion_pll_recalc_rate, .round_rate = clk_alpha_pll_round_rate, - .set_rate = alpha_pll_lucid_set_rate, + .set_rate = alpha_pll_trion_set_rate, };EXPORT_SYMBOL_GPL (clk_alpha_pll_lucid_ops); -const struct clk_ops clk_alpha_pll_fixed_lucid_ops = { - .enable = clk_trion_pll_enable, - .disable = clk_trion_pll_disable, - .is_enabled = clk_trion_pll_is_enabled, - .recalc_rate = clk_trion_pll_recalc_rate, - .round_rate = clk_alpha_pll_round_rate, -}; -EXPORT_SYMBOL_GPL (clk_alpha_pll_fixed_lucid_ops); -const struct clk_ops clk_alpha_pll_postdiv_lucid_ops = { .recalc_rate = clk_alpha_pll_postdiv_fabia_recalc_rate, .round_rate = clk_alpha_pll_postdiv_fabia_round_rate,
drivers/clk/qcom/clk-alpha-pll.h +11 -6
@@ -14,7 +14,7 @@ enum {CLK_ALPHA_PLL_TYPE_BRAMMO ,CLK_ALPHA_PLL_TYPE_FABIA ,CLK_ALPHA_PLL_TYPE_TRION , -CLK_ALPHA_PLL_TYPE_LUCID , +CLK_ALPHA_PLL_TYPE_LUCID =CLK_ALPHA_PLL_TYPE_TRION , CLK_ALPHA_PLL_TYPE_MAX, };
@@ -128,18 +128,23 @@ extern const struct clk_ops clk_alpha_pll_fabia_ops;extern const struct clk_ops clk_alpha_pll_fixed_fabia_ops;extern const struct clk_ops clk_alpha_pll_postdiv_fabia_ops; -extern const struct clk_ops clk_alpha_pll_lucid_ops; -extern const struct clk_ops clk_alpha_pll_fixed_lucid_ops; +extern const struct clk_ops clk_alpha_pll_trion_ops; +extern const struct clk_ops clk_alpha_pll_fixed_trion_ops; +extern const struct clk_ops clk_alpha_pll_postdiv_trion_ops; + +#define clk_alpha_pll_lucid_ops clk_alpha_pll_trion_ops +#define clk_alpha_pll_fixed_lucid_ops clk_alpha_pll_fixed_trion_opsextern const struct clk_ops clk_alpha_pll_postdiv_lucid_ops;void clk_alpha_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config);void clk_fabia_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config); -void clk_lucid_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap, +void clk_trion_pll_configure (struct clk_alpha_pll *pll,struct regmap *regmap,const struct alpha_pll_config *config); +#define clk_lucid_pll_configure (pll, regmap, config) \ + clk_trion_pll_configure(pll, regmap, config) + -extern const struct clk_ops clk_trion_fixed_pll_ops; -extern const struct clk_ops clk_trion_pll_postdiv_ops;#endif
drivers/clk/qcom/gcc-sm8150.c +4 -4
@@ -53,7 +53,7 @@ static struct clk_alpha_pll gpll0 = { .name = "bi_tcxo", }, .num_parents = 1, - .ops = &clk_trion_fixed_pll_ops, + .ops = &clk_alpha_pll_fixed_trion_ops, }, }, };
@@ -79,7 +79,7 @@ static struct clk_alpha_pll_postdiv gpll0_out_even = { .hw = &gpll0.clkr.hw, }, .num_parents = 1, - .ops = &clk_trion_pll_postdiv_ops, + .ops = &clk_alpha_pll_postdiv_trion_ops, }, };
@@ -98,7 +98,7 @@ static struct clk_alpha_pll gpll7 = { .name = "bi_tcxo", }, .num_parents = 1, - .ops = &clk_trion_fixed_pll_ops, + .ops = &clk_alpha_pll_fixed_trion_ops, }, }, };
@@ -118,7 +118,7 @@ static struct clk_alpha_pll gpll9 = { .name = "bi_tcxo", }, .num_parents = 1, - .ops = &clk_trion_fixed_pll_ops, + .ops = &clk_alpha_pll_fixed_trion_ops, }, }, };
Signature · 1 line
2.26.1
PATCH RESEND v2 6/13 dt-bindings: clock: Introduce SM8150 QCOM Graphics clock bindings
In reply to Jonathan MarekAdd device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8150 SoCs.
--- .../bindings/clock/qcom,sm8150-gpucc.yaml | 74 +++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8150.h | 40 ++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8150.h
Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml new file +74 -0
@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,sm8150-gpucc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Graphics Clock & Reset Controller Binding for SM8150 + +maintainers: + - + +description: | + Qualcomm graphics clock control module which supports the clocks, resets and + power domains on SM8150. + + See also dt-bindings/clock/qcom,gpucc-sm8150.h. + +properties: + compatible: + const: qcom,sm8150-gpucc + + clocks: + items: + - description: Board XO source + - description: GPLL0 main branch source + - description: GPLL0 div branch source + + clock-names: + items: + - const: bi_tcxo + - const: gcc_gpu_gpll0_clk_src + - const: gcc_gpu_gpll0_div_clk_src + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sm8150.h> + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@2c90000 { + compatible = "qcom,sm8150-gpucc"; + reg = <0x2c90000 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; +...
include/dt-bindings/clock/qcom,gpucc-sm8150.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8150_H +#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8150_H + +/* GPU_CC clock registers */ +#define GPU_CC_AHB_CLK 0 +#define GPU_CC_CRC_AHB_CLK 1 +#define GPU_CC_CX_APB_CLK 2 +#define GPU_CC_CX_GMU_CLK 3 +#define GPU_CC_CX_QDSS_AT_CLK 4 +#define GPU_CC_CX_QDSS_TRIG_CLK 5 +#define GPU_CC_CX_QDSS_TSCTR_CLK 6 +#define GPU_CC_CX_SNOC_DVM_CLK 7 +#define GPU_CC_CXO_AON_CLK 8 +#define GPU_CC_CXO_CLK 9 +#define GPU_CC_GMU_CLK_SRC 10 +#define GPU_CC_GX_GMU_CLK 11 +#define GPU_CC_GX_QDSS_TSCTR_CLK 12 +#define GPU_CC_GX_VSENSE_CLK 13 +#define GPU_CC_PLL1 14 +#define GPU_CC_PLL_TEST_CLK 15 +#define GPU_CC_SLEEP_CLK 16 + +/* GPU_CC Resets */ +#define GPUCC_GPU_CC_CX_BCR 0 +#define GPUCC_GPU_CC_GFX3D_AON_BCR 1 +#define GPUCC_GPU_CC_GMU_BCR 2 +#define GPUCC_GPU_CC_GX_BCR 3 +#define GPUCC_GPU_CC_SPDM_BCR 4 +#define GPUCC_GPU_CC_XO_BCR 5 + +/* GPU_CC GDSCRs */ +#define GPU_CX_GDSC 0 +#define GPU_GX_GDSC 1 + +#endif
Signature · 1 line
2.26.1
PATCH RESEND v2 12/13 arm64: dts: qcom: add sm8150 GPU nodes
In reply to Jonathan MarekThis brings up the GPU. Tested on HDK855 by running vulkan CTS.
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 136 +++++++++++++++++++++++++++ 1 file changed, 136 insertions(+)
arch/arm64/boot/dts/qcom/sm8150.dtsi +136 -0
@@ -10,6 +10,7 @@ #include <dt-bindings/soc/qcom,rpmh-rsc.h> #include <dt-bindings/clock/qcom,rpmh.h> #include <dt-bindings/clock/qcom,gcc-sm8150.h> +#include <dt-bindings/clock/qcom,gpucc-sm8150.h> / { interrupt-parent = <&intc>;
@@ -540,6 +541,141 @@ glink-edge { }; }; + gpu: gpu@2c00000 { + /* + * note: the amd,imageon compatible makes it possible + * to use the drm/msm driver without the display node, + * make sure to remove it when display node is added + */ + compatible = "qcom,adreno-640.1", + "qcom,adreno", + "amd,imageon"; + #stream-id-cells = <16>; + + reg = <0 0x2c00000 0 0x40000>; + reg-names = "kgsl_3d0_reg_memory"; + + interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>; + + iommus = <&adreno_smmu 0 0x401>; + + operating-points-v2 = <&gpu_opp_table>; + + qcom,gmu = <&gmu>; + + zap-shader { + memory-region = <&gpu_mem>; + }; + + /* note: downstream checks gpu binning for 675 Mhz */ + gpu_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-675000000 { + opp-hz = /bits/ 64 <675000000>; + opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>; + }; + + opp-585000000 { + opp-hz = /bits/ 64 <585000000>; + opp-level = <RPMH_REGULATOR_LEVEL_NOM>; + }; + + opp-499200000 { + opp-hz = /bits/ 64 <499200000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>; + }; + + opp-427000000 { + opp-hz = /bits/ 64 <427000000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>; + }; + + opp-345000000 { + opp-hz = /bits/ 64 <345000000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS>; + }; + + opp-257000000 { + opp-hz = /bits/ 64 <257000000>; + opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>; + }; + }; + }; + + gmu: gmu@2c6a000 { + compatible="qcom,adreno-gmu-640.1", "qcom,adreno-gmu"; + + reg = <0 0x2c6a000 0 0x30000>, + <0 0xb290000 0 0x10000>, + <0 0xb490000 0 0x10000>; + reg-names = "gmu", "gmu_pdc", "gmu_pdc_seq"; + + interrupts = <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "hfi", "gmu"; + + clocks = <&gpucc GPU_CC_AHB_CLK>, + <&gpucc GPU_CC_CX_GMU_CLK>, + <&gpucc GPU_CC_CXO_CLK>, + <&gcc GCC_DDRSS_GPU_AXI_CLK>, + <&gcc GCC_GPU_MEMNOC_GFX_CLK>; + clock-names = "ahb", "gmu", "cxo", "axi", "memnoc"; + + power-domains = <&gpucc GPU_CX_GDSC>, + <&gpucc GPU_GX_GDSC>; + power-domain-names = "cx", "gx"; + + iommus = <&adreno_smmu 5 0x400>; + + operating-points-v2 = <&gmu_opp_table>; + + gmu_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>; + }; + }; + }; + + gpucc: clock-controller@2c90000 { + compatible = "qcom,sm8150-gpucc"; + reg = <0 0x2c90000 0 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; + + adreno_smmu: iommu@2ca0000 { + compatible = "qcom,sm8150-smmu-500", "arm,mmu-500"; + reg = <0 0x2ca0000 0 0x10000>; + #iommu-cells = <2>; + #global-interrupts = <1>; + interrupts = <GIC_SPI 674 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 681 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 682 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 683 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 684 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 685 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 686 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 688 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&gpucc GPU_CC_AHB_CLK>, + <&gcc GCC_GPU_MEMNOC_GFX_CLK>, + <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>; + clock-names = "ahb", "bus", "iface"; + + power-domains = <&gpucc GPU_CX_GDSC>; + }; + tlmm: pinctrl@3100000 { compatible = "qcom,sm8150-pinctrl"; reg = <0x0 0x03100000 0x0 0x300000>,
Signature · 1 line
2.26.1
PATCH RESEND v2 13/13 arm64: dts: qcom: add sm8250 GPU nodes
In reply to Jonathan MarekThis brings up the GPU. Tested on HDK865 by running vulkan CTS.
--- arch/arm64/boot/dts/qcom/sm8250.dtsi | 143 +++++++++++++++++++++++++++ 1 file changed, 143 insertions(+)
arch/arm64/boot/dts/qcom/sm8250.dtsi +143 -0
@@ -5,6 +5,7 @@ #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/clock/qcom,gcc-sm8250.h> +#include <dt-bindings/clock/qcom,gpucc-sm8250.h> #include <dt-bindings/clock/qcom,rpmh.h> #include <dt-bindings/power/qcom-rpmpd.h> #include <dt-bindings/soc/qcom,rpmh-rsc.h>
@@ -387,6 +388,148 @@ tcsr_mutex: hwlock@1f40000 { #hwlock-cells = <1>; }; + gpu: gpu@3d00000 { + /* + * note: the amd,imageon compatible makes it possible + * to use the drm/msm driver without the display node, + * make sure to remove it when display node is added + */ + compatible = "qcom,adreno-650.2", + "qcom,adreno", + "amd,imageon"; + #stream-id-cells = <16>; + + reg = <0 0x3d00000 0 0x40000>; + reg-names = "kgsl_3d0_reg_memory"; + + interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>; + + iommus = <&adreno_smmu 0 0x401>; + + operating-points-v2 = <&gpu_opp_table>; + + qcom,gmu = <&gmu>; + + zap-shader { + memory-region = <&gpu_mem>; + }; + + /* note: downstream checks gpu binning for 670 Mhz */ + gpu_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-670000000 { + opp-hz = /bits/ 64 <670000000>; + opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>; + }; + + opp-587000000 { + opp-hz = /bits/ 64 <587000000>; + opp-level = <RPMH_REGULATOR_LEVEL_NOM>; + }; + + opp-525000000 { + opp-hz = /bits/ 64 <525000000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>; + }; + + opp-490000000 { + opp-hz = /bits/ 64 <490000000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>; + }; + + opp-441600000 { + opp-hz = /bits/ 64 <441600000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS_L0>; + }; + + opp-400000000 { + opp-hz = /bits/ 64 <400000000>; + opp-level = <RPMH_REGULATOR_LEVEL_SVS>; + }; + + opp-305000000 { + opp-hz = /bits/ 64 <305000000>; + opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>; + }; + }; + }; + + gmu: gmu@3d6a000 { + compatible="qcom,adreno-gmu-650.2", "qcom,adreno-gmu"; + + reg = <0 0x3d6a000 0 0x30000>, + <0 0x3de0000 0 0x10000>, + <0 0xb290000 0 0x10000>, + <0 0xb490000 0 0x10000>; + reg-names = "gmu", "rscc", "gmu_pdc", "gmu_pdc_seq"; + + interrupts = <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "hfi", "gmu"; + + clocks = <&gpucc GPU_CC_AHB_CLK>, + <&gpucc GPU_CC_CX_GMU_CLK>, + <&gpucc GPU_CC_CXO_CLK>, + <&gcc GCC_DDRSS_GPU_AXI_CLK>, + <&gcc GCC_GPU_MEMNOC_GFX_CLK>; + clock-names = "ahb", "gmu", "cxo", "axi", "memnoc"; + + power-domains = <&gpucc GPU_CX_GDSC>, + <&gpucc GPU_GX_GDSC>; + power-domain-names = "cx", "gx"; + + iommus = <&adreno_smmu 5 0x400>; + + operating-points-v2 = <&gmu_opp_table>; + + gmu_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-200000000 { + opp-hz = /bits/ 64 <200000000>; + opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>; + }; + }; + }; + + gpucc: clock-controller@3d90000 { + compatible = "qcom,sm8250-gpucc"; + reg = <0 0x3d90000 0 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; + + adreno_smmu: iommu@3da0000 { + compatible = "qcom,sm8250-smmu-500", "arm,mmu-500"; + reg = <0 0x3da0000 0 0x10000>; + #iommu-cells = <2>; + #global-interrupts = <2>; + interrupts = <GIC_SPI 672 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 673 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 678 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 679 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 680 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 681 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 682 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 683 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 684 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 685 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&gpucc GPU_CC_AHB_CLK>, + <&gcc GCC_GPU_MEMNOC_GFX_CLK>, + <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>; + clock-names = "ahb", "bus", "iface"; + + power-domains = <&gpucc GPU_CX_GDSC>; + }; + usb_1_hsphy: phy@88e3000 { compatible = "qcom,sm8250-usb-hs-phy", "qcom,usb-snps-hs-7nm-phy";
Signature · 1 line
2.26.1
PATCH RESEND v2 10/13 clk: qcom: Add graphics clock controller driver for SM8250
In reply to Jonathan MarekAdd support for the graphics clock controller found on SM8250 based devices. This would allow graphics drivers to probe and control their clocks.
This is copied from the downstream kernel, adapted for upstream. For example, GDSCs have been added.
--- drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gpucc-sm8250.c | 450 ++++++++++++++++++++++++++++++++ 3 files changed, 459 insertions(+) create mode 100644 drivers/clk/qcom/gpucc-sm8250.c
drivers/clk/qcom/Kconfig +8 -0
@@ -399,6 +399,14 @@ config SM_GPUCC_8150 Say Y if you want to support graphics controller devices and functionality such as 3D graphics. +config SM_GPUCC_8250 + tristate "SM8250 Graphics Clock Controller" + select SM_GCC_8250 + help + Support for the graphics clock controller on SM8250 devices. + Say Y if you want to support graphics controller devices and + functionality such as 3D graphics. + config SPMI_PMIC_CLKDIV tristate "SPMI PMIC clkdiv Support" depends on SPMI || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
@@ -63,6 +63,7 @@ obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o obj-$(CONFIG_SM_GCC_8150) += gcc-sm8150.o obj-$(CONFIG_SM_GCC_8250) += gcc-sm8250.o obj-$(CONFIG_SM_GPUCC_8150) += gpucc-sm8150.o +obj-$(CONFIG_SM_GPUCC_8250) += gpucc-sm8250.o obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
drivers/clk/qcom/gpucc-sm8250.c new file +450 -0
450 lines not on this page · raw message
Signature · 1 line
2.26.1
PATCH RESEND v2 11/13 dt-bindings: power: Add missing rpmpd rpmh regulator level
In reply to Jonathan MarekAdd RPMH_REGULATOR_LEVEL_SVS_L0, used by sm8250.
--- include/dt-bindings/power/qcom-rpmpd.h | 1 + 1 file changed, 1 insertion(+)
include/dt-bindings/power/qcom-rpmpd.h +1 -0
@@ -55,6 +55,7 @@#define RPMH_REGULATOR_LEVEL_MIN_SVS 48#define RPMH_REGULATOR_LEVEL_LOW_SVS 64#define RPMH_REGULATOR_LEVEL_SVS 128 +#define RPMH_REGULATOR_LEVEL_SVS_L0 144#define RPMH_REGULATOR_LEVEL_SVS_L1 192#define RPMH_REGULATOR_LEVEL_SVS_L2 224#define RPMH_REGULATOR_LEVEL_NOM 256
Signature · 1 line
2.26.1
PATCH RESEND v2 9/13 clk: qcom: Add graphics clock controller driver for SM8150
In reply to Jonathan MarekAdd support for the graphics clock controller found on SM8150 based devices. This would allow graphics drivers to probe and control their clocks.
This is copied from the downstream kernel, adapted for upstream. For example, GDSCs have been added.
--- drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gpucc-sm8150.c | 421 ++++++++++++++++++++++++++++++++ 3 files changed, 430 insertions(+) create mode 100644 drivers/clk/qcom/gpucc-sm8150.c
drivers/clk/qcom/Kconfig +8 -0
@@ -391,6 +391,14 @@ config SM_GCC_8250 Say Y if you want to use peripheral devices such as UART, SPI, I2C, USB, SD/UFS, PCIe etc. +config SM_GPUCC_8150 + tristate "SM8150 Graphics Clock Controller" + select SM_GCC_8150 + help + Support for the graphics clock controller on SM8150 devices. + Say Y if you want to support graphics controller devices and + functionality such as 3D graphics. + config SPMI_PMIC_CLKDIV tristate "SPMI PMIC clkdiv Support" depends on SPMI || COMPILE_TEST
drivers/clk/qcom/Makefile +1 -0
@@ -62,6 +62,7 @@ obj-$(CONFIG_SDM_LPASSCC_845) += lpasscc-sdm845.o obj-$(CONFIG_SDM_VIDEOCC_845) += videocc-sdm845.o obj-$(CONFIG_SM_GCC_8150) += gcc-sm8150.o obj-$(CONFIG_SM_GCC_8250) += gcc-sm8250.o +obj-$(CONFIG_SM_GPUCC_8150) += gpucc-sm8150.o obj-$(CONFIG_SPMI_PMIC_CLKDIV) += clk-spmi-pmic-div.o obj-$(CONFIG_KPSS_XCC) += kpss-xcc.o obj-$(CONFIG_QCOM_HFPLL) += hfpll.o
drivers/clk/qcom/gpucc-sm8150.c new file +421 -0
421 lines not on this page · raw message
Signature · 1 line
2.26.1
PATCH RESEND v2 8/13 clk: qcom: add common gdsc_gx_do_nothing_enable for gpucc drivers
In reply to Jonathan MarekAll gpucc drivers need this, so move it to common code instead of duplicating it in every gpucc driver.
--- drivers/clk/qcom/gdsc.c | 25 +++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 1 + drivers/clk/qcom/gpucc-sc7180.c | 27 +-------------------------- drivers/clk/qcom/gpucc-sdm845.c | 27 +-------------------------- 4 files changed, 28 insertions(+), 52 deletions(-)
drivers/clk/qcom/gdsc.c +25 -0
@@ -433,3 +433,28 @@ void gdsc_unregister(struct gdsc_desc *desc) }of_genpd_del_provider (dev->of_node); } + +/* +* On SDM845+ the GPU GX domain is *almost* entirely controlled by the GMU +* running in the CX domain so the CPU doesn't need to know anything about the +* GX domain EXCEPT.... +* +* Hardware constraints dictate that the GX be powered down before the CX. If +* the GMU crashes it could leave the GX on. In order to successfully bring back +* the device the CPU needs to disable the GX headswitch. There being no sane +* way to reach in and touch that register from deep inside the GPU driver we +* need to set up the infrastructure to be able to ensure that the GPU can +* ensure that the GX is off during this super special case. We do this by +* defining a GX gdsc with a dummy enable function and a "default" disable +* function. +* +* This allows us to attach with genpd_dev_pm_attach_by_name() in the GPU +* driver. During power up, nothing will happen from the CPU (and the GMU will +* power up normally but during power down this will ensure that the GX domain +* is *really* off - this gives us a semi standard way of doing what we need. +*/ +int gdsc_gx_do_nothing_enable (struct generic_pm_domain *domain) +{ +/* Do nothing but give genpd the impression that we were successful */ +return 0 ; +}
drivers/clk/qcom/gdsc.h +1 -0
@@ -68,6 +68,7 @@ struct gdsc_desc {int gdsc_register (struct gdsc_desc *desc,struct reset_controller_dev *,struct regmap *);void gdsc_unregister (struct gdsc_desc *desc); +int gdsc_gx_do_nothing_enable (struct generic_pm_domain *domain);#else static inline int gdsc_register(struct gdsc_desc *desc, struct reset_controller_dev *rcdev,
drivers/clk/qcom/gpucc-sc7180.c +1 -26
@@ -170,37 +170,12 @@ static struct gdsc cx_gdsc = { .flags = VOTABLE, }; -/* -* On SC7180 the GPU GX domain is *almost* entirely controlled by the GMU -* running in the CX domain so the CPU doesn't need to know anything about the -* GX domain EXCEPT.... -* -* Hardware constraints dictate that the GX be powered down before the CX. If -* the GMU crashes it could leave the GX on. In order to successfully bring back -* the device the CPU needs to disable the GX headswitch. There being no sane -* way to reach in and touch that register from deep inside the GPU driver we -* need to set up the infrastructure to be able to ensure that the GPU can -* ensure that the GX is off during this super special case. We do this by -* defining a GX gdsc with a dummy enable function and a "default" disable -* function. -* -* This allows us to attach with genpd_dev_pm_attach_by_name() in the GPU -* driver. During power up, nothing will happen from the CPU (and the GMU will -* power up normally but during power down this will ensure that the GX domain -* is *really* off - this gives us a semi standard way of doing what we need. -*/ -static int gx_gdsc_enable (struct generic_pm_domain *domain) -{ -/* Do nothing but give genpd the impression that we were successful */ -return 0 ; -} -static struct gdsc gx_gdsc = { .gdscr =0x100c , .clamp_io_ctrl =0x1508 , .pd = { .name ="gx_gdsc" , - .power_on = gx_gdsc_enable, + .power_on = gdsc_gx_do_nothing_enable, }, .pwrsts =PWRSTS_OFF_ON , .flags =CLAMP_IO ,
drivers/clk/qcom/gpucc-sdm845.c +1 -26
@@ -131,37 +131,12 @@ static struct gdsc gpu_cx_gdsc = { .flags = VOTABLE, }; -/* -* On SDM845 the GPU GX domain is *almost* entirely controlled by the GMU -* running in the CX domain so the CPU doesn't need to know anything about the -* GX domain EXCEPT.... -* -* Hardware constraints dictate that the GX be powered down before the CX. If -* the GMU crashes it could leave the GX on. In order to successfully bring back -* the device the CPU needs to disable the GX headswitch. There being no sane -* way to reach in and touch that register from deep inside the GPU driver we -* need to set up the infrastructure to be able to ensure that the GPU can -* ensure that the GX is off during this super special case. We do this by -* defining a GX gdsc with a dummy enable function and a "default" disable -* function. -* -* This allows us to attach with genpd_dev_pm_attach_by_name() in the GPU -* driver. During power up, nothing will happen from the CPU (and the GMU will -* power up normally but during power down this will ensure that the GX domain -* is *really* off - this gives us a semi standard way of doing what we need. -*/ -static int gx_gdsc_enable (struct generic_pm_domain *domain) -{ -/* Do nothing but give genpd the impression that we were successful */ -return 0 ; -} -static struct gdsc gpu_gx_gdsc = { .gdscr =0x100c , .clamp_io_ctrl =0x1508 , .pd = { .name ="gpu_gx_gdsc" , - .power_on = gx_gdsc_enable, + .power_on = gdsc_gx_do_nothing_enable, }, .pwrsts =PWRSTS_OFF_ON , .flags =CLAMP_IO |AON_RESET |POLL_CFG_GDSCR ,
Signature · 1 line
2.26.1
PATCH RESEND v2 7/13 dt-bindings: clock: Introduce SM8250 QCOM Graphics clock bindings
In reply to Jonathan MarekAdd device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8250 SoCs.
--- .../bindings/clock/qcom,sm8250-gpucc.yaml | 74 +++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8250.h | 40 ++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yaml create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8250.h
Documentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yaml new file +74 -0
@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,sm8250-gpucc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Graphics Clock & Reset Controller Binding for SM8250 + +maintainers: + - + +description: | + Qualcomm graphics clock control module which supports the clocks, resets and + power domains on SM8250. + + See also dt-bindings/clock/qcom,gpucc-sm8250.h. + +properties: + compatible: + const: qcom,sm8250-gpucc + + clocks: + items: + - description: Board XO source + - description: GPLL0 main branch source + - description: GPLL0 div branch source + + clock-names: + items: + - const: bi_tcxo + - const: gcc_gpu_gpll0_clk_src + - const: gcc_gpu_gpll0_div_clk_src + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sm8250.h> + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@3d90000 { + compatible = "qcom,sm8250-gpucc"; + reg = <0x3d90000 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; +...
include/dt-bindings/clock/qcom,gpucc-sm8250.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8250_H +#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8250_H + +/* GPU_CC clock registers */ +#define GPU_CC_AHB_CLK 0 +#define GPU_CC_CRC_AHB_CLK 1 +#define GPU_CC_CX_APB_CLK 2 +#define GPU_CC_CX_GMU_CLK 3 +#define GPU_CC_CX_QDSS_AT_CLK 4 +#define GPU_CC_CX_QDSS_TRIG_CLK 5 +#define GPU_CC_CX_QDSS_TSCTR_CLK 6 +#define GPU_CC_CX_SNOC_DVM_CLK 7 +#define GPU_CC_CXO_AON_CLK 8 +#define GPU_CC_CXO_CLK 9 +#define GPU_CC_GMU_CLK_SRC 10 +#define GPU_CC_GX_GMU_CLK 11 +#define GPU_CC_GX_QDSS_TSCTR_CLK 12 +#define GPU_CC_GX_VSENSE_CLK 13 +#define GPU_CC_PLL1 14 +#define GPU_CC_SLEEP_CLK 15 +#define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 16 + +/* GPU_CC Resets */ +#define GPUCC_GPU_CC_ACD_BCR 0 +#define GPUCC_GPU_CC_CX_BCR 1 +#define GPUCC_GPU_CC_GFX3D_AON_BCR 2 +#define GPUCC_GPU_CC_GMU_BCR 3 +#define GPUCC_GPU_CC_GX_BCR 4 +#define GPUCC_GPU_CC_XO_BCR 5 + +/* GPU_CC GDSCRs */ +#define GPU_CX_GDSC 0 +#define GPU_GX_GDSC 1 + +#endif
Signature · 1 line
2.26.1
PATCH RESEND v2 5/13 clk: qcom: gcc: remove unnecessary vco_table from SM8150
In reply to Jonathan MarekThe fixed alpha pll ops only use it for clamping in round_rate, which is unnecessary. This is consistent with SM8250 GCC not using vco_table.
--- drivers/clk/qcom/gcc-sm8150.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/clk/qcom/gcc-sm8150.c +0 -10
@@ -34,14 +34,8 @@ enum { P_SLEEP_CLK, }; -static const struct pll_vco trion_vco[] = { - {249600000 ,2000000000 ,0 }, -}; -static struct clk_alpha_pll gpll0 = { .offset =0x0 , - .vco_table = trion_vco, - .num_vco =ARRAY_SIZE (trion_vco), .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION ], .clkr = { .enable_reg =0x52000 ,
@@ -85,8 +79,6 @@ static struct clk_alpha_pll_postdiv gpll0_out_even = {static struct clk_alpha_pll gpll7 = { .offset =0x1a000 , - .vco_table = trion_vco, - .num_vco =ARRAY_SIZE (trion_vco), .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION ], .clkr = { .enable_reg =0x52000 ,
@@ -105,8 +97,6 @@ static struct clk_alpha_pll gpll7 = {static struct clk_alpha_pll gpll9 = { .offset =0x1c000 , - .vco_table = trion_vco, - .num_vco =ARRAY_SIZE (trion_vco), .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_TRION ], .clkr = { .enable_reg =0x52000 ,
Signature · 1 line
2.26.1
PATCH RESEND v2 4/13 clk: qcom: clk-alpha-pll: use the right PCAL_DONE value for lucid pll
In reply to Jonathan MarekLucid PCAL_DONE is different from trion.
--- drivers/clk/qcom/clk-alpha-pll.c | 28 ++++++++++++++++++++++++++-- drivers/clk/qcom/clk-alpha-pll.h | 2 +- 2 files changed, 27 insertions(+), 3 deletions(-)
drivers/clk/qcom/clk-alpha-pll.c +26 -2
@@ -143,6 +143,9 @@ EXPORT_SYMBOL_GPL(clk_alpha_pll_regs);#define TRION_PLL_CAL_VAL 0x44#define TRION_PCAL_DONE BIT(26) +/* LUCID PLL specific settings and offsets */ +#define LUCID_PCAL_DONE BIT(27) +#define pll_alpha_width (p) \ ((PLL_ALPHA_VAL_U(p) - PLL_ALPHA_VAL(p) == 4) ? \ ALPHA_REG_BITWIDTH : ALPHA_REG_16BIT_WIDTH)
@@ -1447,7 +1450,7 @@ EXPORT_SYMBOL_GPL(clk_trion_pll_configure);* The TRION PLL requires a power-on self-calibration which happens when the * PLL comes out of reset. Calibrate in case it is not completed. */ -static int alpha_pll_trion_prepare (struct clk_hw *hw) +static int __alpha_pll_trion_prepare (struct clk_hw *hw,u32 pcal_done) {struct clk_alpha_pll *pll =to_clk_alpha_pll (hw);u32 regval;
@@ -1455,7 +1458,7 @@ static int alpha_pll_trion_prepare(struct clk_hw *hw)/* Return early if calibration is not needed. */ regmap_read (pll->clkr.regmap,PLL_STATUS (pll), ®val); -if (regval &TRION_PCAL_DONE ) +if (regval & pcal_done)return 0 ;/* On/off to calibrate */
@@ -1466,6 +1469,16 @@ static int alpha_pll_trion_prepare(struct clk_hw *hw)return ret; } +static int alpha_pll_trion_prepare (struct clk_hw *hw) +{ +return __alpha_pll_trion_prepare (hw,TRION_PCAL_DONE ); +} + +static int alpha_pll_lucid_prepare (struct clk_hw *hw) +{ +return __alpha_pll_trion_prepare (hw,LUCID_PCAL_DONE ); +} +static int alpha_pll_trion_set_rate (struct clk_hw *hw,unsigned long rate,unsigned long prate) {
@@ -1529,6 +1542,17 @@ const struct clk_ops clk_alpha_pll_trion_ops = { .round_rate = clk_alpha_pll_round_rate, .set_rate = alpha_pll_trion_set_rate, }; +EXPORT_SYMBOL_GPL (clk_alpha_pll_trion_ops); + +const struct clk_ops clk_alpha_pll_lucid_ops = { + .prepare = alpha_pll_lucid_prepare, + .enable = clk_trion_pll_enable, + .disable = clk_trion_pll_disable, + .is_enabled = clk_trion_pll_is_enabled, + .recalc_rate = clk_trion_pll_recalc_rate, + .round_rate = clk_alpha_pll_round_rate, + .set_rate = alpha_pll_trion_set_rate, +};EXPORT_SYMBOL_GPL (clk_alpha_pll_lucid_ops);const struct clk_ops clk_alpha_pll_postdiv_lucid_ops = {
drivers/clk/qcom/clk-alpha-pll.h +1 -1
@@ -132,7 +132,7 @@ extern const struct clk_ops clk_alpha_pll_trion_ops;extern const struct clk_ops clk_alpha_pll_fixed_trion_ops;extern const struct clk_ops clk_alpha_pll_postdiv_trion_ops; -#define clk_alpha_pll_lucid_ops clk_alpha_pll_trion_ops +extern const struct clk_ops clk_alpha_pll_lucid_ops;#define clk_alpha_pll_fixed_lucid_ops clk_alpha_pll_fixed_trion_opsextern const struct clk_ops clk_alpha_pll_postdiv_lucid_ops;
Signature · 1 line
2.26.1
v2 cover Enable GPU for SM8150 and SM8250
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrect PLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add common gdsc_gx_do_nothing_enable for gpucc drivers" and changed gpucc patches to use it.
* Removed CLK_IS_CRITICAL from gpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dts
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
Jonathan Marek (13):
clk: qcom: gcc: fix sm8150 GPU and NPU clocks
clk: qcom: clk-alpha-pll: remove unused/incorrect PLL_CAL_VAL
clk: qcom: clk-alpha-pll: same regs and ops for trion and lucid
clk: qcom: clk-alpha-pll: use the right PCAL_DONE value for lucid pll
clk: qcom: gcc: remove unnecessary vco_table from SM8150
dt-bindings: clock: Introduce SM8150 QCOM Graphics clock bindings
dt-bindings: clock: Introduce SM8250 QCOM Graphics clock bindings
clk: qcom: add common gdsc_gx_do_nothing_enable for gpucc drivers
clk: qcom: Add graphics clock controller driver for SM8150
clk: qcom: Add graphics clock controller driver for SM8250
dt-bindings: power: Add missing rpmpd rpmh regulator level
arm64: dts: qcom: add sm8150 GPU nodes
arm64: dts: qcom: add sm8250 GPU nodes
.../bindings/clock/qcom,sm8150-gpucc.yaml | 74 +++ .../bindings/clock/qcom,sm8250-gpucc.yaml | 74 +++ arch/arm64/boot/dts/qcom/sm8150.dtsi | 136 ++++++ arch/arm64/boot/dts/qcom/sm8250.dtsi | 143 ++++++ drivers/clk/qcom/Kconfig | 16 + drivers/clk/qcom/Makefile | 2 + drivers/clk/qcom/clk-alpha-pll.c | 70 ++- drivers/clk/qcom/clk-alpha-pll.h | 15 +- drivers/clk/qcom/gcc-sm8150.c | 26 +- drivers/clk/qcom/gdsc.c | 25 + drivers/clk/qcom/gdsc.h | 1 + drivers/clk/qcom/gpucc-sc7180.c | 27 +- drivers/clk/qcom/gpucc-sdm845.c | 27 +- drivers/clk/qcom/gpucc-sm8150.c | 421 ++++++++++++++++ drivers/clk/qcom/gpucc-sm8250.c | 450 ++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8150.h | 40 ++ include/dt-bindings/clock/qcom,gpucc-sm8250.h | 40 ++ include/dt-bindings/power/qcom-rpmpd.h | 1 + 18 files changed, 1479 insertions(+), 109 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yaml create mode 100644 drivers/clk/qcom/gpucc-sm8150.c create mode 100644 drivers/clk/qcom/gpucc-sm8250.c create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8150.h create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8250.h
Signature · 1 line
2.26.1
Rob Herring
maintainerRe: [RESEND PATCH v2 06/13] dt-bindings: clock: Introduce SM8150 QCOM Graphics clock bindings
In reply to Jonathan MarekQuoted 11 lines · Jonathan Marek
Add device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8150 SoCs.
Signed-off-by Jonathan Marek <[email protected]>--- .../bindings/clock/qcom,sm8150-gpucc.yaml | 74 +++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8150.h | 40 ++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8150.h
My bot found errors running 'make dt_binding_check' on your patch:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml: maintainers:0: None is not of type 'string' Documentation/devicetree/bindings/Makefile:20: recipe for target 'Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.example.dts' failed make[1]: *** [Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs.... /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml: ignoring, error in schema: maintainers: 0
warning: no schema found in file: ./Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml: ignoring, error in schema: maintainers: 0
warning: no schema found in file: ./Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml
Makefile:1347: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2
See https://patchwork.ozlabs.org/patch/1319320
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
Rob Herring
maintainerRe: [RESEND PATCH v2 06/13] dt-bindings: clock: Introduce SM8150 QCOM Graphics clock bindings
In reply to Jonathan MarekQuoted 17 lines · Jonathan Marek
Add device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8150 SoCs.
Signed-off-by Jonathan Marek <[email protected]>--- .../bindings/clock/qcom,sm8150-gpucc.yaml | 74 +++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8150.h | 40 ++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8150.hDocumentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml new file +0
-0
Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml line 1
Quoted 1 line
Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml new file +1
-0@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0-only
Dual license new bindings.
(GPL-2.0-only OR BSD-2-Clause)
Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml line 10
Quoted 9 lines
Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml new file +9
-0+%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,sm8150-gpucc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Graphics Clock & Reset Controller Binding for SM8150 + +maintainers: + -
Got to pick someone.
Quoted 113 lines
Documentation/devicetree/bindings/clock/qcom,sm8150-gpucc.yaml new file +64
-0+ +description: | + Qualcomm graphics clock control module which supports the clocks, resets and + power domains on SM8150. + + See also dt-bindings/clock/qcom,gpucc-sm8150.h. + +properties: + compatible: + const: qcom,sm8150-gpucc + + clocks: + items: + - description: Board XO source + - description: GPLL0 main branch source + - description: GPLL0 div branch source + + clock-names: + items: + - const: bi_tcxo + - const: gcc_gpu_gpll0_clk_src + - const: gcc_gpu_gpll0_div_clk_src + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sm8150.h> + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@2c90000 { + compatible = "qcom,sm8150-gpucc"; + reg = <0x2c90000 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; +...include/dt-bindings/clock/qcom,gpucc-sm8150.h new file +40
-0@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8150_H +#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8150_H + +/* GPU_CC clock registers */ +#define GPU_CC_AHB_CLK 0 +#define GPU_CC_CRC_AHB_CLK 1 +#define GPU_CC_CX_APB_CLK 2 +#define GPU_CC_CX_GMU_CLK 3 +#define GPU_CC_CX_QDSS_AT_CLK 4 +#define GPU_CC_CX_QDSS_TRIG_CLK 5 +#define GPU_CC_CX_QDSS_TSCTR_CLK 6 +#define GPU_CC_CX_SNOC_DVM_CLK 7 +#define GPU_CC_CXO_AON_CLK 8 +#define GPU_CC_CXO_CLK 9 +#define GPU_CC_GMU_CLK_SRC 10 +#define GPU_CC_GX_GMU_CLK 11 +#define GPU_CC_GX_QDSS_TSCTR_CLK 12 +#define GPU_CC_GX_VSENSE_CLK 13 +#define GPU_CC_PLL1 14 +#define GPU_CC_PLL_TEST_CLK 15 +#define GPU_CC_SLEEP_CLK 16 + +/* GPU_CC Resets */ +#define GPUCC_GPU_CC_CX_BCR 0 +#define GPUCC_GPU_CC_GFX3D_AON_BCR 1 +#define GPUCC_GPU_CC_GMU_BCR 2 +#define GPUCC_GPU_CC_GX_BCR 3 +#define GPUCC_GPU_CC_SPDM_BCR 4 +#define GPUCC_GPU_CC_XO_BCR 5 + +/* GPU_CC GDSCRs */ +#define GPU_CX_GDSC 0 +#define GPU_GX_GDSC 1 + +#endif Signature · 1 line
2.26.1
Rob Herring
maintainerRe: [RESEND PATCH v2 07/13] dt-bindings: clock: Introduce SM8250 QCOM Graphics clock bindings
In reply to Jonathan MarekQuoted 3 lines · Jonathan Marek
Add device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8250 SoCs.
Looks like these 2 schemas could be a single one.
Quoted 137 lines
Signed-off-by Jonathan Marek <[email protected]>--- .../bindings/clock/qcom,sm8250-gpucc.yaml | 74 +++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8250.h | 40 ++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yaml create mode 100644 include/dt-bindings/clock/qcom,gpucc-sm8250.hDocumentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yaml new file +74
-0@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,sm8250-gpucc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Graphics Clock & Reset Controller Binding for SM8250 + +maintainers: + - + +description: | + Qualcomm graphics clock control module which supports the clocks, resets and + power domains on SM8250. + + See also dt-bindings/clock/qcom,gpucc-sm8250.h. + +properties: + compatible: + const: qcom,sm8250-gpucc + + clocks: + items: + - description: Board XO source + - description: GPLL0 main branch source + - description: GPLL0 div branch source + + clock-names: + items: + - const: bi_tcxo + - const: gcc_gpu_gpll0_clk_src + - const: gcc_gpu_gpll0_div_clk_src + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sm8250.h> + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@3d90000 { + compatible = "qcom,sm8250-gpucc"; + reg = <0x3d90000 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; +...include/dt-bindings/clock/qcom,gpucc-sm8250.h new file +40
-0@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8250_H +#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8250_H + +/* GPU_CC clock registers */ +#define GPU_CC_AHB_CLK 0 +#define GPU_CC_CRC_AHB_CLK 1 +#define GPU_CC_CX_APB_CLK 2 +#define GPU_CC_CX_GMU_CLK 3 +#define GPU_CC_CX_QDSS_AT_CLK 4 +#define GPU_CC_CX_QDSS_TRIG_CLK 5 +#define GPU_CC_CX_QDSS_TSCTR_CLK 6 +#define GPU_CC_CX_SNOC_DVM_CLK 7 +#define GPU_CC_CXO_AON_CLK 8 +#define GPU_CC_CXO_CLK 9 +#define GPU_CC_GMU_CLK_SRC 10 +#define GPU_CC_GX_GMU_CLK 11 +#define GPU_CC_GX_QDSS_TSCTR_CLK 12 +#define GPU_CC_GX_VSENSE_CLK 13 +#define GPU_CC_PLL1 14 +#define GPU_CC_SLEEP_CLK 15 +#define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 16 + +/* GPU_CC Resets */ +#define GPUCC_GPU_CC_ACD_BCR 0 +#define GPUCC_GPU_CC_CX_BCR 1 +#define GPUCC_GPU_CC_GFX3D_AON_BCR 2 +#define GPUCC_GPU_CC_GMU_BCR 3 +#define GPUCC_GPU_CC_GX_BCR 4 +#define GPUCC_GPU_CC_XO_BCR 5 + +/* GPU_CC GDSCRs */ +#define GPU_CX_GDSC 0 +#define GPU_GX_GDSC 1 + +#endif Signature · 1 line
2.26.1
Re: [RESEND PATCH v2 07/13] dt-bindings: clock: Introduce SM8250 QCOM Graphics clock bindings
Quoted 7 lines · Rob Herring
Quoted 3 lines · Jonathan Marek
Add device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM8250 SoCs.
Looks like these 2 schemas could be a single one.
I agree, but there are already separate schemas for sdm845 and sc7180 gpucc (which these are a copy paste of), so should those be removed and use the single one too?
Quoted 137 lines
Quoted 137 lines
Signed-off-by Jonathan Marek <[email protected]>--- .../bindings/clock/qcom,sm8250-gpucc.yaml | 74 +++++++++++++++++++ include/dt-bindings/clock/qcom,gpucc-sm8250.h | 40 ++++++++++ 2 files changed, 114 insertions(+)create mode 100644
Documentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yamlcreate mode 100644include/dt-bindings/clock/qcom,gpucc-sm8250.hDocumentation/devicetree/bindings/clock/qcom,sm8250-gpucc.yaml new file +74
-0@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: GPL-2.0-only +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,sm8250-gpucc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Graphics Clock & Reset Controller Binding for SM8250 + +maintainers: + - + +description: | + Qualcomm graphics clock control module which supports the clocks, resets and + power domains on SM8250. + + See also dt-bindings/clock/qcom,gpucc-sm8250.h. + +properties: + compatible: + const: qcom,sm8250-gpucc + + clocks: + items: + - description: Board XO source + - description: GPLL0 main branch source + - description: GPLL0 div branch source + + clock-names: + items: + - const: bi_tcxo + - const: gcc_gpu_gpll0_clk_src + - const: gcc_gpu_gpll0_div_clk_src + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + + '#power-domain-cells': + const: 1 + + reg: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - '#clock-cells' + - '#reset-cells' + - '#power-domain-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/qcom,gcc-sm8250.h> + #include <dt-bindings/clock/qcom,rpmh.h> + clock-controller@3d90000 { + compatible = "qcom,sm8250-gpucc"; + reg = <0x3d90000 0x9000>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_GPU_GPLL0_CLK_SRC>, + <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>; + clock-names = "bi_tcxo", + "gcc_gpu_gpll0_clk_src", + "gcc_gpu_gpll0_div_clk_src"; + #clock-cells = <1>; + #reset-cells = <1>; + #power-domain-cells = <1>; + }; +...include/dt-bindings/clock/qcom,gpucc-sm8250.h new file +40
-0@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. +*/ + +#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8250_H +#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8250_H + +/* GPU_CC clock registers */ +#define GPU_CC_AHB_CLK 0 +#define GPU_CC_CRC_AHB_CLK 1 +#define GPU_CC_CX_APB_CLK 2 +#define GPU_CC_CX_GMU_CLK 3 +#define GPU_CC_CX_QDSS_AT_CLK 4 +#define GPU_CC_CX_QDSS_TRIG_CLK 5 +#define GPU_CC_CX_QDSS_TSCTR_CLK 6 +#define GPU_CC_CX_SNOC_DVM_CLK 7 +#define GPU_CC_CXO_AON_CLK 8 +#define GPU_CC_CXO_CLK 9 +#define GPU_CC_GMU_CLK_SRC 10 +#define GPU_CC_GX_GMU_CLK 11 +#define GPU_CC_GX_QDSS_TSCTR_CLK 12 +#define GPU_CC_GX_VSENSE_CLK 13 +#define GPU_CC_PLL1 14 +#define GPU_CC_SLEEP_CLK 15 +#define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 16 + +/* GPU_CC Resets */ +#define GPUCC_GPU_CC_ACD_BCR 0 +#define GPUCC_GPU_CC_CX_BCR 1 +#define GPUCC_GPU_CC_GFX3D_AON_BCR 2 +#define GPUCC_GPU_CC_GMU_BCR 3 +#define GPUCC_GPU_CC_GX_BCR 4 +#define GPUCC_GPU_CC_XO_BCR 5 + +/* GPU_CC GDSCRs */ +#define GPU_CX_GDSC 0 +#define GPU_GX_GDSC 1 + +#endif Signature · 1 line
2.26.1
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dts
Quoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu: genpd_runtime_resume() [ 56.774196] PM: gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns [ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns [ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu: genpd_runtime_suspend() [ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110
Signature · 2 lines
With best wishes Dmitry
Quoted 22 lines · Dmitry Baryshkov
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dtsQuoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
Quoted 10 lines
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu:
genpd_runtime_resume()
[ 56.774196] PM:gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns
[ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns
[ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu:genpd_runtime_suspend()
[ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110
Do you have your branch published somewhere so I can see what could've went wrong?
Quoted 34 lines · Jonathan Marek
Quoted 22 lines · Dmitry Baryshkov
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dtsQuoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
Quoted 10 lines
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu:
genpd_runtime_resume()
[ 56.774196] PM:gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns
[ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns
[ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu:genpd_runtime_suspend()
[ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110
Quoted 1 line
Do you have your branch published somewhere so I can see what could've went wrong?
I've applied your patches (this series + the extra one for gpu/drm/msm) on top of https://git.linaro.org/landing-teams/working/qualcomm/kernel.git branch integration-linux-qcomlt .
Signature · 2 lines
With best wishes Dmitry
Quoted 35 lines · Dmitry Baryshkov
Quoted 34 lines · Jonathan Marek
Quoted 32 lines · Dmitry Baryshkov
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dtsQuoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu:
genpd_runtime_resume()
[ 56.774196] PM:gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns
[ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns
[ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu:genpd_runtime_suspend()
[ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110
Quoted 3 lines
Quoted 1 line
Do you have your branch published somewhere so I can see what could've went wrong?
I've applied your patches (this series + the extra one for gpu/drm/msm) on top of https://git.linaro.org/landing-teams/working/qualcomm/kernel.git branch integration-linux-qcomlt .
A trimmed down version: git.linaro.org/people/dmitry.baryshkov/kernel.git branch sm8250-gpu-test
Signature · 2 lines
With best wishes Dmitry
Quoted 36 lines · Dmitry Baryshkov
Quoted 35 lines · Dmitry Baryshkov
Quoted 34 lines · Jonathan Marek
Quoted 32 lines · Dmitry Baryshkov
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dtsQuoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu:
genpd_runtime_resume()
[ 56.774196] PM:gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns
[ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns
[ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu:genpd_runtime_suspend()
[ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Do you have your branch published somewhere so I can see what could've went wrong?
I've applied your patches (this series + the extra one for gpu/drm/msm) on top of https://git.linaro.org/landing-teams/working/qualcomm/kernel.git branch integration-linux-qcomlt .
A trimmed down version: git.linaro.org/people/dmitry.baryshkov/kernel.git branch sm8250-gpu-test
Hi,
I tried this branch, with only the sm8250-hdk.dts from my other series added (USB nodes removed as you don't have those in your branch), and the GPU starts up without problems.
Possible differences I can think of:
1) Different firmware version which behaves differently? These are the checksums for the firmware I have:
/lib/firmware# md5sum a650_*
f6536ba45c2f9f64ec31438217b6a027 a650_gmu.bin 897be740bed67deaa1943e9c36293165 a650_sqe.fw 00f1b291a2b30c98f05c25506e3f4761 a650_zap.b00 bec0f79c7c6f5b32254facf3c7e046c7 a650_zap.b01 35273e4135147a269076144a3051b498 a650_zap.b02 ce0dd1af27306eb341a01bda642f1c64 a650_zap.elf 09834955a8865073f6ee483f69a98b33 a650_zap.mdt
2) GPU revision is not 650.2 (the downstream driver had workarounds for bugs in the first revisions, which I didn't include in the upstream driver)
3) Something in the kernel config is making a difference. Here is the kernel config I used to test this: https://gist.github.com/flto/c6b1bc48abda6fb580a2f21c51039c81
-Jonathan
Hi,
Quoted 53 lines · Jonathan Marek
Quoted 36 lines · Dmitry Baryshkov
Quoted 35 lines · Dmitry Baryshkov
Quoted 34 lines · Jonathan Marek
Quoted 32 lines · Dmitry Baryshkov
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dtsQuoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu:
genpd_runtime_resume()
[ 56.774196] PM:gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns
[ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns
[ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu:genpd_runtime_suspend()
[ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Do you have your branch published somewhere so I can see what could've went wrong?
I've applied your patches (this series + the extra one for gpu/drm/msm) on top of https://git.linaro.org/landing-teams/working/qualcomm/kernel.git branch integration-linux-qcomlt .
A trimmed down version: git.linaro.org/people/dmitry.baryshkov/kernel.git branch sm8250-gpu-test
Hi,
I tried this branch, with only the
sm8250-hdk.dtsfrom my other series added (USB nodes removed as you don't have those in your branch), and the GPU starts up without problems.Possible differences I can think of:
1) Different firmware version which behaves differently? These are the checksums for the firmware I have:
Quoted 8 lines
/lib/firmware# md5sum a650_*
f6536ba45c2f9f64ec31438217b6a027 a650_gmu.bin
897be740bed67deaa1943e9c36293165 a650_sqe.fw
00f1b291a2b30c98f05c25506e3f4761 a650_zap.b00
bec0f79c7c6f5b32254facf3c7e046c7 a650_zap.b01
35273e4135147a269076144a3051b498 a650_zap.b02
ce0dd1af27306eb341a01bda642f1c64 a650_zap.elf
09834955a8865073f6ee483f69a98b33 a650_zap.mdt
Interesting. This is what I have here:
3a3a455289c8c36b97a76b95d1dda5cb a650_gmu.bin 9439db9b76c84f4aec625ff2bc4d1f90 a650_sqe.fw 00f1b291a2b30c98f05c25506e3f4761 a650_zap.b00 f30017eb17a440476a939d8eb1fbe102 a650_zap.b01 35273e4135147a269076144a3051b498 a650_zap.b02 03cef57e54ff48ab3ad49c7e2bcac56e a650_zap.elf 93f651f41f4bab30dfb8e2bbd8f64ffd a650_zap.mdt
Quoted 1 line
2) GPU revision is not 650.2 (the downstream driver had workarounds for bugs in the first revisions, which I didn't include in the upstream driver)
Interesting, I will take a look. The first obvious difference is the hang timeout and the a6xx_gmu_start() handling.
Quoted 2 lines
3) Something in the kernel config is making a difference. Here is the kernel config I used to test this: https://gist.github.com/flto/c6b1bc48abda6fb580a2f21c51039c81
No, your config produces the same result:
[ 46.964891] msm msm: [drm:0xffffffc01049bd00] loaded qcom/a650_sqe.fw from new location [ 46.973156] msm msm: [drm:0xffffffc01049bd00] loaded qcom/a650_gmu.bin from new location [ 46.994573] platform 3d6a000.gmu: [drm:0xffffffc0104a85d4] *ERROR* GMU firmware initialization timed out [ 47.004537] msm msm: [drm:0xffffffc01049b584] *ERROR* Couldn't power up the GPU: -110
Signature · 2 lines
With best wishes Dmitry
Quoted 22 lines · Dmitry Baryshkov
Quoted 17 lines · Jonathan Marek
This series adds the missing clock drivers and dts nodes to enable the GPU on both SM8150 and SM8250.
Note an extra patch [1] is still required for GPU to work on SM8250.
Changes in V2:
* Added "clk: qcom: gcc: fix sm8150 GPU and NPU clocks" to fix the newly added SM8150 GPU gcc clocks
* Added "Fixes:" tag to "clk: qcom: clk-alpha-pll: remove unused/incorrectPLL_CAL_VAL"
* Added yaml schemas to gpucc dt-bindings patches
* Added "clk: qcom: add commongdsc_gx_do_nothing_enablefor gpucc drivers" and changed gpucc patches to use it.
* RemovedCLK_IS_CRITICALfromgpu_cc_ahb_clk
* Added missing rpmh regulator level for sm8250 GPU clock levels
* Use sm8150/sm8250 iommu compatibles in dts
* Add gcc_gpu_gpll0_clk_src/gcc_gpu_gpll0_div_clk_src to gpucc clocks in dtsQuoted 1 line
[1] https://gist.github.com/flto/784f1aca761ebf2fe6c105719a4a04ca
With your patches applied:
Quoted 8 lines
[ 56.751977] msm msm: [drm:adreno_request_fw] loaded qcom/a650_sqe.fw from new location [ 56.760166] msm msm: [drm:adreno_request_fw] loaded qcom/a650_gmu.bin from new location [ 56.768485] arm-smmu 3da0000.iommu:
genpd_runtime_resume()
[ 56.774196] PM:gpu_cx_gdsc: Power-on latency exceeded, new value 49531 ns
[ 56.781730] arm-smmu 3da0000.iommu: resume latency exceeded, 462604 ns
[ 56.799559] platform 3d6a000.gmu: [drm:a6xx_gmu_resume] *ERROR* GMU firmware initialization timed out [ 56.809260] arm-smmu 3da0000.iommu:genpd_runtime_suspend()
[ 56.813062] msm msm: [drm:adreno_load_gpu] *ERROR* Couldn't power up the GPU: -110
Confirmed to be a firmware issue. With older firmware proposed patches work fine. A patch to support newer firmware releases will be submitted separately.
Signature · 2 lines
With best wishes Dmitry