1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) 2015--2024 Intel Corporation */
8 struct ipu6_bus_device
;
10 #define IPU6_CPD_SIZE_OF_FW_ARCH_VERSION 7
11 #define IPU6_CPD_SIZE_OF_SYSTEM_VERSION 11
12 #define IPU6_CPD_SIZE_OF_COMPONENT_NAME 12
14 #define IPU6_CPD_METADATA_EXTN_TYPE_IUNIT 0x10
16 #define IPU6_CPD_METADATA_IMAGE_TYPE_RESERVED 0
17 #define IPU6_CPD_METADATA_IMAGE_TYPE_BOOTLOADER 1
18 #define IPU6_CPD_METADATA_IMAGE_TYPE_MAIN_FIRMWARE 2
20 #define IPU6_CPD_PKG_DIR_PSYS_SERVER_IDX 0
21 #define IPU6_CPD_PKG_DIR_ISYS_SERVER_IDX 1
23 #define IPU6_CPD_PKG_DIR_CLIENT_PG_TYPE 3
25 #define IPU6_CPD_METADATA_HASH_KEY_SIZE 48
26 #define IPU6SE_CPD_METADATA_HASH_KEY_SIZE 32
28 struct ipu6_cpd_module_data_hdr
{
34 u32 target_platform_type
;
35 u8 sys_ver
[IPU6_CPD_SIZE_OF_SYSTEM_VERSION
];
36 u8 fw_arch_ver
[IPU6_CPD_SIZE_OF_FW_ARCH_VERSION
];
41 * ipu6_cpd_hdr structure updated as the chksum and
42 * sub_partition_name is unused on host side
43 * CSE layout version 1.6 for IPU6SE (hdr_len = 0x10)
44 * CSE layout version 1.7 for IPU6 (hdr_len = 0x14)
55 u8 name
[IPU6_CPD_SIZE_OF_COMPONENT_NAME
];
61 struct ipu6_cpd_metadata_cmpnt_hdr
{
67 struct ipu6_cpd_metadata_cmpnt
{
68 struct ipu6_cpd_metadata_cmpnt_hdr hdr
;
69 u8 sha2_hash
[IPU6_CPD_METADATA_HASH_KEY_SIZE
];
75 struct ipu6se_cpd_metadata_cmpnt
{
76 struct ipu6_cpd_metadata_cmpnt_hdr hdr
;
77 u8 sha2_hash
[IPU6SE_CPD_METADATA_HASH_KEY_SIZE
];
83 struct ipu6_cpd_metadata_extn
{
90 struct ipu6_cpd_client_pkg_hdr
{
101 int ipu6_cpd_create_pkg_dir(struct ipu6_bus_device
*adev
, const void *src
);
102 void ipu6_cpd_free_pkg_dir(struct ipu6_bus_device
*adev
);
103 int ipu6_cpd_validate_cpd_file(struct ipu6_device
*isp
, const void *cpd_file
,
104 unsigned long cpd_file_size
);
105 #endif /* IPU6_CPD_H */