Each gt contains an independent instance of pcode. Extend pcode functions to interface with pcode on different gt's. To avoid creating dependency of display functionality on intel_gt, pcode function interfaces are exposed in terms of uncore rather than intel_gt. Callers have been converted to pass in the appropritate (i915 or intel_gt) uncore to the pcode functions. v2: Expose pcode functions in terms of uncore rather than gt (Jani/Rodrigo) v3: Retain previous function names to eliminate needless #defines (Rodrigo) v4: Move out i915_pcode_init() to a separate patch (Tvrtko) Remove duplicated drm_err/drm_dbg from intel_pcode_init() (Tvrtko) Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220519085732.1276255-2-tvrtko.ursulin@linux.intel.com [tursulin: fixup merge conflict]
25 lines
700 B
C
25 lines
700 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2013-2021 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_PCODE_H_
|
|
#define _INTEL_PCODE_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct intel_uncore;
|
|
|
|
int snb_pcode_read(struct intel_uncore *uncore, u32 mbox, u32 *val, u32 *val1);
|
|
int snb_pcode_write_timeout(struct intel_uncore *uncore, u32 mbox, u32 val,
|
|
int fast_timeout_us, int slow_timeout_ms);
|
|
#define snb_pcode_write(uncore, mbox, val) \
|
|
snb_pcode_write_timeout(uncore, mbox, val, 500, 0)
|
|
|
|
int skl_pcode_request(struct intel_uncore *uncore, u32 mbox, u32 request,
|
|
u32 reply_mask, u32 reply, int timeout_base_ms);
|
|
|
|
int intel_pcode_init(struct intel_uncore *uncore);
|
|
|
|
#endif /* _INTEL_PCODE_H */
|