aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/s5p-jpeg/jpeg-regs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/s5p-jpeg/jpeg-regs.h')
-rw-r--r--drivers/media/platform/s5p-jpeg/jpeg-regs.h209
1 files changed, 208 insertions, 1 deletions
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-regs.h b/drivers/media/platform/s5p-jpeg/jpeg-regs.h
index 38e50815668c..33f2c7374cfd 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-regs.h
+++ b/drivers/media/platform/s5p-jpeg/jpeg-regs.h
@@ -2,10 +2,11 @@
2 * 2 *
3 * Register definition file for Samsung JPEG codec driver 3 * Register definition file for Samsung JPEG codec driver
4 * 4 *
5 * Copyright (c) 2011 Samsung Electronics Co., Ltd. 5 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com 6 * http://www.samsung.com
7 * 7 *
8 * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com> 8 * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
9 * Author: Jacek Anaszewski <j.anaszewski@samsung.com>
9 * 10 *
10 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -15,6 +16,8 @@
15#ifndef JPEG_REGS_H_ 16#ifndef JPEG_REGS_H_
16#define JPEG_REGS_H_ 17#define JPEG_REGS_H_
17 18
19/* Register and bit definitions for S5PC210 */
20
18/* JPEG mode register */ 21/* JPEG mode register */
19#define S5P_JPGMOD 0x00 22#define S5P_JPGMOD 0x00
20#define S5P_PROC_MODE_MASK (0x1 << 3) 23#define S5P_PROC_MODE_MASK (0x1 << 3)
@@ -166,5 +169,209 @@
166/* JPEG AC Huffman table register */ 169/* JPEG AC Huffman table register */
167#define S5P_JPG_HACTBLG(n) (0x8c0 + (n) * 0x400) 170#define S5P_JPG_HACTBLG(n) (0x8c0 + (n) * 0x400)
168 171
172
173/* Register and bit definitions for Exynos 4x12 */
174
175/* JPEG Codec Control Registers */
176#define EXYNOS4_JPEG_CNTL_REG 0x00
177#define EXYNOS4_INT_EN_REG 0x04
178#define EXYNOS4_INT_TIMER_COUNT_REG 0x08
179#define EXYNOS4_INT_STATUS_REG 0x0c
180#define EXYNOS4_OUT_MEM_BASE_REG 0x10
181#define EXYNOS4_JPEG_IMG_SIZE_REG 0x14
182#define EXYNOS4_IMG_BA_PLANE_1_REG 0x18
183#define EXYNOS4_IMG_SO_PLANE_1_REG 0x1c
184#define EXYNOS4_IMG_PO_PLANE_1_REG 0x20
185#define EXYNOS4_IMG_BA_PLANE_2_REG 0x24
186#define EXYNOS4_IMG_SO_PLANE_2_REG 0x28
187#define EXYNOS4_IMG_PO_PLANE_2_REG 0x2c
188#define EXYNOS4_IMG_BA_PLANE_3_REG 0x30
189#define EXYNOS4_IMG_SO_PLANE_3_REG 0x34
190#define EXYNOS4_IMG_PO_PLANE_3_REG 0x38
191
192#define EXYNOS4_TBL_SEL_REG 0x3c
193
194#define EXYNOS4_IMG_FMT_REG 0x40
195
196#define EXYNOS4_BITSTREAM_SIZE_REG 0x44
197#define EXYNOS4_PADDING_REG 0x48
198#define EXYNOS4_HUFF_CNT_REG 0x4c
199#define EXYNOS4_FIFO_STATUS_REG 0x50
200#define EXYNOS4_DECODE_XY_SIZE_REG 0x54
201#define EXYNOS4_DECODE_IMG_FMT_REG 0x58
202
203#define EXYNOS4_QUAN_TBL_ENTRY_REG 0x100
204#define EXYNOS4_HUFF_TBL_ENTRY_REG 0x200
205
206
207/****************************************************************/
208/* Bit definition part */
209/****************************************************************/
210
211/* JPEG CNTL Register bit */
212#define EXYNOS4_ENC_DEC_MODE_MASK (0xfffffffc << 0)
213#define EXYNOS4_DEC_MODE (1 << 0)
214#define EXYNOS4_ENC_MODE (1 << 1)
215#define EXYNOS4_AUTO_RST_MARKER (1 << 2)
216#define EXYNOS4_RST_INTERVAL_SHIFT 3
217#define EXYNOS4_RST_INTERVAL(x) (((x) & 0xffff) \
218 << EXYNOS4_RST_INTERVAL_SHIFT)
219#define EXYNOS4_HUF_TBL_EN (1 << 19)
220#define EXYNOS4_HOR_SCALING_SHIFT 20
221#define EXYNOS4_HOR_SCALING_MASK (3 << EXYNOS4_HOR_SCALING_SHIFT)
222#define EXYNOS4_HOR_SCALING(x) (((x) & 0x3) \
223 << EXYNOS4_HOR_SCALING_SHIFT)
224#define EXYNOS4_VER_SCALING_SHIFT 22
225#define EXYNOS4_VER_SCALING_MASK (3 << EXYNOS4_VER_SCALING_SHIFT)
226#define EXYNOS4_VER_SCALING(x) (((x) & 0x3) \
227 << EXYNOS4_VER_SCALING_SHIFT)
228#define EXYNOS4_PADDING (1 << 27)
229#define EXYNOS4_SYS_INT_EN (1 << 28)
230#define EXYNOS4_SOFT_RESET_HI (1 << 29)
231
232/* JPEG INT Register bit */
233#define EXYNOS4_INT_EN_MASK (0x1f << 0)
234#define EXYNOS4_PROT_ERR_INT_EN (1 << 0)
235#define EXYNOS4_IMG_COMPLETION_INT_EN (1 << 1)
236#define EXYNOS4_DEC_INVALID_FORMAT_EN (1 << 2)
237#define EXYNOS4_MULTI_SCAN_ERROR_EN (1 << 3)
238#define EXYNOS4_FRAME_ERR_EN (1 << 4)
239#define EXYNOS4_INT_EN_ALL (0x1f << 0)
240
241#define EXYNOS4_MOD_REG_PROC_ENC (0 << 3)
242#define EXYNOS4_MOD_REG_PROC_DEC (1 << 3)
243
244#define EXYNOS4_MOD_REG_SUBSAMPLE_444 (0 << 0)
245#define EXYNOS4_MOD_REG_SUBSAMPLE_422 (1 << 0)
246#define EXYNOS4_MOD_REG_SUBSAMPLE_420 (2 << 0)
247#define EXYNOS4_MOD_REG_SUBSAMPLE_GRAY (3 << 0)
248
249
250/* JPEG IMAGE SIZE Register bit */
251#define EXYNOS4_X_SIZE_SHIFT 0
252#define EXYNOS4_X_SIZE_MASK (0xffff << EXYNOS4_X_SIZE_SHIFT)
253#define EXYNOS4_X_SIZE(x) (((x) & 0xffff) << EXYNOS4_X_SIZE_SHIFT)
254#define EXYNOS4_Y_SIZE_SHIFT 16
255#define EXYNOS4_Y_SIZE_MASK (0xffff << EXYNOS4_Y_SIZE_SHIFT)
256#define EXYNOS4_Y_SIZE(x) (((x) & 0xffff) << EXYNOS4_Y_SIZE_SHIFT)
257
258/* JPEG IMAGE FORMAT Register bit */
259#define EXYNOS4_ENC_IN_FMT_MASK 0xffff0000
260#define EXYNOS4_ENC_GRAY_IMG (0 << 0)
261#define EXYNOS4_ENC_RGB_IMG (1 << 0)
262#define EXYNOS4_ENC_YUV_444_IMG (2 << 0)
263#define EXYNOS4_ENC_YUV_422_IMG (3 << 0)
264#define EXYNOS4_ENC_YUV_440_IMG (4 << 0)
265
266#define EXYNOS4_DEC_GRAY_IMG (0 << 0)
267#define EXYNOS4_DEC_RGB_IMG (1 << 0)
268#define EXYNOS4_DEC_YUV_444_IMG (2 << 0)
269#define EXYNOS4_DEC_YUV_422_IMG (3 << 0)
270#define EXYNOS4_DEC_YUV_420_IMG (4 << 0)
271
272#define EXYNOS4_GRAY_IMG_IP_SHIFT 3
273#define EXYNOS4_GRAY_IMG_IP_MASK (7 << EXYNOS4_GRAY_IMG_IP_SHIFT)
274#define EXYNOS4_GRAY_IMG_IP (4 << EXYNOS4_GRAY_IMG_IP_SHIFT)
275
276#define EXYNOS4_RGB_IP_SHIFT 6
277#define EXYNOS4_RGB_IP_MASK (7 << EXYNOS4_RGB_IP_SHIFT)
278#define EXYNOS4_RGB_IP_RGB_16BIT_IMG (4 << EXYNOS4_RGB_IP_SHIFT)
279#define EXYNOS4_RGB_IP_RGB_32BIT_IMG (5 << EXYNOS4_RGB_IP_SHIFT)
280
281#define EXYNOS4_YUV_444_IP_SHIFT 9
282#define EXYNOS4_YUV_444_IP_MASK (7 << EXYNOS4_YUV_444_IP_SHIFT)
283#define EXYNOS4_YUV_444_IP_YUV_444_2P_IMG (4 << EXYNOS4_YUV_444_IP_SHIFT)
284#define EXYNOS4_YUV_444_IP_YUV_444_3P_IMG (5 << EXYNOS4_YUV_444_IP_SHIFT)
285
286#define EXYNOS4_YUV_422_IP_SHIFT 12
287#define EXYNOS4_YUV_422_IP_MASK (7 << EXYNOS4_YUV_422_IP_SHIFT)
288#define EXYNOS4_YUV_422_IP_YUV_422_1P_IMG (4 << EXYNOS4_YUV_422_IP_SHIFT)
289#define EXYNOS4_YUV_422_IP_YUV_422_2P_IMG (5 << EXYNOS4_YUV_422_IP_SHIFT)
290#define EXYNOS4_YUV_422_IP_YUV_422_3P_IMG (6 << EXYNOS4_YUV_422_IP_SHIFT)
291
292#define EXYNOS4_YUV_420_IP_SHIFT 15
293#define EXYNOS4_YUV_420_IP_MASK (7 << EXYNOS4_YUV_420_IP_SHIFT)
294#define EXYNOS4_YUV_420_IP_YUV_420_2P_IMG (4 << EXYNOS4_YUV_420_IP_SHIFT)
295#define EXYNOS4_YUV_420_IP_YUV_420_3P_IMG (5 << EXYNOS4_YUV_420_IP_SHIFT)
296
297#define EXYNOS4_ENC_FMT_SHIFT 24
298#define EXYNOS4_ENC_FMT_MASK (3 << EXYNOS4_ENC_FMT_SHIFT)
299#define EXYNOS4_ENC_FMT_GRAY (0 << EXYNOS4_ENC_FMT_SHIFT)
300#define EXYNOS4_ENC_FMT_YUV_444 (1 << EXYNOS4_ENC_FMT_SHIFT)
301#define EXYNOS4_ENC_FMT_YUV_422 (2 << EXYNOS4_ENC_FMT_SHIFT)
302#define EXYNOS4_ENC_FMT_YUV_420 (3 << EXYNOS4_ENC_FMT_SHIFT)
303
304#define EXYNOS4_JPEG_DECODED_IMG_FMT_MASK 0x03
305
306#define EXYNOS4_SWAP_CHROMA_CRCB (1 << 26)
307#define EXYNOS4_SWAP_CHROMA_CBCR (0 << 26)
308
309/* JPEG HUFF count Register bit */
310#define EXYNOS4_HUFF_COUNT_MASK 0xffff
311
312/* JPEG Decoded_img_x_y_size Register bit */
313#define EXYNOS4_DECODED_SIZE_MASK 0x0000ffff
314
315/* JPEG Decoded image format Register bit */
316#define EXYNOS4_DECODED_IMG_FMT_MASK 0x3
317
318/* JPEG TBL SEL Register bit */
319#define EXYNOS4_Q_TBL_COMP1_0 (0 << 0)
320#define EXYNOS4_Q_TBL_COMP1_1 (1 << 0)
321#define EXYNOS4_Q_TBL_COMP1_2 (2 << 0)
322#define EXYNOS4_Q_TBL_COMP1_3 (3 << 0)
323
324#define EXYNOS4_Q_TBL_COMP2_0 (0 << 2)
325#define EXYNOS4_Q_TBL_COMP2_1 (1 << 2)
326#define EXYNOS4_Q_TBL_COMP2_2 (2 << 2)
327#define EXYNOS4_Q_TBL_COMP2_3 (3 << 2)
328
329#define EXYNOS4_Q_TBL_COMP3_0 (0 << 4)
330#define EXYNOS4_Q_TBL_COMP3_1 (1 << 4)
331#define EXYNOS4_Q_TBL_COMP3_2 (2 << 4)
332#define EXYNOS4_Q_TBL_COMP3_3 (3 << 4)
333
334#define EXYNOS4_HUFF_TBL_COMP1_AC_0_DC_0 (0 << 6)
335#define EXYNOS4_HUFF_TBL_COMP1_AC_0_DC_1 (1 << 6)
336#define EXYNOS4_HUFF_TBL_COMP1_AC_1_DC_0 (2 << 6)
337#define EXYNOS4_HUFF_TBL_COMP1_AC_1_DC_1 (3 << 6)
338
339#define EXYNOS4_HUFF_TBL_COMP2_AC_0_DC_0 (0 << 8)
340#define EXYNOS4_HUFF_TBL_COMP2_AC_0_DC_1 (1 << 8)
341#define EXYNOS4_HUFF_TBL_COMP2_AC_1_DC_0 (2 << 8)
342#define EXYNOS4_HUFF_TBL_COMP2_AC_1_DC_1 (3 << 8)
343
344#define EXYNOS4_HUFF_TBL_COMP3_AC_0_DC_0 (0 << 10)
345#define EXYNOS4_HUFF_TBL_COMP3_AC_0_DC_1 (1 << 10)
346#define EXYNOS4_HUFF_TBL_COMP3_AC_1_DC_0 (2 << 10)
347#define EXYNOS4_HUFF_TBL_COMP3_AC_1_DC_1 (3 << 10)
348
349/* JPEG quantizer table register */
350#define EXYNOS4_QTBL_CONTENT(n) (0x100 + (n) * 0x40)
351
352/* JPEG DC luminance (code length) Huffman table register */
353#define EXYNOS4_HUFF_TBL_HDCLL 0x200
354
355/* JPEG DC luminance (values) Huffman table register */
356#define EXYNOS4_HUFF_TBL_HDCLV 0x210
357
358/* JPEG DC chrominance (code length) Huffman table register */
359#define EXYNOS4_HUFF_TBL_HDCCL 0x220
360
361/* JPEG DC chrominance (values) Huffman table register */
362#define EXYNOS4_HUFF_TBL_HDCCV 0x230
363
364/* JPEG AC luminance (code length) Huffman table register */
365#define EXYNOS4_HUFF_TBL_HACLL 0x240
366
367/* JPEG AC luminance (values) Huffman table register */
368#define EXYNOS4_HUFF_TBL_HACLV 0x250
369
370/* JPEG AC chrominance (code length) Huffman table register */
371#define EXYNOS4_HUFF_TBL_HACCL 0x300
372
373/* JPEG AC chrominance (values) Huffman table register */
374#define EXYNOS4_HUFF_TBL_HACCV 0x310
375
169#endif /* JPEG_REGS_H_ */ 376#endif /* JPEG_REGS_H_ */
170 377