xref: /linux/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c (revision 48dea9a700c8728cc31a1dd44588b97578de86ee)
1 // SPDX-License-Identifier: MIT
2 /*
3  * Copyright © 2014-2019 Intel Corporation
4  */
5 
6 #include "gt/intel_gt.h"
7 #include "intel_huc_fw.h"
8 #include "i915_drv.h"
9 
10 /**
11  * intel_huc_fw_upload() - load HuC uCode to device
12  * @huc: intel_huc structure
13  *
14  * Called from intel_uc_init_hw() during driver load, resume from sleep and
15  * after a GPU reset. Note that HuC must be loaded before GuC.
16  *
17  * The firmware image should have already been fetched into memory, so only
18  * check that fetch succeeded, and then transfer the image to the h/w.
19  *
20  * Return:	non-zero code on error
21  */
22 int intel_huc_fw_upload(struct intel_huc *huc)
23 {
24 	/* HW doesn't look at destination address for HuC, so set it to 0 */
25 	return intel_uc_fw_upload(&huc->fw, 0, HUC_UKERNEL);
26 }
27