Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * HDMI header definition for OMAP4 HDMI core IP
0004  *
0005  * Copyright (C) 2010-2011 Texas Instruments Incorporated - https://www.ti.com/
0006  */
0007 
0008 #ifndef _HDMI4_CORE_H_
0009 #define _HDMI4_CORE_H_
0010 
0011 #include "hdmi.h"
0012 
0013 /* OMAP4 HDMI IP Core System */
0014 
0015 #define HDMI_CORE_SYS_VND_IDL           0x0
0016 #define HDMI_CORE_SYS_DEV_IDL           0x8
0017 #define HDMI_CORE_SYS_DEV_IDH           0xC
0018 #define HDMI_CORE_SYS_DEV_REV           0x10
0019 #define HDMI_CORE_SYS_SRST          0x14
0020 #define HDMI_CORE_SYS_SYS_CTRL1         0x20
0021 #define HDMI_CORE_SYS_SYS_STAT          0x24
0022 #define HDMI_CORE_SYS_SYS_CTRL3         0x28
0023 #define HDMI_CORE_SYS_DCTL          0x34
0024 #define HDMI_CORE_SYS_DE_DLY            0xC8
0025 #define HDMI_CORE_SYS_DE_CTRL           0xCC
0026 #define HDMI_CORE_SYS_DE_TOP            0xD0
0027 #define HDMI_CORE_SYS_DE_CNTL           0xD8
0028 #define HDMI_CORE_SYS_DE_CNTH           0xDC
0029 #define HDMI_CORE_SYS_DE_LINL           0xE0
0030 #define HDMI_CORE_SYS_DE_LINH_1         0xE4
0031 #define HDMI_CORE_SYS_HRES_L            0xE8
0032 #define HDMI_CORE_SYS_HRES_H            0xEC
0033 #define HDMI_CORE_SYS_VRES_L            0xF0
0034 #define HDMI_CORE_SYS_VRES_H            0xF4
0035 #define HDMI_CORE_SYS_IADJUST           0xF8
0036 #define HDMI_CORE_SYS_POLDETECT         0xFC
0037 #define HDMI_CORE_SYS_HWIDTH1           0x110
0038 #define HDMI_CORE_SYS_HWIDTH2           0x114
0039 #define HDMI_CORE_SYS_VWIDTH            0x11C
0040 #define HDMI_CORE_SYS_VID_CTRL          0x120
0041 #define HDMI_CORE_SYS_VID_ACEN          0x124
0042 #define HDMI_CORE_SYS_VID_MODE          0x128
0043 #define HDMI_CORE_SYS_VID_BLANK1        0x12C
0044 #define HDMI_CORE_SYS_VID_BLANK2        0x130
0045 #define HDMI_CORE_SYS_VID_BLANK3        0x134
0046 #define HDMI_CORE_SYS_DC_HEADER         0x138
0047 #define HDMI_CORE_SYS_VID_DITHER        0x13C
0048 #define HDMI_CORE_SYS_RGB2XVYCC_CT      0x140
0049 #define HDMI_CORE_SYS_R2Y_COEFF_LOW     0x144
0050 #define HDMI_CORE_SYS_R2Y_COEFF_UP      0x148
0051 #define HDMI_CORE_SYS_G2Y_COEFF_LOW     0x14C
0052 #define HDMI_CORE_SYS_G2Y_COEFF_UP      0x150
0053 #define HDMI_CORE_SYS_B2Y_COEFF_LOW     0x154
0054 #define HDMI_CORE_SYS_B2Y_COEFF_UP      0x158
0055 #define HDMI_CORE_SYS_R2CB_COEFF_LOW        0x15C
0056 #define HDMI_CORE_SYS_R2CB_COEFF_UP     0x160
0057 #define HDMI_CORE_SYS_G2CB_COEFF_LOW        0x164
0058 #define HDMI_CORE_SYS_G2CB_COEFF_UP     0x168
0059 #define HDMI_CORE_SYS_B2CB_COEFF_LOW        0x16C
0060 #define HDMI_CORE_SYS_B2CB_COEFF_UP     0x170
0061 #define HDMI_CORE_SYS_R2CR_COEFF_LOW        0x174
0062 #define HDMI_CORE_SYS_R2CR_COEFF_UP     0x178
0063 #define HDMI_CORE_SYS_G2CR_COEFF_LOW        0x17C
0064 #define HDMI_CORE_SYS_G2CR_COEFF_UP     0x180
0065 #define HDMI_CORE_SYS_B2CR_COEFF_LOW        0x184
0066 #define HDMI_CORE_SYS_B2CR_COEFF_UP     0x188
0067 #define HDMI_CORE_SYS_RGB_OFFSET_LOW        0x18C
0068 #define HDMI_CORE_SYS_RGB_OFFSET_UP     0x190
0069 #define HDMI_CORE_SYS_Y_OFFSET_LOW      0x194
0070 #define HDMI_CORE_SYS_Y_OFFSET_UP       0x198
0071 #define HDMI_CORE_SYS_CBCR_OFFSET_LOW       0x19C
0072 #define HDMI_CORE_SYS_CBCR_OFFSET_UP        0x1A0
0073 #define HDMI_CORE_SYS_INTR_STATE        0x1C0
0074 #define HDMI_CORE_SYS_INTR1         0x1C4
0075 #define HDMI_CORE_SYS_INTR2         0x1C8
0076 #define HDMI_CORE_SYS_INTR3         0x1CC
0077 #define HDMI_CORE_SYS_INTR4         0x1D0
0078 #define HDMI_CORE_SYS_INTR_UNMASK1      0x1D4
0079 #define HDMI_CORE_SYS_INTR_UNMASK2      0x1D8
0080 #define HDMI_CORE_SYS_INTR_UNMASK3      0x1DC
0081 #define HDMI_CORE_SYS_INTR_UNMASK4      0x1E0
0082 #define HDMI_CORE_SYS_INTR_CTRL         0x1E4
0083 #define HDMI_CORE_SYS_TMDS_CTRL         0x208
0084 
0085 /* value definitions for HDMI_CORE_SYS_SYS_CTRL1 fields */
0086 #define HDMI_CORE_SYS_SYS_CTRL1_VEN_FOLLOWVSYNC 0x1
0087 #define HDMI_CORE_SYS_SYS_CTRL1_HEN_FOLLOWHSYNC 0x1
0088 #define HDMI_CORE_SYS_SYS_CTRL1_BSEL_24BITBUS   0x1
0089 #define HDMI_CORE_SYS_SYS_CTRL1_EDGE_RISINGEDGE 0x1
0090 
0091 /* HDMI DDC E-DID */
0092 #define HDMI_CORE_DDC_ADDR          0x3B4
0093 #define HDMI_CORE_DDC_SEGM          0x3B8
0094 #define HDMI_CORE_DDC_OFFSET            0x3BC
0095 #define HDMI_CORE_DDC_COUNT1            0x3C0
0096 #define HDMI_CORE_DDC_COUNT2            0x3C4
0097 #define HDMI_CORE_DDC_STATUS            0x3C8
0098 #define HDMI_CORE_DDC_CMD           0x3CC
0099 #define HDMI_CORE_DDC_DATA          0x3D0
0100 
0101 /* HDMI IP Core Audio Video */
0102 
0103 #define HDMI_CORE_AV_ACR_CTRL           0x4
0104 #define HDMI_CORE_AV_FREQ_SVAL          0x8
0105 #define HDMI_CORE_AV_N_SVAL1            0xC
0106 #define HDMI_CORE_AV_N_SVAL2            0x10
0107 #define HDMI_CORE_AV_N_SVAL3            0x14
0108 #define HDMI_CORE_AV_CTS_SVAL1          0x18
0109 #define HDMI_CORE_AV_CTS_SVAL2          0x1C
0110 #define HDMI_CORE_AV_CTS_SVAL3          0x20
0111 #define HDMI_CORE_AV_CTS_HVAL1          0x24
0112 #define HDMI_CORE_AV_CTS_HVAL2          0x28
0113 #define HDMI_CORE_AV_CTS_HVAL3          0x2C
0114 #define HDMI_CORE_AV_AUD_MODE           0x50
0115 #define HDMI_CORE_AV_SPDIF_CTRL         0x54
0116 #define HDMI_CORE_AV_HW_SPDIF_FS        0x60
0117 #define HDMI_CORE_AV_SWAP_I2S           0x64
0118 #define HDMI_CORE_AV_SPDIF_ERTH         0x6C
0119 #define HDMI_CORE_AV_I2S_IN_MAP         0x70
0120 #define HDMI_CORE_AV_I2S_IN_CTRL        0x74
0121 #define HDMI_CORE_AV_I2S_CHST0          0x78
0122 #define HDMI_CORE_AV_I2S_CHST1          0x7C
0123 #define HDMI_CORE_AV_I2S_CHST2          0x80
0124 #define HDMI_CORE_AV_I2S_CHST4          0x84
0125 #define HDMI_CORE_AV_I2S_CHST5          0x88
0126 #define HDMI_CORE_AV_ASRC           0x8C
0127 #define HDMI_CORE_AV_I2S_IN_LEN         0x90
0128 #define HDMI_CORE_AV_HDMI_CTRL          0xBC
0129 #define HDMI_CORE_AV_AUDO_TXSTAT        0xC0
0130 #define HDMI_CORE_AV_AUD_PAR_BUSCLK_1       0xCC
0131 #define HDMI_CORE_AV_AUD_PAR_BUSCLK_2       0xD0
0132 #define HDMI_CORE_AV_AUD_PAR_BUSCLK_3       0xD4
0133 #define HDMI_CORE_AV_TEST_TXCTRL        0xF0
0134 #define HDMI_CORE_AV_DPD            0xF4
0135 #define HDMI_CORE_AV_PB_CTRL1           0xF8
0136 #define HDMI_CORE_AV_PB_CTRL2           0xFC
0137 #define HDMI_CORE_AV_AVI_BASE           0x100
0138 #define HDMI_CORE_AV_AVI_TYPE           0x100
0139 #define HDMI_CORE_AV_AVI_VERS           0x104
0140 #define HDMI_CORE_AV_AVI_LEN            0x108
0141 #define HDMI_CORE_AV_AVI_CHSUM          0x10C
0142 #define HDMI_CORE_AV_AVI_DBYTE(n)       (n * 4 + 0x110)
0143 #define HDMI_CORE_AV_SPD_TYPE           0x180
0144 #define HDMI_CORE_AV_SPD_VERS           0x184
0145 #define HDMI_CORE_AV_SPD_LEN            0x188
0146 #define HDMI_CORE_AV_SPD_CHSUM          0x18C
0147 #define HDMI_CORE_AV_SPD_DBYTE(n)       (n * 4 + 0x190)
0148 #define HDMI_CORE_AV_AUDIO_TYPE         0x200
0149 #define HDMI_CORE_AV_AUDIO_VERS         0x204
0150 #define HDMI_CORE_AV_AUDIO_LEN          0x208
0151 #define HDMI_CORE_AV_AUDIO_CHSUM        0x20C
0152 #define HDMI_CORE_AV_AUD_DBYTE(n)       (n * 4 + 0x210)
0153 #define HDMI_CORE_AV_MPEG_TYPE          0x280
0154 #define HDMI_CORE_AV_MPEG_VERS          0x284
0155 #define HDMI_CORE_AV_MPEG_LEN           0x288
0156 #define HDMI_CORE_AV_MPEG_CHSUM         0x28C
0157 #define HDMI_CORE_AV_MPEG_DBYTE(n)      (n * 4 + 0x290)
0158 #define HDMI_CORE_AV_GEN_DBYTE(n)       (n * 4 + 0x300)
0159 #define HDMI_CORE_AV_CP_BYTE1           0x37C
0160 #define HDMI_CORE_AV_GEN2_DBYTE(n)      (n * 4 + 0x380)
0161 #define HDMI_CORE_AV_CEC_ADDR_ID        0x3FC
0162 
0163 #define HDMI_CORE_AV_SPD_DBYTE_ELSIZE       0x4
0164 #define HDMI_CORE_AV_GEN2_DBYTE_ELSIZE      0x4
0165 #define HDMI_CORE_AV_MPEG_DBYTE_ELSIZE      0x4
0166 #define HDMI_CORE_AV_GEN_DBYTE_ELSIZE       0x4
0167 
0168 #define HDMI_CORE_AV_AVI_DBYTE_NELEMS       15
0169 #define HDMI_CORE_AV_SPD_DBYTE_NELEMS       27
0170 #define HDMI_CORE_AV_AUD_DBYTE_NELEMS       10
0171 #define HDMI_CORE_AV_MPEG_DBYTE_NELEMS      27
0172 #define HDMI_CORE_AV_GEN_DBYTE_NELEMS       31
0173 #define HDMI_CORE_AV_GEN2_DBYTE_NELEMS      31
0174 
0175 enum hdmi_core_inputbus_width {
0176     HDMI_INPUT_8BIT = 0,
0177     HDMI_INPUT_10BIT = 1,
0178     HDMI_INPUT_12BIT = 2
0179 };
0180 
0181 enum hdmi_core_dither_trunc {
0182     HDMI_OUTPUTTRUNCATION_8BIT = 0,
0183     HDMI_OUTPUTTRUNCATION_10BIT = 1,
0184     HDMI_OUTPUTTRUNCATION_12BIT = 2,
0185     HDMI_OUTPUTDITHER_8BIT = 3,
0186     HDMI_OUTPUTDITHER_10BIT = 4,
0187     HDMI_OUTPUTDITHER_12BIT = 5
0188 };
0189 
0190 enum hdmi_core_deepcolor_ed {
0191     HDMI_DEEPCOLORPACKECTDISABLE = 0,
0192     HDMI_DEEPCOLORPACKECTENABLE = 1
0193 };
0194 
0195 enum hdmi_core_packet_mode {
0196     HDMI_PACKETMODERESERVEDVALUE = 0,
0197     HDMI_PACKETMODE24BITPERPIXEL = 4,
0198     HDMI_PACKETMODE30BITPERPIXEL = 5,
0199     HDMI_PACKETMODE36BITPERPIXEL = 6,
0200     HDMI_PACKETMODE48BITPERPIXEL = 7
0201 };
0202 
0203 enum hdmi_core_tclkselclkmult {
0204     HDMI_FPLL05IDCK = 0,
0205     HDMI_FPLL10IDCK = 1,
0206     HDMI_FPLL20IDCK = 2,
0207     HDMI_FPLL40IDCK = 3
0208 };
0209 
0210 enum hdmi_core_packet_ctrl {
0211     HDMI_PACKETENABLE = 1,
0212     HDMI_PACKETDISABLE = 0,
0213     HDMI_PACKETREPEATON = 1,
0214     HDMI_PACKETREPEATOFF = 0
0215 };
0216 
0217 enum hdmi_audio_i2s_config {
0218     HDMI_AUDIO_I2S_MSB_SHIFTED_FIRST = 0,
0219     HDMI_AUDIO_I2S_LSB_SHIFTED_FIRST = 1,
0220     HDMI_AUDIO_I2S_SCK_EDGE_FALLING = 0,
0221     HDMI_AUDIO_I2S_SCK_EDGE_RISING = 1,
0222     HDMI_AUDIO_I2S_VBIT_FOR_PCM = 0,
0223     HDMI_AUDIO_I2S_VBIT_FOR_COMPRESSED = 1,
0224     HDMI_AUDIO_I2S_FIRST_BIT_SHIFT = 0,
0225     HDMI_AUDIO_I2S_FIRST_BIT_NO_SHIFT = 1,
0226     HDMI_AUDIO_I2S_SD0_EN = 1,
0227     HDMI_AUDIO_I2S_SD1_EN = 1 << 1,
0228     HDMI_AUDIO_I2S_SD2_EN = 1 << 2,
0229     HDMI_AUDIO_I2S_SD3_EN = 1 << 3,
0230 };
0231 
0232 struct hdmi_core_video_config {
0233     enum hdmi_core_inputbus_width   ip_bus_width;
0234     enum hdmi_core_dither_trunc op_dither_truc;
0235     enum hdmi_core_deepcolor_ed deep_color_pkt;
0236     enum hdmi_core_packet_mode  pkt_mode;
0237     enum hdmi_core_hdmi_dvi     hdmi_dvi;
0238     enum hdmi_core_tclkselclkmult   tclk_sel_clkmult;
0239 };
0240 
0241 struct hdmi_core_packet_enable_repeat {
0242     u32 audio_pkt;
0243     u32 audio_pkt_repeat;
0244     u32 avi_infoframe;
0245     u32 avi_infoframe_repeat;
0246     u32 gen_cntrl_pkt;
0247     u32 gen_cntrl_pkt_repeat;
0248     u32 generic_pkt;
0249     u32 generic_pkt_repeat;
0250 };
0251 
0252 int hdmi4_core_ddc_init(struct hdmi_core_data *core);
0253 int hdmi4_core_ddc_read(void *data, u8 *buf, unsigned int block, size_t len);
0254 
0255 void hdmi4_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
0256         struct hdmi_config *cfg);
0257 void hdmi4_core_dump(struct hdmi_core_data *core, struct seq_file *s);
0258 int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core);
0259 
0260 int hdmi4_core_enable(struct hdmi_core_data *core);
0261 void hdmi4_core_disable(struct hdmi_core_data *core);
0262 void hdmi4_core_powerdown_disable(struct hdmi_core_data *core);
0263 
0264 int hdmi4_audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
0265 void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
0266 int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
0267         struct omap_dss_audio *audio, u32 pclk);
0268 #endif