blob: a5a08ec4afc8c03224b0c135a120286b81add688 [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
10/* Param header types */
Antonio Nino Diazc41f2062017-10-24 10:07:35 +010011#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 Mathewb911cc72017-02-13 12:46:28 +000018
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); \
Jeenu Viswambharan210f0a82018-08-02 10:14:12 +010026 (_p)->h.size = (uint16_t)sizeof(*(_p)); \
Soby Mathewb911cc72017-02-13 12:46:28 +000027 (_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
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010039#include <stdint.h>
Soby Mathewb911cc72017-02-13 12:46:28 +000040
41/***************************************************************************
42 * This structure provides version information and the size of the
43 * structure, attributes for the structure it represents
44 ***************************************************************************/
45typedef 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