The root tile indicates the pcode initialization is complete when all tiles have completed their initialization. So the mailbox can be polled only on the root tile. Check pcode init status only on root tile and move it to device probe early as root tile is initialized there. Also make similar changes in resume paths. v2: add lock/unlocked version of pcode_mailbox_rw to allow pcode init to be called in device early probe (Rodrigo) v3: add code description about using root tile change function names to xe_pcode_probe_early and xe_pcode_init (Rodrigo) Signed-off-by: Riana Tauro <riana.tauro@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240410085005.1126343-2-riana.tauro@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
32 lines
937 B
C
32 lines
937 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _XE_PCODE_H_
|
|
#define _XE_PCODE_H_
|
|
|
|
#include <linux/types.h>
|
|
struct xe_gt;
|
|
struct xe_device;
|
|
|
|
void xe_pcode_init(struct xe_gt *gt);
|
|
int xe_pcode_probe_early(struct xe_device *xe);
|
|
int xe_pcode_ready(struct xe_device *xe, bool locked);
|
|
int xe_pcode_init_min_freq_table(struct xe_gt *gt, u32 min_gt_freq,
|
|
u32 max_gt_freq);
|
|
int xe_pcode_read(struct xe_gt *gt, u32 mbox, u32 *val, u32 *val1);
|
|
int xe_pcode_write_timeout(struct xe_gt *gt, u32 mbox, u32 val,
|
|
int timeout_ms);
|
|
#define xe_pcode_write(gt, mbox, val) \
|
|
xe_pcode_write_timeout(gt, mbox, val, 1)
|
|
|
|
int xe_pcode_request(struct xe_gt *gt, u32 mbox, u32 request,
|
|
u32 reply_mask, u32 reply, int timeout_ms);
|
|
|
|
#define PCODE_MBOX(mbcmd, param1, param2)\
|
|
(FIELD_PREP(PCODE_MB_COMMAND, mbcmd)\
|
|
| FIELD_PREP(PCODE_MB_PARAM1, param1)\
|
|
| FIELD_PREP(PCODE_MB_PARAM2, param2))
|
|
|
|
#endif
|