Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * HDMI driver definition for TI OMAP5 processors.
0004  *
0005  * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
0006  */
0007 
0008 #ifndef _HDMI5_CORE_H_
0009 #define _HDMI5_CORE_H_
0010 
0011 #include "hdmi.h"
0012 
0013 /* HDMI IP Core System */
0014 
0015 /* HDMI Identification */
0016 #define HDMI_CORE_DESIGN_ID         0x00000
0017 #define HDMI_CORE_REVISION_ID           0x00004
0018 #define HDMI_CORE_PRODUCT_ID0           0x00008
0019 #define HDMI_CORE_PRODUCT_ID1           0x0000C
0020 #define HDMI_CORE_CONFIG0_ID            0x00010
0021 #define HDMI_CORE_CONFIG1_ID            0x00014
0022 #define HDMI_CORE_CONFIG2_ID            0x00018
0023 #define HDMI_CORE_CONFIG3_ID            0x0001C
0024 
0025 /* HDMI Interrupt */
0026 #define HDMI_CORE_IH_FC_STAT0           0x00400
0027 #define HDMI_CORE_IH_FC_STAT1           0x00404
0028 #define HDMI_CORE_IH_FC_STAT2           0x00408
0029 #define HDMI_CORE_IH_AS_STAT0           0x0040C
0030 #define HDMI_CORE_IH_PHY_STAT0          0x00410
0031 #define HDMI_CORE_IH_I2CM_STAT0         0x00414
0032 #define HDMI_CORE_IH_CEC_STAT0          0x00418
0033 #define HDMI_CORE_IH_VP_STAT0           0x0041C
0034 #define HDMI_CORE_IH_I2CMPHY_STAT0      0x00420
0035 #define HDMI_CORE_IH_MUTE           0x007FC
0036 
0037 /* HDMI Video Sampler */
0038 #define HDMI_CORE_TX_INVID0         0x00800
0039 #define HDMI_CORE_TX_INSTUFFING         0x00804
0040 #define HDMI_CORE_TX_RGYDATA0           0x00808
0041 #define HDMI_CORE_TX_RGYDATA1           0x0080C
0042 #define HDMI_CORE_TX_RCRDATA0           0x00810
0043 #define HDMI_CORE_TX_RCRDATA1           0x00814
0044 #define HDMI_CORE_TX_BCBDATA0           0x00818
0045 #define HDMI_CORE_TX_BCBDATA1           0x0081C
0046 
0047 /* HDMI Video Packetizer */
0048 #define HDMI_CORE_VP_STATUS         0x02000
0049 #define HDMI_CORE_VP_PR_CD          0x02004
0050 #define HDMI_CORE_VP_STUFF          0x02008
0051 #define HDMI_CORE_VP_REMAP          0x0200C
0052 #define HDMI_CORE_VP_CONF           0x02010
0053 #define HDMI_CORE_VP_STAT           0x02014
0054 #define HDMI_CORE_VP_INT            0x02018
0055 #define HDMI_CORE_VP_MASK           0x0201C
0056 #define HDMI_CORE_VP_POL            0x02020
0057 
0058 /* Frame Composer */
0059 #define HDMI_CORE_FC_INVIDCONF          0x04000
0060 #define HDMI_CORE_FC_INHACTIV0          0x04004
0061 #define HDMI_CORE_FC_INHACTIV1          0x04008
0062 #define HDMI_CORE_FC_INHBLANK0          0x0400C
0063 #define HDMI_CORE_FC_INHBLANK1          0x04010
0064 #define HDMI_CORE_FC_INVACTIV0          0x04014
0065 #define HDMI_CORE_FC_INVACTIV1          0x04018
0066 #define HDMI_CORE_FC_INVBLANK           0x0401C
0067 #define HDMI_CORE_FC_HSYNCINDELAY0      0x04020
0068 #define HDMI_CORE_FC_HSYNCINDELAY1      0x04024
0069 #define HDMI_CORE_FC_HSYNCINWIDTH0      0x04028
0070 #define HDMI_CORE_FC_HSYNCINWIDTH1      0x0402C
0071 #define HDMI_CORE_FC_VSYNCINDELAY       0x04030
0072 #define HDMI_CORE_FC_VSYNCINWIDTH       0x04034
0073 #define HDMI_CORE_FC_INFREQ0            0x04038
0074 #define HDMI_CORE_FC_INFREQ1            0x0403C
0075 #define HDMI_CORE_FC_INFREQ2            0x04040
0076 #define HDMI_CORE_FC_CTRLDUR            0x04044
0077 #define HDMI_CORE_FC_EXCTRLDUR          0x04048
0078 #define HDMI_CORE_FC_EXCTRLSPAC         0x0404C
0079 #define HDMI_CORE_FC_CH0PREAM           0x04050
0080 #define HDMI_CORE_FC_CH1PREAM           0x04054
0081 #define HDMI_CORE_FC_CH2PREAM           0x04058
0082 #define HDMI_CORE_FC_AVICONF3           0x0405C
0083 #define HDMI_CORE_FC_GCP            0x04060
0084 #define HDMI_CORE_FC_AVICONF0           0x04064
0085 #define HDMI_CORE_FC_AVICONF1           0x04068
0086 #define HDMI_CORE_FC_AVICONF2           0x0406C
0087 #define HDMI_CORE_FC_AVIVID         0x04070
0088 #define HDMI_CORE_FC_AVIETB0            0x04074
0089 #define HDMI_CORE_FC_AVIETB1            0x04078
0090 #define HDMI_CORE_FC_AVISBB0            0x0407C
0091 #define HDMI_CORE_FC_AVISBB1            0x04080
0092 #define HDMI_CORE_FC_AVIELB0            0x04084
0093 #define HDMI_CORE_FC_AVIELB1            0x04088
0094 #define HDMI_CORE_FC_AVISRB0            0x0408C
0095 #define HDMI_CORE_FC_AVISRB1            0x04090
0096 #define HDMI_CORE_FC_AUDICONF0          0x04094
0097 #define HDMI_CORE_FC_AUDICONF1          0x04098
0098 #define HDMI_CORE_FC_AUDICONF2          0x0409C
0099 #define HDMI_CORE_FC_AUDICONF3          0x040A0
0100 #define HDMI_CORE_FC_VSDIEEEID0         0x040A4
0101 #define HDMI_CORE_FC_VSDSIZE            0x040A8
0102 #define HDMI_CORE_FC_VSDIEEEID1         0x040C0
0103 #define HDMI_CORE_FC_VSDIEEEID2         0x040C4
0104 #define HDMI_CORE_FC_VSDPAYLOAD(n)      (n * 4 + 0x040C8)
0105 #define HDMI_CORE_FC_SPDVENDORNAME(n)       (n * 4 + 0x04128)
0106 #define HDMI_CORE_FC_SPDPRODUCTNAME(n)      (n * 4 + 0x04148)
0107 #define HDMI_CORE_FC_SPDDEVICEINF       0x04188
0108 #define HDMI_CORE_FC_AUDSCONF           0x0418C
0109 #define HDMI_CORE_FC_AUDSSTAT           0x04190
0110 #define HDMI_CORE_FC_AUDSV          0x04194
0111 #define HDMI_CORE_FC_AUDSU          0x04198
0112 #define HDMI_CORE_FC_AUDSCHNLS(n)       (n * 4 + 0x0419C)
0113 #define HDMI_CORE_FC_CTRLQHIGH          0x041CC
0114 #define HDMI_CORE_FC_CTRLQLOW           0x041D0
0115 #define HDMI_CORE_FC_ACP0           0x041D4
0116 #define HDMI_CORE_FC_ACP(n)         ((16-n) * 4 + 0x04208)
0117 #define HDMI_CORE_FC_ISCR1_0            0x04248
0118 #define HDMI_CORE_FC_ISCR1(n)           ((16-n) * 4 + 0x0424C)
0119 #define HDMI_CORE_FC_ISCR2(n)           ((15-n) * 4 + 0x0428C)
0120 #define HDMI_CORE_FC_DATAUTO0           0x042CC
0121 #define HDMI_CORE_FC_DATAUTO1           0x042D0
0122 #define HDMI_CORE_FC_DATAUTO2           0x042D4
0123 #define HDMI_CORE_FC_DATMAN         0x042D8
0124 #define HDMI_CORE_FC_DATAUTO3           0x042DC
0125 #define HDMI_CORE_FC_RDRB(n)            (n * 4 + 0x042E0)
0126 #define HDMI_CORE_FC_STAT0          0x04340
0127 #define HDMI_CORE_FC_INT0           0x04344
0128 #define HDMI_CORE_FC_MASK0          0x04348
0129 #define HDMI_CORE_FC_POL0           0x0434C
0130 #define HDMI_CORE_FC_STAT1          0x04350
0131 #define HDMI_CORE_FC_INT1           0x04354
0132 #define HDMI_CORE_FC_MASK1          0x04358
0133 #define HDMI_CORE_FC_POL1           0x0435C
0134 #define HDMI_CORE_FC_STAT2          0x04360
0135 #define HDMI_CORE_FC_INT2           0x04364
0136 #define HDMI_CORE_FC_MASK2          0x04368
0137 #define HDMI_CORE_FC_POL2           0x0436C
0138 #define HDMI_CORE_FC_PRCONF         0x04380
0139 #define HDMI_CORE_FC_GMD_STAT           0x04400
0140 #define HDMI_CORE_FC_GMD_EN         0x04404
0141 #define HDMI_CORE_FC_GMD_UP         0x04408
0142 #define HDMI_CORE_FC_GMD_CONF           0x0440C
0143 #define HDMI_CORE_FC_GMD_HB         0x04410
0144 #define HDMI_CORE_FC_GMD_PB(n)          (n * 4 + 0x04414)
0145 #define HDMI_CORE_FC_DBGFORCE           0x04800
0146 #define HDMI_CORE_FC_DBGAUD0CH0         0x04804
0147 #define HDMI_CORE_FC_DBGAUD1CH0         0x04808
0148 #define HDMI_CORE_FC_DBGAUD2CH0         0x0480C
0149 #define HDMI_CORE_FC_DBGAUD0CH1         0x04810
0150 #define HDMI_CORE_FC_DBGAUD1CH1         0x04814
0151 #define HDMI_CORE_FC_DBGAUD2CH1         0x04818
0152 #define HDMI_CORE_FC_DBGAUD0CH2         0x0481C
0153 #define HDMI_CORE_FC_DBGAUD1CH2         0x04820
0154 #define HDMI_CORE_FC_DBGAUD2CH2         0x04824
0155 #define HDMI_CORE_FC_DBGAUD0CH3         0x04828
0156 #define HDMI_CORE_FC_DBGAUD1CH3         0x0482C
0157 #define HDMI_CORE_FC_DBGAUD2CH3         0x04830
0158 #define HDMI_CORE_FC_DBGAUD0CH4         0x04834
0159 #define HDMI_CORE_FC_DBGAUD1CH4         0x04838
0160 #define HDMI_CORE_FC_DBGAUD2CH4         0x0483C
0161 #define HDMI_CORE_FC_DBGAUD0CH5         0x04840
0162 #define HDMI_CORE_FC_DBGAUD1CH5         0x04844
0163 #define HDMI_CORE_FC_DBGAUD2CH5         0x04848
0164 #define HDMI_CORE_FC_DBGAUD0CH6         0x0484C
0165 #define HDMI_CORE_FC_DBGAUD1CH6         0x04850
0166 #define HDMI_CORE_FC_DBGAUD2CH6         0x04854
0167 #define HDMI_CORE_FC_DBGAUD0CH7         0x04858
0168 #define HDMI_CORE_FC_DBGAUD1CH7         0x0485C
0169 #define HDMI_CORE_FC_DBGAUD2CH7         0x04860
0170 #define HDMI_CORE_FC_DBGTMDS0           0x04864
0171 #define HDMI_CORE_FC_DBGTMDS1           0x04868
0172 #define HDMI_CORE_FC_DBGTMDS2           0x0486C
0173 #define HDMI_CORE_PHY_MASK0         0x0C018
0174 #define HDMI_CORE_PHY_I2CM_INT_ADDR     0x0C09C
0175 #define HDMI_CORE_PHY_I2CM_CTLINT_ADDR      0x0C0A0
0176 
0177 /* HDMI Audio */
0178 #define HDMI_CORE_AUD_CONF0         0x0C400
0179 #define HDMI_CORE_AUD_CONF1         0x0C404
0180 #define HDMI_CORE_AUD_INT           0x0C408
0181 #define HDMI_CORE_AUD_N1            0x0C800
0182 #define HDMI_CORE_AUD_N2            0x0C804
0183 #define HDMI_CORE_AUD_N3            0x0C808
0184 #define HDMI_CORE_AUD_CTS1          0x0C80C
0185 #define HDMI_CORE_AUD_CTS2          0x0C810
0186 #define HDMI_CORE_AUD_CTS3          0x0C814
0187 #define HDMI_CORE_AUD_INCLKFS           0x0C818
0188 #define HDMI_CORE_AUD_CC08          0x0CC08
0189 #define HDMI_CORE_AUD_GP_CONF0          0x0D400
0190 #define HDMI_CORE_AUD_GP_CONF1          0x0D404
0191 #define HDMI_CORE_AUD_GP_CONF2          0x0D408
0192 #define HDMI_CORE_AUD_D010          0x0D010
0193 #define HDMI_CORE_AUD_GP_STAT           0x0D40C
0194 #define HDMI_CORE_AUD_GP_INT            0x0D410
0195 #define HDMI_CORE_AUD_GP_POL            0x0D414
0196 #define HDMI_CORE_AUD_GP_MASK           0x0D418
0197 
0198 /* HDMI Main Controller */
0199 #define HDMI_CORE_MC_CLKDIS         0x10004
0200 #define HDMI_CORE_MC_SWRSTZREQ          0x10008
0201 #define HDMI_CORE_MC_FLOWCTRL           0x10010
0202 #define HDMI_CORE_MC_PHYRSTZ            0x10014
0203 #define HDMI_CORE_MC_LOCKONCLOCK        0x10018
0204 
0205 /* HDMI COLOR SPACE CONVERTER */
0206 #define HDMI_CORE_CSC_CFG           0x10400
0207 #define HDMI_CORE_CSC_SCALE         0x10404
0208 #define HDMI_CORE_CSC_COEF_A1_MSB       0x10408
0209 #define HDMI_CORE_CSC_COEF_A1_LSB       0x1040C
0210 #define HDMI_CORE_CSC_COEF_A2_MSB       0x10410
0211 #define HDMI_CORE_CSC_COEF_A2_LSB       0x10414
0212 #define HDMI_CORE_CSC_COEF_A3_MSB       0x10418
0213 #define HDMI_CORE_CSC_COEF_A3_LSB       0x1041C
0214 #define HDMI_CORE_CSC_COEF_A4_MSB       0x10420
0215 #define HDMI_CORE_CSC_COEF_A4_LSB       0x10424
0216 #define HDMI_CORE_CSC_COEF_B1_MSB       0x10428
0217 #define HDMI_CORE_CSC_COEF_B1_LSB       0x1042C
0218 #define HDMI_CORE_CSC_COEF_B2_MSB       0x10430
0219 #define HDMI_CORE_CSC_COEF_B2_LSB       0x10434
0220 #define HDMI_CORE_CSC_COEF_B3_MSB       0x10438
0221 #define HDMI_CORE_CSC_COEF_B3_LSB       0x1043C
0222 #define HDMI_CORE_CSC_COEF_B4_MSB       0x10440
0223 #define HDMI_CORE_CSC_COEF_B4_LSB       0x10444
0224 #define HDMI_CORE_CSC_COEF_C1_MSB       0x10448
0225 #define HDMI_CORE_CSC_COEF_C1_LSB       0x1044C
0226 #define HDMI_CORE_CSC_COEF_C2_MSB       0x10450
0227 #define HDMI_CORE_CSC_COEF_C2_LSB       0x10454
0228 #define HDMI_CORE_CSC_COEF_C3_MSB       0x10458
0229 #define HDMI_CORE_CSC_COEF_C3_LSB       0x1045C
0230 #define HDMI_CORE_CSC_COEF_C4_MSB       0x10460
0231 #define HDMI_CORE_CSC_COEF_C4_LSB       0x10464
0232 
0233 /* HDMI HDCP */
0234 #define HDMI_CORE_HDCP_MASK         0x14020
0235 
0236 /* HDMI CEC */
0237 #define HDMI_CORE_CEC_MASK          0x17408
0238 
0239 /* HDMI I2C Master */
0240 #define HDMI_CORE_I2CM_SLAVE            0x157C8
0241 #define HDMI_CORE_I2CM_ADDRESS          0x157CC
0242 #define HDMI_CORE_I2CM_DATAO            0x157D0
0243 #define HDMI_CORE_I2CM_DATAI            0X157D4
0244 #define HDMI_CORE_I2CM_OPERATION        0x157D8
0245 #define HDMI_CORE_I2CM_INT          0x157DC
0246 #define HDMI_CORE_I2CM_CTLINT           0x157E0
0247 #define HDMI_CORE_I2CM_DIV          0x157E4
0248 #define HDMI_CORE_I2CM_SEGADDR          0x157E8
0249 #define HDMI_CORE_I2CM_SOFTRSTZ         0x157EC
0250 #define HDMI_CORE_I2CM_SEGPTR           0x157F0
0251 #define HDMI_CORE_I2CM_SS_SCL_HCNT_1_ADDR   0x157F4
0252 #define HDMI_CORE_I2CM_SS_SCL_HCNT_0_ADDR   0x157F8
0253 #define HDMI_CORE_I2CM_SS_SCL_LCNT_1_ADDR   0x157FC
0254 #define HDMI_CORE_I2CM_SS_SCL_LCNT_0_ADDR   0x15800
0255 #define HDMI_CORE_I2CM_FS_SCL_HCNT_1_ADDR   0x15804
0256 #define HDMI_CORE_I2CM_FS_SCL_HCNT_0_ADDR   0x15808
0257 #define HDMI_CORE_I2CM_FS_SCL_LCNT_1_ADDR   0x1580C
0258 #define HDMI_CORE_I2CM_FS_SCL_LCNT_0_ADDR   0x15810
0259 #define HDMI_CORE_I2CM_SDA_HOLD_ADDR        0x15814
0260 
0261 enum hdmi_core_packet_mode {
0262     HDMI_PACKETMODERESERVEDVALUE = 0,
0263     HDMI_PACKETMODE24BITPERPIXEL = 4,
0264     HDMI_PACKETMODE30BITPERPIXEL = 5,
0265     HDMI_PACKETMODE36BITPERPIXEL = 6,
0266     HDMI_PACKETMODE48BITPERPIXEL = 7,
0267 };
0268 
0269 struct hdmi_core_vid_config {
0270     struct hdmi_config v_fc_config;
0271     enum hdmi_core_packet_mode packet_mode;
0272     int data_enable_pol;
0273     int vblank_osc;
0274     int hblank;
0275     int vblank;
0276 };
0277 
0278 struct csc_table {
0279     u16 a1, a2, a3, a4;
0280     u16 b1, b2, b3, b4;
0281     u16 c1, c2, c3, c4;
0282 };
0283 
0284 int hdmi5_read_edid(struct hdmi_core_data *core, u8 *edid, int len);
0285 void hdmi5_core_dump(struct hdmi_core_data *core, struct seq_file *s);
0286 int hdmi5_core_handle_irqs(struct hdmi_core_data *core);
0287 void hdmi5_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
0288             struct hdmi_config *cfg);
0289 int hdmi5_core_init(struct platform_device *pdev, struct hdmi_core_data *core);
0290 
0291 int hdmi5_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
0292             struct omap_dss_audio *audio, u32 pclk);
0293 #endif