blob: 90d59b3a884ce941cc2b5b1c490dd30c0af00678 [file] [log] [blame]
Soby Mathewb911cc72017-02-13 12:46:28 +00001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
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
10/* Param header types */
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
18/* Param header version */
19#define VERSION_1 0x01
20#define VERSION_2 0x02
21
22#define SET_PARAM_HEAD(_p, _type, _ver, _attr) do { \
23 (_p)->h.type = (uint8_t)(_type); \
24 (_p)->h.version = (uint8_t)(_ver); \
25 (_p)->h.size = (uint16_t)sizeof(*_p); \
26 (_p)->h.attr = (uint32_t)(_attr) ; \
27 } while (0)
28
29/* Following is used for populating structure members statically. */
30#define SET_STATIC_PARAM_HEAD(_p, _type, _ver, _p_type, _attr) \
31 ._p.h.type = (uint8_t)(_type), \
32 ._p.h.version = (uint8_t)(_ver), \
33 ._p.h.size = (uint16_t)sizeof(_p_type), \
34 ._p.h.attr = (uint32_t)(_attr)
35
36#ifndef __ASSEMBLY__
37
38#include <types.h>
39
40/***************************************************************************
41 * This structure provides version information and the size of the
42 * structure, attributes for the structure it represents
43 ***************************************************************************/
44typedef struct param_header {
45 uint8_t type; /* type of the structure */
46 uint8_t version; /* version of this structure */
47 uint16_t size; /* size of this structure in bytes */
48 uint32_t attr; /* attributes: unused bits SBZ */
49} param_header_t;
50
51#endif /*__ASSEMBLY__*/
52
53#endif /* __PARAM_HEADER_H__ */
54