aboutsummaryrefslogtreecommitdiffstats
path: root/roms/skiboot/include/powercap.h
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/include/powercap.h
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/include/powercap.h')
-rw-r--r--roms/skiboot/include/powercap.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/roms/skiboot/include/powercap.h b/roms/skiboot/include/powercap.h
new file mode 100644
index 000000000..e47219130
--- /dev/null
+++ b/roms/skiboot/include/powercap.h
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+/* Copyright 2017 IBM Corp. */
+
+#ifndef __POWERCAP_H
+#define __POWERCAP_H
+
+#include <opal.h>
+
+enum powercap_class {
+ POWERCAP_CLASS_OCC,
+};
+
+/*
+ * Powercap handle is defined as u32. The first and last bytes are
+ * used to indicate the class and attribute.
+ *
+ * | Class | Reserved | Attribute |
+ * |-------|---------------|-----------|
+ */
+
+#define powercap_make_handle(class, attr) (((class & 0xF) << 24) | (attr & 0xF))
+
+#define powercap_get_class(handle) ((handle >> 24) & 0xF)
+#define powercap_get_attr(handle) (handle & 0xF)
+
+/* Powercap OCC interface */
+int occ_get_powercap(u32 handle, u32 *pcap);
+int __attribute__((__const__)) occ_set_powercap(u32 handle, int token, u32 pcap);
+
+#endif /* __POWERCAP_H */