2018-03-14 07:32:50 +07:00
|
|
|
/*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
* Copyright © 2017-2018 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INTEL_WOPCM_H_
|
|
|
|
#define _INTEL_WOPCM_H_
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct intel_wopcm - Overall WOPCM info and WOPCM regions.
|
|
|
|
* @size: Size of overall WOPCM.
|
|
|
|
* @guc: GuC WOPCM Region info.
|
|
|
|
* @guc.base: GuC WOPCM base which is offset from WOPCM base.
|
|
|
|
* @guc.size: Size of the GuC WOPCM region.
|
|
|
|
*/
|
|
|
|
struct intel_wopcm {
|
|
|
|
u32 size;
|
|
|
|
struct {
|
|
|
|
u32 base;
|
|
|
|
u32 size;
|
|
|
|
} guc;
|
|
|
|
};
|
|
|
|
|
2019-07-31 06:07:40 +07:00
|
|
|
/**
|
|
|
|
* intel_wopcm_guc_base()
|
|
|
|
* @wopcm: intel_wopcm structure
|
|
|
|
*
|
|
|
|
* Returns the base of the WOPCM shadowed region.
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* 0 if GuC is not present or not in use.
|
|
|
|
* Otherwise, the GuC WOPCM base.
|
|
|
|
*/
|
|
|
|
static inline u32 intel_wopcm_guc_base(struct intel_wopcm *wopcm)
|
|
|
|
{
|
|
|
|
return wopcm->guc.base;
|
|
|
|
}
|
|
|
|
|
2019-06-11 18:00:43 +07:00
|
|
|
/**
|
|
|
|
* intel_wopcm_guc_size()
|
|
|
|
* @wopcm: intel_wopcm structure
|
|
|
|
*
|
|
|
|
* Returns size of the WOPCM shadowed region.
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* 0 if GuC is not present or not in use.
|
|
|
|
* Otherwise, the GuC WOPCM size.
|
|
|
|
*/
|
|
|
|
static inline u32 intel_wopcm_guc_size(struct intel_wopcm *wopcm)
|
|
|
|
{
|
|
|
|
return wopcm->guc.size;
|
|
|
|
}
|
|
|
|
|
2018-03-14 07:32:50 +07:00
|
|
|
void intel_wopcm_init_early(struct intel_wopcm *wopcm);
|
2019-08-03 01:40:55 +07:00
|
|
|
void intel_wopcm_init(struct intel_wopcm *wopcm);
|
2018-03-14 07:32:50 +07:00
|
|
|
|
|
|
|
#endif
|