fsi.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. #ifndef _UAPI_LINUX_FSI_H
  3. #define _UAPI_LINUX_FSI_H
  4. #include <linux/types.h>
  5. #include <linux/ioctl.h>
  6. /*
  7. * /dev/scom "raw" ioctl interface
  8. *
  9. * The driver supports a high level "read/write" interface which
  10. * handles retries and converts the status to Linux error codes,
  11. * however low level tools an debugger need to access the "raw"
  12. * HW status information and interpret it themselves, so this
  13. * ioctl interface is also provided for their use case.
  14. */
  15. /* Structure for SCOM read/write */
  16. struct scom_access {
  17. __u64 addr; /* SCOM address, supports indirect */
  18. __u64 data; /* SCOM data (in for write, out for read) */
  19. __u64 mask; /* Data mask for writes */
  20. __u32 intf_errors; /* Interface error flags */
  21. #define SCOM_INTF_ERR_PARITY 0x00000001 /* Parity error */
  22. #define SCOM_INTF_ERR_PROTECTION 0x00000002 /* Blocked by secure boot */
  23. #define SCOM_INTF_ERR_ABORT 0x00000004 /* PIB reset during access */
  24. #define SCOM_INTF_ERR_UNKNOWN 0x80000000 /* Unknown error */
  25. /*
  26. * Note: Any other bit set in intf_errors need to be considered as an
  27. * error. Future implementations may define new error conditions. The
  28. * pib_status below is only valid if intf_errors is 0.
  29. */
  30. __u8 pib_status; /* 3-bit PIB status */
  31. #define SCOM_PIB_SUCCESS 0 /* Access successful */
  32. #define SCOM_PIB_BLOCKED 1 /* PIB blocked, pls retry */
  33. #define SCOM_PIB_OFFLINE 2 /* Chiplet offline */
  34. #define SCOM_PIB_PARTIAL 3 /* Partial good */
  35. #define SCOM_PIB_BAD_ADDR 4 /* Invalid address */
  36. #define SCOM_PIB_CLK_ERR 5 /* Clock error */
  37. #define SCOM_PIB_PARITY_ERR 6 /* Parity error on the PIB bus */
  38. #define SCOM_PIB_TIMEOUT 7 /* Bus timeout */
  39. __u8 pad;
  40. };
  41. /* Flags for SCOM check */
  42. #define SCOM_CHECK_SUPPORTED 0x00000001 /* Interface supported */
  43. #define SCOM_CHECK_PROTECTED 0x00000002 /* Interface blocked by secure boot */
  44. /* Flags for SCOM reset */
  45. #define SCOM_RESET_INTF 0x00000001 /* Reset interface */
  46. #define SCOM_RESET_PIB 0x00000002 /* Reset PIB */
  47. #define FSI_SCOM_CHECK _IOR('s', 0x00, __u32)
  48. #define FSI_SCOM_READ _IOWR('s', 0x01, struct scom_access)
  49. #define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)
  50. #define FSI_SCOM_RESET _IOW('s', 0x03, __u32)
  51. #endif /* _UAPI_LINUX_FSI_H */