Loading Documentation/devicetree/bindings/arm/msm/clock-controller.txt +3 −1 Original line number Diff line number Diff line Loading @@ -57,10 +57,12 @@ Required properties: "qcom,mmsscc-8996" "qcom,mmsscc-8996-v2" "qcom,mmsscc-8996-v3" "qcom,mmsscc-8996-pro" "qcom,gpucc-8996" "qcom,gpucc-8996-v2" "qcom,gpucc-8996-v3" "qcom,gpucc-8996-v3.0" "qcom,gpucc-8996-pro" "qcom,gcc-gfx-titanium" "qcom,gcc-californium" "qcom,cc-debug-californium" Loading @@ -76,7 +78,7 @@ Required properties: there is one expected base: "cc_base". Optional reg-names are "apcs_base", "meas", "mmss_base", "lpass_base", "apcs_c0_base", "apcs_c1_base", "apcs_cci_base". "apcs_cci_base", "efuse". Optional properties: - vdd_dig-supply: The digital logic rail supply. Loading arch/arm/boot/dts/qcom/msm8996.dtsi +5 −5 Original line number Diff line number Diff line Loading @@ -746,8 +746,9 @@ clock_mmss: qcom,mmsscc@8c0000 { compatible = "qcom,mmsscc-8996"; reg = <0x8c0000 0xb00c>; reg-names = "cc_base"; reg = <0x8c0000 0xb00c>, <0x74130 0x8>; reg-names = "cc_base", "efuse"; vdd_dig-supply = <&pm8994_s1_corner>; mmpll4_dig-supply = <&pm8994_s1_corner>; mmpll4_analog-supply = <&pm8994_l12>; Loading @@ -771,9 +772,8 @@ clock_gpu: qcom,gpucc@8c0000 { compatible = "qcom,gpucc-8996"; reg = <0x8c0000 0xb00c>, <0x74130 0x8>; reg-names = "cc_base", "efuse"; reg = <0x8c0000 0xb00c>; reg-names = "cc_base"; vdd_gfx-supply = <&gfx_vreg>; qcom,gfx3d_clk_src-opp-handle = <&msm_gpu>; vdd_mx-supply = <&pm8994_s2_corner>; Loading arch/arm/boot/dts/qcom/msm8996pro.dtsi +289 −0 Original line number Diff line number Diff line Loading @@ -377,3 +377,292 @@ qcom,cpr-dynamic-floor-corner = <1>; }; &pmi8994_s2 { regulator-max-microvolt = <1065000>; }; &pm8004_s2 { regulator-max-microvolt = <1065000>; }; &gfx_cpr { compatible = "qcom,cpr3-msm8996pro-mmss-regulator"; }; &gfx_vreg { regulator-min-microvolt = <2>; regulator-max-microvolt = <9>; qcom,cpr-fuse-corners = <4>; qcom,cpr-fuse-combos = <16>; qcom,cpr-speed-bins = <2>; qcom,cpr-speed-bin-corners = <9 9>; qcom,cpr-corners = /* Speed bin 0 */ <9 9 9 9 9 9 9 9>, /* Speed bin 1 */ <9 9 9 9 9 9 9 9>; qcom,cpr-corner-fmax-map = /* Speed bin 0 */ <2 4 6 9>, /* Speed bin 1 */ <2 4 6 9>; qcom,cpr-voltage-ceiling = /* Speed bin 0 */ <400000 670000 670000 745000 825000 905000 960000 1015000 1065000>, /* Speed bin 1 */ <400000 670000 670000 745000 825000 905000 960000 1015000 1065000>; qcom,cpr-voltage-floor = /* Speed bin 0 */ <400000 520000 520000 520000 520000 520000 520000 520000 520000>, /* Speed bin 1 */ <400000 520000 520000 520000 520000 520000 520000 520000 520000>; qcom,mem-acc-voltage = /* Speed bin 0 */ <1 1 1 1 2 2 2 2 2>, /* Speed bin 1 */ <1 1 1 1 2 2 2 2 2>; qcom,corner-frequencies = /* Speed bin 0 */ <0 133000000 214000000 315000000 401800000 510000000 560000000 624000000 652800000>, /* Speed bin 1 */ <0 133000000 214000000 315000000 401800000 510000000 560000000 624000000 652800000>; qcom,cpr-target-quotients = /* Speed bin 0 */ <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, <0 0 0 0 0 0 185 179 291 299 304 319 0 0 0 0>, <0 0 0 0 0 0 287 273 425 426 443 453 0 0 0 0>, <0 0 0 0 0 0 414 392 584 576 608 612 0 0 0 0>, <0 0 0 0 0 0 459 431 684 644 692 679 0 0 0 0>, <0 0 0 0 0 0 577 543 798 768 823 810 0 0 0 0>, <0 0 0 0 0 0 669 629 886 864 924 911 0 0 0 0>, <0 0 0 0 0 0 771 725 984 970 1036 1024 0 0 0 0>, <0 0 0 0 0 0 908 868 1118 1106 1179 1174 0 0 0 0>, /* Speed bin 1 */ <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, <0 0 0 0 0 0 185 179 291 299 304 319 0 0 0 0>, <0 0 0 0 0 0 287 273 425 426 443 453 0 0 0 0>, <0 0 0 0 0 0 414 392 584 576 608 612 0 0 0 0>, <0 0 0 0 0 0 459 431 684 644 692 679 0 0 0 0>, <0 0 0 0 0 0 577 543 798 768 823 810 0 0 0 0>, <0 0 0 0 0 0 669 629 886 864 924 911 0 0 0 0>, <0 0 0 0 0 0 771 725 984 970 1036 1024 0 0 0 0>, <0 0 0 0 0 0 908 868 1118 1106 1179 1174 0 0 0 0>; qcom,cpr-ro-scaling-factor = /* Speed bin 0 */ <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, /* Speed bin 1 */ <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>; qcom,cpr-open-loop-voltage-fuse-adjustment = /* Speed bin 0 */ <(-70000) 0 0 0>, /* Speed bin 1 */ <(-70000) 0 0 0>; qcom,cpr-closed-loop-voltage-adjustment = /* Speed bin 0 */ <0 0 30000 10000 10000 45000 25000 25000 25000>, /* Speed bin 1 */ <0 0 30000 10000 10000 45000 25000 25000 25000>; qcom,cpr-floor-to-ceiling-max-range = /* Speed bin 0 */ <0 70000 70000 75000 80000 90000 95000 100000 100000>, /* Speed bin 1 */ <0 70000 70000 75000 80000 90000 95000 100000 100000>; qcom,cpr-fused-closed-loop-voltage-adjustment-map = /* Speed bin 0 */ <0 2 2 2 2 0 0 4 4>, /* Speed bin 1 */ <0 2 2 2 2 0 0 4 4>; qcom,cpr-aging-max-voltage-adjustment = <15000>; qcom,cpr-aging-ref-corner = <6>; qcom,cpr-aging-ro-scaling-factor = <2950>; qcom,allow-aging-voltage-adjustment = <1>; }; &clock_cpu { compatible = "qcom,cpu-clock-8996-v3"; qcom,pwrcl-speedbin0-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 768000000 7 >, < 844800000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >; qcom,pwrcl-speedbin1-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 768000000 7 >, < 844800000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >; qcom,perfcl-speedbin0-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 748800000 7 >, < 825600000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >, < 1670400000 19 >, < 1747200000 20 >, < 1824000000 21 >, < 1900800000 22 >, < 1977600000 23 >, < 2054400000 24 >, < 2150400000 25 >; /* Additional frequencies to be added after characterization. */ qcom,perfcl-speedbin1-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 748800000 7 >, < 825600000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >, < 1670400000 19 >, < 1747200000 20 >, < 1824000000 21 >, < 1900800000 22 >, < 1977600000 23 >, < 2054400000 24 >, < 2150400000 25 >; qcom,cbf-speedbin0-v0 = < 0 0 >, < 192000000 1 >, < 307200000 2 >, < 384000000 3 >, < 441600000 4 >, < 537600000 5 >, < 614400000 6 >, < 691200000 7 >, < 768000000 8 >, < 844800000 9 >, < 902400000 10 >, < 979200000 11 >, < 1056000000 12 >, < 1132800000 13 >, < 1190400000 14 >, < 1286400000 15 >, < 1363200000 16 >, < 1440000000 17 >, < 1516800000 18 >, < 1593600000 19 >; qcom,cbf-speedbin1-v0 = < 0 0 >, < 192000000 1 >, < 307200000 2 >, < 384000000 3 >, < 441600000 4 >, < 537600000 5 >, < 614400000 6 >, < 691200000 7 >, < 768000000 8 >, < 844800000 9 >, < 902400000 10 >, < 979200000 11 >, < 1056000000 12 >, < 1132800000 13 >, < 1190400000 14 >, < 1286400000 15 >, < 1363200000 16 >, < 1440000000 17 >, < 1516800000 18 >, < 1593600000 19 >; }; drivers/clk/msm/clock-alpha-pll.c +5 −5 Original line number Diff line number Diff line /* * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -629,11 +629,11 @@ static long alpha_pll_round_rate(struct clk *c, unsigned long rate) return -EINVAL; freq_hz = round_rate_up(pll, rate, &l_val, &a_val); if (pll->is_fabia) { if (rate < pll->min_supported_freq) return pll->min_supported_freq; if (pll->is_fabia) return freq_hz; } ret = find_vco(pll, freq_hz); if (!IS_ERR_VALUE(ret)) return freq_hz; Loading drivers/clk/msm/clock-mmss-8996.c +60 −31 Original line number Diff line number Diff line /* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -68,8 +68,10 @@ static void __iomem *virt_base_gpu; #define GFX_MIN_SVS_LEVEL 2 #define GPU_REQ_ID 0x3 #define EFUSE_SHIFT 29 #define EFUSE_MASK 0x7 #define EFUSE_SHIFT_v3 29 #define EFUSE_MASK_v3 0x7 #define EFUSE_SHIFT_PRO 28 #define EFUSE_MASK_PRO 0x3 static struct clk_ops clk_ops_gpu; Loading Loading @@ -402,9 +404,9 @@ static struct mux_div_clk gfx3d_clk_src_v2 = { .max_div = 1, }, .parents = (struct clk_src[]) { {&mmpll9_postdiv_clk.c, 2}, {&mmpll2_postdiv_clk.c, 3}, {&mmpll8_postdiv_clk.c, 4}, {&mmpll9_postdiv_clk.c, 2}, }, .num_parents = 3, .c = { Loading Loading @@ -3512,6 +3514,19 @@ static void msm_mmsscc_8996_v3_fixup(void) video_subcore1_clk_src.c.fmax[VDD_DIG_HIGH] = 520000000; } static void msm_mmsscc_8996_pro_fixup(void) { mmpll9.c.rate = 0; mmpll9.c.fmax[VDD_DIG_LOWER] = 652800000; mmpll9.c.fmax[VDD_DIG_LOW] = 652800000; mmpll9.c.fmax[VDD_DIG_NOMINAL] = 1305600000; mmpll9.c.fmax[VDD_DIG_HIGH] = 1305600000; mmpll9.c.ops = &clk_ops_alpha_pll; mmpll9.min_supported_freq = 1248000000; mmpll9_postdiv_clk.c.ops = &clk_ops_div; } static int is_v3_gpu; static int gpu_pre_set_rate(struct clk *clk, unsigned long new_rate) { Loading Loading @@ -3610,6 +3625,10 @@ static int of_get_fmax_vdd_class(struct platform_device *pdev, struct clk *c, } static struct platform_driver msm_clock_gpu_driver; struct resource *efuse_res; void __iomem *gpu_base; u64 efuse; int gpu_speed_bin; int msm_mmsscc_8996_probe(struct platform_device *pdev) { Loading @@ -3618,19 +3637,33 @@ int msm_mmsscc_8996_probe(struct platform_device *pdev) struct clk *tmp; struct regulator *reg; u32 regval; int is_v2, is_v3 = 0; int is_pro, is_v2, is_v3 = 0; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cc_base"); if (!res) { dev_err(&pdev->dev, "Unable to retrieve register base.\n"); return -ENOMEM; } efuse_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse"); if (!efuse_res) { dev_err(&pdev->dev, "Unable to retrieve efuse register base.\n"); return -ENOMEM; } virt_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!virt_base) { dev_err(&pdev->dev, "Failed to map CC registers\n"); return -ENOMEM; } gpu_base = devm_ioremap(&pdev->dev, efuse_res->start, resource_size(efuse_res)); if (!gpu_base) { dev_err(&pdev->dev, "Unable to map in efuse base\n"); return -ENOMEM; } /* Clear the DBG_CLK_DIV bits of the MMSS debug register */ regval = readl_relaxed(virt_base + mmss_gcc_dbg_clk.offset); regval &= ~BM(18, 17); Loading Loading @@ -3706,6 +3739,9 @@ int msm_mmsscc_8996_probe(struct platform_device *pdev) ext_extpclk_clk_src.dev = &pdev->dev; ext_extpclk_clk_src.clk_id = "extpclk_src"; efuse = readl_relaxed(gpu_base); gpu_speed_bin = ((efuse >> EFUSE_SHIFT_v3) & EFUSE_MASK_v3); is_v2 = of_device_is_compatible(pdev->dev.of_node, "qcom,mmsscc-8996-v2"); if (is_v2) Loading @@ -3716,14 +3752,22 @@ int msm_mmsscc_8996_probe(struct platform_device *pdev) if (is_v3) msm_mmsscc_8996_v3_fixup(); is_pro = of_device_is_compatible(pdev->dev.of_node, "qcom,mmsscc-8996-pro"); if (is_pro) { gpu_speed_bin = ((efuse >> EFUSE_SHIFT_PRO) & EFUSE_MASK_PRO); msm_mmsscc_8996_v3_fixup(); if (!gpu_speed_bin) msm_mmsscc_8996_pro_fixup(); } rc = of_msm_clock_register(pdev->dev.of_node, msm_clocks_mmss_8996, ARRAY_SIZE(msm_clocks_mmss_8996)); if (rc) return rc; /* Register v2/v3 specific clocks */ if (is_v2 || is_v3) { /* Register v2/v3/pro specific clocks */ if (is_v2 || is_v3 || is_pro) { rc = of_msm_clock_register(pdev->dev.of_node, msm_clocks_mmsscc_8996_v2, ARRAY_SIZE(msm_clocks_mmsscc_8996_v2)); Loading @@ -3739,6 +3783,7 @@ static struct of_device_id msm_clock_mmss_match_table[] = { { .compatible = "qcom,mmsscc-8996" }, { .compatible = "qcom,mmsscc-8996-v2" }, { .compatible = "qcom,mmsscc-8996-v3" }, { .compatible = "qcom,mmsscc-8996-pro" }, {}, }; Loading Loading @@ -3803,14 +3848,11 @@ static void msm_gpucc_8996_v2_fixup(void) int msm_gpucc_8996_probe(struct platform_device *pdev) { struct resource *res, *efuse_res; struct resource *res; struct device_node *of_node = pdev->dev.of_node; void __iomem *base; int rc; struct regulator *reg; u64 efuse; int speed_bin; int is_v2_gpu, is_v3_0_gpu; int is_v2_gpu, is_v3_0_gpu, is_pro_gpu; char speedbin_str[] = "qcom,gfxfreq-speedbin0"; char mx_speedbin_str[] = "qcom,gfxfreq-mx-speedbin0"; Loading @@ -3823,12 +3865,6 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) return -ENOMEM; } efuse_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse"); if (!efuse_res) { dev_err(&pdev->dev, "Unable to retrieve efuse register base.\n"); return -ENOMEM; } gfx3d_clk_src_v2.base = virt_base_gpu = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!virt_base_gpu) { Loading @@ -3836,13 +3872,6 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) return -ENOMEM; } base = devm_ioremap(&pdev->dev, efuse_res->start, resource_size(efuse_res)); if (!base) { dev_err(&pdev->dev, "Unable to map in efuse base\n"); return -ENOMEM; } reg = vdd_gfx.regulator[0] = devm_regulator_get(&pdev->dev, "vdd_gfx"); if (IS_ERR(reg)) { if (PTR_ERR(reg) != -EPROBE_DEFER) Loading Loading @@ -3870,14 +3899,13 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) is_v2_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-v2"); is_v3_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-v3"); is_v3_0_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-v3.0"); is_pro_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-pro"); efuse = readl_relaxed(base); speed_bin = ((efuse >> EFUSE_SHIFT) & EFUSE_MASK); dev_info(&pdev->dev, "using speed bin %u\n", speed_bin); dev_info(&pdev->dev, "using speed bin %u\n", gpu_speed_bin); snprintf(speedbin_str, ARRAY_SIZE(speedbin_str), "qcom,gfxfreq-speedbin%d", speed_bin); "qcom,gfxfreq-speedbin%d", gpu_speed_bin); snprintf(mx_speedbin_str, ARRAY_SIZE(mx_speedbin_str), "qcom,gfxfreq-mx-speedbin%d", speed_bin); "qcom,gfxfreq-mx-speedbin%d", gpu_speed_bin); rc = of_get_fmax_vdd_class(pdev, &gpu_mx_clk.c, mx_speedbin_str); if (rc) { Loading @@ -3890,7 +3918,7 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) } } if (!is_v2_gpu && !is_v3_gpu && !is_v3_0_gpu) { if (!is_v2_gpu && !is_v3_gpu && !is_v3_0_gpu && !is_pro_gpu) { rc = of_get_fmax_vdd_class(pdev, &gfx3d_clk_src.c, speedbin_str); if (rc) { Loading Loading @@ -3942,6 +3970,7 @@ static struct of_device_id msm_clock_gpu_match_table[] = { { .compatible = "qcom,gpucc-8996-v2" }, { .compatible = "qcom,gpucc-8996-v3" }, { .compatible = "qcom,gpucc-8996-v3.0" }, { .compatible = "qcom,gpucc-8996-pro" }, {}, }; Loading Loading
Documentation/devicetree/bindings/arm/msm/clock-controller.txt +3 −1 Original line number Diff line number Diff line Loading @@ -57,10 +57,12 @@ Required properties: "qcom,mmsscc-8996" "qcom,mmsscc-8996-v2" "qcom,mmsscc-8996-v3" "qcom,mmsscc-8996-pro" "qcom,gpucc-8996" "qcom,gpucc-8996-v2" "qcom,gpucc-8996-v3" "qcom,gpucc-8996-v3.0" "qcom,gpucc-8996-pro" "qcom,gcc-gfx-titanium" "qcom,gcc-californium" "qcom,cc-debug-californium" Loading @@ -76,7 +78,7 @@ Required properties: there is one expected base: "cc_base". Optional reg-names are "apcs_base", "meas", "mmss_base", "lpass_base", "apcs_c0_base", "apcs_c1_base", "apcs_cci_base". "apcs_cci_base", "efuse". Optional properties: - vdd_dig-supply: The digital logic rail supply. Loading
arch/arm/boot/dts/qcom/msm8996.dtsi +5 −5 Original line number Diff line number Diff line Loading @@ -746,8 +746,9 @@ clock_mmss: qcom,mmsscc@8c0000 { compatible = "qcom,mmsscc-8996"; reg = <0x8c0000 0xb00c>; reg-names = "cc_base"; reg = <0x8c0000 0xb00c>, <0x74130 0x8>; reg-names = "cc_base", "efuse"; vdd_dig-supply = <&pm8994_s1_corner>; mmpll4_dig-supply = <&pm8994_s1_corner>; mmpll4_analog-supply = <&pm8994_l12>; Loading @@ -771,9 +772,8 @@ clock_gpu: qcom,gpucc@8c0000 { compatible = "qcom,gpucc-8996"; reg = <0x8c0000 0xb00c>, <0x74130 0x8>; reg-names = "cc_base", "efuse"; reg = <0x8c0000 0xb00c>; reg-names = "cc_base"; vdd_gfx-supply = <&gfx_vreg>; qcom,gfx3d_clk_src-opp-handle = <&msm_gpu>; vdd_mx-supply = <&pm8994_s2_corner>; Loading
arch/arm/boot/dts/qcom/msm8996pro.dtsi +289 −0 Original line number Diff line number Diff line Loading @@ -377,3 +377,292 @@ qcom,cpr-dynamic-floor-corner = <1>; }; &pmi8994_s2 { regulator-max-microvolt = <1065000>; }; &pm8004_s2 { regulator-max-microvolt = <1065000>; }; &gfx_cpr { compatible = "qcom,cpr3-msm8996pro-mmss-regulator"; }; &gfx_vreg { regulator-min-microvolt = <2>; regulator-max-microvolt = <9>; qcom,cpr-fuse-corners = <4>; qcom,cpr-fuse-combos = <16>; qcom,cpr-speed-bins = <2>; qcom,cpr-speed-bin-corners = <9 9>; qcom,cpr-corners = /* Speed bin 0 */ <9 9 9 9 9 9 9 9>, /* Speed bin 1 */ <9 9 9 9 9 9 9 9>; qcom,cpr-corner-fmax-map = /* Speed bin 0 */ <2 4 6 9>, /* Speed bin 1 */ <2 4 6 9>; qcom,cpr-voltage-ceiling = /* Speed bin 0 */ <400000 670000 670000 745000 825000 905000 960000 1015000 1065000>, /* Speed bin 1 */ <400000 670000 670000 745000 825000 905000 960000 1015000 1065000>; qcom,cpr-voltage-floor = /* Speed bin 0 */ <400000 520000 520000 520000 520000 520000 520000 520000 520000>, /* Speed bin 1 */ <400000 520000 520000 520000 520000 520000 520000 520000 520000>; qcom,mem-acc-voltage = /* Speed bin 0 */ <1 1 1 1 2 2 2 2 2>, /* Speed bin 1 */ <1 1 1 1 2 2 2 2 2>; qcom,corner-frequencies = /* Speed bin 0 */ <0 133000000 214000000 315000000 401800000 510000000 560000000 624000000 652800000>, /* Speed bin 1 */ <0 133000000 214000000 315000000 401800000 510000000 560000000 624000000 652800000>; qcom,cpr-target-quotients = /* Speed bin 0 */ <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, <0 0 0 0 0 0 185 179 291 299 304 319 0 0 0 0>, <0 0 0 0 0 0 287 273 425 426 443 453 0 0 0 0>, <0 0 0 0 0 0 414 392 584 576 608 612 0 0 0 0>, <0 0 0 0 0 0 459 431 684 644 692 679 0 0 0 0>, <0 0 0 0 0 0 577 543 798 768 823 810 0 0 0 0>, <0 0 0 0 0 0 669 629 886 864 924 911 0 0 0 0>, <0 0 0 0 0 0 771 725 984 970 1036 1024 0 0 0 0>, <0 0 0 0 0 0 908 868 1118 1106 1179 1174 0 0 0 0>, /* Speed bin 1 */ <0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>, <0 0 0 0 0 0 185 179 291 299 304 319 0 0 0 0>, <0 0 0 0 0 0 287 273 425 426 443 453 0 0 0 0>, <0 0 0 0 0 0 414 392 584 576 608 612 0 0 0 0>, <0 0 0 0 0 0 459 431 684 644 692 679 0 0 0 0>, <0 0 0 0 0 0 577 543 798 768 823 810 0 0 0 0>, <0 0 0 0 0 0 669 629 886 864 924 911 0 0 0 0>, <0 0 0 0 0 0 771 725 984 970 1036 1024 0 0 0 0>, <0 0 0 0 0 0 908 868 1118 1106 1179 1174 0 0 0 0>; qcom,cpr-ro-scaling-factor = /* Speed bin 0 */ <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, /* Speed bin 1 */ <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>, <0 0 0 0 0 0 2035 1917 1959 2131 2246 2253 0 0 0 0>; qcom,cpr-open-loop-voltage-fuse-adjustment = /* Speed bin 0 */ <(-70000) 0 0 0>, /* Speed bin 1 */ <(-70000) 0 0 0>; qcom,cpr-closed-loop-voltage-adjustment = /* Speed bin 0 */ <0 0 30000 10000 10000 45000 25000 25000 25000>, /* Speed bin 1 */ <0 0 30000 10000 10000 45000 25000 25000 25000>; qcom,cpr-floor-to-ceiling-max-range = /* Speed bin 0 */ <0 70000 70000 75000 80000 90000 95000 100000 100000>, /* Speed bin 1 */ <0 70000 70000 75000 80000 90000 95000 100000 100000>; qcom,cpr-fused-closed-loop-voltage-adjustment-map = /* Speed bin 0 */ <0 2 2 2 2 0 0 4 4>, /* Speed bin 1 */ <0 2 2 2 2 0 0 4 4>; qcom,cpr-aging-max-voltage-adjustment = <15000>; qcom,cpr-aging-ref-corner = <6>; qcom,cpr-aging-ro-scaling-factor = <2950>; qcom,allow-aging-voltage-adjustment = <1>; }; &clock_cpu { compatible = "qcom,cpu-clock-8996-v3"; qcom,pwrcl-speedbin0-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 768000000 7 >, < 844800000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >; qcom,pwrcl-speedbin1-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 768000000 7 >, < 844800000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >; qcom,perfcl-speedbin0-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 748800000 7 >, < 825600000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >, < 1670400000 19 >, < 1747200000 20 >, < 1824000000 21 >, < 1900800000 22 >, < 1977600000 23 >, < 2054400000 24 >, < 2150400000 25 >; /* Additional frequencies to be added after characterization. */ qcom,perfcl-speedbin1-v0 = < 0 0 >, < 307200000 1 >, < 384000000 2 >, < 460800000 3 >, < 537600000 4 >, < 614400000 5 >, < 691200000 6 >, < 748800000 7 >, < 825600000 8 >, < 902400000 9 >, < 979200000 10 >, < 1056000000 11 >, < 1132800000 12 >, < 1209600000 13 >, < 1286400000 14 >, < 1363200000 15 >, < 1440000000 16 >, < 1516800000 17 >, < 1593600000 18 >, < 1670400000 19 >, < 1747200000 20 >, < 1824000000 21 >, < 1900800000 22 >, < 1977600000 23 >, < 2054400000 24 >, < 2150400000 25 >; qcom,cbf-speedbin0-v0 = < 0 0 >, < 192000000 1 >, < 307200000 2 >, < 384000000 3 >, < 441600000 4 >, < 537600000 5 >, < 614400000 6 >, < 691200000 7 >, < 768000000 8 >, < 844800000 9 >, < 902400000 10 >, < 979200000 11 >, < 1056000000 12 >, < 1132800000 13 >, < 1190400000 14 >, < 1286400000 15 >, < 1363200000 16 >, < 1440000000 17 >, < 1516800000 18 >, < 1593600000 19 >; qcom,cbf-speedbin1-v0 = < 0 0 >, < 192000000 1 >, < 307200000 2 >, < 384000000 3 >, < 441600000 4 >, < 537600000 5 >, < 614400000 6 >, < 691200000 7 >, < 768000000 8 >, < 844800000 9 >, < 902400000 10 >, < 979200000 11 >, < 1056000000 12 >, < 1132800000 13 >, < 1190400000 14 >, < 1286400000 15 >, < 1363200000 16 >, < 1440000000 17 >, < 1516800000 18 >, < 1593600000 19 >; };
drivers/clk/msm/clock-alpha-pll.c +5 −5 Original line number Diff line number Diff line /* * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -629,11 +629,11 @@ static long alpha_pll_round_rate(struct clk *c, unsigned long rate) return -EINVAL; freq_hz = round_rate_up(pll, rate, &l_val, &a_val); if (pll->is_fabia) { if (rate < pll->min_supported_freq) return pll->min_supported_freq; if (pll->is_fabia) return freq_hz; } ret = find_vco(pll, freq_hz); if (!IS_ERR_VALUE(ret)) return freq_hz; Loading
drivers/clk/msm/clock-mmss-8996.c +60 −31 Original line number Diff line number Diff line /* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -68,8 +68,10 @@ static void __iomem *virt_base_gpu; #define GFX_MIN_SVS_LEVEL 2 #define GPU_REQ_ID 0x3 #define EFUSE_SHIFT 29 #define EFUSE_MASK 0x7 #define EFUSE_SHIFT_v3 29 #define EFUSE_MASK_v3 0x7 #define EFUSE_SHIFT_PRO 28 #define EFUSE_MASK_PRO 0x3 static struct clk_ops clk_ops_gpu; Loading Loading @@ -402,9 +404,9 @@ static struct mux_div_clk gfx3d_clk_src_v2 = { .max_div = 1, }, .parents = (struct clk_src[]) { {&mmpll9_postdiv_clk.c, 2}, {&mmpll2_postdiv_clk.c, 3}, {&mmpll8_postdiv_clk.c, 4}, {&mmpll9_postdiv_clk.c, 2}, }, .num_parents = 3, .c = { Loading Loading @@ -3512,6 +3514,19 @@ static void msm_mmsscc_8996_v3_fixup(void) video_subcore1_clk_src.c.fmax[VDD_DIG_HIGH] = 520000000; } static void msm_mmsscc_8996_pro_fixup(void) { mmpll9.c.rate = 0; mmpll9.c.fmax[VDD_DIG_LOWER] = 652800000; mmpll9.c.fmax[VDD_DIG_LOW] = 652800000; mmpll9.c.fmax[VDD_DIG_NOMINAL] = 1305600000; mmpll9.c.fmax[VDD_DIG_HIGH] = 1305600000; mmpll9.c.ops = &clk_ops_alpha_pll; mmpll9.min_supported_freq = 1248000000; mmpll9_postdiv_clk.c.ops = &clk_ops_div; } static int is_v3_gpu; static int gpu_pre_set_rate(struct clk *clk, unsigned long new_rate) { Loading Loading @@ -3610,6 +3625,10 @@ static int of_get_fmax_vdd_class(struct platform_device *pdev, struct clk *c, } static struct platform_driver msm_clock_gpu_driver; struct resource *efuse_res; void __iomem *gpu_base; u64 efuse; int gpu_speed_bin; int msm_mmsscc_8996_probe(struct platform_device *pdev) { Loading @@ -3618,19 +3637,33 @@ int msm_mmsscc_8996_probe(struct platform_device *pdev) struct clk *tmp; struct regulator *reg; u32 regval; int is_v2, is_v3 = 0; int is_pro, is_v2, is_v3 = 0; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cc_base"); if (!res) { dev_err(&pdev->dev, "Unable to retrieve register base.\n"); return -ENOMEM; } efuse_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse"); if (!efuse_res) { dev_err(&pdev->dev, "Unable to retrieve efuse register base.\n"); return -ENOMEM; } virt_base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!virt_base) { dev_err(&pdev->dev, "Failed to map CC registers\n"); return -ENOMEM; } gpu_base = devm_ioremap(&pdev->dev, efuse_res->start, resource_size(efuse_res)); if (!gpu_base) { dev_err(&pdev->dev, "Unable to map in efuse base\n"); return -ENOMEM; } /* Clear the DBG_CLK_DIV bits of the MMSS debug register */ regval = readl_relaxed(virt_base + mmss_gcc_dbg_clk.offset); regval &= ~BM(18, 17); Loading Loading @@ -3706,6 +3739,9 @@ int msm_mmsscc_8996_probe(struct platform_device *pdev) ext_extpclk_clk_src.dev = &pdev->dev; ext_extpclk_clk_src.clk_id = "extpclk_src"; efuse = readl_relaxed(gpu_base); gpu_speed_bin = ((efuse >> EFUSE_SHIFT_v3) & EFUSE_MASK_v3); is_v2 = of_device_is_compatible(pdev->dev.of_node, "qcom,mmsscc-8996-v2"); if (is_v2) Loading @@ -3716,14 +3752,22 @@ int msm_mmsscc_8996_probe(struct platform_device *pdev) if (is_v3) msm_mmsscc_8996_v3_fixup(); is_pro = of_device_is_compatible(pdev->dev.of_node, "qcom,mmsscc-8996-pro"); if (is_pro) { gpu_speed_bin = ((efuse >> EFUSE_SHIFT_PRO) & EFUSE_MASK_PRO); msm_mmsscc_8996_v3_fixup(); if (!gpu_speed_bin) msm_mmsscc_8996_pro_fixup(); } rc = of_msm_clock_register(pdev->dev.of_node, msm_clocks_mmss_8996, ARRAY_SIZE(msm_clocks_mmss_8996)); if (rc) return rc; /* Register v2/v3 specific clocks */ if (is_v2 || is_v3) { /* Register v2/v3/pro specific clocks */ if (is_v2 || is_v3 || is_pro) { rc = of_msm_clock_register(pdev->dev.of_node, msm_clocks_mmsscc_8996_v2, ARRAY_SIZE(msm_clocks_mmsscc_8996_v2)); Loading @@ -3739,6 +3783,7 @@ static struct of_device_id msm_clock_mmss_match_table[] = { { .compatible = "qcom,mmsscc-8996" }, { .compatible = "qcom,mmsscc-8996-v2" }, { .compatible = "qcom,mmsscc-8996-v3" }, { .compatible = "qcom,mmsscc-8996-pro" }, {}, }; Loading Loading @@ -3803,14 +3848,11 @@ static void msm_gpucc_8996_v2_fixup(void) int msm_gpucc_8996_probe(struct platform_device *pdev) { struct resource *res, *efuse_res; struct resource *res; struct device_node *of_node = pdev->dev.of_node; void __iomem *base; int rc; struct regulator *reg; u64 efuse; int speed_bin; int is_v2_gpu, is_v3_0_gpu; int is_v2_gpu, is_v3_0_gpu, is_pro_gpu; char speedbin_str[] = "qcom,gfxfreq-speedbin0"; char mx_speedbin_str[] = "qcom,gfxfreq-mx-speedbin0"; Loading @@ -3823,12 +3865,6 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) return -ENOMEM; } efuse_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "efuse"); if (!efuse_res) { dev_err(&pdev->dev, "Unable to retrieve efuse register base.\n"); return -ENOMEM; } gfx3d_clk_src_v2.base = virt_base_gpu = devm_ioremap(&pdev->dev, res->start, resource_size(res)); if (!virt_base_gpu) { Loading @@ -3836,13 +3872,6 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) return -ENOMEM; } base = devm_ioremap(&pdev->dev, efuse_res->start, resource_size(efuse_res)); if (!base) { dev_err(&pdev->dev, "Unable to map in efuse base\n"); return -ENOMEM; } reg = vdd_gfx.regulator[0] = devm_regulator_get(&pdev->dev, "vdd_gfx"); if (IS_ERR(reg)) { if (PTR_ERR(reg) != -EPROBE_DEFER) Loading Loading @@ -3870,14 +3899,13 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) is_v2_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-v2"); is_v3_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-v3"); is_v3_0_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-v3.0"); is_pro_gpu = of_device_is_compatible(of_node, "qcom,gpucc-8996-pro"); efuse = readl_relaxed(base); speed_bin = ((efuse >> EFUSE_SHIFT) & EFUSE_MASK); dev_info(&pdev->dev, "using speed bin %u\n", speed_bin); dev_info(&pdev->dev, "using speed bin %u\n", gpu_speed_bin); snprintf(speedbin_str, ARRAY_SIZE(speedbin_str), "qcom,gfxfreq-speedbin%d", speed_bin); "qcom,gfxfreq-speedbin%d", gpu_speed_bin); snprintf(mx_speedbin_str, ARRAY_SIZE(mx_speedbin_str), "qcom,gfxfreq-mx-speedbin%d", speed_bin); "qcom,gfxfreq-mx-speedbin%d", gpu_speed_bin); rc = of_get_fmax_vdd_class(pdev, &gpu_mx_clk.c, mx_speedbin_str); if (rc) { Loading @@ -3890,7 +3918,7 @@ int msm_gpucc_8996_probe(struct platform_device *pdev) } } if (!is_v2_gpu && !is_v3_gpu && !is_v3_0_gpu) { if (!is_v2_gpu && !is_v3_gpu && !is_v3_0_gpu && !is_pro_gpu) { rc = of_get_fmax_vdd_class(pdev, &gfx3d_clk_src.c, speedbin_str); if (rc) { Loading Loading @@ -3942,6 +3970,7 @@ static struct of_device_id msm_clock_gpu_match_table[] = { { .compatible = "qcom,gpucc-8996-v2" }, { .compatible = "qcom,gpucc-8996-v3" }, { .compatible = "qcom,gpucc-8996-v3.0" }, { .compatible = "qcom,gpucc-8996-pro" }, {}, }; Loading