power: reset: Move in_panic handling out of dload mode
* Some devices might want to use that logic without enabling download mode Change-Id: Idd4a2cc8a47041740f8d4e9f43bffd84fae5830d Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
parent
89190bd929
commit
0ed91aca25
1 changed files with 15 additions and 13 deletions
|
@ -63,6 +63,19 @@ static void scm_disable_sdi(void);
|
|||
* So the SDI cannot be re-enabled when it already by-passed.
|
||||
*/
|
||||
|
||||
static int in_panic;
|
||||
|
||||
static int panic_prep_restart(struct notifier_block *this,
|
||||
unsigned long event, void *ptr)
|
||||
{
|
||||
in_panic = 1;
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static struct notifier_block panic_blk = {
|
||||
.notifier_call = panic_prep_restart,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_QCOM_DLOAD_MODE
|
||||
#define EDL_MODE_PROP "qcom,msm-imem-emergency_download_mode"
|
||||
#define DL_MODE_PROP "qcom,msm-imem-download_mode"
|
||||
|
@ -70,7 +83,6 @@ static void scm_disable_sdi(void);
|
|||
#define KASLR_OFFSET_PROP "qcom,msm-imem-kaslr_offset"
|
||||
#endif
|
||||
|
||||
static int in_panic;
|
||||
static int dload_type = SCM_DLOAD_FULLDUMP;
|
||||
#ifdef CONFIG_DLOAD_MODE_DEFAULT
|
||||
static int download_mode = -1;
|
||||
|
@ -109,17 +121,6 @@ int oem_get_download_mode(void)
|
|||
return download_mode;
|
||||
}
|
||||
|
||||
static int panic_prep_restart(struct notifier_block *this,
|
||||
unsigned long event, void *ptr)
|
||||
{
|
||||
in_panic = 1;
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static struct notifier_block panic_blk = {
|
||||
.notifier_call = panic_prep_restart,
|
||||
};
|
||||
|
||||
int scm_set_dload_mode(int arg1, int arg2)
|
||||
{
|
||||
struct scm_desc desc = {
|
||||
|
@ -615,11 +616,12 @@ static int msm_restart_probe(struct platform_device *pdev)
|
|||
struct device_node *np;
|
||||
int ret = 0;
|
||||
|
||||
atomic_notifier_chain_register(&panic_notifier_list, &panic_blk);
|
||||
|
||||
#ifdef CONFIG_QCOM_DLOAD_MODE
|
||||
if (scm_is_call_available(SCM_SVC_BOOT, SCM_DLOAD_CMD) > 0)
|
||||
scm_dload_supported = true;
|
||||
|
||||
atomic_notifier_chain_register(&panic_notifier_list, &panic_blk);
|
||||
np = of_find_compatible_node(NULL, NULL, DL_MODE_PROP);
|
||||
if (!np) {
|
||||
pr_err("unable to find DT imem DLOAD mode node\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue