pmi.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _POWERPC_PMI_H
  2. #define _POWERPC_PMI_H
  3. /*
  4. * Definitions for talking with PMI device on PowerPC
  5. *
  6. * PMI (Platform Management Interrupt) is a way to communicate
  7. * with the BMC (Baseboard Management Controller) via interrupts.
  8. * Unlike IPMI it is bidirectional and has a low latency.
  9. *
  10. * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
  11. *
  12. * Author: Christian Krafft <krafft@de.ibm.com>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2, or (at your option)
  17. * any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27. */
  28. #ifdef __KERNEL__
  29. #define PMI_TYPE_FREQ_CHANGE 0x01
  30. #define PMI_TYPE_POWER_BUTTON 0x02
  31. #define PMI_READ_TYPE 0
  32. #define PMI_READ_DATA0 1
  33. #define PMI_READ_DATA1 2
  34. #define PMI_READ_DATA2 3
  35. #define PMI_WRITE_TYPE 4
  36. #define PMI_WRITE_DATA0 5
  37. #define PMI_WRITE_DATA1 6
  38. #define PMI_WRITE_DATA2 7
  39. #define PMI_ACK 0x80
  40. #define PMI_TIMEOUT 100
  41. typedef struct {
  42. u8 type;
  43. u8 data0;
  44. u8 data1;
  45. u8 data2;
  46. } pmi_message_t;
  47. struct pmi_handler {
  48. struct list_head node;
  49. u8 type;
  50. void (*handle_pmi_message) (pmi_message_t);
  51. };
  52. int pmi_register_handler(struct pmi_handler *);
  53. void pmi_unregister_handler(struct pmi_handler *);
  54. int pmi_send_message(pmi_message_t);
  55. #endif /* __KERNEL__ */
  56. #endif /* _POWERPC_PMI_H */