/* * The AUDIO power domain is marked as disabled to prevent the driver from * managing its power state. Direct AON firmware calls to control this power * island trigger a firmware bug causing system instability. Until this * firmware issue is resolved, the AUDIO power domain must remain disabled * to avoid crashes.
*/ staticconststruct th1520_power_info th1520_pd_ranges[] = {
[TH1520_AUDIO_PD] = {"audio", TH1520_AON_AUDIO_PD, true },
[TH1520_VDEC_PD] = { "vdec", TH1520_AON_VDEC_PD, false },
[TH1520_NPU_PD] = { "npu", TH1520_AON_NPU_PD, false },
[TH1520_VENC_PD] = { "venc", TH1520_AON_VENC_PD, false },
[TH1520_GPU_PD] = { "gpu", TH1520_AON_GPU_PD, false },
[TH1520_DSP0_PD] = { "dsp0", TH1520_AON_DSP0_PD, false },
[TH1520_DSP1_PD] = { "dsp1", TH1520_AON_DSP1_PD, false }
};
ret = pm_genpd_init(&pd->genpd, NULL, true); if (ret) return ERR_PTR(ret);
return pd;
}
staticvoid th1520_pd_init_all_off(struct generic_pm_domain **domains, struct device *dev)
{ int ret; int i;
for (i = 0; i < ARRAY_SIZE(th1520_pd_ranges); i++) { struct th1520_power_domain *pd;
if (th1520_pd_ranges[i].disabled) continue;
pd = to_th1520_power_domain(domains[i]);
ret = th1520_aon_power_update(pd->aon_chan, pd->rsrc, false); if (ret)
dev_err(dev, "Failed to initially power down power domain %s\n",
pd->genpd.name);
}
}
staticint th1520_pd_pwrseq_gpu_init(struct device *dev)
{ struct auxiliary_device *adev; int ret;
/* * Correctly check only for the property's existence in the DT node. * We don't need to get/claim the reset here; that is the job of * the auxiliary driver that we are about to spawn.
*/ if (device_property_match_string(dev, "reset-names", "gpu-clkgen") < 0) /* * This is not an error. It simply means the optional sequencer * is not described in the device tree.
*/ return 0;
adev = devm_kzalloc(dev, sizeof(*adev), GFP_KERNEL); if (!adev) return -ENOMEM;
/* * Initialize all power domains to off to ensure they start in a * low-power state. This allows device drivers to manage power * domains by turning them on or off as needed.
*/
th1520_pd_init_all_off(domains, dev);
ret = of_genpd_add_provider_onecell(dev->of_node, pd_data); if (ret) goto err_clean_genpd;
ret = th1520_pd_pwrseq_gpu_init(dev); if (ret) goto err_clean_provider;
return 0;
err_clean_provider:
of_genpd_del_provider(dev->of_node);
err_clean_genpd: for (i--; i >= 0; i--)
pm_genpd_remove(domains[i]);
err_clean_aon:
th1520_aon_deinit(aon_chan);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.