• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 *
3 * SPDX-License-Identifier: GPL-2.0
4 *
5 * Copyright (C) 2011-2018 ARM or its affiliates
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19 
20 #ifndef __SYSTEM_AUTOWRITE_H__
21 #define __SYSTEM_AUTOWRITE_H__
22 
23 #include "acamera_types.h"
24 
25 
26 #define FR_AUTO_WRITE_BASE  0xFE023C00
27 #define DS1_AUTO_WRITE_BASE 0xFE023C80
28 #define DS2_AUTO_WRITE_BASE 0xFE023D00
29 
30 #define DS1_OFFSET 0x80
31 #define DS2_OFFSET 0x100
32 
33 #define MIPI_BL_PING_ADDR0_ST     0x00
34 #define MIPI_BL_PING_ADDR0_ED     0x04
35 #define MIPI_BL_PING_ADDR1_ST     0x08
36 #define MIPI_BL_PING_ADDR1_ED     0x0C
37 #define MIPI_BL_PONG_ADDR0_ST     0x10
38 #define MIPI_BL_PONG_ADDR0_ED     0x14
39 #define MIPI_BL_PONG_ADDR1_ST     0x18
40 #define MIPI_BL_PONG_ADDR1_ED     0x1C
41 #define MIPI_BL_FRAME_TH          0x20
42 #define MIPI_BL_FRAME_BUFFER_START_ADDR0    0x24
43 #define MIPI_BL_FRAME_SIZE0       0x28
44 #define MIPI_BL_FRAME_BUF_SIZE0   0x2c
45 #define MIPI_BL_FRAME_BUFFER_START_ADDR1    0x30
46 #define MIPI_BL_FRAME_SIZE1       0x34
47 #define MIPI_BL_FRAME_BUF_SIZE1   0x38
48 #define MIPI_BL_CTRL0             0x3c
49 #define MIPI_BL_CTRL1             0x40
50 #define MIPI_BL_COUNT             0x44
51 #define MIPI_BL_AWADDR_0          0x48
52 #define MIPI_BL_AWADDR_I          0x4c
53 #define MIPI_BL_STAT0             0x50
54 #define MIPI_BL_STAT1             0x54
55 #define MIPI_BL_STAT2             0x58
56 #define MIPI_BL_STAT3             0x5c
57 #define MIPI_BL_FRAME_BUFFER_START_ADDR0P   0x60
58 
59 typedef struct _auto_write_cfg_t {
60 	uint32_t p_type;
61 	uint32_t ping_st0;
62 	uint32_t ping_ed0;
63 	uint32_t pong_st0;
64 	uint32_t pong_ed0;
65 	uint32_t ping_st1;
66 	uint32_t ping_ed1;
67 	uint32_t pong_st1;
68 	uint32_t pong_ed1;
69 	uint32_t frame_buffer_start0;
70 	uint32_t frame_size0;
71 	uint32_t frame_buffer_size0;
72 	uint32_t frame_buffer_start1;
73 	uint32_t frame_size1;
74 	uint32_t frame_buffer_size1;
75 	uint32_t wreay_delay;
76 	uint32_t bvalid_delay;
77 	uint32_t drop_jump;
78 	uint32_t drop_write;
79 	uint32_t drop_skip;
80 	uint32_t drop_enable;
81 }auto_write_cfg_t;
82 
83 void auto_cap_init(void);
84 void auto_cap_deinit(void);
85 void auto_write_fr_init(void *cfg);
86 void auto_write_ds1_init(void *cfg);
87 void auto_write_ds2_init(void *cfg);
88 void auto_write_stop(void *cfg);
89 void auto_write_cfg_ping_pong(void *cfg);
90 
91 uint32_t autowrite_fr_ping_start( void );
92 uint32_t autowrite_fr_pong_start( void );
93 uint32_t autowrite_fr_image_buffer_stride_read( void );
94 uint32_t autowrite_fr_image_buffer_stride_read1( void );
95 uint32_t autowrite_fr_writer_frame_wcount_read( void );
96 uint32_t autowrite_fr_writer_memsize_read( void );
97 uint32_t autowrite_fr_writer_memsize_read1( void );
98 uint32_t autowrite_fr_drop_jump_read( void );
99 uint32_t autowrite_fr_drop_write_read( void );
100 uint32_t autowrite_fr_drop_mode_status( void );
101 
102 uint32_t autowrite_ds1_ping_start( void );
103 uint32_t autowrite_ds1_pong_start( void );
104 uint32_t autowrite_ds1_image_buffer_stride_read( void );
105 uint32_t autowrite_ds1_image_buffer_stride_read1( void );
106 uint32_t autowrite_ds1_writer_frame_wcount_read( void );
107 uint32_t autowrite_ds1_writer_memsize_read( void );
108 uint32_t autowrite_ds1_writer_memsize_read1( void );
109 uint32_t autowrite_ds1_drop_jump_read( void );
110 uint32_t autowrite_ds1_drop_write_read( void );
111 uint32_t autowrite_ds1_drop_mode_status( void );
112 
113 uint32_t autowrite_ds2_ping_start( void );
114 uint32_t autowrite_ds2_pong_start( void );
115 uint32_t autowrite_ds2_image_buffer_stride_read( void );
116 uint32_t autowrite_ds2_image_buffer_stride_read1( void );
117 uint32_t autowrite_ds2_writer_frame_wcount_read( void );
118 uint32_t autowrite_ds2_writer_memsize_read( void );
119 uint32_t autowrite_ds2_writer_memsize_read1( void );
120 uint32_t autowrite_ds2_drop_jump_read( void );
121 uint32_t autowrite_ds2_drop_write_read( void );
122 uint32_t autowrite_ds2_drop_mode_status( void );
123 
124 uint32_t autowrite_fr_start_address_read( void );
125 uint32_t autowrite_ds1_start_address_read( void );
126 uint32_t autowrite_ds2_start_address_read( void );
127 
128 void autowrite_path_reset(void);
129 
130 void auto_write_fr_start(void *cfg);
131 void auto_write_ds1_start(void *cfg);
132 void auto_write_ds2_start(void *cfg);
133 
134 uint32_t autowrite_fr_stop( void );
135 uint32_t autowrite_ds1_stop( void );
136 uint32_t autowrite_ds2_stop( void );
137 
138 #endif // __SYSTEM_UART_H__
139