summaryrefslogtreecommitdiffstats
path: root/drivers/sysreset
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sysreset')
-rw-r--r--drivers/sysreset/poweroff_gpio.c2
-rw-r--r--drivers/sysreset/sysreset-ti-sci.c2
-rw-r--r--drivers/sysreset/sysreset-uclass.c12
-rw-r--r--drivers/sysreset/sysreset_gpio.c2
-rw-r--r--drivers/sysreset/sysreset_octeon.c2
-rw-r--r--drivers/sysreset/sysreset_resetctl.c2
-rw-r--r--drivers/sysreset/sysreset_sandbox.c6
-rw-r--r--drivers/sysreset/sysreset_socfpga.c2
-rw-r--r--drivers/sysreset/sysreset_sti.c2
-rw-r--r--drivers/sysreset/sysreset_syscon.c2
-rw-r--r--drivers/sysreset/sysreset_watchdog.c2
-rw-r--r--drivers/sysreset/sysreset_x86.c11
12 files changed, 24 insertions, 23 deletions
diff --git a/drivers/sysreset/poweroff_gpio.c b/drivers/sysreset/poweroff_gpio.c
index ac482c37f4..a5c24fd85b 100644
--- a/drivers/sysreset/poweroff_gpio.c
+++ b/drivers/sysreset/poweroff_gpio.c
@@ -87,6 +87,6 @@ U_BOOT_DRIVER(poweroff_gpio) = {
.id = UCLASS_SYSRESET,
.ops = &poweroff_gpio_ops,
.probe = poweroff_gpio_probe,
- .priv_auto_alloc_size = sizeof(struct poweroff_gpio_info),
+ .priv_auto = sizeof(struct poweroff_gpio_info),
.of_match = poweroff_gpio_ids,
};
diff --git a/drivers/sysreset/sysreset-ti-sci.c b/drivers/sysreset/sysreset-ti-sci.c
index 7707c72bb5..81bfd67ad9 100644
--- a/drivers/sysreset/sysreset-ti-sci.c
+++ b/drivers/sysreset/sysreset-ti-sci.c
@@ -70,6 +70,6 @@ U_BOOT_DRIVER(ti_sci_sysreset) = {
.id = UCLASS_SYSRESET,
.of_match = ti_sci_sysreset_of_match,
.probe = ti_sci_sysreset_probe,
- .priv_auto_alloc_size = sizeof(struct ti_sci_sysreset_data),
+ .priv_auto = sizeof(struct ti_sci_sysreset_data),
.ops = &ti_sci_sysreset_ops,
};
diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
index 3f5414ed1f..e69fb2255b 100644
--- a/drivers/sysreset/sysreset-uclass.c
+++ b/drivers/sysreset/sysreset-uclass.c
@@ -9,12 +9,13 @@
#include <common.h>
#include <command.h>
#include <cpu_func.h>
-#include <hang.h>
-#include <log.h>
-#include <sysreset.h>
#include <dm.h>
#include <errno.h>
+#include <hang.h>
+#include <log.h>
#include <regmap.h>
+#include <spl.h>
+#include <sysreset.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dm/root.h>
@@ -101,7 +102,10 @@ void sysreset_walk_halt(enum sysreset_t type)
mdelay(100);
/* Still no reset? Give up */
- log_err("System reset not supported on this platform\n");
+ if (spl_phase() <= PHASE_SPL)
+ log_err("no sysreset\n");
+ else
+ log_err("System reset not supported on this platform\n");
hang();
}
diff --git a/drivers/sysreset/sysreset_gpio.c b/drivers/sysreset/sysreset_gpio.c
index d7280eeda8..680b759eb3 100644
--- a/drivers/sysreset/sysreset_gpio.c
+++ b/drivers/sysreset/sysreset_gpio.c
@@ -55,6 +55,6 @@ U_BOOT_DRIVER(gpio_reboot) = {
.name = "gpio_restart",
.of_match = led_gpio_ids,
.ops = &gpio_reboot_ops,
- .priv_auto_alloc_size = sizeof(struct gpio_reboot_priv),
+ .priv_auto = sizeof(struct gpio_reboot_priv),
.probe = gpio_reboot_probe,
};
diff --git a/drivers/sysreset/sysreset_octeon.c b/drivers/sysreset/sysreset_octeon.c
index a05dac3226..ebdea6ab66 100644
--- a/drivers/sysreset/sysreset_octeon.c
+++ b/drivers/sysreset/sysreset_octeon.c
@@ -45,7 +45,7 @@ static const struct udevice_id octeon_sysreset_ids[] = {
U_BOOT_DRIVER(sysreset_octeon) = {
.id = UCLASS_SYSRESET,
.name = "octeon_sysreset",
- .priv_auto_alloc_size = sizeof(struct octeon_sysreset_data),
+ .priv_auto = sizeof(struct octeon_sysreset_data),
.ops = &octeon_sysreset,
.probe = octeon_sysreset_probe,
.of_match = octeon_sysreset_ids,
diff --git a/drivers/sysreset/sysreset_resetctl.c b/drivers/sysreset/sysreset_resetctl.c
index b8203ba605..c039521eb4 100644
--- a/drivers/sysreset/sysreset_resetctl.c
+++ b/drivers/sysreset/sysreset_resetctl.c
@@ -43,6 +43,6 @@ U_BOOT_DRIVER(resetctl_reboot) = {
.name = "resetctl_reboot",
.of_match = resetctl_reboot_ids,
.ops = &resetctl_reboot_ops,
- .priv_auto_alloc_size = sizeof(struct resetctl_reboot_priv),
+ .priv_auto = sizeof(struct resetctl_reboot_priv),
.probe = resetctl_reboot_probe,
};
diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c
index 7026a48c4b..08685823e9 100644
--- a/drivers/sysreset/sysreset_sandbox.c
+++ b/drivers/sysreset/sysreset_sandbox.c
@@ -47,10 +47,10 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type)
/*
* If we have a device tree, the device we created from platform data
- * (see the U_BOOT_DEVICE() declaration below) should not do anything.
+ * (see the U_BOOT_DRVINFO() declaration below) should not do anything.
* If we are that device, return an error.
*/
- if (state->fdt_fname && !dev_of_valid(dev))
+ if (state->fdt_fname && !dev_has_ofnode(dev))
return -ENODEV;
switch (type) {
@@ -135,7 +135,7 @@ U_BOOT_DRIVER(warm_sysreset_sandbox) = {
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
/* This is here in case we don't have a device tree */
-U_BOOT_DEVICE(sysreset_sandbox_non_fdt) = {
+U_BOOT_DRVINFO(sysreset_sandbox_non_fdt) = {
.name = "sysreset_sandbox",
};
#endif
diff --git a/drivers/sysreset/sysreset_socfpga.c b/drivers/sysreset/sysreset_socfpga.c
index 67cec6563a..e38296ac3f 100644
--- a/drivers/sysreset/sysreset_socfpga.c
+++ b/drivers/sysreset/sysreset_socfpga.c
@@ -51,7 +51,7 @@ static struct sysreset_ops socfpga_sysreset = {
U_BOOT_DRIVER(sysreset_socfpga) = {
.id = UCLASS_SYSRESET,
.name = "socfpga_sysreset",
- .priv_auto_alloc_size = sizeof(struct socfpga_sysreset_data),
+ .priv_auto = sizeof(struct socfpga_sysreset_data),
.ops = &socfpga_sysreset,
.probe = socfpga_sysreset_probe,
};
diff --git a/drivers/sysreset/sysreset_sti.c b/drivers/sysreset/sysreset_sti.c
index 43e161c65d..29e88dbcd1 100644
--- a/drivers/sysreset/sysreset_sti.c
+++ b/drivers/sysreset/sysreset_sti.c
@@ -79,5 +79,5 @@ U_BOOT_DRIVER(sysreset_sti) = {
.ops = &sti_sysreset,
.probe = sti_sysreset_probe,
.of_match = sti_sysreset_ids,
- .priv_auto_alloc_size = sizeof(struct sti_sysreset_priv),
+ .priv_auto = sizeof(struct sti_sysreset_priv),
};
diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c
index 1c47486614..28fdfb0978 100644
--- a/drivers/sysreset/sysreset_syscon.c
+++ b/drivers/sysreset/sysreset_syscon.c
@@ -87,6 +87,6 @@ U_BOOT_DRIVER(syscon_reboot) = {
.id = UCLASS_SYSRESET,
.of_match = syscon_reboot_ids,
.probe = syscon_reboot_probe,
- .priv_auto_alloc_size = sizeof(struct syscon_reboot_priv),
+ .priv_auto = sizeof(struct syscon_reboot_priv),
.ops = &syscon_reboot_ops,
};
diff --git a/drivers/sysreset/sysreset_watchdog.c b/drivers/sysreset/sysreset_watchdog.c
index d500d41326..0dc2d8b9b6 100644
--- a/drivers/sysreset/sysreset_watchdog.c
+++ b/drivers/sysreset/sysreset_watchdog.c
@@ -54,6 +54,6 @@ U_BOOT_DRIVER(wdt_reboot) = {
.id = UCLASS_SYSRESET,
.of_match = wdt_reboot_ids,
.ops = &wdt_reboot_ops,
- .priv_auto_alloc_size = sizeof(struct wdt_reboot_priv),
+ .priv_auto = sizeof(struct wdt_reboot_priv),
.probe = wdt_reboot_probe,
};
diff --git a/drivers/sysreset/sysreset_x86.c b/drivers/sysreset/sysreset_x86.c
index 7682ffbd29..8042f3994f 100644
--- a/drivers/sysreset/sysreset_x86.c
+++ b/drivers/sysreset/sysreset_x86.c
@@ -13,10 +13,7 @@
#include <acpi/acpi_s3.h>
#include <asm/io.h>
#include <asm/processor.h>
-
-struct x86_sysreset_platdata {
- struct udevice *pch;
-};
+#include <asm/sysreset.h>
/*
* Power down the machine by using the power management sleep control
@@ -30,7 +27,7 @@ struct x86_sysreset_platdata {
*/
int pch_sysreset_power_off(struct udevice *dev)
{
- struct x86_sysreset_platdata *plat = dev_get_platdata(dev);
+ struct x86_sysreset_plat *plat = dev_get_plat(dev);
struct pch_pmbase_info pm;
u32 reg32;
int ret;
@@ -130,7 +127,7 @@ void __efi_runtime EFIAPI efi_reset_system(
static int x86_sysreset_probe(struct udevice *dev)
{
- struct x86_sysreset_platdata *plat = dev_get_platdata(dev);
+ struct x86_sysreset_plat *plat = dev_get_plat(dev);
/* Locate the PCH if there is one. It isn't essential */
uclass_first_device(UCLASS_PCH, &plat->pch);
@@ -154,5 +151,5 @@ U_BOOT_DRIVER(x86_reset) = {
.of_match = x86_sysreset_ids,
.ops = &x86_sysreset_ops,
.probe = x86_sysreset_probe,
- .platdata_auto_alloc_size = sizeof(struct x86_sysreset_platdata),
+ .plat_auto = sizeof(struct x86_sysreset_plat),
};