Enable dev_freq SPDM support in order to increase BIMC
vote based on bus rejection rate. Make cci_clk an optional
property as it's not always a relevant indicator of cpu performance.
CRs-Fixed:
1025515
Change-Id: I713cc396c8d563735981547e0dc18a63f6f15180
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Required properties:
-compatible: Must be "qcom,devfreq_spdm"
--clock-names: Clocks used to measure current bus frequency.
- Expected names are "cci_clk"
--clocks: References to named clocks
-qcom,spdm-client: Client id of the port being monitored
-qcom,bw-upstep: Initial up vote size in MB/s
-qcom,bw-dwnstep: Initial down vote size in MB/s
-qcom,up-step-multp: used to increase rate of growth on up votes
-qcom,spdm-interval: down-vote polling interval
+Optional properties:
+-clock-names: Clocks used to measure current bus frequency.
+ Expected names are "cci_clk"
+-clocks: References to named clocks
+
Example:
devfreq_spdm_cpu {
compatible = "qcom,devfreq_spdm";
update_thresholds:
desc.arg[0] = SPDM_CMD_ENABLE;
desc.arg[1] = data->spdm_client;
- desc.arg[2] = (clk_get_rate(data->cci_clk)) / 1000;
+
+ if (data->cci_clk)
+ desc.arg[2] = (clk_get_rate(data->cci_clk)) / 1000;
+ else
+ desc.arg[2] = 0;
+
ext_status = spdm_ext_call(&desc, 3);
if (ext_status)
pr_err("External command %u failed with error %u",
data->cci_clk = clk_get(&pdev->dev, "cci_clk");
if (IS_ERR(data->cci_clk)) {
- ret = PTR_ERR(data->cci_clk);
- goto no_clock;
+ data->cci_clk = NULL;
}
data->profile =
no_spdm_device:
devm_kfree(&pdev->dev, data->profile);
no_profile:
-no_clock:
msm_bus_scale_unregister_client(data->bus_scale_client_id);
no_bus_scaling:
devm_kfree(&pdev->dev, data->config_data.ports);
*irq = platform_get_irq_byname(pdev, "spdm-irq");
ret = request_threaded_irq(*irq, isr, threaded_isr,
- IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+ IRQF_ONESHOT,
spdm_hyp_gov.name, pdev);
if (ret)
goto no_irq;