Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * SPDX-License-Identifier: MIT
0003  *
0004  * Copyright © 2017-2018 Intel Corporation
0005  */
0006 
0007 #ifndef _INTEL_WOPCM_H_
0008 #define _INTEL_WOPCM_H_
0009 
0010 #include <linux/types.h>
0011 
0012 /**
0013  * struct intel_wopcm - Overall WOPCM info and WOPCM regions.
0014  * @size: Size of overall WOPCM.
0015  * @guc: GuC WOPCM Region info.
0016  * @guc.base: GuC WOPCM base which is offset from WOPCM base.
0017  * @guc.size: Size of the GuC WOPCM region.
0018  */
0019 struct intel_wopcm {
0020     u32 size;
0021     struct {
0022         u32 base;
0023         u32 size;
0024     } guc;
0025 };
0026 
0027 /**
0028  * intel_wopcm_guc_base()
0029  * @wopcm:  intel_wopcm structure
0030  *
0031  * Returns the base of the WOPCM shadowed region.
0032  *
0033  * Returns:
0034  * 0 if GuC is not present or not in use.
0035  * Otherwise, the GuC WOPCM base.
0036  */
0037 static inline u32 intel_wopcm_guc_base(struct intel_wopcm *wopcm)
0038 {
0039     return wopcm->guc.base;
0040 }
0041 
0042 /**
0043  * intel_wopcm_guc_size()
0044  * @wopcm:  intel_wopcm structure
0045  *
0046  * Returns size of the WOPCM shadowed region.
0047  *
0048  * Returns:
0049  * 0 if GuC is not present or not in use.
0050  * Otherwise, the GuC WOPCM size.
0051  */
0052 static inline u32 intel_wopcm_guc_size(struct intel_wopcm *wopcm)
0053 {
0054     return wopcm->guc.size;
0055 }
0056 
0057 void intel_wopcm_init_early(struct intel_wopcm *wopcm);
0058 void intel_wopcm_init(struct intel_wopcm *wopcm);
0059 
0060 #endif