1 #ifndef _RK3288_HDMI_HW_H
2 #define _RK3288_HDMI_HW_H
14 #define HDMI_SCL_RATE (100*1000)
16 /*Register and Field Descriptions*/
17 /*Identification Registers*/
18 #define IDENTIFICATION_BASE 0x0000
19 enum IDENTIFICATION_REG{
20 DESIGN_ID = IDENTIFICATION_BASE,
31 #define m_PREPEN (1 << 7)
32 #define m_AUDSPDIF (1 << 5)
33 #define m_AUDI2S (1 << 4)
34 #define m_HDMI14 (1 << 3)
35 #define m_CSC (1 << 2)
36 #define m_CEC (1 << 1)
37 #define m_HDCP (1 << 0)
40 #define m_HDMI20 (1 << 5)
41 #define m_CONFAPB (1 << 1)
46 MHL_WITH_HEAC_PHY = 0xb2,
48 HDMI_3D_TX_WITH_HEAC_PHY = 0xe2,
53 #define m_AHB_AUD_DMA (1 << 1)
54 #define m_GP_AUD (1 << 0)
57 /*Interrupt Registers*/
58 #define INTERRUPT_BASE 0x0100
60 IH_FC_STAT0 = INTERRUPT_BASE,
71 IH_MUTE_FC_STAT0 = 0x0180,
79 IH_MUTE_I2CMPHY_STAT0,
80 IH_MUTE_AHBDMAAUD_STAT0,
85 #define m_AUD_INFOFRAME (1 << 7)
86 #define m_AUD_CONTENT_PROTECT (1 << 6)
87 #define m_AUD_HBR (1 << 5)
88 #define m_AUD_SAMPLE (1 << 2)
89 #define m_AUD_CLK_REGEN (1 << 1)
90 #define m_NULL_PACKET (1 << 0)
93 #define m_GMD (1 << 7)
94 #define m_ISCR1 (1 << 6)
95 #define m_ISCR2 (1 << 5)
96 #define m_VSD (1 << 4)
97 #define m_SPD (1 << 3)
98 #define m_AVI_INFOFRAME (1 << 1)
99 #define m_GCP (1 << 0)
102 #define m_LOWPRIO_OVERFLOW (1 << 1)
103 #define m_HIGHPRIO_OVERFLOW (1 << 0)
106 #define m_FIFO_UNDERRUN (1 << 4)
107 #define m_FIFO_OVERRUN (1 << 3)
108 #define m_AUD_FIFO_UDFLOW_THR (1 << 2)
109 #define m_AUD_FIFO_UDFLOW (1 << 1)
110 #define m_AUD_FIFO_OVERFLOW (1 << 0)
113 #define m_RX_SENSE3 (1 << 5)
114 #define m_RX_SENSE2 (1 << 4)
115 #define m_RX_SENSE1 (1 << 3)
116 #define m_RX_SENSE0 (1 << 2)
117 #define m_TX_PHY_LOCK (1 << 1)
118 #define m_HPD (1 << 0)
121 #define m_SCDC_READREQ (1 << 2)
122 #define m_I2CM_DONE (1 << 1)
123 #define m_I2CM_ERROR (1 << 0)
126 #define m_WAKEUP (1 << 6)
127 #define m_ERR_FOLLOW (1 << 5)
128 #define m_ERR_INITIATOR (1 << 4)
129 #define m_ARB_LOST (1 << 3)
130 #define m_NACK (1 << 2)
131 #define m_EOM (1 << 1)
132 #define m_DONE (1 << 0)
135 #define m_FIFOFULL_REPET (1 << 7)
136 #define m_FIFOEMPTY_REPET (1 << 6)
137 #define m_FIFOFULL_PACK (1 << 5)
138 #define m_FIFOEMPTY_PACK (1 << 4)
139 #define m_FIFOFULL_REMAP (1 << 3)
140 #define m_FIFOEMPTY_REMAP (1 << 2)
141 #define m_FIFOFULL_BYPASS (1 << 1)
142 #define m_FIFOEMPTY_BYPASS (1 << 0)
145 #define m_I2CMPHY_DONE (1 << 1)
146 #define m_I2CMPHY_ERR (1 << 0)
149 #define m_AUDDMA_INT_BUFOVERRUN (1 << 6)
150 #define m_AUDDMA_INT_ERR (1 << 5)
151 #define m_AUDDMA_INT_LOST (1 << 4)
152 #define m_AUDDMA_INT_RETRYSPLIT (1 << 3)
153 #define m_AUDDMA_INT_DONE (1 << 2)
154 #define m_AUDDMA_INT_BUFFULL (1 << 1)
155 #define m_AUDDMA_INT_BUFEMPTY (1 << 0)
158 #define m_IH_FC_STAT0 (1 << 7)
159 #define m_IH_FC_STAT1 (1 << 6)
160 #define m_IH_FC_STAT2_VP (1 << 5)
161 #define m_IH_AS_STAT0 (1 << 4)
162 #define m_IH_PHY (1 << 3)
163 #define m_IH_I2CM_STAT0 (1 << 2)
164 #define m_IH_CEC_STAT0 (1 << 1)
165 #define m_IH_AHBDMAAUD_STAT0 (1 << 0)
168 #define m_AUDI_MUTE (1 << 7)
169 #define m_ACP_MUTE (1 << 6)
170 #define m_DST_MUTE (1 << 4)
171 #define m_OBA_MUTE (1 << 3)
172 #define m_AUDS_MUTE (1 << 2)
173 #define m_ACR_MUTE (1 << 1)
174 #define m_NULL_MUTE (1 << 0)
177 #define m_GMD_MUTE (1 << 7)
178 #define m_ISCR1_MUTE (1 << 6)
179 #define m_ISCR2_MUTE (1 << 5)
180 #define m_VSD_MUTE (1 << 4)
181 #define m_SPD_MUTE (1 << 3)
182 #define m_AVI_MUTE (1 << 1)
183 #define m_GCP_MUTE (1 << 0)
187 /*Video Sampler Registers*/
188 #define VIDEO_SAMPLER_BASE 0x0200
190 TX_INVID0 = VIDEO_SAMPLER_BASE,
200 /*Video Packetizer Registers*/
201 #define VIDEO_PACKETIZER_BASE 0x0800
203 VP_STATUS = VIDEO_PACKETIZER_BASE,
211 /*Frame Composer Registers*/
212 #define FRAME_COMPOSER_BASE 0x1000
214 FC_INVIDCONF = FRAME_COMPOSER_BASE,
259 FC_VSDPAYLOAD0 = 0x1032, //0~23
260 FC_SPDVENDORNAME0 = 0x104a, //0~7
261 FC_SPDPRODUCTNAME0 = 0x1052, //0~15
262 FC_SPDDEVICEINF = 0x1062,
268 FC_CTRLQHIGH = 0x1073,
271 FC_ACP16 = 0x1082, //16~1
274 FC_ISCR2_15 = 0x10a3, //15~0
275 FC_DATAUTO0 = 0x10B3,
299 FC_DBGFORCE = 0x1200,
300 FC_DBGAUD0CH0, //aud0~aud2 ch0
301 FC_DBGAUD0CH1 = 0x1204, //aud0~aud2 ch1
302 FC_DBGAUD0CH2 = 0x1207, //aud0~aud2 ch2
303 FC_DBGAUD0CH3 = 0x120a, //aud0~aud2 ch3
304 FC_DBGAUD0CH4 = 0x120d, //aud0~aud2 ch4
305 FC_DBGAUD0CH5 = 0x1210, //aud0~aud2 ch5
306 FC_DBGAUD0CH6 = 0x1213, //aud0~aud2 ch6
307 FC_DBGAUD0CH7 = 0x1216, //aud0~aud2 ch7
308 FC_DBGTMDS0 = 0x1219,
313 /*HDMI Source PHY Registers*/
314 #define HDMI_SOURCE_PHY_BASE 0x3000
316 PHY_CONF0 = HDMI_SOURCE_PHY_BASE,
331 /*I2C Master PHY Registers*/
332 #define I2C_MASTER_PHY_BASE 0x3020
334 PHY_I2CM_SLAVE = I2C_MASTER_PHY_BASE,
345 PHY_I2CM_SS_SCL_HCNT_1_ADDR,
346 PHY_I2CM_SS_SCL_HCNT_0_ADDR,
347 PHY_I2CM_SS_SCL_LCNT_1_ADDR,
348 PHY_I2CM_SS_SCL_LCNT_0_ADDR,
349 PHY_I2CM_FS_SCL_HCNT_1_ADDR,
350 PHY_I2CM_FS_SCL_HCNT_0_ADDR,
351 PHY_I2CM_FS_SCL_LCNT_1_ADDR,
352 PHY_I2CM_FS_SCL_LCNT_0_ADDR,
356 /*Audio Sampler Registers*/
357 #define AUDIO_SAMPLER_BASE 0x3100
359 AUD_CONF0 = AUDIO_SAMPLER_BASE,
377 /*Generic Parallel Audio Interface Registers*/
378 #define GP_AUDIO_INTERFACE_BASE 0x3500
380 GP_CONF0 = GP_AUDIO_INTERFACE_BASE,
386 /*Audio DMA Registers*/
387 #define AUDIO_DMA_BASE 0x3600
389 AHB_DMA_CONF0 = AUDIO_DMA_BASE,
393 AHB_DMA_STRADDR_SET0_0, //0~3
394 AHB_DMA_STPADDR_SET0_0 = 0x3608,//0~3
395 AHB_DMA_BSTADDR0 = 0x360c, //0~3
396 AHB_DMA_MBLENGTH0 = 0x3610, //0~3,
397 AHB_DMA_MASK = 0x3614,
398 AHB_DMA_CONF1 = 0x3616,
399 AHB_DMA_BUFFMASK = 0x3619,
400 AHB_DMA_MASK1 = 0x361b,
403 AHB_DMA_STRADDR_SET1_0 = 0x3620,//0~3
404 AHB_DMA_STPADDR_SET1_0 = 0x3624 //0~3
407 /*Main Controller Registers*/
408 #define MAIN_CONTROLLER_BASE 0X4000
421 /*Color Space Converter Registers*/
422 #define COLOR_SPACE_CONVERTER_BASE 0x4100
424 CSC_CFG = COLOR_SPACE_CONVERTER_BASE,
454 /*HDCP Encryption Engine Registers*/
455 #define HDCP_ENCRYPTION_ENGINE_BASE 0x5000
457 A_HDCPCFG0 = HDCP_ENCRYPTION_ENGINE_BASE,
468 A_COREVERLSB = 0x5014,
471 HDCP_BSTATUS_0 = 0x5020,
482 HDCP_VH = 0x52a5, //0~19
483 HDCP_REVOC_SIZE_0 = 0x52b9,
485 HDCP_REVOC_LIST, //0~5059
488 /*HDCP BKSV Registers*/
489 #define HDCP_BKSV_BASE 0x7800
491 HDCPREG_BKSV0 = HDCP_BKSV_BASE,
498 /*HDCP AN Registers*/
499 #define HDCP_AN_BASE 0x7805
501 HDCPREG_ANCONF = HDCP_AN_BASE,
512 /*Encrypted DPK Embedded Storage Registers*/
513 #define ENCRYPTED_DPK_EMBEDDED_BASE 0x780e
515 HDCPREG_RMCTL = ENCRYPTED_DPK_EMBEDDED_BASE,
528 /*CEC Engine Registers*/
529 #define CEC_ENGINE_BASE 0x7d00
531 CEC_CTRL = CEC_ENGINE_BASE,
537 CEC_TX_DATA0 = 0x7d10, //txdata0~txdata15
538 CEC_RX_DATA0 = 0x7d20, //rxdata0~rxdata15
543 /*I2C Master Registers*/
544 #define I2C_MASTER_BASE 0x7e00
546 I2CM_SLAVE = I2C_MASTER_BASE,
557 I2CM_SS_SCL_HCNT_1_ADDR,
558 I2CM_SS_SCL_HCNT_0_ADDR,
559 I2CM_SS_SCL_LCNT_1_ADDR,
560 I2CM_SS_SCL_LCNT_0_ADDR,
561 I2CM_FS_SCL_HCNT_1_ADDR,
562 I2CM_FS_SCL_HCNT_0_ADDR,
563 I2CM_FS_SCL_LCNT_1_ADDR,
564 I2CM_FS_SCL_LCNT_0_ADDR,
566 I2CM_SCDC_READ_UPDATE,
567 I2CM_READ_BUFF0 = 0x7e20, //buff0~buff7
568 I2CM_SCDC_UPDATE0 = 0x7e30,
575 extern struct hdmi *hdmi;
576 static inline int hdmi_readl(u16 offset, u32 *val)
579 *val = readl_relaxed(hdmi->regbase + (offset) * 0x04);
583 static inline int hdmi_writel(u16 offset, u32 val)
586 writel_relaxed(val, hdmi->regbase + (offset) * 0x04);
590 static inline int hdmi_msk_reg(u16 offset, u32 msk, u32 val)
594 temp = readl_relaxed(hdmi->regbase + (offset) * 0x04) & (0xFF - (msk));
595 writel_relaxed(temp | ( (val) & (msk) ), hdmi->regbase + (offset) * 0x04);
598 static inline void rk3028_hdmi_reset_pclk(void)
600 writel_relaxed(0x00010001,RK2928_CRU_BASE+ 0x128);
602 writel_relaxed(0x00010000, RK2928_CRU_BASE + 0x128);