summaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/psci.c23
-rw-r--r--sys/dev/fdt/pscivar.h26
2 files changed, 27 insertions, 22 deletions
diff --git a/sys/dev/fdt/psci.c b/sys/dev/fdt/psci.c
index 14bcd878690..72fea23cf3f 100644
--- a/sys/dev/fdt/psci.c
+++ b/sys/dev/fdt/psci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psci.c,v 1.16 2024/04/13 14:20:48 kettenis Exp $ */
+/* $OpenBSD: psci.c,v 1.17 2024/07/10 11:01:24 kettenis Exp $ */
/*
* Copyright (c) 2016 Jonathan Gray <jsg@openbsd.org>
@@ -37,27 +37,6 @@ extern void (*powerdownfn)(void);
#define SMCCC_ARCH_WORKAROUND_2 0x80007fff
#define SMCCC_ARCH_WORKAROUND_3 0x80003fff
-#define PSCI_VERSION 0x84000000
-#ifdef __LP64__
-#define CPU_SUSPEND 0xc4000001
-#else
-#define CPU_SUSPEND 0x84000001
-#endif
-#define CPU_OFF 0x84000002
-#ifdef __LP64__
-#define CPU_ON 0xc4000003
-#else
-#define CPU_ON 0x84000003
-#endif
-#define SYSTEM_OFF 0x84000008
-#define SYSTEM_RESET 0x84000009
-#define PSCI_FEATURES 0x8400000a
-#ifdef __LP64__
-#define SYSTEM_SUSPEND 0xc400000e
-#else
-#define SYSTEM_SUSPEND 0x8400000e
-#endif
-
struct psci_softc {
struct device sc_dev;
register_t (*sc_callfn)(register_t, register_t, register_t,
diff --git a/sys/dev/fdt/pscivar.h b/sys/dev/fdt/pscivar.h
index ba8942b0353..f11666a6185 100644
--- a/sys/dev/fdt/pscivar.h
+++ b/sys/dev/fdt/pscivar.h
@@ -10,12 +10,38 @@
#define PSCI_METHOD_HVC 1
#define PSCI_METHOD_SMC 2
+#define PSCI_VERSION 0x84000000
+#ifdef __LP64__
+#define CPU_SUSPEND 0xc4000001
+#else
+#define CPU_SUSPEND 0x84000001
+#endif
+#define CPU_OFF 0x84000002
+#ifdef __LP64__
+#define CPU_ON 0xc4000003
+#else
+#define CPU_ON 0x84000003
+#endif
+#define SYSTEM_OFF 0x84000008
+#define SYSTEM_RESET 0x84000009
+#define PSCI_FEATURES 0x8400000a
+#ifdef __LP64__
+#define SYSTEM_SUSPEND 0xc400000e
+#else
+#define SYSTEM_SUSPEND 0x8400000e
+#endif
+
+#define PSCI_FEATURE_POWER_STATE_EXT (1 << 1)
+#define PSCI_POWER_STATE_POWERDOWN (1 << 16)
+#define PSCI_POWER_STATE_EXT_POWERDOWN (1 << 30)
+
int psci_can_suspend(void);
int32_t psci_system_suspend(register_t, register_t);
int32_t psci_cpu_on(register_t, register_t, register_t);
int32_t psci_cpu_off(void);
int32_t psci_cpu_suspend(register_t, register_t, register_t);
+int32_t psci_features(uint32_t);
void psci_flush_bp(void);
int psci_method(void);