Does it need a hardware change for using CPPC?
+static int cppc_cpufreq_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
+{
- unsigned int cpu = policy->cpu;
- struct cpc_desc *current_cpu_cpc = per_cpu(cpc_desc, cpu);
- struct cpufreq_freqs freqs;
- u16 status;
- freqs.old = policy->cur;
- freqs.new = target_freq;
- cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
- /* Set CPU Perf thresholds and current desired perf value. */
- acpi_write(policy->max, ¤t_cpu_cpc->pcc_regs[MAX_PERF]);
- acpi_write(policy->min, ¤t_cpu_cpc->pcc_regs[MIN_PERF]);
- acpi_write(target_freq, ¤t_cpu_cpc->pcc_regs[DESIRED_PERF]);
- status = send_pcc_cmd(CMD_WRITE, 0, PCC_SUBSPACE_IDX,
comm_base_addr);
- if (status & CMD_COMPLETE) {
pr_debug("Failed to set target CPU perf for CPU:%d,
status:%d\n",
cpu, status);
return -EINVAL;
- }
- return 0;
+}
-> Don't need cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE)?
- /* Base address returned from PCC subspace desc needs to ioremap'd.
* Used by the client to send/recv data from platform.
*/
- comm_base_addr = ioremap_nocache(pcc_comm_base_addr, len);
- if (comm_base_addr) {
->Should be if (!comm_base_addr) ?
pr_err("Could not map PCC communicate channel\n");
ret = -ENOMEM;
goto out_err;
- }
Thanks Best Regards.