/arch/powerpc/include/asm/pmi.h

http://github.com/mirrors/linux · C Header · 53 lines · 31 code · 10 blank · 12 comment · 0 complexity · 273868b35738914852da4205f68affe3 MD5 · raw file

  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 <krafft@de.ibm.com>
  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 */