diff options
author | Michal Simek <michal.simek@xilinx.com> | 2020-08-13 12:43:22 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-08-24 14:11:31 -0400 |
commit | 10e4d64e345b6b684d27d3da6ed8d887c8e45f76 (patch) | |
tree | e74f81cb34502d8c6d668a4c3e2697a70764ff83 /drivers/firmware/psci.c | |
parent | 565add124de00c994652a0d2d6d1eb6b2a7c9553 (diff) |
firmware: psci: Do not bind driver if U-Boot runs in EL3
There is no reason to bind psci driver if U-Boot runs in EL3 because
SMC/HVC instructions can't be called. That's why detect this state and
don't let user to crash from prompt by performing reset or poweroff
commands (if enabled).
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/firmware/psci.c')
-rw-r--r-- | drivers/firmware/psci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index 7d2e49fd3e..68953cc4f4 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -19,6 +19,7 @@ #include <linux/errno.h> #include <linux/printk.h> #include <linux/psci.h> +#include <asm/system.h> #define DRIVER_NAME "psci" @@ -73,6 +74,11 @@ static int psci_probe(struct udevice *dev) { const char *method; +#if defined(CONFIG_ARM64) + if (current_el() == 3) + return -EINVAL; +#endif + method = ofnode_read_string(dev_ofnode(dev), "method"); if (!method) { pr_warn("missing \"method\" property\n"); |