ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / include / mach / dtv.h
1 /*
2  * arch/arm/mach-tegra/include/mach/dtv.h
3  *
4  * Header file for describing resources of DTV module
5  *
6  * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
7  *
8  * Authors:
9  *     Adam Jiang <chaoj@nvidia.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24  * MA 02110-1301, USA.
25  *
26  */
27
28 #ifndef __DTV_H__
29 #define __DTV_H__
30
31 /* offsets from TEGRA_DTV_BASE */
32 #define DTV_SPI_CONTROL         0x40
33 #define DTV_MODE                0x44
34 #define DTV_CTRL                0x48
35 #define DTV_PACKET_COUNT        0x4c
36 #define DTV_ERROR_COUNT         0x50
37 #define DTV_INTERRUPT_STATUS    0x54
38 #define DTV_STATUS              0x58
39 #define DTV_RX_FIFO             0x5c
40
41 /* DTV_SPI_CONTROL */
42 #define DTV_SPI_CONTROL_ENABLE_DTV  1
43
44 /* DTV_MODE_0 */
45 #define DTV_MODE_BYTE_SWIZZLE_SHIFT 6
46 #define DTV_MODE_BYTE_SWIZZLE       (1 << DTV_MODE_BYTE_SWIZZLE_SHIFT)
47 #define DTV_MODE_BYTE_SWIZZLE_MASK  1
48 #define DTV_MODE_BIT_SWIZZLE_SHIFT  5
49 #define DTV_MODE_BIT_SWIZZLE        (1 << DTV_MODE_BIT_SWIZZLE_SHIFT)
50 #define DTV_MODE_BIT_SWIZZLE_MASK   1
51 #define DTV_MODE_CLK_EDGE_SHIFT     4
52 #define DTV_MODE_CLK_EDGE_MASK      1
53 #define DTV_MODE_CLK_EDGE_NEG       (1 << DTV_MODE_CLK_EDGE_SHIFT)
54 #define DTV_MODE_PRTL_SEL_SHIFT     2
55 #define DTV_MODE_PRTL_SEL_MASK      (0x3 << DTV_MODE_PRTL_SEL_SHIFT)
56 #define DTV_MODE_CLK_MODE_SHIFT     1
57 #define DTV_MODE_CLK_MODE_MASK      (0x1 << DTV_MODE_CLK_MODE_SHIFT)
58 #define DTV_MODE_PRTL_ENABLE        1
59
60 /* DTV_CONTROL_0 */
61 #define DTV_CTRL_FEC_SIZE_SHIFT         24
62 #define DTV_CTRL_FEC_SIZE_MASK          (0x7F << DTV_CTRL_FEC_SIZE_SHIFT)
63 #define DTV_CTRL_BODY_SIZE_SHIFT        16
64 #define DTV_CTRL_BODY_SIZE_MASK         (0xFF << DTV_CTRL_BODY_SIZE_SHIFT)
65 #define DTV_CTRL_FIFO_ATTN_LEVEL_SHIFT  8
66 #define DTV_CTRL_FIFO_ATTN_LEVEL_MASK   (0x1F << DTV_CTRL_FIFO_ATTN_LEVEL_SHIFT)
67 #define DTV_CTRL_FIFO_ATTN_ONE_WORD     (0 << DTV_CTRL_FIFO_ATTN_LEVEL_SHIFT)
68 #define DTV_CTRL_FIFO_ATTN_TWO_WORD     (1 << DTV_CTRL_FIFO_ATTN_LEVEL_SHIFT)
69 #define DTV_CTRL_FIFO_ATTN_THREE_WORD   (2 << DTV_CTRL_FIFO_ATTN_LEVEL_SHIFT)
70 #define DTV_CTRL_FIFO_ATTN_FOUR_WORD    (3 << DTV_CTRL_FIFO_ATTN_LEVEL_SHIFT)
71 #define DTV_CTRL_BODY_VALID_SEL_SHIFT   6
72 #define DTV_CTRL_BODY_VALID_SEL_MASK    (1 << DTV_CTRL_BODY_VALID_SEL_SHIFT)
73 #define DTV_CTRL_START_SEL_SHIFT        4
74 #define DTV_CTRL_START_SEL_MASK         (1 << DTV_CTRL_START_SEL_SHIFT)
75 #define DTV_CTRL_ERROR_POLARITY_SHIFT   2
76 #define DTV_CTRL_ERROR_POLARITY_MASK    (1 << DTV_CTRL_ERROR_POLARITY_SHIFT)
77 #define DTV_CTRL_PSYNC_POLARITY_SHIFT   1
78 #define DTV_CTRL_PSYNC_POLARITY_MASK    (1 << DTV_CTRL_PSYNC_POLARITY_SHIFT)
79 #define DTV_CTRL_VALID_POLARITY_SHIFT   0
80 #define DTV_CTRL_VALID_POLARITY_MASK    (1 << DTV_CTRL_VALID_POLARITY_SHIFT)
81
82 /* DTV_INTERRUPT_STATUS_0 */
83 #define DTV_INTERRUPT_PACKET_UNDERRUN_ERR 8
84 #define DTV_INTERRUPT_BODY_OVERRUN_ERR    4
85 #define DTV_INTERRUPT_BODY_UNDERRUN_ERR   2
86 #define DTV_INTERRUPT_UPSTREAM_ERR        1
87
88 /* DTV_STATUS_0 */
89 #define DTV_STATUS_RXF_UNDERRUN 4
90 #define DTV_STATUS_RXF_EMPTY    2
91 #define DTV_STATUS_RXF_FULL     1
92
93 #endif /* __DTV_H__ */