Add a new debugfs to dump information about the GSC. This includes: - the FW path and SW tracking status; - the release, security and compatibility versions; - the HECI1 status registers. Note that those are the same registers that the mei driver dumps in their own status sysfs on DG2 (where mei owns the GSC). To make it simpler to loop through the status register, the code has been update to use a PICK macro and the existing code using the regs had been adapted to match. v2: fix includes and copyright dates (Alan) v3: actually fix the includes Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Alan Previn <alan.previn.teres.alexis@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230612181529.2222451-5-daniele.ceraolospurio@intel.com
65 lines
1.7 KiB
C
65 lines
1.7 KiB
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2020 Intel Corporation
|
|
*/
|
|
|
|
#include <linux/debugfs.h>
|
|
#include <linux/string_helpers.h>
|
|
|
|
#include <drm/drm_print.h>
|
|
|
|
#include "gt/intel_gt_debugfs.h"
|
|
#include "intel_guc_debugfs.h"
|
|
#include "intel_gsc_uc_debugfs.h"
|
|
#include "intel_huc_debugfs.h"
|
|
#include "intel_uc.h"
|
|
#include "intel_uc_debugfs.h"
|
|
|
|
static int uc_usage_show(struct seq_file *m, void *data)
|
|
{
|
|
struct intel_uc *uc = m->private;
|
|
struct drm_printer p = drm_seq_file_printer(m);
|
|
|
|
drm_printf(&p, "[guc] supported:%s wanted:%s used:%s\n",
|
|
str_yes_no(intel_uc_supports_guc(uc)),
|
|
str_yes_no(intel_uc_wants_guc(uc)),
|
|
str_yes_no(intel_uc_uses_guc(uc)));
|
|
drm_printf(&p, "[huc] supported:%s wanted:%s used:%s\n",
|
|
str_yes_no(intel_uc_supports_huc(uc)),
|
|
str_yes_no(intel_uc_wants_huc(uc)),
|
|
str_yes_no(intel_uc_uses_huc(uc)));
|
|
drm_printf(&p, "[submission] supported:%s wanted:%s used:%s\n",
|
|
str_yes_no(intel_uc_supports_guc_submission(uc)),
|
|
str_yes_no(intel_uc_wants_guc_submission(uc)),
|
|
str_yes_no(intel_uc_uses_guc_submission(uc)));
|
|
|
|
return 0;
|
|
}
|
|
DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(uc_usage);
|
|
|
|
void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
|
|
{
|
|
static const struct intel_gt_debugfs_file files[] = {
|
|
{ "usage", &uc_usage_fops, NULL },
|
|
};
|
|
struct dentry *root;
|
|
|
|
if (!gt_root)
|
|
return;
|
|
|
|
/* GuC and HuC go always in pair, no need to check both */
|
|
if (!intel_uc_supports_guc(uc))
|
|
return;
|
|
|
|
root = debugfs_create_dir("uc", gt_root);
|
|
if (IS_ERR(root))
|
|
return;
|
|
|
|
uc->guc.dbgfs_node = root;
|
|
|
|
intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
|
|
|
|
intel_gsc_uc_debugfs_register(&uc->gsc, root);
|
|
intel_guc_debugfs_register(&uc->guc, root);
|
|
intel_huc_debugfs_register(&uc->huc, root);
|
|
}
|