1 /* 2 * Copyright (c) 2022-2023, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #ifndef __FIP_PARSER_H__ 9 #define __FIP_PARSER_H__ 10 11 #include "firmware_image_package.h" 12 #include "stddef.h" 13 14 #ifdef __cplusplus 15 extern "C" { 16 #endif 17 18 /** 19 * \brief Parse a FIP and retrieve the offset and size of one 20 * of the firmware images (specified by UUID). 21 * 22 * \param[in] fip_base The RSE address mapped to the FIP base address in 23 * host flash. 24 * \param[in] atu_slot_size The size of the ATU region that was mapped for 25 * access to this FIP. This is used to prevent reads 26 * outside the mapped region. 27 * \param[in] uuid The UUID of the firmware image to get the offset 28 * and size of. 29 * 30 * \param[out] offset The offset in host flash of the firmware image. 31 * \param[out] size The size of the firmware image. 32 * 33 * \return 0 if operation completed successfully, another 34 * value on error. 35 */ 36 int fip_get_entry_by_uuid(uint32_t fip_base, uint32_t atu_slot_size, uuid_t uuid, 37 uint64_t *offset, size_t *size); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif /* __FIP_PARSER_H__ */ 44