forked from milosladni/jepoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ve.h
139 lines (124 loc) · 3.99 KB
/
ve.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
* Copyright (c) 2013 Jens Kuske <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __VE_H__
#define __VE_H__
#include <stdint.h>
int ve_open(void);
void ve_close(void);
void ve_flush_cache(void *start, int len);
void *ve_get_regs(void);
int ve_get_version(void);
int ve_wait(int timeout);
void *ve_malloc(int size);
void ve_free(void *ptr);
uint32_t ve_virt2phys(void *ptr);
static inline void writeb(uint8_t val, void *addr)
{
*((volatile uint8_t *)addr) = val;
}
static inline void writel(uint32_t val, void *addr)
{
*((volatile uint32_t *)addr) = val;
}
static inline uint32_t readl(void *addr)
{
return *((volatile uint32_t *) addr);
}
extern void *regs;
#define S(val, off) writel(val, regs + (off))
#define L(off) readl(regs + (off))
#define VE_CTRL 0x000
#define VE_VERSION 0x0f0
#define VE_MPEG_PIC_HDR 0x100
#define VE_MPEG_SIZE 0x108
#define VE_MPEG_FRAME_SIZE 0x10c
#define VE_MPEG_CTRL 0x114
#define VE_MPEG_TRIGGER 0x118
#define VE_MPEG_STATUS 0x11c
#define VE_MPEG_VLD_ADDR 0x128
#define VE_MPEG_VLD_OFFSET 0x12c
#define VE_MPEG_VLD_LEN 0x130
#define VE_MPEG_VLD_END 0x134
#define VE_MPEG_REC_LUMA 0x148
#define VE_MPEG_REC_CHROMA 0x14c
#define VE_MPEG_FWD_LUMA 0x150
#define VE_MPEG_FWD_CHROMA 0x154
#define VE_MPEG_BACK_LUMA 0x158
#define VE_MPEG_BACK_CHROMA 0x15c
#define VE_MPEG_IQ_MIN_INPUT 0x180
#define VE_MPEG_JPEG_SIZE 0x1b8
#define VE_MPEG_JPEG_RES_INT 0x1c0
#define VE_MPEG_ROT_LUMA 0x1cc
#define VE_MPEG_ROT_CHROMA 0x1d0
#define VE_MPEG_SDROT_CTRL 0x1d4
#define VE_MPEG_RAM_WRITE_PTR 0x1e0
#define VE_MPEG_RAM_WRITE_DATA 0x1e4
#define VE_H264_FRAME_SIZE 0x200
#define VE_H264_PIC_HDR 0x204
#define VE_H264_SLICE_HDR 0x208
#define VE_H264_SLICE_HDR2 0x20c
#define VE_H264_PRED_WEIGHT 0x210
#define VE_H264_QP_PARAM 0x21c
#define VE_H264_CTRL 0x220
#define VE_H264_TRIGGER 0x224
#define VE_H264_STATUS 0x228
#define VE_H264_CUR_MB_NUM 0x22c
#define VE_H264_VLD_ADDR 0x230
#define VE_H264_VLD_OFFSET 0x234
#define VE_H264_VLD_LEN 0x238
#define VE_H264_VLD_END 0x23c
#define VE_H264_SDROT_CTRL 0x240
#define VE_H264_OUTPUT_FRAME_IDX 0x24c
#define VE_H264_EXTRA_BUFFER1 0x250
#define VE_H264_EXTRA_BUFFER2 0x254
#define VE_H264_BASIC_BITS 0x2dc
#define VE_H264_RAM_WRITE_PTR 0x2e0
#define VE_H264_RAM_WRITE_DATA 0x2e4
#define VE_SRAM_H264_PRED_WEIGHT_TABLE 0x000
#define VE_SRAM_H264_FRAMEBUFFER_LIST 0x400
#define VE_SRAM_H264_REF_LIST0 0x640
#define VE_SRAM_H264_REF_LIST1 0x664
#define VE_SRAM_H264_SCALING_LISTS 0x800
#define VE_ISP_PIC_SIZE 0xa00
#define VE_ISP_PIC_STRIDE 0xa04
#define VE_ISP_CTRL 0xa08
#define VE_ISP_PIC_LUMA 0xa78
#define VE_ISP_PIC_CHROMA 0xa7c
#define VE_AVC_PARAM 0xb04
#define VE_AVC_QP 0xb08
#define VE_AVC_MOTION_EST 0xb10
#define VE_AVC_CTRL 0xb14
#define VE_AVC_TRIGGER 0xb18
#define VE_AVC_STATUS 0xb1c
#define VE_AVC_BASIC_BITS 0xb20
#define VE_AVC_VLE_ADDR 0xb80
#define VE_AVC_VLE_END 0xb84
#define VE_AVC_VLE_OFFSET 0xb88
#define VE_AVC_VLE_MAX 0xb8c
#define VE_AVC_VLE_LENGTH 0xb90
#define VE_AVC_REF_LUMA 0xba0
#define VE_AVC_REF_CHROMA 0xba4
#define VE_AVC_REC_LUMA 0xbb0
#define VE_AVC_REC_CHROMA 0xbb4
#define VE_AVC_REF_SLUMA 0xbb8
#define VE_AVC_REC_SLUMA 0xbbc
#define VE_AVC_MB_INFO 0xbc0
#define VE_AVC_SDRAM_INDEX 0xbe0
#define VE_AVC_SDRAM_DATA 0xbe4
#endif