opal-prd.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * OPAL Runtime Diagnostics interface driver
  3. * Supported on POWERNV platform
  4. *
  5. * (C) Copyright IBM 2015
  6. *
  7. * Author: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>
  8. * Author: Jeremy Kerr <jk@ozlabs.org>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2, or (at your option)
  13. * any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. */
  20. #ifndef _UAPI_ASM_POWERPC_OPAL_PRD_H_
  21. #define _UAPI_ASM_POWERPC_OPAL_PRD_H_
  22. #include <linux/types.h>
  23. /**
  24. * The version of the kernel interface of the PRD system. This describes the
  25. * interface available for the /dev/opal-prd device. The actual PRD message
  26. * layout and content is private to the firmware <--> userspace interface, so
  27. * is not covered by this versioning.
  28. *
  29. * Future interface versions are backwards-compatible; if a later kernel
  30. * version is encountered, functionality provided in earlier versions
  31. * will work.
  32. */
  33. #define OPAL_PRD_KERNEL_VERSION 1
  34. #define OPAL_PRD_GET_INFO _IOR('o', 0x01, struct opal_prd_info)
  35. #define OPAL_PRD_SCOM_READ _IOR('o', 0x02, struct opal_prd_scom)
  36. #define OPAL_PRD_SCOM_WRITE _IOW('o', 0x03, struct opal_prd_scom)
  37. #ifndef __ASSEMBLY__
  38. struct opal_prd_info {
  39. __u64 version;
  40. __u64 reserved[3];
  41. };
  42. struct opal_prd_scom {
  43. __u64 chip;
  44. __u64 addr;
  45. __u64 data;
  46. __s64 rc;
  47. };
  48. #endif /* __ASSEMBLY__ */
  49. #endif /* _UAPI_ASM_POWERPC_OPAL_PRD_H */