mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
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>
This commit is contained in:
parent
565add124d
commit
10e4d64e34
|
@ -19,6 +19,7 @@
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/printk.h>
|
#include <linux/printk.h>
|
||||||
#include <linux/psci.h>
|
#include <linux/psci.h>
|
||||||
|
#include <asm/system.h>
|
||||||
|
|
||||||
#define DRIVER_NAME "psci"
|
#define DRIVER_NAME "psci"
|
||||||
|
|
||||||
|
@ -73,6 +74,11 @@ static int psci_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
const char *method;
|
const char *method;
|
||||||
|
|
||||||
|
#if defined(CONFIG_ARM64)
|
||||||
|
if (current_el() == 3)
|
||||||
|
return -EINVAL;
|
||||||
|
#endif
|
||||||
|
|
||||||
method = ofnode_read_string(dev_ofnode(dev), "method");
|
method = ofnode_read_string(dev_ofnode(dev), "method");
|
||||||
if (!method) {
|
if (!method) {
|
||||||
pr_warn("missing \"method\" property\n");
|
pr_warn("missing \"method\" property\n");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user