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