blob: 0c1503f1bbd88652f526e7344420a23f971f5217 [file] [log] [blame]
Soby Mathewb911cc72017-02-13 12:46:28 +00001/*
Jeenu Viswambharan210f0a82018-08-02 10:14:12 +01002 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
Soby Mathewb911cc72017-02-13 12:46:28 +00003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soby Mathewb911cc72017-02-13 12:46:28 +00005 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef PARAM_HEADER_H
8#define PARAM_HEADER_H
Soby Mathewb911cc72017-02-13 12:46:28 +00009
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010010#include <stdbool.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011
12#include <lib/utils_def.h>
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010013
Soby Mathewb911cc72017-02-13 12:46:28 +000014/* Param header types */
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010015#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 Mathewb911cc72017-02-13 12:46:28 +000022
23/* Param header version */
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010024#define VERSION_1 U(0x01)
25#define VERSION_2 U(0x02)
Soby Mathewb911cc72017-02-13 12:46:28 +000026
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 Viswambharan210f0a82018-08-02 10:14:12 +010030 (_p)->h.size = (uint16_t)sizeof(*(_p)); \
Soby Mathewb911cc72017-02-13 12:46:28 +000031 (_p)->h.attr = (uint32_t)(_attr) ; \
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010032 } while (false)
Soby Mathewb911cc72017-02-13 12:46:28 +000033
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 Diaz4b32e622018-08-16 16:52:57 +010043#include <stdint.h>
Soby Mathewb911cc72017-02-13 12:46:28 +000044
45/***************************************************************************
46 * This structure provides version information and the size of the
47 * structure, attributes for the structure it represents
48 ***************************************************************************/
49typedef 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 Diaz5eb88372018-11-08 10:20:19 +000058#endif /* PARAM_HEADER_H */