aboutsummaryrefslogtreecommitdiffstats
path: root/roms/skiboot/include/dio-p9.h
diff options
context:
space:
mode:
Diffstat (limited to 'roms/skiboot/include/dio-p9.h')
-rw-r--r--roms/skiboot/include/dio-p9.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/roms/skiboot/include/dio-p9.h b/roms/skiboot/include/dio-p9.h
new file mode 100644
index 000000000..957322f1b
--- /dev/null
+++ b/roms/skiboot/include/dio-p9.h
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
+/* Copyright 2019 IBM Corp. */
+
+#ifndef __DIO_H
+#define __DIO_H
+
+struct proc_chip;
+
+/* Initialize the P9 DIO */
+extern void p9_dio_init(void);
+
+/* The function typedef for dio interrupt callback */
+typedef void (*dio_interrupt_callback)(struct proc_chip *chip);
+
+/* Register dio interrupt on GPIO port.
+ * This effectively enables the DIO interrupt on the GPIO port,
+ * and callback will be called when the interrupt is triggered */
+extern int dio_interrupt_register(struct proc_chip *chip,
+ int port, dio_interrupt_callback c);
+
+/* Deregister dio interrupt on GPIO port.
+ * This effectively disables the DIO interrupt on the GPIO port. */
+extern int dio_interrupt_deregister(struct proc_chip *chip,
+ int port, dio_interrupt_callback c);
+
+/* The function to be called when DIO interrupt is triggered */
+extern void dio_interrupt_handler(uint32_t chip_id);
+
+
+#define NUM_OF_P9_DIO_PORTS 3 /* P9 has GPIO port 0~2 for interrupts */
+
+struct p9_dio {
+ dio_interrupt_callback callbacks[NUM_OF_P9_DIO_PORTS];
+};
+
+#endif /* __DIO_H */