^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) /* Copyright (c) 2018 Rockchip Electronics Co. Ltd. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #ifndef _RKFLASH_DEBUG_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define _RKFLASH_DEBUG_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Debug control center
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * 1. Set Printing-adding-macro to 1 to allow print code being compiled in.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * 2. Set variable 'rkflash_debug' to control debug print to enable print.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * Printing-adding
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define PRINT_SWI_INFO 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define PRINT_SWI_ERROR 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define PRINT_SWI_HEX 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define PRINT_SWI_CON_IO 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define PRINT_SWI_BLK_IO 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * Print switch, set var rkflash_debug corresponding bit to 1 if needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * I - info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * IO - IO request about
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define PRINT_BIT_CON_IO BIT(0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define PRINT_BIT_BLK_IO BIT(4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __printf(1, 2) int rkflash_print_info(const char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __printf(1, 2) int rkflash_print_error(const char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) void rkflash_print_hex(const char *s, const void *buf, int w, size_t len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) __printf(1, 2) int rkflash_print_dio(const char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) __printf(1, 2) int rkflash_print_bio(const char *fmt, ...);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)