mirror of
https://github.com/torvalds/linux.git
synced 2026-05-03 05:52:38 -04:00
Pull driver core updates from Greg KH: "Here is the large set of driver core changes for 6.4-rc1. Once again, a busy development cycle, with lots of changes happening in the driver core in the quest to be able to move "struct bus" and "struct class" into read-only memory, a task now complete with these changes. This will make the future rust interactions with the driver core more "provably correct" as well as providing more obvious lifetime rules for all busses and classes in the kernel. The changes required for this did touch many individual classes and busses as many callbacks were changed to take const * parameters instead. All of these changes have been submitted to the various subsystem maintainers, giving them plenty of time to review, and most of them actually did so. Other than those changes, included in here are a small set of other things: - kobject logging improvements - cacheinfo improvements and updates - obligatory fw_devlink updates and fixes - documentation updates - device property cleanups and const * changes - firwmare loader dependency fixes. All of these have been in linux-next for a while with no reported problems" * tag 'driver-core-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (120 commits) device property: make device_property functions take const device * driver core: update comments in device_rename() driver core: Don't require dynamic_debug for initcall_debug probe timing firmware_loader: rework crypto dependencies firmware_loader: Strip off \n from customized path zram: fix up permission for the hot_add sysfs file cacheinfo: Add use_arch[|_cache]_info field/function arch_topology: Remove early cacheinfo error message if -ENOENT cacheinfo: Check cache properties are present in DT cacheinfo: Check sib_leaf in cache_leaves_are_shared() cacheinfo: Allow early level detection when DT/ACPI info is missing/broken cacheinfo: Add arm64 early level initializer implementation cacheinfo: Add arch specific early level initializer tty: make tty_class a static const structure driver core: class: remove struct class_interface * from callbacks driver core: class: mark the struct class in struct class_interface constant driver core: class: make class_register() take a const * driver core: class: mark class_release() as taking a const * driver core: remove incorrect comment for device_create* MIPS: vpe-cmp: remove module owner pointer from struct class usage. ...
88 lines
2.2 KiB
C
88 lines
2.2 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2014-2019 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_HUC_H_
|
|
#define _INTEL_HUC_H_
|
|
|
|
#include "i915_reg_defs.h"
|
|
#include "i915_sw_fence.h"
|
|
#include "intel_uc_fw.h"
|
|
#include "intel_huc_fw.h"
|
|
|
|
#include <linux/notifier.h>
|
|
#include <linux/hrtimer.h>
|
|
|
|
struct bus_type;
|
|
|
|
enum intel_huc_delayed_load_status {
|
|
INTEL_HUC_WAITING_ON_GSC = 0,
|
|
INTEL_HUC_WAITING_ON_PXP,
|
|
INTEL_HUC_DELAYED_LOAD_ERROR,
|
|
};
|
|
|
|
struct intel_huc {
|
|
/* Generic uC firmware management */
|
|
struct intel_uc_fw fw;
|
|
|
|
/* HuC-specific additions */
|
|
struct {
|
|
i915_reg_t reg;
|
|
u32 mask;
|
|
u32 value;
|
|
} status;
|
|
|
|
struct {
|
|
struct i915_sw_fence fence;
|
|
struct hrtimer timer;
|
|
struct notifier_block nb;
|
|
enum intel_huc_delayed_load_status status;
|
|
} delayed_load;
|
|
};
|
|
|
|
int intel_huc_sanitize(struct intel_huc *huc);
|
|
void intel_huc_init_early(struct intel_huc *huc);
|
|
int intel_huc_init(struct intel_huc *huc);
|
|
void intel_huc_fini(struct intel_huc *huc);
|
|
void intel_huc_suspend(struct intel_huc *huc);
|
|
int intel_huc_auth(struct intel_huc *huc);
|
|
int intel_huc_wait_for_auth_complete(struct intel_huc *huc);
|
|
int intel_huc_check_status(struct intel_huc *huc);
|
|
void intel_huc_update_auth_status(struct intel_huc *huc);
|
|
bool intel_huc_is_authenticated(struct intel_huc *huc);
|
|
|
|
void intel_huc_register_gsc_notifier(struct intel_huc *huc, const struct bus_type *bus);
|
|
void intel_huc_unregister_gsc_notifier(struct intel_huc *huc, const struct bus_type *bus);
|
|
|
|
static inline bool intel_huc_is_supported(struct intel_huc *huc)
|
|
{
|
|
return intel_uc_fw_is_supported(&huc->fw);
|
|
}
|
|
|
|
static inline bool intel_huc_is_wanted(struct intel_huc *huc)
|
|
{
|
|
return intel_uc_fw_is_enabled(&huc->fw);
|
|
}
|
|
|
|
static inline bool intel_huc_is_used(struct intel_huc *huc)
|
|
{
|
|
GEM_BUG_ON(__intel_uc_fw_status(&huc->fw) == INTEL_UC_FIRMWARE_SELECTED);
|
|
return intel_uc_fw_is_available(&huc->fw);
|
|
}
|
|
|
|
static inline bool intel_huc_is_loaded_by_gsc(const struct intel_huc *huc)
|
|
{
|
|
return huc->fw.loaded_via_gsc;
|
|
}
|
|
|
|
static inline bool intel_huc_wait_required(struct intel_huc *huc)
|
|
{
|
|
return intel_huc_is_used(huc) && intel_huc_is_loaded_by_gsc(huc) &&
|
|
!intel_huc_is_authenticated(huc);
|
|
}
|
|
|
|
void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p);
|
|
|
|
#endif
|