intel_wopcm.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * SPDX-License-Identifier: MIT
  3. *
  4. * Copyright © 2017-2018 Intel Corporation
  5. */
  6. #ifndef _INTEL_WOPCM_H_
  7. #define _INTEL_WOPCM_H_
  8. #include <linux/types.h>
  9. /**
  10. * struct intel_wopcm - Overall WOPCM info and WOPCM regions.
  11. * @size: Size of overall WOPCM.
  12. * @guc: GuC WOPCM Region info.
  13. * @guc.base: GuC WOPCM base which is offset from WOPCM base.
  14. * @guc.size: Size of the GuC WOPCM region.
  15. */
  16. struct intel_wopcm {
  17. u32 size;
  18. struct {
  19. u32 base;
  20. u32 size;
  21. } guc;
  22. };
  23. /**
  24. * intel_wopcm_guc_base()
  25. * @wopcm: intel_wopcm structure
  26. *
  27. * Returns the base of the WOPCM shadowed region.
  28. *
  29. * Returns:
  30. * 0 if GuC is not present or not in use.
  31. * Otherwise, the GuC WOPCM base.
  32. */
  33. static inline u32 intel_wopcm_guc_base(struct intel_wopcm *wopcm)
  34. {
  35. return wopcm->guc.base;
  36. }
  37. /**
  38. * intel_wopcm_guc_size()
  39. * @wopcm: intel_wopcm structure
  40. *
  41. * Returns size of the WOPCM shadowed region.
  42. *
  43. * Returns:
  44. * 0 if GuC is not present or not in use.
  45. * Otherwise, the GuC WOPCM size.
  46. */
  47. static inline u32 intel_wopcm_guc_size(struct intel_wopcm *wopcm)
  48. {
  49. return wopcm->guc.size;
  50. }
  51. void intel_wopcm_init_early(struct intel_wopcm *wopcm);
  52. void intel_wopcm_init(struct intel_wopcm *wopcm);
  53. #endif