]> git.sur5r.net Git - u-boot/blobdiff - drivers/firmware/psci.c
spi: xilinx_spi: Added support to read JEDEC-id twice at the boot time
[u-boot] / drivers / firmware / psci.c
index 40fba6432ce317827e853d067530f8d00afe0edf..2cb35f356f40ae2c3b58ca0a2cff6207c7fd14e6 100644 (file)
@@ -1,18 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2017 Masahiro Yamada <yamada.masahiro@socionext.com>
  *
  * Based on drivers/firmware/psci.c from Linux:
  * Copyright (C) 2015 ARM Limited
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
-#include <dm/device.h>
+#include <dm.h>
 #include <dm/lists.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <linux/arm-smccc.h>
 #include <linux/errno.h>
+#include <linux/printk.h>
 #include <linux/psci.h>
 
 psci_fn *invoke_psci_fn;
@@ -40,15 +40,15 @@ static unsigned long __invoke_psci_fn_smc(unsigned long function_id,
 static int psci_bind(struct udevice *dev)
 {
        /* No SYSTEM_RESET support for PSCI 0.1 */
-       if (of_device_is_compatible(dev, "arm,psci-0.2") ||
-           of_device_is_compatible(dev, "arm,psci-1.0")) {
+       if (device_is_compatible(dev, "arm,psci-0.2") ||
+           device_is_compatible(dev, "arm,psci-1.0")) {
                int ret;
 
                /* bind psci-sysreset optionally */
                ret = device_bind_driver(dev, "psci-sysreset", "psci-sysreset",
                                         NULL);
                if (ret)
-                       debug("PSCI System Reset was not bound.\n");
+                       pr_debug("PSCI System Reset was not bound.\n");
        }
 
        return 0;
@@ -59,10 +59,10 @@ static int psci_probe(struct udevice *dev)
        DECLARE_GLOBAL_DATA_PTR;
        const char *method;
 
-       method = fdt_stringlist_get(gd->fdt_blob, dev->of_offset, "method", 0,
-                                   NULL);
+       method = fdt_stringlist_get(gd->fdt_blob, dev_of_offset(dev), "method",
+                                   0, NULL);
        if (!method) {
-               printf("missing \"method\" property\n");
+               pr_warn("missing \"method\" property\n");
                return -ENXIO;
        }
 
@@ -71,7 +71,7 @@ static int psci_probe(struct udevice *dev)
        } else if (!strcmp("smc", method)) {
                invoke_psci_fn = __invoke_psci_fn_smc;
        } else {
-               printf("invalid \"method\" property: %s\n", method);
+               pr_warn("invalid \"method\" property: %s\n", method);
                return -EINVAL;
        }