1 /* 2 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef PARAM_HEADER_H 8 #define PARAM_HEADER_H 9 10 #include <stdbool.h> 11 12 #include <lib/utils_def.h> 13 14 /* Param header types */ 15 #define PARAM_EP U(0x01) 16 #define PARAM_IMAGE_BINARY U(0x02) 17 #define PARAM_BL31 U(0x03) 18 #define PARAM_BL_LOAD_INFO U(0x04) 19 #define PARAM_BL_PARAMS U(0x05) 20 #define PARAM_PSCI_LIB_ARGS U(0x06) 21 #define PARAM_SP_IMAGE_BOOT_INFO U(0x07) 22 23 /* Param header version */ 24 #define VERSION_1 U(0x01) 25 #define VERSION_2 U(0x02) 26 27 #define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \ 28 (_p)->h.type = (uint8_t)(_type); \ 29 (_p)->h.version = (uint8_t)(_ver); \ 30 (_p)->h.size = (uint16_t)sizeof(*(_p)); \ 31 (_p)->h.attr = (uint32_t)(_attr) ; \ 32 } while (false) 33 34 /* Following is used for populating structure members statically. */ 35 #define SET_STATIC_PARAM_HEAD(_p, _type, _ver, _p_type, _attr) \ 36 ._p.h.type = (uint8_t)(_type), \ 37 ._p.h.version = (uint8_t)(_ver), \ 38 ._p.h.size = (uint16_t)sizeof(_p_type), \ 39 ._p.h.attr = (uint32_t)(_attr) 40 41 #ifndef __ASSEMBLY__ 42 43 #include <stdint.h> 44 45 /*************************************************************************** 46 * This structure provides version information and the size of the 47 * structure, attributes for the structure it represents 48 ***************************************************************************/ 49 typedef struct param_header { 50 uint8_t type; /* type of the structure */ 51 uint8_t version; /* version of this structure */ 52 uint16_t size; /* size of this structure in bytes */ 53 uint32_t attr; /* attributes: unused bits SBZ */ 54 } param_header_t; 55 56 #endif /*__ASSEMBLY__*/ 57 58 #endif /* PARAM_HEADER_H */ 59