xref: /OK3568_Linux_fs/u-boot/drivers/rkflash/rkflash_debug.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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  * Debug control center
15  * 1. Set Printing-adding-macro to 1 to allow print code being compiled in.
16  * 2. Set variable 'rkflash_debug' to control debug print to enable print.
17  */
18 
19 /*
20  * Printing-adding
21  */
22 #define	PRINT_SWI_INFO		0
23 #define	PRINT_SWI_ERROR		1
24 #define PRINT_SWI_HEX		1
25 
26 #define	PRINT_SWI_CON_IO	1
27 #define	PRINT_SWI_BLK_IO	1
28 
29 /*
30  * Print switch, set var rkflash_debug corresponding bit to 1 if needed.
31  * I - info
32  * IO - IO request about
33  */
34 #define	PRINT_BIT_CON_IO	BIT(0)
35 #define	PRINT_BIT_BLK_IO	BIT(4)
36 
37 __printf(1, 2) int rkflash_print_info(const char *fmt, ...);
38 __printf(1, 2) int rkflash_print_error(const char *fmt, ...);
39 void rkflash_print_hex(const char *s, const void *buf, int w, size_t len);
40 
41 __printf(1, 2) int rkflash_print_dio(const char *fmt, ...);
42 __printf(1, 2) int rkflash_print_bio(const char *fmt, ...);
43 
44 void rkflash_test(struct udevice *p_dev);
45 
46 #endif
47