pmi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef _POWERPC_PMI_H
  3. #define _POWERPC_PMI_H
  4. /*
  5. * Definitions for talking with PMI device on PowerPC
  6. *
  7. * PMI (Platform Management Interrupt) is a way to communicate
  8. * with the BMC (Baseboard Management Controller) via interrupts.
  9. * Unlike IPMI it is bidirectional and has a low latency.
  10. *
  11. * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
  12. *
  13. * Author: Christian Krafft <[email protected]>
  14. */
  15. #ifdef __KERNEL__
  16. #define PMI_TYPE_FREQ_CHANGE 0x01
  17. #define PMI_TYPE_POWER_BUTTON 0x02
  18. #define PMI_READ_TYPE 0
  19. #define PMI_READ_DATA0 1
  20. #define PMI_READ_DATA1 2
  21. #define PMI_READ_DATA2 3
  22. #define PMI_WRITE_TYPE 4
  23. #define PMI_WRITE_DATA0 5
  24. #define PMI_WRITE_DATA1 6
  25. #define PMI_WRITE_DATA2 7
  26. #define PMI_ACK 0x80
  27. #define PMI_TIMEOUT 100
  28. typedef struct {
  29. u8 type;
  30. u8 data0;
  31. u8 data1;
  32. u8 data2;
  33. } pmi_message_t;
  34. struct pmi_handler {
  35. struct list_head node;
  36. u8 type;
  37. void (*handle_pmi_message) (pmi_message_t);
  38. };
  39. int pmi_register_handler(struct pmi_handler *);
  40. void pmi_unregister_handler(struct pmi_handler *);
  41. int pmi_send_message(pmi_message_t);
  42. #endif /* __KERNEL__ */
  43. #endif /* _POWERPC_PMI_H */