Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/adv7511/zed/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 #define DDR_BASEADDR XPAR_DDR_MEM_BASEADDR
68 #define UART_BASEADDR XPS_UART1_BASEADDR
69 #ifdef XPAR_AXI_VDMA_0_BASEADDR
70 #define VDMA_BASEADDR XPAR_AXI_VDMA_0_BASEADDR
71 #else
72 #define VDMA_BASEADDR XPAR_AXI_HDMI_DMA_BASEADDR
73 #endif
74 #define ADMA_DEVICE_ID XPAR_XDMAPS_1_DEVICE_ID
75 #define IIC_BASEADDR XPS_I2C0_BASEADDR
76 #define VIDEO_BASEADDR DDR_BASEADDR + 0x2000000
77 #define AUDIO_BASEADDR DDR_BASEADDR + 0x1000000
78 #define A_SAMPLE_FREQ 48000
79 #define A_FREQ 1400
80 #define AUDIO_LENGTH (A_SAMPLE_FREQ/A_FREQ)
81
82 #define AXI_HDMI_REG_RESET 0x040
83 #define AXI_HDMI_REG_CTRL 0x044
84 #define AXI_HDMI_REG_SOURCE_SEL 0x048
85 #define AXI_HDMI_REG_COLORPATTERN 0x04c
86 #define AXI_HDMI_REG_STATUS 0x05c
87 #define AXI_HDMI_REG_VDMA_STATUS 0x060
88 #define AXI_HDMI_REG_TPM_STATUS 0x064
89 #define AXI_HDMI_REG_HTIMING1 0x400
90 #define AXI_HDMI_REG_HTIMING2 0x404
91 #define AXI_HDMI_REG_HTIMING3 0x408
92 #define AXI_HDMI_REG_VTIMING1 0x440
93 #define AXI_HDMI_REG_VTIMING2 0x444
94 #define AXI_HDMI_REG_VTIMING3 0x448
95
96 #define AXI_VDMA_REG_DMA_CTRL 0x00
97 #define AXI_VDMA_REG_V_SIZE 0x50
98 #define AXI_VDMA_REG_H_SIZE 0x54
99 #define AXI_VDMA_REG_FRMDLY_STRIDE 0x58
100 #define AXI_VDMA_REG_START_1 0x5C
101 #define AXI_VDMA_REG_START_2 0x60
102 #define AXI_VDMA_REG_START_3 0x64
103
104 #define AXI_CLKGEN_V2_REG_RESET 0x40
105 #define AXI_CLKGEN_V2_REG_DRP_CNTRL 0x70
106 #define AXI_CLKGEN_V2_REG_DRP_STATUS 0x74
107
108 #define AXI_CLKGEN_V2_RESET_MMCM_ENABLE (1 << 1)
109 #define AXI_CLKGEN_V2_RESET_ENABLE (1 << 0)
110
111 #define AXI_CLKGEN_V2_DRP_CNTRL_SEL (1 << 29)
112 #define AXI_CLKGEN_V2_DRP_CNTRL_READ (1 << 28)
113 #define AXI_CLKGEN_V2_DRP_STATUS_BUSY (1 << 16)
114
115 #define MMCM_REG_CLKOUT0_1 0x08
116 #define MMCM_REG_CLKOUT0_2 0x09
117 #define MMCM_REG_CLK_FB1 0x14
118 #define MMCM_REG_CLK_FB2 0x15
119 #define MMCM_REG_CLK_DIV 0x16
120 #define MMCM_REG_LOCK1 0x18
121 #define MMCM_REG_LOCK2 0x19
122 #define MMCM_REG_LOCK3 0x1a
123 #define MMCM_REG_FILTER1 0x4e
124 #define MMCM_REG_FILTER2 0x4f
125
126 enum videoResolution
127 {
128 RESOLUTION_640x480,
129 RESOLUTION_800x600,
130 RESOLUTION_1024x768,
131 RESOLUTION_1280x720,
132 RESOLUTION_1360x768,
133 RESOLUTION_1600x900,
134 RESOLUTION_1920x1080
135 };
136
137 /******************************************************************************/
138 /************************ Functions Declarations ******************************/
139 /******************************************************************************/
140 void InitHdmiVideoPcore(unsigned short horizontalActiveTime,
141 unsigned short horizontalBlankingTime,
142 unsigned short horizontalSyncOffset,
143 unsigned short horizontalSyncPulseWidth,
144 unsigned short verticalActiveTime,
145 unsigned short verticalBlankingTime,
146 unsigned short verticalSyncOffset,
147 unsigned short verticalSyncPulseWidth);
148 void SetVideoResolution(unsigned char resolution);
149 void InitHdmiAudioPcore(void);
150 void AudioClick(void);
151 int CLKGEN_SetRate(unsigned long rate,
152 unsigned long parent_rate);
153 unsigned long CLKGEN_GetRate(unsigned long parent_rate);
154
155 #endif /* CF_HDMI_H_ */