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