pmu.h 656 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright(c) 2023 Huawei
  4. * CXL Specification rev 3.0 Setion 8.2.7 (CPMU Register Interface)
  5. */
  6. #ifndef CXL_PMU_H
  7. #define CXL_PMU_H
  8. #include <linux/device.h>
  9. enum cxl_pmu_type {
  10. CXL_PMU_MEMDEV,
  11. };
  12. #define CXL_PMU_REGMAP_SIZE 0xe00 /* Table 8-32 CXL 3.0 specification */
  13. struct cxl_pmu {
  14. struct device dev;
  15. void __iomem *base;
  16. int assoc_id;
  17. int index;
  18. enum cxl_pmu_type type;
  19. };
  20. #define to_cxl_pmu(dev) container_of(dev, struct cxl_pmu, dev)
  21. struct cxl_pmu_regs;
  22. int devm_cxl_pmu_add(struct device *parent, struct cxl_pmu_regs *regs,
  23. int assoc_id, int idx, enum cxl_pmu_type type);
  24. #endif