Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 #ifndef _POWERPC_PMI_H
0003 #define _POWERPC_PMI_H
0004 
0005 /*
0006  * Definitions for talking with PMI device on PowerPC
0007  *
0008  * PMI (Platform Management Interrupt) is a way to communicate
0009  * with the BMC (Baseboard Management Controller) via interrupts.
0010  * Unlike IPMI it is bidirectional and has a low latency.
0011  *
0012  * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
0013  *
0014  * Author: Christian Krafft <krafft@de.ibm.com>
0015  */
0016 
0017 #ifdef __KERNEL__
0018 
0019 #define PMI_TYPE_FREQ_CHANGE    0x01
0020 #define PMI_TYPE_POWER_BUTTON   0x02
0021 #define PMI_READ_TYPE       0
0022 #define PMI_READ_DATA0      1
0023 #define PMI_READ_DATA1      2
0024 #define PMI_READ_DATA2      3
0025 #define PMI_WRITE_TYPE      4
0026 #define PMI_WRITE_DATA0     5
0027 #define PMI_WRITE_DATA1     6
0028 #define PMI_WRITE_DATA2     7
0029 
0030 #define PMI_ACK         0x80
0031 
0032 #define PMI_TIMEOUT     100
0033 
0034 typedef struct {
0035     u8  type;
0036     u8  data0;
0037     u8  data1;
0038     u8  data2;
0039 } pmi_message_t;
0040 
0041 struct pmi_handler {
0042     struct list_head node;
0043     u8 type;
0044     void (*handle_pmi_message) (pmi_message_t);
0045 };
0046 
0047 int pmi_register_handler(struct pmi_handler *);
0048 void pmi_unregister_handler(struct pmi_handler *);
0049 
0050 int pmi_send_message(pmi_message_t);
0051 
0052 #endif /* __KERNEL__ */
0053 #endif /* _POWERPC_PMI_H */