Patrick Williams | 8dd6848 | 2022-10-04 07:57:18 -0500 | [diff] [blame^] | 1 | From 6d26058401bce6012173b5341cdf4de72772a1c2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Davidson K <davidson.kumaresan@arm.com> |
| 3 | Date: Mon, 6 Jun 2022 13:19:07 +0530 |
| 4 | Subject: [PATCH 5/7] efi_firmware: add new fmp driver that supports arm fwu |
| 5 | specification |
| 6 | |
| 7 | This fmp driver communicates to the firmware update secure partition |
| 8 | executing in the secure world which is an implementation of the arm |
| 9 | psa specification for the firmware update. The communication to the |
| 10 | firmware update secure partition is based on stmm and arm ff-a framework. |
| 11 | |
| 12 | It implements only the get_image_info and set_image api. |
| 13 | |
| 14 | Signed-off-by: Davidson K <davidson.kumaresan@arm.com> |
| 15 | Change-Id: I94c2cad210c32a60a8a0594cacf530b68ab6a09d |
| 16 | Upstream-Status: Pending [Not submitted to upstream yet] |
| 17 | --- |
| 18 | include/efi_firmware_arm_psa.h | 218 +++++++++++ |
| 19 | include/efi_loader.h | 1 + |
| 20 | lib/efi_loader/Kconfig | 9 + |
| 21 | lib/efi_loader/Makefile | 1 + |
| 22 | lib/efi_loader/efi_capsule.c | 8 + |
| 23 | lib/efi_loader/efi_firmware.c | 134 +++++++ |
| 24 | lib/efi_loader/efi_firmware_arm_psa.c | 520 ++++++++++++++++++++++++++ |
| 25 | 7 files changed, 891 insertions(+) |
| 26 | create mode 100644 include/efi_firmware_arm_psa.h |
| 27 | create mode 100644 lib/efi_loader/efi_firmware_arm_psa.c |
| 28 | |
| 29 | diff --git a/include/efi_firmware_arm_psa.h b/include/efi_firmware_arm_psa.h |
| 30 | new file mode 100644 |
| 31 | index 0000000000..82f932066c |
| 32 | --- /dev/null |
| 33 | +++ b/include/efi_firmware_arm_psa.h |
| 34 | @@ -0,0 +1,218 @@ |
| 35 | +/* SPDX-License-Identifier: GPL-2.0+ */ |
| 36 | +/* |
| 37 | + * Copyright (C) 2022 Arm Limited |
| 38 | + */ |
| 39 | + |
| 40 | +#ifndef _EFI_FIRMWARE_ARM_PSA_H |
| 41 | +#define _EFI_FIRMWARE_ARM_PSA_H |
| 42 | + |
| 43 | +#include <efi_loader.h> |
| 44 | +#include <mm_communication.h> |
| 45 | +#include <stdint.h> |
| 46 | + |
| 47 | +#define PSA_FWU_DIRECTORY_UUID \ |
| 48 | + EFI_GUID(0xdeee58d9, 0x5147, 0x4ad3, \ |
| 49 | + 0xa2, 0x90, 0x77, 0x66, 0x6e, 0x23, 0x41, 0xa5) |
| 50 | + |
| 51 | +#define PSA_FWU_SP_UUID \ |
| 52 | + EFI_GUID(0x6823a838, 0x1b06, 0x470e, \ |
| 53 | + 0x97, 0x74, 0x0c, 0xce, 0x8b, 0xfb, 0x53, 0xfd) |
| 54 | + |
| 55 | +#define FFA_FWU_SP_UUID \ |
| 56 | + {0x68, 0x23, 0xa8, 0x38, 0x1b, 0x06, 0x47, \ |
| 57 | + 0x0e, 0x97, 0x74, 0x0c, 0xce, 0x8b, 0xfb, 0x53, 0xfd} |
| 58 | + |
| 59 | +#define FWU_DISCOVER 0 |
| 60 | +#define FWU_BEGIN_STAGING 1 |
| 61 | +#define FWU_END_STAGING 2 |
| 62 | +#define FWU_CANCEL_STAGING 3 |
| 63 | +#define FWU_OPEN 4 |
| 64 | +#define FWU_WRITE_STREAM 5 |
| 65 | +#define FWU_READ_STREAM 6 |
| 66 | +#define FWU_COMMIT 7 |
| 67 | +#define FWU_ACCEPT_IMAGE 9 |
| 68 | +#define FWU_SELECT_PREVIOUS 10 |
| 69 | + |
| 70 | +#define FWU_SUCCESS 0 |
| 71 | +#define FWU_UNKNOWN ((int32_t)-1) |
| 72 | +#define FWU_BUSY ((int32_t)-2) |
| 73 | +#define FWU_OUT_OF_BOUNDS ((int32_t)-3) |
| 74 | +#define FWU_AUTH_FAIL ((int32_t)-4) |
| 75 | +#define FWU_NO_PERMISSION ((int32_t)-5) |
| 76 | +#define FWU_DENIED ((int32_t)-6) |
| 77 | +#define FWU_RESUME ((int32_t)-7) |
| 78 | + |
| 79 | +#define MAX_IMAGES 5 |
| 80 | + |
| 81 | +typedef int32_t fwu_status_t; |
| 82 | + |
| 83 | +struct fwu_image_info_entry { |
| 84 | + efi_guid_t image_guid; |
| 85 | + uint32_t client_permissions; |
| 86 | + uint32_t img_max_size; |
| 87 | + uint32_t lowest_acceptable_version; |
| 88 | + uint32_t img_version; |
| 89 | + uint32_t accepted; |
| 90 | + uint32_t reserved; |
| 91 | +}__packed; |
| 92 | + |
| 93 | +struct fwu_image_directory { |
| 94 | + uint32_t directory_version; |
| 95 | + uint32_t num_images; |
| 96 | + uint32_t active_index; |
| 97 | + uint32_t boot_index; |
| 98 | + struct fwu_image_info_entry entries[MAX_IMAGES]; |
| 99 | +}__packed; |
| 100 | + |
| 101 | +int __efi_runtime arm_psa_get_image_info( |
| 102 | + efi_uintn_t *image_info_size, |
| 103 | + struct efi_firmware_image_descriptor *image_info, |
| 104 | + u32 *descriptor_version, |
| 105 | + u8 *descriptor_count, |
| 106 | + efi_uintn_t *descriptor_size, |
| 107 | + u32 *package_version, |
| 108 | + u16 **package_version_name |
| 109 | +); |
| 110 | + |
| 111 | +int __efi_runtime arm_psa_update( |
| 112 | + const void *image, |
| 113 | + u8 image_index, |
| 114 | + efi_uintn_t image_size |
| 115 | +); |
| 116 | + |
| 117 | +struct mm_fwu_discover_arg { |
| 118 | + uint32_t func_id; |
| 119 | +}__packed; |
| 120 | + |
| 121 | +struct mm_fwu_discover_ret { |
| 122 | + uint32_t status; |
| 123 | + uint8_t version_major; |
| 124 | + uint8_t version_minor; |
| 125 | + uint16_t num_func; |
| 126 | + uint8_t function_presence[]; |
| 127 | +}__packed; |
| 128 | + |
| 129 | +struct mm_fwu_begin_staging_arg { |
| 130 | + uint32_t func_id; |
| 131 | +}__packed; |
| 132 | + |
| 133 | +struct mm_fwu_begin_staging_ret { |
| 134 | + uint32_t status; |
| 135 | +}__packed; |
| 136 | + |
| 137 | +struct mm_fwu_end_staging_arg { |
| 138 | + uint32_t func_id; |
| 139 | +}__packed; |
| 140 | + |
| 141 | +struct mm_fwu_end_staging_ret { |
| 142 | + uint32_t status; |
| 143 | +}__packed; |
| 144 | + |
| 145 | +struct mm_fwu_cancel_staging_arg { |
| 146 | + uint32_t func_id; |
| 147 | +}__packed; |
| 148 | + |
| 149 | +struct mm_fwu_cancel_staging_ret { |
| 150 | + uint32_t status; |
| 151 | +}__packed; |
| 152 | + |
| 153 | +struct mm_fwu_open_arg { |
| 154 | + uint32_t func_id; |
| 155 | + efi_guid_t image_guid; |
| 156 | +}__packed; |
| 157 | + |
| 158 | +struct mm_fwu_open_ret { |
| 159 | + uint32_t status; |
| 160 | + uint32_t handle; |
| 161 | +}__packed; |
| 162 | + |
| 163 | +struct mm_fwu_write_stream_arg { |
| 164 | + uint32_t func_id; |
| 165 | + uint32_t handle; |
| 166 | + uint32_t data_len; |
| 167 | + uint8_t payload[]; |
| 168 | +}__packed; |
| 169 | + |
| 170 | +struct mm_fwu_write_stream_ret { |
| 171 | + uint32_t status; |
| 172 | +}; |
| 173 | + |
| 174 | +struct mm_fwu_read_stream_arg { |
| 175 | + uint32_t func_id; |
| 176 | + uint32_t handle; |
| 177 | +}__packed; |
| 178 | + |
| 179 | +struct mm_fwu_read_stream_ret { |
| 180 | + uint32_t status; |
| 181 | + uint32_t read_bytes; |
| 182 | + uint32_t total_bytes; |
| 183 | + uint8_t payload[]; |
| 184 | +}__packed; |
| 185 | + |
| 186 | +struct mm_fwu_commit_arg { |
| 187 | + uint32_t func_id; |
| 188 | + uint32_t handle; |
| 189 | + uint32_t acceptance_req; |
| 190 | + uint32_t max_atomic_len; |
| 191 | +}__packed; |
| 192 | + |
| 193 | +struct mm_fwu_commit_ret { |
| 194 | + uint32_t status; |
| 195 | + uint32_t progress; |
| 196 | + uint32_t total_work; |
| 197 | +}__packed; |
| 198 | + |
| 199 | +struct mm_fwu_accept_arg { |
| 200 | + uint32_t func_id; |
| 201 | + uint32_t reserved; |
| 202 | + efi_guid_t image_type_uuid; |
| 203 | +}__packed; |
| 204 | + |
| 205 | +struct mm_fwu_accept_ret { |
| 206 | + uint32_t status; |
| 207 | +}; |
| 208 | + |
| 209 | +struct mm_fwu_select_previous_arg { |
| 210 | + uint32_t func_id; |
| 211 | +}__packed; |
| 212 | + |
| 213 | +struct mm_fwu_select_previous_ret { |
| 214 | + uint32_t status; |
| 215 | +}__packed; |
| 216 | + |
| 217 | +inline static void *get_fwu_hdr(struct efi_mm_communicate_header *mm_hdr) |
| 218 | +{ |
| 219 | + const efi_guid_t fwu_sp_guid = PSA_FWU_SP_UUID; |
| 220 | + guidcpy(&mm_hdr->header_guid, &fwu_sp_guid); |
| 221 | + return mm_hdr->data; |
| 222 | +} |
| 223 | + |
| 224 | +#define GET_HDR(name) \ |
| 225 | +static inline struct mm_fwu_##name * \ |
| 226 | +get_fwu_##name (struct efi_mm_communicate_header *mm_hdr) \ |
| 227 | +{ \ |
| 228 | + return (struct mm_fwu_##name *)get_fwu_hdr(mm_hdr); \ |
| 229 | +} \ |
| 230 | + |
| 231 | +GET_HDR(discover_arg) |
| 232 | +GET_HDR(discover_ret) |
| 233 | +GET_HDR(begin_staging_arg) |
| 234 | +GET_HDR(begin_staging_ret) |
| 235 | +GET_HDR(end_staging_arg) |
| 236 | +GET_HDR(end_staging_ret) |
| 237 | +GET_HDR(cancel_staging_arg) |
| 238 | +GET_HDR(cancel_staging_ret) |
| 239 | +GET_HDR(open_arg) |
| 240 | +GET_HDR(open_ret) |
| 241 | +GET_HDR(write_stream_arg) |
| 242 | +GET_HDR(write_stream_ret) |
| 243 | +GET_HDR(read_stream_arg) |
| 244 | +GET_HDR(read_stream_ret) |
| 245 | +GET_HDR(commit_arg) |
| 246 | +GET_HDR(commit_ret) |
| 247 | +GET_HDR(accept_arg) |
| 248 | +GET_HDR(accept_ret) |
| 249 | +GET_HDR(select_previous_arg) |
| 250 | +GET_HDR(select_previous_ret) |
| 251 | + |
| 252 | +#endif /* _EFI_FIRMWARE_ARM_PSA_H */ |
| 253 | diff --git a/include/efi_loader.h b/include/efi_loader.h |
| 254 | index af36639ec6..7327c87497 100644 |
| 255 | --- a/include/efi_loader.h |
| 256 | +++ b/include/efi_loader.h |
| 257 | @@ -961,6 +961,7 @@ u16 *efi_create_indexed_name(u16 *buffer, size_t buffer_size, const char *name, |
| 258 | |
| 259 | extern const struct efi_firmware_management_protocol efi_fmp_fit; |
| 260 | extern const struct efi_firmware_management_protocol efi_fmp_raw; |
| 261 | +extern const struct efi_firmware_management_protocol efi_fmp_arm_psa; |
| 262 | |
| 263 | /* Capsule update */ |
| 264 | efi_status_t EFIAPI efi_update_capsule( |
| 265 | diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig |
| 266 | index e5e35fe51f..f99d436f16 100644 |
| 267 | --- a/lib/efi_loader/Kconfig |
| 268 | +++ b/lib/efi_loader/Kconfig |
| 269 | @@ -168,6 +168,15 @@ config EFI_CAPSULE_FIRMWARE_MANAGEMENT |
| 270 | Select this option if you want to enable capsule-based |
| 271 | firmware update using Firmware Management Protocol. |
| 272 | |
| 273 | +config EFI_CAPSULE_FIRMWARE_ARM_PSA |
| 274 | + bool "FMP driver for ARM PSA FWU specification" |
| 275 | + depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT |
| 276 | + select EFI_CAPSULE_FIRMWARE |
| 277 | + help |
| 278 | + Select this option if you want to enable firmware management protocol |
| 279 | + driver that supports the ARM PSA firmware update specification as |
| 280 | + mentioned in https://developer.arm.com/documentation/den0118/a/ |
| 281 | + |
| 282 | config EFI_CAPSULE_FIRMWARE_FIT |
| 283 | bool "FMP driver for FIT images" |
| 284 | depends on FIT |
| 285 | diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile |
| 286 | index 034d26cf01..f986ac6417 100644 |
| 287 | --- a/lib/efi_loader/Makefile |
| 288 | +++ b/lib/efi_loader/Makefile |
| 289 | @@ -38,6 +38,7 @@ obj-y += efi_boottime.o |
| 290 | obj-y += efi_helper.o |
| 291 | obj-$(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) += efi_capsule.o |
| 292 | obj-$(CONFIG_EFI_CAPSULE_FIRMWARE) += efi_firmware.o |
| 293 | +obj-$(CONFIG_EFI_CAPSULE_FIRMWARE_ARM_PSA) += efi_firmware_arm_psa.o |
| 294 | obj-y += efi_console.o |
| 295 | obj-y += efi_device_path.o |
| 296 | obj-$(CONFIG_EFI_DEVICE_PATH_TO_TEXT) += efi_device_path_to_text.o |
| 297 | diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c |
| 298 | index f00440163d..3154fc51d3 100644 |
| 299 | --- a/lib/efi_loader/efi_capsule.c |
| 300 | +++ b/lib/efi_loader/efi_capsule.c |
| 301 | @@ -1041,6 +1041,14 @@ efi_status_t __weak efi_load_capsule_drivers(void) |
| 302 | &efi_fmp_raw, NULL)); |
| 303 | } |
| 304 | |
| 305 | + if (IS_ENABLED(CONFIG_EFI_CAPSULE_FIRMWARE_ARM_PSA)) { |
| 306 | + handle = NULL; |
| 307 | + ret = EFI_CALL(efi_install_multiple_protocol_interfaces( |
| 308 | + &handle, |
| 309 | + &efi_guid_firmware_management_protocol, |
| 310 | + &efi_fmp_arm_psa, NULL)); |
| 311 | + } |
| 312 | + |
| 313 | return ret; |
| 314 | } |
| 315 | |
| 316 | diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c |
| 317 | index a5ff32f121..3356559af8 100644 |
| 318 | --- a/lib/efi_loader/efi_firmware.c |
| 319 | +++ b/lib/efi_loader/efi_firmware.c |
| 320 | @@ -9,6 +9,7 @@ |
| 321 | #include <common.h> |
| 322 | #include <charset.h> |
| 323 | #include <dfu.h> |
| 324 | +#include <efi_firmware_arm_psa.h> |
| 325 | #include <efi_loader.h> |
| 326 | #include <image.h> |
| 327 | #include <signatures.h> |
| 328 | @@ -478,3 +479,136 @@ const struct efi_firmware_management_protocol efi_fmp_raw = { |
| 329 | .set_package_info = efi_firmware_set_package_info_unsupported, |
| 330 | }; |
| 331 | #endif /* CONFIG_EFI_CAPSULE_FIRMWARE_RAW */ |
| 332 | + |
| 333 | +#ifdef CONFIG_EFI_CAPSULE_FIRMWARE_ARM_PSA |
| 334 | +/* |
| 335 | + * This FIRMWARE_MANAGEMENT_PROTOCOL driver provides a firmware update |
| 336 | + * method that supports the arm psa firmware update specification. |
| 337 | + */ |
| 338 | + |
| 339 | +/** |
| 340 | + * efi_firmware_arm_psa_get_image_info - return information about the |
| 341 | + * current firmware image |
| 342 | + * @this: Protocol instance |
| 343 | + * @image_info_size: Size of @image_info |
| 344 | + * @image_info: Image information |
| 345 | + * @descriptor_version: Pointer to version number |
| 346 | + * @descriptor_count: Pointer to number of descriptors |
| 347 | + * @descriptor_size: Pointer to descriptor size |
| 348 | + * package_version: Package version |
| 349 | + * package_version_name: Package version's name |
| 350 | + * |
| 351 | + * Return information bout the current firmware image in @image_info. |
| 352 | + * @image_info will consist of a number of descriptors. |
| 353 | + * |
| 354 | + * Return status code |
| 355 | + */ |
| 356 | + |
| 357 | +static |
| 358 | +efi_status_t EFIAPI efi_firmware_arm_psa_get_image_info( |
| 359 | + struct efi_firmware_management_protocol *this, |
| 360 | + efi_uintn_t *image_info_size, |
| 361 | + struct efi_firmware_image_descriptor *image_info, |
| 362 | + u32 *descriptor_version, |
| 363 | + u8 *descriptor_count, |
| 364 | + efi_uintn_t *descriptor_size, |
| 365 | + u32 *package_version, |
| 366 | + u16 **package_version_name) |
| 367 | +{ |
| 368 | + int ret; |
| 369 | + |
| 370 | + EFI_ENTRY("%p %p %p %p %p %p %p %p\n", this, |
| 371 | + image_info_size, image_info, |
| 372 | + descriptor_version, descriptor_count, descriptor_size, |
| 373 | + package_version, package_version_name); |
| 374 | + |
| 375 | + if (!image_info_size) |
| 376 | + return EFI_EXIT(EFI_INVALID_PARAMETER); |
| 377 | + |
| 378 | + if (*image_info_size && |
| 379 | + (!image_info || !descriptor_version || !descriptor_count || |
| 380 | + !descriptor_size || !package_version || !package_version_name)) |
| 381 | + return EFI_EXIT(EFI_INVALID_PARAMETER); |
| 382 | + |
| 383 | + ret = arm_psa_get_image_info(image_info_size, image_info, |
| 384 | + descriptor_version, descriptor_count, |
| 385 | + descriptor_size, |
| 386 | + package_version, package_version_name); |
| 387 | + |
| 388 | + if (ret) { |
| 389 | + if (ret == -ENOMEM) |
| 390 | + return EFI_EXIT(EFI_BUFFER_TOO_SMALL); |
| 391 | + else |
| 392 | + return EFI_EXIT(EFI_DEVICE_ERROR); |
| 393 | + } |
| 394 | + |
| 395 | + return EFI_EXIT(EFI_SUCCESS); |
| 396 | +} |
| 397 | + |
| 398 | +/** |
| 399 | + * efi_firmware_arm_psa_set_image - update the firmware image |
| 400 | + * @this: Protocol instance |
| 401 | + * @image_index: Image index number |
| 402 | + * @image: New image |
| 403 | + * @image_size: Size of new image |
| 404 | + * @vendor_code: Vendor-specific update policy |
| 405 | + * @progress: Function to report the progress of update |
| 406 | + * @abort_reason: Pointer to string of abort reason |
| 407 | + * |
| 408 | + * Update the firmware to new image, following the arm psa firmware |
| 409 | + * update specification. |
| 410 | + * @vendor_code, @progress and @abort_reason are not supported. |
| 411 | + * |
| 412 | + * Return: status code |
| 413 | + */ |
| 414 | +static |
| 415 | +efi_status_t EFIAPI efi_firmware_arm_psa_set_image( |
| 416 | + struct efi_firmware_management_protocol *this, |
| 417 | + u8 image_index, |
| 418 | + const void *image, |
| 419 | + efi_uintn_t image_size, |
| 420 | + const void *vendor_code, |
| 421 | + efi_status_t (*progress)(efi_uintn_t completion), |
| 422 | + u16 **abort_reason) |
| 423 | +{ |
| 424 | + u32 fmp_hdr_signature; |
| 425 | + const struct fmp_payload_header *header; |
| 426 | + |
| 427 | + EFI_ENTRY("%p %d %p %zd %p %p %p\n", this, image_index, image, |
| 428 | + image_size, vendor_code, progress, abort_reason); |
| 429 | + |
| 430 | + if (!image) |
| 431 | + return EFI_EXIT(EFI_INVALID_PARAMETER); |
| 432 | + |
| 433 | + /* TODO: capsule authentication */ |
| 434 | + |
| 435 | + fmp_hdr_signature = FMP_PAYLOAD_HDR_SIGNATURE; |
| 436 | + header = (void *)image; |
| 437 | + |
| 438 | + if (!memcmp(&header->signature, &fmp_hdr_signature, |
| 439 | + sizeof(fmp_hdr_signature))) { |
| 440 | + /* |
| 441 | + * When building the capsule with the scripts in |
| 442 | + * edk2, a FMP header is inserted above the capsule |
| 443 | + * payload. Compensate for this header to get the |
| 444 | + * actual payload that is to be updated. |
| 445 | + */ |
| 446 | + image = (unsigned char *)image + header->header_size; |
| 447 | + image_size -= header->header_size; |
| 448 | + } |
| 449 | + |
| 450 | + if (arm_psa_update(image, image_index, image_size)) |
| 451 | + return EFI_EXIT(EFI_DEVICE_ERROR); |
| 452 | + |
| 453 | + return EFI_EXIT(EFI_SUCCESS); |
| 454 | +} |
| 455 | + |
| 456 | +const struct efi_firmware_management_protocol efi_fmp_arm_psa = { |
| 457 | + .get_image_info = efi_firmware_arm_psa_get_image_info, |
| 458 | + .get_image = efi_firmware_get_image_unsupported, |
| 459 | + .set_image = efi_firmware_arm_psa_set_image, |
| 460 | + .check_image = efi_firmware_check_image_unsupported, |
| 461 | + .get_package_info = efi_firmware_get_package_info_unsupported, |
| 462 | + .set_package_info = efi_firmware_set_package_info_unsupported, |
| 463 | +}; |
| 464 | +#endif /* CONFIG_EFI_CAPSULE_FIRMWARE_ARM_PSA */ |
| 465 | diff --git a/lib/efi_loader/efi_firmware_arm_psa.c b/lib/efi_loader/efi_firmware_arm_psa.c |
| 466 | new file mode 100644 |
| 467 | index 0000000000..ab575f0124 |
| 468 | --- /dev/null |
| 469 | +++ b/lib/efi_loader/efi_firmware_arm_psa.c |
| 470 | @@ -0,0 +1,520 @@ |
| 471 | +/* SPDX-License-Identifier: GPL-2.0+ */ |
| 472 | +/* |
| 473 | + * Copyright (C) 2022 Arm Limited |
| 474 | + */ |
| 475 | + |
| 476 | +#include <arm_ffa_helper.h> |
| 477 | +#include <configs/total_compute.h> |
| 478 | +#include <efi_firmware_arm_psa.h> |
| 479 | +#include <efi_loader.h> |
| 480 | +#include <malloc.h> |
| 481 | +#include <mapmem.h> |
| 482 | +#include <mm_communication.h> |
| 483 | + |
| 484 | +/* MM return codes */ |
| 485 | +#define MM_SUCCESS 0 |
| 486 | + |
| 487 | +#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 0xC4000061 |
| 488 | +#define ARM_SVC_ID_SP_EVENT_COMPLETE ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64 |
| 489 | + |
| 490 | +__efi_runtime_data static u16 mm_sp_id; |
| 491 | +__efi_runtime_data static int fwu_initialized = 0; |
| 492 | +__efi_runtime_data struct fwu_image_directory cached_image_directory; |
| 493 | +__efi_runtime_data struct efi_mm_communicate_header *mm_hdr; |
| 494 | +__efi_runtime_data void *mm_comm_buf; |
| 495 | + |
| 496 | +/** |
| 497 | + * ffa_discover_mm_sp_id() - Query the MM partition ID |
| 498 | + * |
| 499 | + * Use the FF-A driver to get the MM partition ID. |
| 500 | + * If multiple partitions are found, use the first one |
| 501 | + * |
| 502 | + * Return: |
| 503 | + * |
| 504 | + * 0 on success |
| 505 | + */ |
| 506 | +static int __efi_runtime ffa_discover_mm_sp_id(void) |
| 507 | +{ |
| 508 | + struct ffa_interface_data func_data = {0}; |
| 509 | + u32 count = 0; |
| 510 | + int ret; |
| 511 | + struct ffa_partition_info *parts_info; |
| 512 | + static union ffa_partition_uuid fwu_sp_uuid = {.bytes = FFA_FWU_SP_UUID}; |
| 513 | + |
| 514 | + /* |
| 515 | + * get from the driver the count of the SPs matching the UUID |
| 516 | + */ |
| 517 | + func_data.data0_size = sizeof(fwu_sp_uuid); |
| 518 | + func_data.data0 = &fwu_sp_uuid; |
| 519 | + func_data.data1_size = sizeof(count); |
| 520 | + func_data.data1 = &count; |
| 521 | + |
| 522 | + ret = ffa_helper_get_partitions_info(&func_data); |
| 523 | + if (ret != FFA_ERR_STAT_SUCCESS) { |
| 524 | + log_err("EFI: Failure in querying partitions count (error code: %d)\n", ret); |
| 525 | + return ret; |
| 526 | + } |
| 527 | + |
| 528 | + if (!count) { |
| 529 | + log_info("EFI: No MM partition found\n"); |
| 530 | + return ret; |
| 531 | + } |
| 532 | + |
| 533 | + /* |
| 534 | + * pre-allocate a buffer to be filled by the driver |
| 535 | + * with ffa_partition_info structs |
| 536 | + */ |
| 537 | + parts_info = calloc(count, sizeof(struct ffa_partition_info)); |
| 538 | + if (!parts_info) |
| 539 | + return -EINVAL; |
| 540 | + |
| 541 | + log_info("EFI: Pre-allocating %d partition(s) info structures\n", count); |
| 542 | + |
| 543 | + func_data.data1_size = count * sizeof(struct ffa_partition_info); |
| 544 | + func_data.data1 = parts_info; |
| 545 | + |
| 546 | + /* |
| 547 | + * ask the driver to fill the |
| 548 | + * buffer with the SPs info |
| 549 | + */ |
| 550 | + ret = ffa_helper_get_partitions_info(&func_data); |
| 551 | + if (ret != FFA_ERR_STAT_SUCCESS) { |
| 552 | + log_err("EFI: Failure in querying partition(s) info (error code: %d)\n", ret); |
| 553 | + free(parts_info); |
| 554 | + return ret; |
| 555 | + } |
| 556 | + |
| 557 | + /* |
| 558 | + * MM SPs found , use the first one |
| 559 | + */ |
| 560 | + |
| 561 | + mm_sp_id = parts_info[0].id; |
| 562 | + |
| 563 | + log_info("EFI: MM partition ID 0x%x\n", mm_sp_id); |
| 564 | + |
| 565 | + free(parts_info); |
| 566 | + |
| 567 | + return 0; |
| 568 | +} |
| 569 | + |
| 570 | +/** |
| 571 | + * ffa_notify_mm_sp() - Announce there is data in the shared buffer |
| 572 | + * |
| 573 | + * Notifies the MM partition in the trusted world that |
| 574 | + * data is available in the shared buffer. |
| 575 | + * This is a blocking call during which trusted world has exclusive access |
| 576 | + * to the MM shared buffer. |
| 577 | + * |
| 578 | + * Return: |
| 579 | + * |
| 580 | + * 0 on success |
| 581 | + */ |
| 582 | +static int __efi_runtime ffa_notify_mm_sp(void) |
| 583 | +{ |
| 584 | + struct ffa_interface_data func_data = {0}; |
| 585 | + struct ffa_send_direct_data msg = {0}; |
| 586 | + int ret; |
| 587 | + u32 sp_event_complete; |
| 588 | + int sp_event_ret; |
| 589 | + |
| 590 | + func_data.data0_size = sizeof(mm_sp_id); |
| 591 | + func_data.data0 = &mm_sp_id; |
| 592 | + |
| 593 | + msg.a3 = FFA_SHARED_MM_BUFFER_ADDR; |
| 594 | + msg.a4 = FFA_SHARED_MM_BUFFER_SIZE; |
| 595 | + func_data.data1_size = sizeof(msg); |
| 596 | + func_data.data1 = &msg; |
| 597 | + |
| 598 | + ret = ffa_helper_msg_send_direct_req(&func_data); |
| 599 | + if (ret != FFA_ERR_STAT_SUCCESS) { |
| 600 | + log_err("EFI: Failure to notify the MM SP , FF-A error (%d)\n", ret); |
| 601 | + return ret; |
| 602 | + } |
| 603 | + |
| 604 | + sp_event_complete = msg.a3; |
| 605 | + sp_event_ret = (int)msg.a4; |
| 606 | + |
| 607 | + if (sp_event_complete == ARM_SVC_ID_SP_EVENT_COMPLETE && sp_event_ret == MM_SUCCESS) |
| 608 | + return 0; |
| 609 | + |
| 610 | + log_err("EFI: Failure to notify the MM SP (0x%x , %d)\n", |
| 611 | + sp_event_complete, |
| 612 | + sp_event_ret); |
| 613 | + |
| 614 | + return -EACCES; |
| 615 | +} |
| 616 | + |
| 617 | +static fwu_status_t __efi_runtime fwu_discover(void) |
| 618 | +{ |
| 619 | + int ret; |
| 620 | + struct mm_fwu_discover_arg *discover_arg = get_fwu_discover_arg(mm_hdr); |
| 621 | + struct mm_fwu_discover_ret *discover_ret = get_fwu_discover_ret(mm_hdr); |
| 622 | + |
| 623 | + discover_arg->func_id = FWU_DISCOVER; |
| 624 | + |
| 625 | + mm_hdr->message_len = sizeof(struct mm_fwu_discover_arg); |
| 626 | + |
| 627 | + ret = ffa_notify_mm_sp(); |
| 628 | + if (ret) |
| 629 | + return ret; |
| 630 | + |
| 631 | + if (discover_ret->version_major != 1) { |
| 632 | + log_err("FWU: Unsupported Update Agent version\n"); |
| 633 | + return -EINVAL; |
| 634 | + } |
| 635 | + /* TODO: check other parameters as well */ |
| 636 | + |
| 637 | + return discover_ret->status; |
| 638 | +} |
| 639 | + |
| 640 | +static fwu_status_t __efi_runtime fwu_begin_staging(void) |
| 641 | +{ |
| 642 | + int ret; |
| 643 | + struct mm_fwu_begin_staging_arg *begin_staging_arg = get_fwu_begin_staging_arg(mm_hdr); |
| 644 | + struct mm_fwu_begin_staging_ret *begin_staging_ret = get_fwu_begin_staging_ret(mm_hdr); |
| 645 | + |
| 646 | + begin_staging_arg->func_id = FWU_BEGIN_STAGING; |
| 647 | + |
| 648 | + mm_hdr->message_len = sizeof(struct mm_fwu_begin_staging_arg); |
| 649 | + |
| 650 | + ret = ffa_notify_mm_sp(); |
| 651 | + if (ret) |
| 652 | + return ret; |
| 653 | + |
| 654 | + return begin_staging_ret->status; |
| 655 | +} |
| 656 | + |
| 657 | +static fwu_status_t __efi_runtime fwu_end_staging(void) |
| 658 | +{ |
| 659 | + int ret; |
| 660 | + struct mm_fwu_end_staging_arg *end_staging_arg = get_fwu_end_staging_arg(mm_hdr); |
| 661 | + struct mm_fwu_end_staging_ret *end_staging_ret = get_fwu_end_staging_ret(mm_hdr); |
| 662 | + |
| 663 | + end_staging_arg->func_id = FWU_END_STAGING; |
| 664 | + |
| 665 | + mm_hdr->message_len = sizeof(struct mm_fwu_end_staging_arg); |
| 666 | + |
| 667 | + ret = ffa_notify_mm_sp(); |
| 668 | + if (ret) |
| 669 | + return ret; |
| 670 | + |
| 671 | + return end_staging_ret->status; |
| 672 | +} |
| 673 | + |
| 674 | +static fwu_status_t __efi_runtime fwu_cancel_staging(void) |
| 675 | +{ |
| 676 | + int ret; |
| 677 | + struct mm_fwu_cancel_staging_arg *cancel_staging_arg = get_fwu_cancel_staging_arg(mm_hdr); |
| 678 | + struct mm_fwu_cancel_staging_ret *cancel_staging_ret = get_fwu_cancel_staging_ret(mm_hdr); |
| 679 | + |
| 680 | + cancel_staging_arg->func_id = FWU_CANCEL_STAGING; |
| 681 | + |
| 682 | + mm_hdr->message_len = sizeof(struct mm_fwu_cancel_staging_arg); |
| 683 | + |
| 684 | + ret = ffa_notify_mm_sp(); |
| 685 | + if (ret) |
| 686 | + return ret; |
| 687 | + |
| 688 | + return cancel_staging_ret->status; |
| 689 | +} |
| 690 | + |
| 691 | +static fwu_status_t __efi_runtime fwu_open(const efi_guid_t *img_uuid, uint32_t *handle) |
| 692 | +{ |
| 693 | + int ret; |
| 694 | + struct mm_fwu_open_arg *open_hdr = get_fwu_open_arg(mm_hdr); |
| 695 | + struct mm_fwu_open_ret *open_ret = get_fwu_open_ret(mm_hdr); |
| 696 | + |
| 697 | + open_hdr->func_id = FWU_OPEN; |
| 698 | + guidcpy(&open_hdr->image_guid, img_uuid); |
| 699 | + |
| 700 | + mm_hdr->message_len = sizeof(struct mm_fwu_open_arg); |
| 701 | + |
| 702 | + ret = ffa_notify_mm_sp(); |
| 703 | + if (ret) |
| 704 | + return ret; |
| 705 | + |
| 706 | + *handle = open_ret->handle; |
| 707 | + |
| 708 | + return open_ret->status; |
| 709 | +} |
| 710 | + |
| 711 | +static fwu_status_t __efi_runtime fwu_read_stream(uint32_t handle, uint8_t *buffer, uint32_t buffer_size) |
| 712 | +{ |
| 713 | + int ret; |
| 714 | + struct mm_fwu_read_stream_arg *read_stream_hdr = get_fwu_read_stream_arg(mm_hdr); |
| 715 | + struct mm_fwu_read_stream_ret *read_stream_ret = get_fwu_read_stream_ret(mm_hdr); |
| 716 | + uint32_t payload_size = FFA_SHARED_MM_BUFFER_SIZE - sizeof(struct mm_fwu_read_stream_ret) |
| 717 | + - sizeof(struct efi_mm_communicate_header); |
| 718 | + uint32_t read_offset = 0, read_size, total_size; |
| 719 | + |
| 720 | + do { |
| 721 | + read_stream_hdr->func_id = FWU_READ_STREAM; |
| 722 | + read_stream_hdr->handle = handle; |
| 723 | + |
| 724 | + mm_hdr->message_len = sizeof(struct mm_fwu_read_stream_arg); |
| 725 | + |
| 726 | + ret = ffa_notify_mm_sp(); |
| 727 | + if (ret) |
| 728 | + return ret; |
| 729 | + |
| 730 | + if (read_stream_ret->status) |
| 731 | + return read_stream_ret->status; |
| 732 | + |
| 733 | + read_size = read_stream_ret->read_bytes; |
| 734 | + total_size = read_stream_ret->total_bytes; |
| 735 | + |
| 736 | + log_info("FWU: read bytes / total bytes : %d/%d\n", read_size, total_size); |
| 737 | + |
| 738 | + if ((read_size <= payload_size) && (read_offset + read_size <= buffer_size)) |
| 739 | + memcpy(buffer + read_offset, read_stream_ret->payload, read_size); |
| 740 | + else |
| 741 | + return -EINVAL; |
| 742 | + |
| 743 | + read_offset += read_size; |
| 744 | + |
| 745 | + if (read_offset > total_size) |
| 746 | + return -EINVAL; |
| 747 | + } while (total_size != read_offset); |
| 748 | + |
| 749 | + return read_stream_ret->status; |
| 750 | +} |
| 751 | + |
| 752 | +static fwu_status_t __efi_runtime fwu_write_stream(uint32_t handle, const uint8_t *buffer, uint32_t remaining_size) |
| 753 | +{ |
| 754 | + int ret; |
| 755 | + struct mm_fwu_write_stream_arg *write_stream_arg = get_fwu_write_stream_arg(mm_hdr); |
| 756 | + struct mm_fwu_write_stream_ret *write_stream_ret = get_fwu_write_stream_ret(mm_hdr); |
| 757 | + uint32_t write_size; |
| 758 | + uint32_t payload_size = FFA_SHARED_MM_BUFFER_SIZE - sizeof(struct mm_fwu_write_stream_arg) |
| 759 | + - sizeof(struct efi_mm_communicate_header); |
| 760 | + |
| 761 | + while (remaining_size) { |
| 762 | + write_size = (remaining_size < payload_size) ? remaining_size : payload_size; |
| 763 | + write_stream_arg->func_id = FWU_WRITE_STREAM; |
| 764 | + write_stream_arg->handle = handle; |
| 765 | + write_stream_arg->data_len = write_size; |
| 766 | + memcpy(write_stream_arg->payload, buffer, write_size); |
| 767 | + |
| 768 | + mm_hdr->message_len = sizeof(struct mm_fwu_write_stream_arg) + write_size; |
| 769 | + |
| 770 | + ret = ffa_notify_mm_sp(); |
| 771 | + if (ret) |
| 772 | + return ret; |
| 773 | + |
| 774 | + if(write_stream_ret->status) |
| 775 | + return write_stream_ret->status; |
| 776 | + |
| 777 | + remaining_size -= write_size; |
| 778 | + buffer += write_size; |
| 779 | + |
| 780 | + log_info("FWU: write size = %d, remaining size = %d\n", |
| 781 | + write_size, remaining_size); |
| 782 | + } |
| 783 | + |
| 784 | + return write_stream_ret->status; |
| 785 | +} |
| 786 | + |
| 787 | +static fwu_status_t __efi_runtime fwu_commit(uint32_t handle, bool client_accept) |
| 788 | +{ |
| 789 | + int ret; |
| 790 | + struct mm_fwu_commit_arg *commit_arg = get_fwu_commit_arg(mm_hdr); |
| 791 | + struct mm_fwu_commit_ret *commit_ret = get_fwu_commit_ret(mm_hdr); |
| 792 | + |
| 793 | + do { |
| 794 | + commit_arg->func_id = FWU_COMMIT; |
| 795 | + commit_arg->handle = handle; |
| 796 | + commit_arg->acceptance_req = client_accept; |
| 797 | + commit_arg->max_atomic_len = 0; |
| 798 | + |
| 799 | + mm_hdr->message_len = sizeof(struct mm_fwu_commit_arg); |
| 800 | + |
| 801 | + ret = ffa_notify_mm_sp(); |
| 802 | + if (ret) |
| 803 | + return ret; |
| 804 | + |
| 805 | + log_info("FWU: commit progress %d/%d (work/total_work)\n", |
| 806 | + commit_ret->progress, commit_ret->total_work); |
| 807 | + |
| 808 | + } while(commit_ret->status==FWU_RESUME); |
| 809 | + |
| 810 | + return commit_ret->status; |
| 811 | +} |
| 812 | + |
| 813 | +int __efi_runtime arm_psa_update( |
| 814 | + const void *image, |
| 815 | + u8 image_index, |
| 816 | + efi_uintn_t image_size |
| 817 | +) |
| 818 | +{ |
| 819 | + int ret = 0; |
| 820 | + uint32_t handle; |
| 821 | + |
| 822 | + if(image_index >= cached_image_directory.num_images) |
| 823 | + return -EINVAL; |
| 824 | + |
| 825 | + ret = fwu_begin_staging(); |
| 826 | + if (ret) { |
| 827 | + log_err("FWU: begin staging failed, ret = %d\n", ret); |
| 828 | + return ret; |
| 829 | + } |
| 830 | + |
| 831 | + ret = fwu_open(&cached_image_directory.entries[image_index].image_guid, &handle); |
| 832 | + if (ret) { |
| 833 | + log_err("FWU: firmware image open failed, ret = %d\n", ret); |
| 834 | + goto cancel_staging; |
| 835 | + } |
| 836 | + |
| 837 | + ret = fwu_write_stream(handle, (uint8_t *)image, image_size); |
| 838 | + if (ret) { |
| 839 | + log_err("FWU: write stream failed, ret = %d\n", ret); |
| 840 | + goto cancel_staging; |
| 841 | + } |
| 842 | + |
| 843 | + /* TODO: implement client driven image acceptance */ |
| 844 | + ret = fwu_commit(handle, 0); |
| 845 | + if (ret) { |
| 846 | + log_err("FWU: commit failed, ret = %d\n", ret); |
| 847 | + goto cancel_staging; |
| 848 | + } |
| 849 | + |
| 850 | + ret = fwu_end_staging(); |
| 851 | + if (ret) { |
| 852 | + log_err("FWU: end staging failed, ret = %d\n", ret); |
| 853 | + goto cancel_staging; |
| 854 | + } |
| 855 | + |
| 856 | + log_info("successfully updated the image at index %d\n", image_index); |
| 857 | + return ret; |
| 858 | + |
| 859 | +cancel_staging: |
| 860 | + if (fwu_cancel_staging()) |
| 861 | + log_err("FWU: cancel staging failed, ret = %d\n", ret); |
| 862 | + |
| 863 | + return ret; |
| 864 | +} |
| 865 | + |
| 866 | +static int __efi_runtime read_image_directory(void) |
| 867 | +{ |
| 868 | + int ret; |
| 869 | + uint32_t handle; |
| 870 | + |
| 871 | + const efi_guid_t fwu_directory_uuid = PSA_FWU_DIRECTORY_UUID; |
| 872 | + |
| 873 | + ret = fwu_open(&fwu_directory_uuid, &handle); |
| 874 | + if (ret) { |
| 875 | + log_err("FWU: open image directory failed, ret = %d\n", ret); |
| 876 | + return ret; |
| 877 | + } |
| 878 | + |
| 879 | + ret = fwu_read_stream(handle, (uint8_t *)&cached_image_directory, sizeof(cached_image_directory)); |
| 880 | + if (ret) { |
| 881 | + log_err("FWU: read stream failed, ret = %d\n", ret); |
| 882 | + return ret; |
| 883 | + } |
| 884 | + |
| 885 | + if(cached_image_directory.num_images > MAX_IMAGES) { |
| 886 | + log_err("FWU: image limit exceeded.\n"); |
| 887 | + log_err("FWU: number of images present: %d, max number of images supported: %d\n", |
| 888 | + cached_image_directory.num_images, MAX_IMAGES); |
| 889 | + return -EINVAL; |
| 890 | + } |
| 891 | + |
| 892 | + return ret; |
| 893 | +} |
| 894 | + |
| 895 | +static int update_agent_init(void) |
| 896 | +{ |
| 897 | + int ret; |
| 898 | + |
| 899 | + ret = ffa_discover_mm_sp_id(); |
| 900 | + if (ret) { |
| 901 | + log_err("FWU: discover update agent failed, ret = %d\n", ret); |
| 902 | + return ret; |
| 903 | + } |
| 904 | + |
| 905 | + mm_comm_buf = (void *)map_sysmem((phys_addr_t)FFA_SHARED_MM_BUFFER_ADDR, 0); |
| 906 | + mm_hdr = (struct efi_mm_communicate_header *)mm_comm_buf; |
| 907 | + |
| 908 | + ret = fwu_discover(); |
| 909 | + if (ret) { |
| 910 | + log_err("FWU: discover failed, ret = %d\n", ret); |
| 911 | + goto out; |
| 912 | + } |
| 913 | + |
| 914 | + ret = read_image_directory(); |
| 915 | + if (ret) { |
| 916 | + log_err("FWU: reading image directory failed, ret = %d\n", ret); |
| 917 | + goto out; |
| 918 | + } |
| 919 | + |
| 920 | + fwu_initialized = 1; |
| 921 | + return ret; |
| 922 | +out: |
| 923 | + unmap_sysmem(mm_comm_buf); |
| 924 | + return ret; |
| 925 | +} |
| 926 | + |
| 927 | +int __efi_runtime arm_psa_get_image_info( |
| 928 | + efi_uintn_t *image_info_size, |
| 929 | + struct efi_firmware_image_descriptor *image_info, |
| 930 | + u32 *descriptor_version, |
| 931 | + u8 *descriptor_count, |
| 932 | + efi_uintn_t *descriptor_size, |
| 933 | + u32 *package_version, |
| 934 | + u16 **package_version_name) |
| 935 | +{ |
| 936 | + int ret = 0; |
| 937 | + int required_image_info_size; |
| 938 | + |
| 939 | + if (!fwu_initialized) { |
| 940 | + ret = update_agent_init(); |
| 941 | + if (ret) { |
| 942 | + log_err("update agent init failed, ret = %d\n", ret); |
| 943 | + return ret; |
| 944 | + } |
| 945 | + } |
| 946 | + |
| 947 | + required_image_info_size = cached_image_directory.num_images * |
| 948 | + sizeof(struct efi_firmware_image_descriptor); |
| 949 | + |
| 950 | + if (*image_info_size < required_image_info_size) { |
| 951 | + *image_info_size = required_image_info_size; |
| 952 | + return -ENOMEM; |
| 953 | + } |
| 954 | + |
| 955 | + *descriptor_version = EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION; |
| 956 | + *descriptor_count = cached_image_directory.num_images; |
| 957 | + *descriptor_size = required_image_info_size; |
| 958 | + *package_version = 0xffffffff; /* not supported */ |
| 959 | + *package_version_name = NULL; /* not supported */ |
| 960 | + |
| 961 | + for (int i = 0; i < cached_image_directory.num_images; i++) { |
| 962 | + image_info[i].image_index = i+1; |
| 963 | + guidcpy(&image_info[i].image_type_id, &cached_image_directory.entries[i].image_guid); |
| 964 | + image_info[i].image_id = i; |
| 965 | + image_info[i].image_id_name = NULL; /* not supported */ |
| 966 | + image_info[i].version = cached_image_directory.entries[i].img_version; |
| 967 | + image_info[i].version_name = NULL; /* not supported */ |
| 968 | + image_info[i].size = cached_image_directory.entries[i].img_max_size; |
| 969 | + |
| 970 | + image_info[i].attributes_supported = |
| 971 | + IMAGE_ATTRIBUTE_IMAGE_UPDATABLE | |
| 972 | + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED; |
| 973 | + image_info[i].attributes_setting = |
| 974 | + IMAGE_ATTRIBUTE_IMAGE_UPDATABLE; |
| 975 | + |
| 976 | + /* Check if the capsule authentication is enabled */ |
| 977 | + if (IS_ENABLED(CONFIG_EFI_CAPSULE_AUTHENTICATE)) |
| 978 | + image_info[i].attributes_setting |= |
| 979 | + IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED; |
| 980 | + |
| 981 | + image_info[i].lowest_supported_image_version = |
| 982 | + cached_image_directory.entries[i].lowest_acceptable_version; |
| 983 | + image_info[i].last_attempt_version = 0; |
| 984 | + image_info[i].last_attempt_status = LAST_ATTEMPT_STATUS_SUCCESS; |
| 985 | + image_info[i].hardware_instance = 1; |
| 986 | + image_info[i].dependencies = NULL; /* not supported */ |
| 987 | + } |
| 988 | + |
| 989 | + return ret; |
| 990 | +} |
| 991 | -- |
| 992 | 2.34.1 |
| 993 | |