![]() |
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 <device/device.h>
#include <edid.h>
#include <gpio.h>
#include <string.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
#include <soc/display.h>
#include <soc/mipi.h>
#include <soc/soc.h>
#include <types.h>
#include <timer.h>
Go to the source code of this file.
Variables | |
static struct rk_mipi_dsi | rk_mipi [2] |
static const struct dphy_pll_parameter_map | dppa_map [] |
|
inlinestatic |
Definition at line 123 of file mipi.c.
References DIV_ROUND_UP, rk_mipi_dsi::lane_bps, and NSECS_PER_SEC.
Referenced by rk_mipi_dsi_phy_init().
|
inlinestatic |
Definition at line 117 of file mipi.c.
References DIV_ROUND_UP, rk_mipi_dsi::lane_bps, and NSECS_PER_SEC.
Referenced by rk_mipi_dsi_phy_init().
|
static |
Definition at line 79 of file mipi.c.
References ARRAY_SIZE, dppa_map, and dphy_pll_parameter_map::max_mbps.
Referenced by rk_mipi_dsi_phy_init().
|
inlinestatic |
Definition at line 257 of file mipi.c.
References MIPI_DSI_FMT_RGB565, MIPI_DSI_FMT_RGB666, MIPI_DSI_FMT_RGB666_PACKED, and MIPI_DSI_FMT_RGB888.
Referenced by rk_mipi_dsi_get_lane_bps().
|
static |
Definition at line 537 of file mipi.c.
References rk_mipi_regs::dsi_cmd_pkt_status, rk_mipi_dsi::mipi_regs, read32(), stopwatch_expired(), stopwatch_init_msecs_expire(), and val.
Referenced by rk_mipi_dsi_dci_long_write(), and rk_mipi_dsi_gen_pkt_hdr_write().
|
static |
Definition at line 482 of file mipi.c.
References rk_mipi_regs::dsi_int_msk0, rk_mipi_regs::dsi_int_msk1, rk_mipi_regs::dsi_int_st0, rk_mipi_regs::dsi_int_st1, rk_mipi_dsi::mipi_regs, read32(), and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 411 of file mipi.c.
References CMD_MODE_ALL_LP, rk_mipi_regs::dsi_bta_to_cnt, rk_mipi_regs::dsi_cmd_mode_cfg, rk_mipi_regs::dsi_mode_cfg, rk_mipi_regs::dsi_to_cnt_cfg, ENABLE_CMD_MODE, HSTX_TO_CNT, LPRX_TO_CNT, rk_mipi_dsi::mipi_regs, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 588 of file mipi.c.
References BIOS_ERR, rk_mipi_regs::dsi_gen_pld_data, GEN_PLD_W_FULL, memcpy(), rk_mipi_dsi::mipi_regs, printk, rk_mipi_dsi_check_fifo(), and write32().
Referenced by rk_mipi_dsi_write().
|
static |
Definition at line 577 of file mipi.c.
References GEN_HDATA, GEN_HTYPE, MIPI_DSI_DCS_SHORT_WRITE, rk_mipi_dsi_gen_pkt_hdr_write(), rk_mipi_message_config(), and val.
Referenced by rk_mipi_prepare().
|
static |
Definition at line 490 of file mipi.c.
References rk_mipi_regs::dsi_phy_if_cfg, rk_mipi_dsi::lanes, rk_mipi_dsi::mipi_regs, N_LANES, PHY_STOP_WAIT_TIME, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 468 of file mipi.c.
References rk_mipi_regs::dsi_phy_tmr_cfg, rk_mipi_regs::dsi_phy_tmr_lpclk_cfg, MAX_RD_TIME, rk_mipi_dsi::mipi_regs, PHY_CLKHS2LP_TIME, PHY_CLKLP2HS_TIME, PHY_HS2LP_TIME, PHY_LP2HS_TIME, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 357 of file mipi.c.
References DPI_COLOR_CODING_16BIT_1, DPI_COLOR_CODING_18BIT_1, DPI_COLOR_CODING_18BIT_2, DPI_COLOR_CODING_24BIT, rk_mipi_regs::dsi_dpi_cfg_pol, rk_mipi_regs::dsi_dpi_color_coding, rk_mipi_regs::dsi_dpi_lp_cmd_tim, rk_mipi_regs::dsi_dpi_vcid, EN18_LOOSELY, rk_mipi_dsi::format, INVACT_LPCMD_TIME, MIPI_DSI_FMT_RGB565, MIPI_DSI_FMT_RGB666, MIPI_DSI_FMT_RGB666_PACKED, MIPI_DSI_FMT_RGB888, rk_mipi_dsi::mipi_regs, OUTVACT_LPCMD_TIME, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 552 of file mipi.c.
References BIOS_ERR, rk_mipi_regs::dsi_cmd_pkt_status, rk_mipi_regs::dsi_gen_hdr, GEN_CMD_EMPTY, GEN_CMD_FULL, GEN_PLD_W_EMPTY, mask, rk_mipi_dsi::mipi_regs, printk, read32(), rk_mipi_dsi_check_fifo(), stopwatch_expired(), stopwatch_init_msecs_expire(), val, and write32().
Referenced by rk_mipi_dsi_dcs_cmd(), and rk_mipi_dsi_write().
|
static |
Definition at line 421 of file mipi.c.
References DIV_ROUND_UP, rk_mipi_dsi::lane_bps, edid::mode, MSECS_PER_SEC, and edid_mode::pixel_clock.
Referenced by rk_mipi_dsi_line_timer_config().
|
static |
Definition at line 274 of file mipi.c.
References ABS, ARRAY_SIZE, BIOS_DEBUG, BIOS_ERR, DIV_ROUND_UP, dppa_map, rk_mipi_dsi::feedback_div, rk_mipi_dsi::format, rk_mipi_dsi::input_div, rk_mipi_dsi::lane_bps, mipi_panel_data::lanes, dphy_pll_parameter_map::max_mbps, MHz, mipi_dsi_pixel_format_to_bpp(), edid::mode, MSECS_PER_SEC, OSC_HZ, edid_mode::pixel_clock, and printk.
Referenced by rk_mipi_enable().
|
static |
Definition at line 510 of file mipi.c.
References DIV_ROUND_UP, rk_mipi_regs::dsi_clk_cfg, rk_mipi_regs::dsi_phy_rstz, rk_mipi_regs::dsi_pwr_up, rk_mipi_dsi::lane_bps, rk_mipi_dsi::mipi_regs, PHY_DISABLECLK, PHY_DISFORCEPLL, PHY_RSTZ, PHY_SHUTDOWNZ, RESET, TO_CLK_DIVIDSION, TX_ESC_CLK_DIVIDSION, USECS_PER_SEC, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 434 of file mipi.c.
References rk_mipi_regs::dsi_vid_hbp_time, rk_mipi_regs::dsi_vid_hline_time, rk_mipi_regs::dsi_vid_hsa_time, edid_mode::ha, edid_mode::hbl, edid_mode::hso, edid_mode::hspw, htotal, rk_mipi_dsi::mipi_regs, edid::mode, rk_mipi_dsi_get_hcomponent_lbcc(), and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 385 of file mipi.c.
References rk_mipi_regs::dsi_pckhdl_cfg, EN_BTA, EN_CRC_RX, EN_ECC_RX, rk_mipi_dsi::mipi_regs, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 143 of file mipi.c.
References AFE_BIAS_BANDGAP_ANALOG_PROGRAMMABILITY, BANDGAP_96_10, BANDGAP_AND_BIAS_CONTROL, BANDGAP_ON, BANDGAP_SEL, BIAS_BLOCK_ON, BIASEXTR_127_7, BIASEXTR_SEL, BIOS_DEBUG, BIOS_ERR, BIT, bits_per_ns(), BYPASS_VCO_RANGE, bytes_per_ns(), CP_CURRENT_SEL, CP_PROGRAM_EN, DIV_ROUND_UP, dppa_map, rk_mipi_regs::dsi_phy_rstz, rk_mipi_regs::dsi_phy_status, rk_mipi_regs::dsi_phy_tst_ctrl0, rk_mipi_dsi::feedback_div, HIGH_PROGRAM_EN, HS_RX_CONTROL_OF_LANE_0, HS_TX_CLOCK_LANE_EXIT_STATE_TIME_CONTROL, HS_TX_CLOCK_LANE_HS_ZERO_STATE_TIME_CONTROL, HS_TX_CLOCK_LANE_POST_TIME_CONTROL, HS_TX_CLOCK_LANE_PREPARE_STATE_TIME_CONTROL, HS_TX_CLOCK_LANE_REQUEST_STATE_TIME_CONTROL, HS_TX_CLOCK_LANE_TRAIL_STATE_TIME_CONTROL, HS_TX_DATA_LANE_EXIT_STATE_TIME_CONTROL, HS_TX_DATA_LANE_HS_ZERO_STATE_TIME_CONTROL, HS_TX_DATA_LANE_PREPARE_STATE_TIME_CONTROL, HS_TX_DATA_LANE_REQUEST_STATE_TIME_CONTROL, HS_TX_DATA_LANE_TRAIL_STATE_TIME_CONTROL, HSFREQRANGE_SEL, rk_mipi_dsi::input_div, INPUT_DIVIDER, INTERNAL_REG_CURRENT, rk_mipi_dsi::lane_bps, LEVEL_SHIFTERS_ON, LOOP_DIV_HIGH_SEL, LOOP_DIV_LOW_SEL, LOW_PROGRAM_EN, LPF_PROGRAM_EN, LPF_RESISTORS_SEL, max_mbps_to_parameter(), rk_mipi_dsi::mipi_regs, PHY_ENABLECLK, PHY_ENFORCEPLL, PHY_TESTCLR, PHY_UNRSTZ, PHY_UNSHUTDOWNZ, PHY_UNTESTCLR, PLL_BIAS_CUR_SEL_CAP_VCO_CONTROL, PLL_CP_CONTROL_PLL_LOCK_BYPASS, PLL_INPUT_AND_LOOP_DIVIDER_RATIOS_CONTROL, PLL_INPUT_DIV_EN, PLL_INPUT_DIVIDER_RATIO, PLL_LOOP_DIV_EN, PLL_LOOP_DIVIDER_RATIO, PLL_LPF_AND_CP_CONTROL, POWER_CONTROL, POWER_MANAGE, printk, read32(), REF_BIAS_CUR_SEL, rk_mipi_dsi_phy_write(), rk_mipi_dsi_wait_phy_lock(), SETRD_MAX, STOP_STATE_CLK_LANE, stopwatch_expired(), stopwatch_init_msecs_expire(), TER_CAL_DONE, TER_RESISTOR_HIGH, TER_RESISTOR_LOW, TER_RESISTORS_ON, TERMINATION_RESISTER_CONTROL, THS_PRE_PROGRAM_EN, THS_ZERO_PROGRAM_EN, TLP_PROGRAM_EN, USECS_PER_SEC, val, VCO_IN_CAP_CON_LOW, VCO_RANGE_CON_SEL, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 91 of file mipi.c.
References rk_mipi_regs::dsi_phy_tst_ctrl0, rk_mipi_regs::dsi_phy_tst_ctrl1, rk_mipi_dsi::mipi_regs, PHY_TESTCLK, PHY_TESTDIN, PHY_TESTDOUT, PHY_TESTEN, PHY_UNTESTCLK, PHY_UNTESTCLR, PHY_UNTESTEN, and write32().
Referenced by rk_mipi_dsi_phy_init().
|
static |
Definition at line 496 of file mipi.c.
References rk_mipi_regs::dsi_lpclk_ctrl, rk_mipi_regs::dsi_mode_cfg, rk_mipi_regs::dsi_pwr_up, ENABLE_CMD_MODE, ENABLE_VIDEO_MODE, MIPI_DSI_CMD_MODE, rk_mipi_dsi::mipi_regs, PHY_TXREQUESTCLKHS, POWERUP, RESET, rk_mipi_dsi_video_mode_config(), and write32().
Referenced by rk_mipi_enable(), and rk_mipi_prepare().
|
static |
Definition at line 452 of file mipi.c.
References rk_mipi_regs::dsi_vid_vactive_lines, rk_mipi_regs::dsi_vid_vbp_lines, rk_mipi_regs::dsi_vid_vfp_lines, rk_mipi_regs::dsi_vid_vsa_lines, rk_mipi_dsi::mipi_regs, edid::mode, edid_mode::va, edid_mode::vbl, edid_mode::vso, edid_mode::vspw, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 391 of file mipi.c.
References rk_mipi_regs::dsi_vid_mode_cfg, ENABLE_LOW_POWER, rk_mipi_dsi::mipi_regs, VID_MODE_TYPE_BURST_SYNC_PULSES, and write32().
Referenced by rk_mipi_dsi_set_mode(), and rk_mipi_enable().
|
static |
Definition at line 397 of file mipi.c.
References rk_mipi_regs::dsi_vid_pkt_size, edid_mode::ha, mipi_panel_data::mipi_num, rk_mipi_dsi::mipi_regs, edid::mode, VID_PKT_SIZE, and write32().
Referenced by rk_mipi_enable().
|
static |
Definition at line 27 of file mipi.c.
Referenced by rk_mipi_enable().
|
static |
Definition at line 128 of file mipi.c.
References rk_mipi_regs::dsi_phy_status, LOCK, rk_mipi_dsi::mipi_regs, read32(), stopwatch_expired(), stopwatch_init_msecs_expire(), and val.
Referenced by rk_mipi_dsi_phy_init().
|
static |
Definition at line 617 of file mipi.c.
References BIOS_ERR, buf, die(), GEN_HDATA, GEN_HTYPE, MIPI_DSI_DCS_LONG_WRITE, MIPI_DSI_DCS_SHORT_WRITE, MIPI_DSI_DCS_SHORT_WRITE_PARAM, printk, rk_mipi_dsi_dci_long_write(), rk_mipi_dsi_gen_pkt_hdr_write(), rk_mipi_message_config(), and val.
Referenced by rk_mipi_prepare().
|
static |
Definition at line 651 of file mipi.c.
References MIPI_DSI_CMD_MODE, rk_mipi_dsi_clear_err(), rk_mipi_dsi_command_mode_config(), rk_mipi_dsi_dphy_interface_config(), rk_mipi_dsi_dphy_timing_config(), rk_mipi_dsi_dpi_config(), rk_mipi_dsi_get_lane_bps(), rk_mipi_dsi_init(), rk_mipi_dsi_line_timer_config(), rk_mipi_dsi_packet_handler_config(), rk_mipi_dsi_phy_init(), rk_mipi_dsi_set_mode(), rk_mipi_dsi_vertical_timing_config(), rk_mipi_dsi_video_mode_config(), rk_mipi_dsi_video_packet_config(), and rk_mipi_dsi_wait_for_two_frames().
Referenced by rk_mipi_prepare().
|
static |
Definition at line 531 of file mipi.c.
References CMD_MODE_ALL_LP, rk_mipi_regs::dsi_cmd_mode_cfg, rk_mipi_regs::dsi_lpclk_ctrl, rk_mipi_dsi::mipi_regs, and write32().
Referenced by rk_mipi_dsi_dcs_cmd(), and rk_mipi_dsi_write().
void rk_mipi_prepare | ( | const struct edid * | edid, |
const struct mipi_panel_data * | panel_data | ||
) |
Definition at line 676 of file mipi.c.
References panel_init_command::cmd, mipi_panel_data::display_on_udelay, rk_mipi_dsi::format, mipi_panel_data::format, mipi_panel_data::init_cmd, rk_mipi_dsi::lanes, mipi_panel_data::lanes, panel_init_command::len, MIPI_DCS_EXIT_SLEEP_MODE, MIPI_DCS_NOP, MIPI_DCS_SET_DISPLAY_ON, MIPI_DSI_VID_MODE, mipi_panel_data::mipi_num, rk_mipi, rk_mipi_dsi_dcs_cmd(), rk_mipi_dsi_set_mode(), rk_mipi_dsi_write(), rk_mipi_enable(), udelay(), and mipi_panel_data::video_mode_udelay.
Referenced by rk_display_init().
|
static |
Definition at line 27 of file mipi.c.
Referenced by max_mbps_to_parameter(), rk_mipi_dsi_get_lane_bps(), and rk_mipi_dsi_phy_init().
|
static |
Definition at line 1 of file mipi.c.
Referenced by rk_mipi_prepare().