coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <device/mmio.h>
#include <console/console.h>
#include <delay.h>
#include <edid.h>
#include <gpio.h>
#include <stdint.h>
#include <soc/addressmap.h>
#include <soc/hdmi.h>
#include <soc/grf.h>
#include <soc/vop.h>
#include <timer.h>
#include "chip.h"
Go to the source code of this file.
Data Structures | |
struct | tmds_n_cts |
struct | hdmi_mpll_config |
struct | hdmi_phy_config |
Macros | |
#define | AUDIO_SAMPLERATE_DEFAULT (48*KHz) |
#define | hdmi_debug(x...) do { if (0) printk(BIOS_DEBUG, x); } while (0) |
Variables | |
struct rk3288_hdmi_regs *const | hdmi_regs = (void *)HDMI_TX_BASE |
static const struct tmds_n_cts | n_cts_table [] |
static const struct hdmi_phy_config | rockchip_phy_config [] |
static const struct hdmi_mpll_config | rockchip_mpll_cfg [] |
static const u32 | csc_coeff_default [3][4] |
#define hdmi_debug | ( | x... | ) | do { if (0) printk(BIOS_DEBUG, x); } while (0) |
Definition at line 593 of file hdmi.c.
References rk3288_hdmi_regs::aud_conf0, rk3288_hdmi_regs::aud_int, rk3288_hdmi_regs::aud_int1, HDMI_AUD_CONF0_SW_AUDIO_FIFO_RST, HDMI_MC_SWRSTZ_II2SSWRST_REQ, hdmi_regs, rk3288_hdmi_regs::mc_swrstz, and write32().
Referenced by hdmi_setup().
Definition at line 581 of file hdmi.c.
References rk3288_hdmi_regs::aud_conf0, rk3288_hdmi_regs::aud_conf1, rk3288_hdmi_regs::aud_conf2, HDMI_AUD_CONF0_I2S_IN_EN_0, HDMI_AUD_CONF0_I2S_SELECT, HDMI_AUD_CONF1_I2S_MODE_STANDARD_MODE, HDMI_AUD_CONF1_I2S_WIDTH_16BIT, hdmi_regs, and write32().
Referenced by hdmi_setup().
Definition at line 176 of file hdmi.c.
References tmds_n_cts::cts, hdmi_debug, hdmi_lookup_n_cts(), hdmi_set_clock_regenerator(), tmds_n_cts::n, and n_cts_table.
Referenced by hdmi_setup().
Definition at line 480 of file hdmi.c.
References rk3288_hdmi_regs::fc_hsyncindelay0, rk3288_hdmi_regs::fc_hsyncindelay1, rk3288_hdmi_regs::fc_hsyncinwidth0, rk3288_hdmi_regs::fc_hsyncinwidth1, rk3288_hdmi_regs::fc_inhactv0, rk3288_hdmi_regs::fc_inhactv1, rk3288_hdmi_regs::fc_inhblank0, rk3288_hdmi_regs::fc_inhblank1, rk3288_hdmi_regs::fc_invactv0, rk3288_hdmi_regs::fc_invactv1, rk3288_hdmi_regs::fc_invblank, rk3288_hdmi_regs::fc_invidconf, rk3288_hdmi_regs::fc_vsyncindelay, rk3288_hdmi_regs::fc_vsyncinwidth, edid_mode::ha, edid_mode::hbl, HDMI_FC_INVIDCONF_DE_IN_POLARITY_ACTIVE_HIGH, HDMI_FC_INVIDCONF_DE_IN_POLARITY_ACTIVE_LOW, HDMI_FC_INVIDCONF_DVI_MODEZ_DVI_MODE, HDMI_FC_INVIDCONF_DVI_MODEZ_HDMI_MODE, HDMI_FC_INVIDCONF_HDCP_KEEPOUT_INACTIVE, HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_HIGH, HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY_ACTIVE_LOW, HDMI_FC_INVIDCONF_IN_I_P_PROGRESSIVE, HDMI_FC_INVIDCONF_R_V_BLANK_IN_OSC_ACTIVE_LOW, HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_HIGH, HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY_ACTIVE_LOW, edid::hdmi_monitor_detected, hdmi_regs, edid_mode::hso, edid_mode::hspw, edid::mode, edid_mode::phsync, edid_mode::pvsync, edid_mode::va, edid_mode::vbl, edid_mode::vso, edid_mode::vspw, and write32().
Referenced by hdmi_setup().
Definition at line 568 of file hdmi.c.
References count, rk3288_hdmi_regs::fc_invidconf, HDMI_MC_SWRSTZ_TMDSSWRST_REQ, hdmi_regs, rk3288_hdmi_regs::mc_swrstz, read32(), val, and write32().
Referenced by hdmi_setup().
Definition at line 708 of file hdmi.c.
References clrsetbits32, HDMI_I2CM_SOFTRSTZ, hdmi_regs, and rk3288_hdmi_regs::i2cm_softrstz.
Referenced by hdmi_read_edid().
|
static |
Definition at line 689 of file hdmi.c.
References hdmi_regs, rk3288_hdmi_regs::ih_i2cm_stat0, read32(), stopwatch_expired(), stopwatch_init_msecs_expire(), udelay(), val, and write32().
Referenced by hdmi_read_edid().
Definition at line 541 of file hdmi.c.
References rk3288_hdmi_regs::fc_ch0pream, rk3288_hdmi_regs::fc_ch1pream, rk3288_hdmi_regs::fc_ch2pream, rk3288_hdmi_regs::fc_ctrldur, rk3288_hdmi_regs::fc_exctrldur, rk3288_hdmi_regs::fc_exctrlspac, HDMI_MC_CLKDIS_AUDCLK_DISABLE, HDMI_MC_CLKDIS_PIXELCLK_DISABLE, HDMI_MC_CLKDIS_TMDSCLK_DISABLE, hdmi_regs, rk3288_hdmi_regs::mc_clkdis, and write32().
Referenced by hdmi_setup().
Definition at line 668 of file hdmi.c.
References HDMI_PHY_HPD, hdmi_regs, rk3288_hdmi_regs::phy_stat0, read32(), and val.
Referenced by hdmi_wait_for_hpd().
Definition at line 630 of file hdmi.c.
References HDMI_IH_MUTE_MUTE_ALL_INTERRUPT, HDMI_IH_MUTE_MUTE_WAKEUP_INTERRUPT, HDMI_IH_PHY_STAT0_HPD, HDMI_PHY_HPD, HDMI_PHY_I2CM_CTLINT_ADDR_ARBITRATION_POL, HDMI_PHY_I2CM_CTLINT_ADDR_NAC_POL, HDMI_PHY_I2CM_INT_ADDR_DONE_POL, hdmi_regs, rk3288_hdmi_regs::i2cm_ctlint, rk3288_hdmi_regs::i2cm_int, rk3288_hdmi_regs::ih_mute, rk3288_hdmi_regs::ih_phy_stat0, rk3288_hdmi_regs::phy_i2cm_ctlint_addr, rk3288_hdmi_regs::phy_i2cm_int_addr, rk3288_hdmi_regs::phy_mask0, read32(), and write32().
Referenced by rk_hdmi_init().
|
static |
Definition at line 162 of file hdmi.c.
References ARRAY_SIZE, and n_cts_table.
Referenced by hdmi_audio_set_samplerate().
|
static |
Definition at line 381 of file hdmi.c.
References HDMI_MC_FLOWCTRL_FEED_THROUGH_OFF_CSC_BYPASS, HDMI_MC_HEACPHY_RST_ASSERT, HDMI_MC_PHYRSTZ_ASSERT, HDMI_MC_PHYRSTZ_DEASSERT, hdmi_phy_enable_power(), hdmi_phy_enable_spare(), hdmi_phy_enable_tmds(), hdmi_phy_gen2_pddq(), hdmi_phy_gen2_txpwron(), hdmi_phy_i2c_write(), HDMI_PHY_I2CM_SLAVE_ADDR_PHY_GEN2, hdmi_phy_test_clear(), HDMI_PHY_TX_PHY_LOCK, hdmi_regs, rk3288_hdmi_regs::mc_flowctrl, rk3288_hdmi_regs::mc_heacphy_rst, rk3288_hdmi_regs::mc_phyrstz, hdmi_mpll_config::mpixelclock, hdmi_phy_config::mpixelclock, PHY_CKCALCTRL, PHY_CKSYMTXCTRL, rk3288_hdmi_regs::phy_i2cm_slave_addr, PHY_OPMODE_PLLCFG, PHY_PLLCLKBISTPHASE, PHY_PLLCURRCTRL, PHY_PLLGMPCTRL, PHY_PLLPHBYCTRL, rk3288_hdmi_regs::phy_stat0, PHY_TXTERM, PHY_VLEVCTRL, read32(), rockchip_mpll_cfg, rockchip_phy_config, stopwatch_expired(), stopwatch_init_msecs_expire(), udelay(), val, and write32().
Referenced by hdmi_phy_init().
Definition at line 337 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_PDZ_MASK, HDMI_PHY_CONF0_PDZ_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_configure(), and hdmi_phy_init().
Definition at line 349 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_SPARECTRL_MASK, HDMI_PHY_CONF0_SPARECTRL_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_configure().
Definition at line 343 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_ENTMDS_MASK, HDMI_PHY_CONF0_ENTMDS_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_configure(), and hdmi_phy_init().
Definition at line 355 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_GEN2_PDDQ_MASK, HDMI_PHY_CONF0_GEN2_PDDQ_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_configure().
Definition at line 361 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_GEN2_TXPWRON_MASK, HDMI_PHY_CONF0_GEN2_TXPWRON_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_configure().
Definition at line 325 of file hdmi.c.
References addr, HDMI_PHY_I2CM_OPERATION_ADDR_WRITE, hdmi_phy_wait_i2c_done(), hdmi_regs, rk3288_hdmi_regs::ih_i2cmphy_stat0, rk3288_hdmi_regs::phy_i2cm_address_addr, rk3288_hdmi_regs::phy_i2cm_datao_0_addr, rk3288_hdmi_regs::phy_i2cm_datao_1_addr, rk3288_hdmi_regs::phy_i2cm_operation_addr, and write32().
Referenced by hdmi_phy_configure().
|
static |
Definition at line 458 of file hdmi.c.
References hdmi_debug, hdmi_phy_configure(), hdmi_phy_enable_power(), hdmi_phy_enable_tmds(), hdmi_phy_sel_data_en_pol(), and hdmi_phy_sel_interface_control().
Referenced by hdmi_setup().
Definition at line 368 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_SELDATAENPOL_MASK, HDMI_PHY_CONF0_SELDATAENPOL_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_init().
Definition at line 375 of file hdmi.c.
References clrsetbits32, HDMI_PHY_CONF0_SELDIPIF_MASK, HDMI_PHY_CONF0_SELDIPIF_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_conf0.
Referenced by hdmi_phy_init().
Definition at line 300 of file hdmi.c.
References clrsetbits32, HDMI_PHY_TST0_TSTCLR_MASK, HDMI_PHY_TST0_TSTCLR_OFFSET, hdmi_regs, and rk3288_hdmi_regs::phy_tst0.
Referenced by hdmi_phy_configure().
|
static |
Definition at line 306 of file hdmi.c.
References hdmi_regs, rk3288_hdmi_regs::ih_i2cmphy_stat0, read32(), stopwatch_expired(), stopwatch_init_msecs_expire(), udelay(), val, and write32().
Referenced by hdmi_phy_i2c_write().
|
static |
Definition at line 714 of file hdmi.c.
References clrsetbits32, hdmi_ddc_reset(), hdmi_ddc_wait_i2c_done(), HDMI_EDID_BLOCK_SIZE, HDMI_I2CM_DIV_FAST_STD_MODE, HDMI_I2CM_DIV_STD_MODE, HDMI_I2CM_OPT_RD8, HDMI_I2CM_OPT_RD8_EXT, HDMI_I2CM_SEGADDR_DDC, HDMI_I2CM_SLAVE_DDC_ADDR, hdmi_regs, rk3288_hdmi_regs::i2cm_buf0, rk3288_hdmi_regs::i2cm_div, rk3288_hdmi_regs::i2cm_operation, rk3288_hdmi_regs::i2cm_segaddr, rk3288_hdmi_regs::i2cm_segptr, rk3288_hdmi_regs::i2cm_slave, rk3288_hdmi_regs::i2cm_ss_scl_hcnt_0_addr, rk3288_hdmi_regs::i2cm_ss_scl_lcnt_0_addr, rk3288_hdmi_regs::i2cmess, read32(), val, and write32().
Referenced by rk_hdmi_get_edid().
Definition at line 133 of file hdmi.c.
References rk3288_hdmi_regs::aud_cts1, rk3288_hdmi_regs::aud_cts2, rk3288_hdmi_regs::aud_cts3, rk3288_hdmi_regs::aud_inputclkfs, rk3288_hdmi_regs::aud_n1, rk3288_hdmi_regs::aud_n2, rk3288_hdmi_regs::aud_n3, HDMI_AUD_CTS3_AUDCTS19_16_MASK, HDMI_AUD_CTS3_CTS_MANUAL, HDMI_AUD_CTS3_N_SHIFT_1, HDMI_AUD_CTS3_N_SHIFT_OFFSET, HDMI_AUD_INPUTCLKFS_128, HDMI_AUD_N3_AUDN19_16_MASK, HDMI_AUD_N3_NCTS_ATOMIC_WRITE, hdmi_regs, and write32().
Referenced by hdmi_audio_set_samplerate().
|
static |
Definition at line 602 of file hdmi.c.
References edid_mode::ha, hdmi_audio_fifo_reset(), hdmi_audio_set_format(), hdmi_audio_set_samplerate(), hdmi_av_composer(), hdmi_clear_overflow(), hdmi_debug, hdmi_enable_video_path(), hdmi_phy_init(), hdmi_video_csc(), hdmi_video_packetize(), hdmi_video_sample(), edid::mode, edid_mode::pixel_clock, and edid_mode::va.
Referenced by rk_hdmi_enable().
Definition at line 223 of file hdmi.c.
References ARRAY_SIZE, clrsetbits32, rk3288_hdmi_regs::csc_coef, csc_coeff_default, rk3288_hdmi_regs::csc_scale, HDMI_CSC_SCALE_CSCSCALE_MASK, hdmi_regs, rk3288_hdmi_regs::lsb, rk3288_hdmi_regs::msb, and write32().
Referenced by hdmi_video_csc().
Definition at line 241 of file hdmi.c.
References clrsetbits32, rk3288_hdmi_regs::csc_cfg, rk3288_hdmi_regs::csc_scale, HDMI_CSC_CFG_INTMODE_DISABLE, HDMI_CSC_SCALE_CSC_COLORDE_PTH_24BPP, HDMI_CSC_SCALE_CSC_COLORDE_PTH_MASK, hdmi_regs, hdmi_update_csc_coeffs(), and write32().
Referenced by hdmi_setup().
Definition at line 254 of file hdmi.c.
References clrsetbits32, hdmi_regs, HDMI_VP_CONF_BYPASS_EN_ENABLE, HDMI_VP_CONF_BYPASS_EN_MASK, HDMI_VP_CONF_BYPASS_SELECT_MASK, HDMI_VP_CONF_BYPASS_SELECT_VID_PACKETIZER, HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS, HDMI_VP_CONF_OUTPUT_SELECTOR_MASK, HDMI_VP_CONF_PP_EN_DISABLE, HDMI_VP_CONF_PP_EN_ENMASK, HDMI_VP_CONF_PR_EN_DISABLE, HDMI_VP_CONF_PR_EN_MASK, HDMI_VP_CONF_YCC422_EN_DISABLE, HDMI_VP_CONF_YCC422_EN_MASK, HDMI_VP_PR_CD_COLOR_DEPTH_MASK, HDMI_VP_PR_CD_COLOR_DEPTH_OFFSET, HDMI_VP_PR_CD_DESIRED_PR_FACTOR_MASK, HDMI_VP_PR_CD_DESIRED_PR_FACTOR_OFFSET, HDMI_VP_REMAP_YCC422_16BIT, HDMI_VP_STUFF_IDEFAULT_PHASE_MASK, HDMI_VP_STUFF_IDEFAULT_PHASE_OFFSET, HDMI_VP_STUFF_PP_STUFFING_MASK, HDMI_VP_STUFF_PP_STUFFING_STUFFING_MODE, HDMI_VP_STUFF_PR_STUFFING_MASK, HDMI_VP_STUFF_PR_STUFFING_STUFFING_MODE, HDMI_VP_STUFF_YCC422_STUFFING_MASK, HDMI_VP_STUFF_YCC422_STUFFING_STUFFING_MODE, val, rk3288_hdmi_regs::vp_conf, rk3288_hdmi_regs::vp_pr_cd, rk3288_hdmi_regs::vp_remap, rk3288_hdmi_regs::vp_stuff, and write32().
Referenced by hdmi_setup().
Definition at line 199 of file hdmi.c.
References hdmi_regs, HDMI_TX_INSTUFFING_BDBDATA_STUFFING_ENABLE, HDMI_TX_INSTUFFING_GYDATA_STUFFING_ENABLE, HDMI_TX_INSTUFFING_RCRDATA_STUFFING_ENABLE, HDMI_TX_INVID0_INTERNAL_DE_GENERATOR_DISABLE, HDMI_TX_INVID0_VIDEO_MAPPING_MASK, HDMI_TX_INVID0_VIDEO_MAPPING_OFFSET, rk3288_hdmi_regs::tx_bcbdata0, rk3288_hdmi_regs::tx_bcbdata1, rk3288_hdmi_regs::tx_gydata0, rk3288_hdmi_regs::tx_gydata1, rk3288_hdmi_regs::tx_instuffing, rk3288_hdmi_regs::tx_invid0, rk3288_hdmi_regs::tx_rcrdata0, rk3288_hdmi_regs::tx_rcrdata1, val, and write32().
Referenced by hdmi_setup().
|
static |
Definition at line 675 of file hdmi.c.
References hdmi_get_plug_in_status(), stopwatch_expired(), stopwatch_init_msecs_expire(), and udelay().
Referenced by rk_hdmi_init().
int rk_hdmi_enable | ( | const struct edid * | edid | ) |
Definition at line 809 of file hdmi.c.
References hdmi_setup().
Referenced by rk_display_init().
int rk_hdmi_get_edid | ( | struct edid * | edid | ) |
Definition at line 765 of file hdmi.c.
References decode_edid(), EDID_CONFORMANT, EDID_MODE_640x480_60Hz, GPIO, gpio_get(), gpio_input_pullup(), gpio_output(), hdmi_debug, HDMI_EDID_BLOCK_SIZE, hdmi_read_edid(), IOMUX_HDMI_EDP_I2C_SCL, IOMUX_HDMI_EDP_I2C_SDA, rk3288_grf_regs::iomux_i2c5scl, rk3288_grf_regs::iomux_i2c5sda, rk3288_grf, set_display_mode(), udelay(), and write32().
Referenced by rk_display_init().
int rk_hdmi_init | ( | u32 | vop_id | ) |
Definition at line 816 of file hdmi.c.
References hdmi_debug, hdmi_init_interrupt(), hdmi_wait_for_hpd(), rk3288_grf, RK_CLRBITS, RK_SETBITS, rk3288_grf_regs::soc_con6, val, and write32().
Referenced by rk_display_init().
|
static |
Definition at line 127 of file hdmi.c.
Referenced by hdmi_update_csc_coeffs().
struct rk3288_hdmi_regs* const hdmi_regs = (void *)HDMI_TX_BASE |
Definition at line 25 of file hdmi.c.
Referenced by hdmi_audio_fifo_reset(), hdmi_audio_set_format(), hdmi_av_composer(), hdmi_clear_overflow(), hdmi_ddc_reset(), hdmi_ddc_wait_i2c_done(), hdmi_enable_video_path(), hdmi_get_plug_in_status(), hdmi_init_interrupt(), hdmi_phy_configure(), hdmi_phy_enable_power(), hdmi_phy_enable_spare(), hdmi_phy_enable_tmds(), hdmi_phy_gen2_pddq(), hdmi_phy_gen2_txpwron(), hdmi_phy_i2c_write(), hdmi_phy_sel_data_en_pol(), hdmi_phy_sel_interface_control(), hdmi_phy_test_clear(), hdmi_phy_wait_i2c_done(), hdmi_read_edid(), hdmi_set_clock_regenerator(), hdmi_update_csc_coeffs(), hdmi_video_csc(), hdmi_video_packetize(), and hdmi_video_sample().
|
static |
Definition at line 25 of file hdmi.c.
Referenced by hdmi_audio_set_samplerate(), and hdmi_lookup_n_cts().
|
static |
Definition at line 25 of file hdmi.c.
Referenced by hdmi_phy_configure().
|
static |
Definition at line 25 of file hdmi.c.
Referenced by hdmi_phy_configure().