hc
2025-02-14 bbb9540dc49f70f6b703d1c8d1b85fa5f602d86e
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
/*
 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
 *
 * SPDX-License-Identifier:    GPL-2.0
 */
 
#ifndef _RKFLASH_DEBUG_H
#define _RKFLASH_DEBUG_H
 
#include <common.h>
#include <dm.h>
 
/*
 * Debug control center
 * 1. Set Printing-adding-macro to 1 to allow print code being compiled in.
 * 2. Set variable 'rkflash_debug' to control debug print to enable print.
 */
 
/*
 * Printing-adding
 */
#define    PRINT_SWI_INFO        0
#define    PRINT_SWI_ERROR        1
#define PRINT_SWI_HEX        1
 
#define    PRINT_SWI_CON_IO    1
#define    PRINT_SWI_BLK_IO    1
 
/*
 * Print switch, set var rkflash_debug corresponding bit to 1 if needed.
 * I - info
 * IO - IO request about
 */
#define    PRINT_BIT_CON_IO    BIT(0)
#define    PRINT_BIT_BLK_IO    BIT(4)
 
__printf(1, 2) int rkflash_print_info(const char *fmt, ...);
__printf(1, 2) int rkflash_print_error(const char *fmt, ...);
void rkflash_print_hex(const char *s, const void *buf, int w, size_t len);
 
__printf(1, 2) int rkflash_print_dio(const char *fmt, ...);
__printf(1, 2) int rkflash_print_bio(const char *fmt, ...);
 
void rkflash_test(struct udevice *p_dev);
 
#endif