Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/adv7511/ac701/cf_hdmi.h

raw symbols SCIP
1 /***************************************************************************//**
2 * @file cf_hdmi.h
3 ********************************************************************************
4 * Copyright 2013(c) Analog Devices, Inc.
5 *
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * - Neither the name of Analog Devices, Inc. nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 * - The use of this software may or may not infringe the patent rights
20 * of one or more patent holders. This license does not release you
21 * from the requirement that you obtain separate licenses from these
22 * patent holders to use this software.
23 * - Use of the software either in source or binary form, must be run
24 * on or directly connected to an Analog Devices Inc. component.
25 *
26 * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
27 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
28 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29 * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
30 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
32 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 ********************************************************************************
38 * SVN Revision: $WCREV$
39 *******************************************************************************/
40
41 #ifndef CF_HDMI_H_
42 #define CF_HDMI_H_
43
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 #include "xparameters.h"
48
49 /******************************************************************************/
50 /************************** Macros Definitions ********************************/
51 /******************************************************************************/
52 #ifdef XPAR_AXI_CLKGEN_0_BASEADDR
53 #define CF_CLKGEN_BASEADDR XPAR_AXI_CLKGEN_0_BASEADDR
54 #else
55 #define CF_CLKGEN_BASEADDR XPAR_AXI_HDMI_CLKGEN_BASEADDR
56 #endif
57 #ifdef XPAR_AXI_HDMI_TX_0_BASEADDR
58 #define CFV_BASEADDR XPAR_AXI_HDMI_TX_0_BASEADDR
59 #else
60 #define CFV_BASEADDR XPAR_AXI_HDMI_CORE_BASEADDR
61 #endif
62 #ifdef XPAR_AXI_SPDIF_TX_0_BASEADDR
63 #define CFA_BASEADDR XPAR_AXI_SPDIF_TX_0_BASEADDR
64 #else
65 #define CFA_BASEADDR XPAR_AXI_SPDIF_TX_CORE_BASEADDR
66 #endif
67 #ifdef XPAR_DDR3_SDRAM_S_AXI_BASEADDR
68 #define DDR_BASEADDR XPAR_DDR3_SDRAM_S_AXI_BASEADDR
69 #else
70 #define DDR_BASEADDR XPAR_AXI_DDR_CNTRL_BASEADDR
71 #endif
72 #ifdef XPAR_RS232_UART_1_BASEADDR
73 #define UART_BASEADDR XPAR_RS232_UART_1_BASEADDR
74 #else
75 #define UART_BASEADDR XPAR_AXI_UART_BASEADDR
76 #endif
77 #ifdef XPAR_AXI_VDMA_0_BASEADDR
78 #define VDMA_BASEADDR XPAR_AXI_VDMA_0_BASEADDR
79 #else
80 #define VDMA_BASEADDR XPAR_AXI_HDMI_DMA_BASEADDR
81 #endif
82 #ifdef XPAR_AXI_DMA_0_BASEADDR
83 #define ADMA_BASEADDR XPAR_AXI_DMA_0_BASEADDR
84 #else
85 #define ADMA_BASEADDR XPAR_AXIDMA_1_BASEADDR
86 #endif
87 #define IIC_BASEADDR XPAR_AXI_IIC_0_BASEADDR
88 #define VIDEO_BASEADDR DDR_BASEADDR + 0x2000000
89 #define AUDIO_BASEADDR DDR_BASEADDR + 0x1000000
90 #define A_SAMPLE_FREQ 48000
91 #define A_FREQ 1400
92 #define AUDIO_LENGTH (A_SAMPLE_FREQ/A_FREQ)
93
94 #define AXI_HDMI_REG_RESET 0x040
95 #define AXI_HDMI_REG_CTRL 0x044
96 #define AXI_HDMI_REG_SOURCE_SEL 0x048
97 #define AXI_HDMI_REG_COLORPATTERN 0x04c
98 #define AXI_HDMI_REG_STATUS 0x05c
99 #define AXI_HDMI_REG_VDMA_STATUS 0x060
100 #define AXI_HDMI_REG_TPM_STATUS 0x064
101 #define AXI_HDMI_REG_HTIMING1 0x400
102 #define AXI_HDMI_REG_HTIMING2 0x404
103 #define AXI_HDMI_REG_HTIMING3 0x408
104 #define AXI_HDMI_REG_VTIMING1 0x440
105 #define AXI_HDMI_REG_VTIMING2 0x444
106 #define AXI_HDMI_REG_VTIMING3 0x448
107
108 #define AXI_VDMA_REG_DMA_CTRL 0x00
109 #define AXI_VDMA_REG_V_SIZE 0x50
110 #define AXI_VDMA_REG_H_SIZE 0x54
111 #define AXI_VDMA_REG_FRMDLY_STRIDE 0x58
112 #define AXI_VDMA_REG_START_1 0x5C
113 #define AXI_VDMA_REG_START_2 0x60
114 #define AXI_VDMA_REG_START_3 0x64
115
116 #define AXI_CLKGEN_V2_REG_RESET 0x40
117 #define AXI_CLKGEN_V2_REG_DRP_CNTRL 0x70
118 #define AXI_CLKGEN_V2_REG_DRP_STATUS 0x74
119
120 #define AXI_CLKGEN_V2_RESET_MMCM_ENABLE (1 << 1)
121 #define AXI_CLKGEN_V2_RESET_ENABLE (1 << 0)
122
123 #define AXI_CLKGEN_V2_DRP_CNTRL_SEL (1 << 29)
124 #define AXI_CLKGEN_V2_DRP_CNTRL_READ (1 << 28)
125 #define AXI_CLKGEN_V2_DRP_STATUS_BUSY (1 << 16)
126
127 #define MMCM_REG_CLKOUT0_1 0x08
128 #define MMCM_REG_CLKOUT0_2 0x09
129 #define MMCM_REG_CLK_FB1 0x14
130 #define MMCM_REG_CLK_FB2 0x15
131 #define MMCM_REG_CLK_DIV 0x16
132 #define MMCM_REG_LOCK1 0x18
133 #define MMCM_REG_LOCK2 0x19
134 #define MMCM_REG_LOCK3 0x1a
135 #define MMCM_REG_FILTER1 0x4e
136 #define MMCM_REG_FILTER2 0x4f
137
138 enum videoResolution
139 {
140 RESOLUTION_640x480,
141 RESOLUTION_800x600,
142 RESOLUTION_1024x768,
143 RESOLUTION_1280x720,
144 RESOLUTION_1360x768,
145 RESOLUTION_1600x900,
146 RESOLUTION_1920x1080
147 };
148
149 /******************************************************************************/
150 /************************ Functions Declarations ******************************/
151 /******************************************************************************/
152 void InitHdmiVideoPcore(unsigned short horizontalActiveTime,
153 unsigned short horizontalBlankingTime,
154 unsigned short horizontalSyncOffset,
155 unsigned short horizontalSyncPulseWidth,
156 unsigned short verticalActiveTime,
157 unsigned short verticalBlankingTime,
158 unsigned short verticalSyncOffset,
159 unsigned short verticalSyncPulseWidth);
160 void SetVideoResolution(unsigned char resolution);
161 void InitHdmiAudioPcore(void);
162 void AudioClick(void);
163 int CLKGEN_SetRate(unsigned long rate,
164 unsigned long parent_rate);
165 unsigned long CLKGEN_GetRate(unsigned long parent_rate);
166
167 #endif /* CF_HDMI_H_ */