summaryrefslogtreecommitdiffstats
path: root/plat/brcm/board/common/cmn_plat_def.h
blob: 79d9a29d5d2ad84cf71ae1908afad3524641244a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * Copyright (c) 2015 - 2020, Broadcom
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef CMN_PLAT_DEF_H
#define CMN_PLAT_DEF_H

#include <bcm_elog.h>
#include <platform_def.h>

#ifndef GET_LOG_LEVEL
#define GET_LOG_LEVEL() LOG_LEVEL
#endif

#ifndef SET_LOG_LEVEL
#define SET_LOG_LEVEL(x) ((void)(x))
#endif

#define PLAT_LOG_NOTICE(...)						 \
		do {							 \
			if (GET_LOG_LEVEL() >= LOG_LEVEL_NOTICE) {	 \
				bcm_elog(LOG_MARKER_NOTICE __VA_ARGS__); \
				tf_log(LOG_MARKER_NOTICE __VA_ARGS__);	 \
			}						 \
		} while (0)

#define PLAT_LOG_ERROR(...)						 \
		do {							 \
			if (GET_LOG_LEVEL() >= LOG_LEVEL_ERROR) {	 \
				bcm_elog(LOG_MARKER_ERROR, __VA_ARGS__); \
				tf_log(LOG_MARKER_ERROR __VA_ARGS__);	 \
			}						 \
		} while (0)

#define PLAT_LOG_WARN(...)						 \
		do {							 \
			if (GET_LOG_LEVEL() >= LOG_LEVEL_WARNING) {	 \
				bcm_elog(LOG_MARKER_WARNING, __VA_ARGS__);\
				tf_log(LOG_MARKER_WARNING __VA_ARGS__);	 \
			}						 \
		} while (0)

#define PLAT_LOG_INFO(...)						 \
		do {							 \
			if (GET_LOG_LEVEL() >= LOG_LEVEL_INFO) {	 \
				bcm_elog(LOG_MARKER_INFO __VA_ARGS__);	 \
				tf_log(LOG_MARKER_INFO  __VA_ARGS__);    \
			}						 \
		} while (0)

#define PLAT_LOG_VERBOSE(...)						 \
		do {							 \
			if (GET_LOG_LEVEL()  >= LOG_LEVEL_VERBOSE) {	 \
				bcm_elog(LOG_MARKER_VERBOSE __VA_ARGS__);\
				tf_log(LOG_MARKER_VERBOSE __VA_ARGS__);	 \
			}						 \
		} while (0)

/*
 * The number of regions like RO(code), coherent and data required by
 * different BL stages which need to be mapped in the MMU.
 */
#if USE_COHERENT_MEM
#define CMN_BL_REGIONS	3
#else
#define CMN_BL_REGIONS	2
#endif

/*
 * FIP definitions
 */
#define PLAT_FIP_ATTEMPT_OFFSET		0x20000
#define PLAT_FIP_NUM_ATTEMPTS		128

#define PLAT_BRCM_FIP_QSPI_BASE		QSPI_BASE_ADDR
#define PLAT_BRCM_FIP_NAND_BASE		NAND_BASE_ADDR
#define PLAT_BRCM_FIP_MAX_SIZE		0x01000000

#define PLAT_BRCM_FIP_BASE	PLAT_BRCM_FIP_QSPI_BASE
#endif