soc: qcom: eud: Fix enable status for secure mode

Currently, the EUD driver performs the check if bootloaders
have already enabled the EUD hardware by doing a logical OR
of EUD_CSR_EUD_EN (non-secure) and EUD_EUD_EN2 (secure), even
if the driver is configured to work in secure mode, which is
incorrect. Hence, check the status of the EUD hardware by only
looking at the respective register for that particular mode.

Change-Id: I9f005557ddb10e304fa5da723b13c1f1108d1a6f
Signed-off-by: Raghavendra Rao Ananta <rananta@codeaurora.org>
This commit is contained in:
Raghavendra Rao Ananta 2020-09-22 15:46:27 -07:00
commit 5702e2b044

View file

@ -107,12 +107,13 @@ static int msm_eud_hw_is_enabled(struct platform_device *pdev)
if (ret) {
dev_err(&pdev->dev,
"qcom_scm_io_readl failed with rc: %d\n", ret);
sec_eud_enabled = 0;
return 0;
}
return sec_eud_enabled;
}
return (sec_eud_enabled & BIT(0)) ||
(readl_relaxed(chip->eud_reg_base + EUD_REG_CSR_EUD_EN) & BIT(0));
return readl_relaxed(chip->eud_reg_base + EUD_REG_CSR_EUD_EN) & BIT(0);
}
static int check_eud_mode_mgr2(struct eud_chip *chip)