summaryrefslogtreecommitdiff
path: root/drivers/ddr/marvell/a38x/ddr3_logging_def.h
blob: 2de7c4fa312b600d1bf330613673aeeb4586e124 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
 * Copyright (C) Marvell International Ltd. and its affiliates
 *
 * SPDX-License-Identifier:	GPL-2.0
 */

#ifndef _DDR3_LOGGING_CONFIG_H
#define _DDR3_LOGGING_CONFIG_H

#ifdef SILENT_LIB
#define DEBUG_TRAINING_BIST_ENGINE(level, s)
#define DEBUG_TRAINING_IP(level, s)
#define DEBUG_CENTRALIZATION_ENGINE(level, s)
#define DEBUG_TRAINING_HW_ALG(level, s)
#define DEBUG_TRAINING_IP_ENGINE(level, s)
#define DEBUG_LEVELING(level, s)
#define DEBUG_PBS_ENGINE(level, s)
#define DEBUG_TRAINING_STATIC_IP(level, s)
#define DEBUG_TRAINING_ACCESS(level, s)
#else
#ifdef LIB_FUNCTIONAL_DEBUG_ONLY
#define DEBUG_TRAINING_BIST_ENGINE(level, s)
#define DEBUG_TRAINING_IP_ENGINE(level, s)
#define DEBUG_TRAINING_IP(level, s)		\
	if (level >= debug_training)		\
		printf s
#define DEBUG_CENTRALIZATION_ENGINE(level, s)	\
	if (level >= debug_centralization)	\
		printf s
#define DEBUG_TRAINING_HW_ALG(level, s)		\
	if (level >= debug_training_hw_alg)	\
		printf s
#define DEBUG_LEVELING(level, s)		\
	if (level >= debug_leveling)		\
		printf s
#define DEBUG_PBS_ENGINE(level, s)		\
	if (level >= debug_pbs)			\
		printf s
#define DEBUG_TRAINING_STATIC_IP(level, s)	\
	if (level >= debug_training_static)	\
		printf s
#define DEBUG_TRAINING_ACCESS(level, s)		\
	if (level >= debug_training_access)	\
		printf s
#else
#define DEBUG_TRAINING_BIST_ENGINE(level, s)	\
	if (level >= debug_training_bist)	\
		printf s

#define DEBUG_TRAINING_IP_ENGINE(level, s)	\
	if (level >= debug_training_ip)		\
		printf s
#define DEBUG_TRAINING_IP(level, s)		\
	if (level >= debug_training)		\
		printf s
#define DEBUG_CENTRALIZATION_ENGINE(level, s)	\
	if (level >= debug_centralization)	\
		printf s
#define DEBUG_TRAINING_HW_ALG(level, s)		\
	if (level >= debug_training_hw_alg)	\
		printf s
#define DEBUG_LEVELING(level, s)		\
	if (level >= debug_leveling)		\
		printf s
#define DEBUG_PBS_ENGINE(level, s)		\
	if (level >= debug_pbs)			\
		printf s
#define DEBUG_TRAINING_STATIC_IP(level, s)	\
	if (level >= debug_training_static)	\
		printf s
#define DEBUG_TRAINING_ACCESS(level, s)		\
	if (level >= debug_training_access)	\
		printf s
#endif
#endif

/* Logging defines */
#define DEBUG_LEVEL_TRACE	1
#define DEBUG_LEVEL_INFO	2
#define DEBUG_LEVEL_ERROR	3

enum ddr_lib_debug_block {
	DEBUG_BLOCK_STATIC,
	DEBUG_BLOCK_TRAINING_MAIN,
	DEBUG_BLOCK_LEVELING,
	DEBUG_BLOCK_CENTRALIZATION,
	DEBUG_BLOCK_PBS,
	DEBUG_BLOCK_IP,
	DEBUG_BLOCK_BIST,
	DEBUG_BLOCK_ALG,
	DEBUG_BLOCK_DEVICE,
	DEBUG_BLOCK_ACCESS,
	DEBUG_STAGES_REG_DUMP,
	/* All excluding IP and REG_DUMP, should be enabled separatelly */
	DEBUG_BLOCK_ALL
};

int ddr3_tip_print_log(u32 dev_num, u32 mem_addr);
int ddr3_tip_print_stability_log(u32 dev_num);

#endif /* _DDR3_LOGGING_CONFIG_H */