1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2025 Intel Corporation 4 */ 5 6 #ifndef _XE_LATE_BIND_TYPES_H_ 7 #define _XE_LATE_BIND_TYPES_H_ 8 9 #include <linux/iosys-map.h> 10 #include <linux/mutex.h> 11 #include <linux/types.h> 12 #include <linux/workqueue.h> 13 #include "xe_uc_fw_abi.h" 14 15 #define XE_LB_MAX_PAYLOAD_SIZE SZ_4K 16 17 /** 18 * enum xe_late_bind_fw_id - enum to determine late binding fw index 19 */ 20 enum xe_late_bind_fw_id { 21 /** @XE_LB_FW_FAN_CONTROL: Fan control */ 22 XE_LB_FW_FAN_CONTROL = 0, 23 /** @XE_LB_FW_MAX_ID: Number of IDs */ 24 XE_LB_FW_MAX_ID 25 }; 26 27 /** 28 * struct xe_late_bind_fw 29 */ 30 struct xe_late_bind_fw { 31 /** @id: firmware index */ 32 u32 id; 33 /** @blob_path: firmware binary path */ 34 char blob_path[PATH_MAX]; 35 /** @type: firmware type */ 36 u32 type; 37 /** @flags: firmware flags */ 38 u32 flags; 39 /** @payload: to store the late binding blob */ 40 const u8 *payload; 41 /** @payload_size: late binding blob payload_size */ 42 size_t payload_size; 43 /** @work: worker to upload latebind blob */ 44 struct work_struct work; 45 /** @version: late binding blob manifest version */ 46 struct gsc_version version; 47 }; 48 49 /** 50 * struct xe_late_bind_component - Late Binding services component 51 * @mei_dev: device that provide Late Binding service. 52 * @ops: Ops implemented by Late Binding driver, used by Xe driver. 53 * 54 * Communication between Xe and MEI drivers for Late Binding services 55 */ 56 struct xe_late_bind_component { 57 struct device *mei_dev; 58 const struct intel_lb_component_ops *ops; 59 }; 60 61 /** 62 * struct xe_late_bind 63 */ 64 struct xe_late_bind { 65 /** @component: struct for communication with mei component */ 66 struct xe_late_bind_component component; 67 /** @late_bind_fw: late binding firmware array */ 68 struct xe_late_bind_fw late_bind_fw[XE_LB_FW_MAX_ID]; 69 /** @wq: workqueue to submit request to download late bind blob */ 70 struct workqueue_struct *wq; 71 /** @component_added: whether the component has been added */ 72 bool component_added; 73 /** @disable: to block late binding reload during pm resume flow*/ 74 bool disable; 75 }; 76 77 #endif 78