Jackie Li | 6b0478f | 2018-03-13 17:32:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright © 2017-2018 Intel Corporation |
| 5 | */ |
| 6 | |
| 7 | #ifndef _INTEL_WOPCM_H_ |
| 8 | #define _INTEL_WOPCM_H_ |
| 9 | |
| 10 | #include <linux/types.h> |
| 11 | |
| 12 | /** |
| 13 | * struct intel_wopcm - Overall WOPCM info and WOPCM regions. |
| 14 | * @size: Size of overall WOPCM. |
| 15 | * @guc: GuC WOPCM Region info. |
| 16 | * @guc.base: GuC WOPCM base which is offset from WOPCM base. |
| 17 | * @guc.size: Size of the GuC WOPCM region. |
| 18 | */ |
| 19 | struct intel_wopcm { |
| 20 | u32 size; |
| 21 | struct { |
| 22 | u32 base; |
| 23 | u32 size; |
| 24 | } guc; |
| 25 | }; |
| 26 | |
Tvrtko Ursulin | 9937e16b | 2019-06-11 12:00:43 +0100 | [diff] [blame] | 27 | /** |
Daniele Ceraolo Spurio | 63064d8 | 2019-07-30 16:07:40 -0700 | [diff] [blame] | 28 | * intel_wopcm_guc_base() |
| 29 | * @wopcm: intel_wopcm structure |
| 30 | * |
| 31 | * Returns the base of the WOPCM shadowed region. |
| 32 | * |
| 33 | * Returns: |
| 34 | * 0 if GuC is not present or not in use. |
| 35 | * Otherwise, the GuC WOPCM base. |
| 36 | */ |
| 37 | static inline u32 intel_wopcm_guc_base(struct intel_wopcm *wopcm) |
| 38 | { |
| 39 | return wopcm->guc.base; |
| 40 | } |
| 41 | |
| 42 | /** |
Tvrtko Ursulin | 9937e16b | 2019-06-11 12:00:43 +0100 | [diff] [blame] | 43 | * intel_wopcm_guc_size() |
| 44 | * @wopcm: intel_wopcm structure |
| 45 | * |
| 46 | * Returns size of the WOPCM shadowed region. |
| 47 | * |
| 48 | * Returns: |
| 49 | * 0 if GuC is not present or not in use. |
| 50 | * Otherwise, the GuC WOPCM size. |
| 51 | */ |
| 52 | static inline u32 intel_wopcm_guc_size(struct intel_wopcm *wopcm) |
| 53 | { |
| 54 | return wopcm->guc.size; |
| 55 | } |
| 56 | |
Jackie Li | 6b0478f | 2018-03-13 17:32:50 -0700 | [diff] [blame] | 57 | void intel_wopcm_init_early(struct intel_wopcm *wopcm); |
Michal Wajdeczko | 6bd0fbe | 2019-08-02 18:40:55 +0000 | [diff] [blame] | 58 | void intel_wopcm_init(struct intel_wopcm *wopcm); |
Jackie Li | 6b0478f | 2018-03-13 17:32:50 -0700 | [diff] [blame] | 59 | |
| 60 | #endif |