1
2
3
4
5
6
7
8
9
10 #ifndef EXYNOS_REGS_ROTATOR_H
11 #define EXYNOS_REGS_ROTATOR_H
12
13
14 #define ROT_CONFIG 0x00
15 #define ROT_CONFIG_IRQ (3 << 8)
16
17
18 #define ROT_CONTROL 0x10
19 #define ROT_CONTROL_PATTERN_WRITE (1 << 16)
20 #define ROT_CONTROL_FMT_YCBCR420_2P (1 << 8)
21 #define ROT_CONTROL_FMT_RGB888 (6 << 8)
22 #define ROT_CONTROL_FMT_MASK (7 << 8)
23 #define ROT_CONTROL_FLIP_VERTICAL (2 << 6)
24 #define ROT_CONTROL_FLIP_HORIZONTAL (3 << 6)
25 #define ROT_CONTROL_FLIP_MASK (3 << 6)
26 #define ROT_CONTROL_ROT_90 (1 << 4)
27 #define ROT_CONTROL_ROT_180 (2 << 4)
28 #define ROT_CONTROL_ROT_270 (3 << 4)
29 #define ROT_CONTROL_ROT_MASK (3 << 4)
30 #define ROT_CONTROL_START (1 << 0)
31
32
33 #define ROT_STATUS 0x20
34 #define ROT_STATUS_IRQ_PENDING(x) (1 << (x))
35 #define ROT_STATUS_IRQ(x) (((x) >> 8) & 0x3)
36 #define ROT_STATUS_IRQ_VAL_COMPLETE 1
37 #define ROT_STATUS_IRQ_VAL_ILLEGAL 2
38
39
40 #define ROT_SRC_BUF_ADDR(n) (0x30 + ((n) << 2))
41 #define ROT_DST_BUF_ADDR(n) (0x50 + ((n) << 2))
42
43
44 #define ROT_SRC_BUF_SIZE 0x3c
45 #define ROT_DST_BUF_SIZE 0x5c
46 #define ROT_SET_BUF_SIZE_H(x) ((x) << 16)
47 #define ROT_SET_BUF_SIZE_W(x) ((x) << 0)
48 #define ROT_GET_BUF_SIZE_H(x) ((x) >> 16)
49 #define ROT_GET_BUF_SIZE_W(x) ((x) & 0xffff)
50
51
52 #define ROT_SRC_CROP_POS 0x40
53 #define ROT_DST_CROP_POS 0x60
54 #define ROT_CROP_POS_Y(x) ((x) << 16)
55 #define ROT_CROP_POS_X(x) ((x) << 0)
56
57
58 #define ROT_SRC_CROP_SIZE 0x44
59 #define ROT_SRC_CROP_SIZE_H(x) ((x) << 16)
60 #define ROT_SRC_CROP_SIZE_W(x) ((x) << 0)
61
62
63 #define ROT_ALIGN(x, align, mask) (((x) + (1 << ((align) - 1))) & (mask))
64
65 #define ROT_MIN(min, mask) (((min) + ~(mask)) & (mask))
66
67 #define ROT_MAX(max, mask) ((max) & (mask))
68
69 #endif
70