|
| 1 | +/* |
| 2 | + * Copyright (c) 2025 Nordic Semiconductor ASA |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + */ |
| 5 | + |
| 6 | +#ifndef ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ |
| 7 | +#define ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ |
| 8 | + |
| 9 | +#include <stdint.h> |
| 10 | +#include <stddef.h> |
| 11 | + |
| 12 | +#define IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE (16UL) /* Size in bytes */ |
| 13 | +#define IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE (32UL) /* Size in bytes */ |
| 14 | + |
| 15 | +/** @brief UICR error description contained in the boot report. */ |
| 16 | +struct ironside_se_boot_report_uicr_error { |
| 17 | + /** The type of error. A value of 0 indicates no error */ |
| 18 | + uint32_t error_type; |
| 19 | + /** Error descriptions specific to each type of UICR error */ |
| 20 | + union { |
| 21 | + /** RFU */ |
| 22 | + struct { |
| 23 | + uint32_t rfu[4]; |
| 24 | + } rfu; |
| 25 | + } description; |
| 26 | +}; |
| 27 | + |
| 28 | +/** @brief IRONside boot report. */ |
| 29 | +struct ironside_se_boot_report { |
| 30 | + /** Magic value used to identify valid boot report */ |
| 31 | + uint32_t magic; |
| 32 | + /** Firmware version of IRONside SE. 8bit MAJOR.MINOR.PATCH.SEQNUM */ |
| 33 | + uint32_t ironside_se_version_int; |
| 34 | + /** Human readable extraversion of IRONside SE */ |
| 35 | + char ironside_se_extraversion[12]; |
| 36 | + /** Firmware version of IRONside SE recovery firmware. 8bit MAJOR.MINOR.PATCH.SEQNUM */ |
| 37 | + uint32_t ironside_se_recovery_version_int; |
| 38 | + /** Human readable extraversion of IRONside SE recovery firmware */ |
| 39 | + char ironside_se_recovery_extraversion[12]; |
| 40 | + /** Copy of SICR.UROT.UPDATE.STATUS.*/ |
| 41 | + uint32_t ironside_update_status; |
| 42 | + /** See @ref ironside_se_boot_report_uicr_error */ |
| 43 | + struct ironside_se_boot_report_uicr_error uicr_error_description; |
| 44 | + /** Data passed from booting local domain to local domain being booted */ |
| 45 | + uint8_t local_domain_context[IRONSIDE_SE_BOOT_REPORT_LOCAL_DOMAIN_CONTEXT_SIZE]; |
| 46 | + /** CSPRNG data */ |
| 47 | + uint8_t random_data[IRONSIDE_SE_BOOT_REPORT_RANDOM_DATA_SIZE]; |
| 48 | + /** Reserved for Future Use */ |
| 49 | + uint32_t rfu[64]; |
| 50 | +}; |
| 51 | + |
| 52 | +/** |
| 53 | + * @brief Get a pointer to the IRONside boot report. |
| 54 | + * |
| 55 | + * @param[out] report Will be set to point to the IRONside boot report. |
| 56 | + * |
| 57 | + * @return non-negative value if success, negative value otherwise. |
| 58 | + * @retval -EFAULT if the magic field in the report is incorrect. |
| 59 | + * @retval -EINVAL if @ref report is NULL. |
| 60 | + */ |
| 61 | +int ironside_se_boot_report_get(const struct ironside_se_boot_report **report); |
| 62 | + |
| 63 | +#endif /* ZEPHYR_SOC_NORDIC_NRF54H_IRONSIDE_SE_BOOT_REPORT_INCLUDE_NRF_IRONSIDE_SE_BOOT_REPORT_H_ */ |
0 commit comments