intel_pmc_bxt.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef MFD_INTEL_PMC_BXT_H
  3. #define MFD_INTEL_PMC_BXT_H
  4. /* GCR reg offsets from GCR base */
  5. #define PMC_GCR_PMC_CFG_REG 0x08
  6. #define PMC_GCR_TELEM_DEEP_S0IX_REG 0x78
  7. #define PMC_GCR_TELEM_SHLW_S0IX_REG 0x80
  8. /* PMC_CFG_REG bit masks */
  9. #define PMC_CFG_NO_REBOOT_EN BIT(4)
  10. /**
  11. * struct intel_pmc_dev - Intel PMC device structure
  12. * @dev: Pointer to the parent PMC device
  13. * @scu: Pointer to the SCU IPC device data structure
  14. * @gcr_mem_base: Virtual base address of GCR (Global Configuration Registers)
  15. * @gcr_lock: Lock used to serialize access to GCR registers
  16. * @telem_base: Pointer to telemetry SSRAM base resource or %NULL if not
  17. * available
  18. */
  19. struct intel_pmc_dev {
  20. struct device *dev;
  21. struct intel_scu_ipc_dev *scu;
  22. void __iomem *gcr_mem_base;
  23. spinlock_t gcr_lock;
  24. struct resource *telem_base;
  25. };
  26. #if IS_ENABLED(CONFIG_MFD_INTEL_PMC_BXT)
  27. int intel_pmc_gcr_read64(struct intel_pmc_dev *pmc, u32 offset, u64 *data);
  28. int intel_pmc_gcr_update(struct intel_pmc_dev *pmc, u32 offset, u32 mask, u32 val);
  29. int intel_pmc_s0ix_counter_read(struct intel_pmc_dev *pmc, u64 *data);
  30. #else
  31. static inline int intel_pmc_gcr_read64(struct intel_pmc_dev *pmc, u32 offset,
  32. u64 *data)
  33. {
  34. return -ENOTSUPP;
  35. }
  36. static inline int intel_pmc_gcr_update(struct intel_pmc_dev *pmc, u32 offset,
  37. u32 mask, u32 val)
  38. {
  39. return -ENOTSUPP;
  40. }
  41. static inline int intel_pmc_s0ix_counter_read(struct intel_pmc_dev *pmc, u64 *data)
  42. {
  43. return -ENOTSUPP;
  44. }
  45. #endif
  46. #endif /* MFD_INTEL_PMC_BXT_H */