cpuidle update:
I've got the spm driver working by adding:
{ .compatible = "qcom,ipq8064-saw2-v1.1-cpu",
.data = &spm_reg_8064_cpu },
in spm.c and editing qcom-ipq8064.dtsi:
saw0: regulator@2089000 {
compatible = "qcom,saw2",
"qcom,ipq8064-saw2-v1.1-cpu",
"syscon";
reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
regulator;
};
saw1: regulator@2099000 {
compatible = "qcom,saw2",
"qcom,ipq8064-saw2-v1.1-cpu",
"syscon";
reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
regulator;
};
I tried a similar change under saw_l2. I observed (via pr_err statements) spm_dev_prob starts for this but (gracefully) does not finish so I've left it out.
WARNING: I don't know if this approach will get the spm driver working on ipq8065 (r7800) systems. Since spm.c adjusts "power" to a physical device (the cpu) any prospective tester should consider if they can afford a new router before trying this. The data hard coded in &spm_reg_8064_cpu in spm.c appears to be necessary (router won't boot for me without it). I don't know if this data will work for ipq8065 systems.
I can also get both idle states "arm-idle" and "qcom,idle-state-spc" working as shown by
/sys/devices/system/cpu/cpu[0|1]/cpuidle/state[0|1]/usage
Note there is a cleaner way to disable "qcom,idle-state-spc" than by the spm.c hackery in my prior post. Turns out adding status = "disabled":
idle-states {
CPU_SPC: spc {
compatible = "qcom,idle-state-spc",
"arm,idle-state";
status = "disabled"
entry-latency-us = <400>;
exit-latency-us = <900>;
min-residency-us = <3000>;
};
in qcom-ipq8064.dtsi will disable only "qcom,idle-state-spc" and leave "arm,idle-state" functional. The "dev" reg code in cpuidle-arm.c is still necessary to get the additional sysfs info. Remove status = "disabled" to get the spc idle state. I observe after ~40 min up with no load, the spc driver gets used the most.
I have not yet posted patches to my github k419 branch but I plan to do so and will post a link once its ready.