xref: /rk3399_rockchip-uboot/drivers/rkflash/rkflash_debug.h (revision bc04a3dd9a41813372820ba50655022a6a28bfbf)
1 /*
2  * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:	GPL-2.0
5  */
6 
7 #ifndef _RKFLASH_DEBUG_H
8 #define _RKFLASH_DEBUG_H
9 
10 #include <common.h>
11 #include <dm.h>
12 
13 /*
14  * Test switch
15  */
16 #define BLK_STRESS_TEST_EN	0
17 
18 /*
19  * Print switch, set to 1 if needed
20  * I - info
21  * E - error
22  * HEX - multiline print
23  */
24 
25 #define	PRINT_SWI_SFC_I		0
26 #define	PRINT_SWI_SFC_E		1
27 #define PRINT_SWI_SFC_HEX	1
28 
29 #define	PRINT_SWI_NANDC_I	0
30 #define	PRINT_SWI_NANDC_E	1
31 #define PRINT_SWI_NANDC_HEX	1
32 
33 #if (PRINT_SWI_SFC_I)
34 #define PRINT_SFC_I(...) printf(__VA_ARGS__)
35 #else
36 #define PRINT_SFC_I(...)
37 #endif
38 
39 #if (PRINT_SWI_SFC_E)
40 #define PRINT_SFC_E(...) printf(__VA_ARGS__)
41 #else
42 #define PRINT_SFC_E(...)
43 #endif
44 
45 #if (PRINT_SWI_SFC_HEX)
46 #define PRINT_SFC_HEX(s, buf, width, len)\
47 		rkflash_print_hex(s, buf, width, len)
48 #else
49 #define PRINT_SFC_HEX(s, buf, width, len)
50 #endif
51 
52 #if (PRINT_SWI_NANDC_I)
53 #define PRINT_NANDC_I(...) printf(__VA_ARGS__)
54 #else
55 #define PRINT_NANDC_I(...)
56 #endif
57 
58 #if (PRINT_SWI_NANDC_E)
59 #define PRINT_NANDC_E(...) printf(__VA_ARGS__)
60 #else
61 #define PRINT_NANDC_E(...)
62 #endif
63 
64 #if (PRINT_SWI_NANDC_HEX)
65 #define PRINT_NANDC_HEX(s, buf, width, len)\
66 		rkflash_print_hex(s, buf, width, len)
67 #else
68 #define PRINT_NANDC_HEX(s, buf, width, len)
69 #endif
70 
71 void rkflash_print_hex(char *s, void *buf, u32 width, u32 len);
72 void rkflash_test(struct udevice *p_dev);
73 
74 #endif
75