blob: ec4ee4ee128118c48bcbc85bfa87e82e7f17e034 [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
7#ifndef __PARAM_HEADER_H__
8#define __PARAM_HEADER_H__
9
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010010#include <stdbool.h>
11#include <utils_def.h>
12
Soby Mathewb911cc72017-02-13 12:46:28 +000013/* Param header types */
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010014#define PARAM_EP U(0x01)
15#define PARAM_IMAGE_BINARY U(0x02)
16#define PARAM_BL31 U(0x03)
17#define PARAM_BL_LOAD_INFO U(0x04)
18#define PARAM_BL_PARAMS U(0x05)
19#define PARAM_PSCI_LIB_ARGS U(0x06)
20#define PARAM_SP_IMAGE_BOOT_INFO U(0x07)
Soby Mathewb911cc72017-02-13 12:46:28 +000021
22/* Param header version */
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010023#define VERSION_1 U(0x01)
24#define VERSION_2 U(0x02)
Soby Mathewb911cc72017-02-13 12:46:28 +000025
26#define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \
27 (_p)->h.type = (uint8_t)(_type); \
28 (_p)->h.version = (uint8_t)(_ver); \
Jeenu Viswambharan210f0a82018-08-02 10:14:12 +010029 (_p)->h.size = (uint16_t)sizeof(*(_p)); \
Soby Mathewb911cc72017-02-13 12:46:28 +000030 (_p)->h.attr = (uint32_t)(_attr) ; \
Antonio Nino Diaz38b4ce02018-08-21 14:14:31 +010031 } while (false)
Soby Mathewb911cc72017-02-13 12:46:28 +000032
33/* Following is used for populating structure members statically. */
34#define SET_STATIC_PARAM_HEAD(_p, _type, _ver, _p_type, _attr) \
35 ._p.h.type = (uint8_t)(_type), \
36 ._p.h.version = (uint8_t)(_ver), \
37 ._p.h.size = (uint16_t)sizeof(_p_type), \
38 ._p.h.attr = (uint32_t)(_attr)
39
40#ifndef __ASSEMBLY__
41
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010042#include <stdint.h>
Soby Mathewb911cc72017-02-13 12:46:28 +000043
44/***************************************************************************
45 * This structure provides version information and the size of the
46 * structure, attributes for the structure it represents
47 ***************************************************************************/
48typedef struct param_header {
49 uint8_t type; /* type of the structure */
50 uint8_t version; /* version of this structure */
51 uint16_t size; /* size of this structure in bytes */
52 uint32_t attr; /* attributes: unused bits SBZ */
53} param_header_t;
54
55#endif /*__ASSEMBLY__*/
56
57#endif /* __PARAM_HEADER_H__ */
58