GNU Linux-libre 4.14.251-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / hive_isp_css_common / debug_global.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef __DEBUG_GLOBAL_H_INCLUDED__
16 #define __DEBUG_GLOBAL_H_INCLUDED__
17
18 #include <type_support.h>
19
20 #define DEBUG_BUF_SIZE  1024
21 #define DEBUG_BUF_MASK  (DEBUG_BUF_SIZE - 1)
22
23 #define DEBUG_DATA_ENABLE_ADDR          0x00
24 #define DEBUG_DATA_BUF_MODE_ADDR        0x04
25 #define DEBUG_DATA_HEAD_ADDR            0x08
26 #define DEBUG_DATA_TAIL_ADDR            0x0C
27 #define DEBUG_DATA_BUF_ADDR                     0x10
28
29 #define DEBUG_DATA_ENABLE_DDR_ADDR              0x00
30 #define DEBUG_DATA_BUF_MODE_DDR_ADDR    HIVE_ISP_DDR_WORD_BYTES
31 #define DEBUG_DATA_HEAD_DDR_ADDR                (2 * HIVE_ISP_DDR_WORD_BYTES)
32 #define DEBUG_DATA_TAIL_DDR_ADDR                (3 * HIVE_ISP_DDR_WORD_BYTES)
33 #define DEBUG_DATA_BUF_DDR_ADDR                 (4 * HIVE_ISP_DDR_WORD_BYTES)
34
35 #define DEBUG_BUFFER_ISP_DMEM_ADDR       0x0
36
37 /*
38  * Enable HAS_WATCHDOG_SP_THREAD_DEBUG for additional SP thread and
39  * pipe information on watchdog output
40  * #undef HAS_WATCHDOG_SP_THREAD_DEBUG
41  * #define HAS_WATCHDOG_SP_THREAD_DEBUG
42  */
43
44
45 /*
46  * The linear buffer mode will accept data until the first
47  * overflow and then stop accepting new data
48  * The circular buffer mode will accept if there is place
49  * and discard the data if the buffer is full
50  */
51 typedef enum {
52         DEBUG_BUFFER_MODE_LINEAR = 0,
53         DEBUG_BUFFER_MODE_CIRCULAR,
54         N_DEBUG_BUFFER_MODE
55 } debug_buf_mode_t;
56
57 struct debug_data_s {
58         uint32_t                        enable;
59         uint32_t                        bufmode;
60         uint32_t                        head;
61         uint32_t                        tail;
62         uint32_t                        buf[DEBUG_BUF_SIZE];
63 };
64
65 /* thread.sp.c doesn't have a notion of HIVE_ISP_DDR_WORD_BYTES
66    still one point of control is needed for debug purposes */
67
68 #ifdef HIVE_ISP_DDR_WORD_BYTES
69 struct debug_data_ddr_s {
70         uint32_t                        enable;
71         int8_t                          padding1[HIVE_ISP_DDR_WORD_BYTES-sizeof(uint32_t)];
72         uint32_t                        bufmode;
73         int8_t                          padding2[HIVE_ISP_DDR_WORD_BYTES-sizeof(uint32_t)];
74         uint32_t                        head;
75         int8_t                          padding3[HIVE_ISP_DDR_WORD_BYTES-sizeof(uint32_t)];
76         uint32_t                        tail;
77         int8_t                          padding4[HIVE_ISP_DDR_WORD_BYTES-sizeof(uint32_t)];
78         uint32_t                        buf[DEBUG_BUF_SIZE];
79 };
80 #endif
81
82 #endif /* __DEBUG_GLOBAL_H_INCLUDED__ */
83