Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 1 | /* |
Jeenu Viswambharan | 210f0a8 | 2018-08-02 10:14:12 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 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 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef PARAM_HEADER_H |
| 8 | #define PARAM_HEADER_H |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 9 | |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 10 | #include <stdbool.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 11 | |
| 12 | #include <lib/utils_def.h> |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 13 | |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 14 | /* Param header types */ |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 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) |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 22 | |
| 23 | /* Param header version */ |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 24 | #define VERSION_1 U(0x01) |
| 25 | #define VERSION_2 U(0x02) |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 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); \ |
Jeenu Viswambharan | 210f0a8 | 2018-08-02 10:14:12 +0100 | [diff] [blame] | 30 | (_p)->h.size = (uint16_t)sizeof(*(_p)); \ |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 31 | (_p)->h.attr = (uint32_t)(_attr) ; \ |
Antonio Nino Diaz | 38b4ce0 | 2018-08-21 14:14:31 +0100 | [diff] [blame] | 32 | } while (false) |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 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 | |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 43 | #include <stdint.h> |
Soby Mathew | b911cc7 | 2017-02-13 12:46:28 +0000 | [diff] [blame] | 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 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 58 | #endif /* PARAM_HEADER_H */ |