xref: /rk3399_rockchip-uboot/drivers/rkflash/rkflash_debug.h (revision d5f538dc02e53c7267fcd4a914104071fca889b5)
1 /*
2  * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5  */
6 
7 #ifndef _RKFLASH_DEBUG_H
8 #define _RKFLASH_DEBUG_H
9 
10 #include <common.h>
11 #include <dm.h>
12 
13 /*
14  * Print switch, set to 1 if needed
15  * I - info
16  * E - error
17  * HEX - multiline print
18  */
19 
20 #define	PRINT_SWI_SFC_I		0
21 #define	PRINT_SWI_SFC_E		1
22 #define PRINT_SWI_SFC_HEX	1
23 
24 /*
25  * Test switch
26  */
27 #define BLK_STRESS_TEST_EN	0
28 
29 #if (RINT_SWI_SFC_I)
30 #define PRINT_SFC_I(...) printf(__VA_ARGS__)
31 #else
32 #define PRINT_SFC_I(...)
33 #endif
34 
35 #if (PRINT_SWI_SFC_E)
36 #define PRINT_SFC_E(...) printf(__VA_ARGS__)
37 #else
38 #define PRINT_SFC_E(...)
39 #endif
40 
41 #if (PRINT_SWI_SFC_HEX)
42 #define PRINT_SFC_HEX(s, buf, width, len)\
43 		rkflash_print_hex(s, buf, width, len)
44 #else
45 #define PRINT_SFC_HEX(s, buf, width, len)
46 #endif
47 
48 void rkflash_print_hex(char *s, void *buf, u32 width, u32 len);
49 void rkflash_test(struct udevice *p_dev);
50 
51 #endif
52