mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
firmware: qcom_scm: Add a call for getting dload mode
Add an SCM call to read the dload mode cookie, which can be used in various drivers to make decisions based on the dload mode. Earlier, this support was not there and HLOS was not aware of changes in this cookie, outside of its domain. Change-Id: I3bb82b65bc411354090b34b98f7e651dd1888e5b Signed-off-by: Khaja Hussain Shaik Khaji <[email protected]>
This commit is contained in:
parent
c7cfe23876
commit
446a7be36f
2 changed files with 22 additions and 0 deletions
|
|
@ -207,6 +207,25 @@ void qcom_scm_set_download_mode(enum qcom_download_mode mode,
|
|||
}
|
||||
EXPORT_SYMBOL(qcom_scm_set_download_mode);
|
||||
|
||||
int qcom_scm_get_download_mode(unsigned int *mode, phys_addr_t tcsr_boot_misc)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
struct device *dev = __scm ? __scm->dev : NULL;
|
||||
|
||||
if (tcsr_boot_misc || (__scm && __scm->dload_mode_addr)) {
|
||||
ret = qcom_scm_io_readl(tcsr_boot_misc ? : __scm->dload_mode_addr, mode);
|
||||
} else {
|
||||
dev_err(dev,
|
||||
"No available mechanism for getting download mode\n");
|
||||
}
|
||||
|
||||
if (ret)
|
||||
dev_err(dev, "failed to get download mode: %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_scm_get_download_mode);
|
||||
|
||||
int qcom_scm_config_cpu_errata(void)
|
||||
{
|
||||
return __qcom_scm_config_cpu_errata(__scm->dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue