10 #include <soc/addressmap.h>
13 #define BRIDGE_GETHIGHERBYTE(x) ((uint8_t)((x & 0xff00) >> 8))
14 #define BRIDGE_GETLOWERBYTE(x) ((uint8_t)(x & 0x00ff))
17 #define DP_CLK_FUDGE_NUM 10
18 #define DP_CLK_FUDGE_DEN 8
21 #define DP_BRIDGE_DPCD_REV 0x700
22 #define DP_BRIDGE_11 0x00
23 #define DP_BRIDGE_12 0x01
24 #define DP_BRIDGE_13 0x02
25 #define DP_BRIDGE_14 0x03
26 #define DP_BRIDGE_CONFIGURATION_SET 0x10a
27 #define DP_MAX_LINK_RATE 0x001
28 #define DP_MAX_LANE_COUNT 0x002
29 #define DP_SUPPORTED_LINK_RATES 0x010
30 #define DP_MAX_LINK_RATE 0x001
31 #define DP_MAX_SUPPORTED_RATES 8
32 #define DP_LANE_COUNT_MASK 0xf
35 #define DP_LINK_BW_SET 0x100
36 #define DP_LINK_BW_1_62 0x06
37 #define DP_LINK_BW_2_7 0x0a
38 #define DP_LINK_BW_5_4 0x14
40 #define AUX_CMD_SEND 0x1
41 #define MIN_DSI_CLK_FREQ_MHZ 40
42 #define MAX_DSI_CLK_FREQ_MHZ 750
155 0, 1620, 2160, 2430, 2700, 3240, 4320, 5400
160 unsigned int target_reg,
161 unsigned int total_size,
188 for (i = 0; i <
length; i++)
209 for (i = 0; i <
length; i++) {
261 unsigned int rate_per_200khz;
274 for (i = 0; i <
ARRAY_SIZE(sink_rates); i++) {
275 rate_per_200khz = le16_to_cpu(sink_rates[i]);
277 if (!rate_per_200khz)
284 rate_per_200khz * 200)
285 rate_valid[j] =
true;
294 printk(
BIOS_ERR,
"No matching eDP rates in table; falling back\n");
326 stream_bit_rate_mhz = (pixel_clk_hz * bpp) /
MHz;
329 min_req_dsi_clk = stream_bit_rate_mhz / (num_of_lanes * 2);
358 for (dp_rate_idx = i;
361 if (rate_valid[dp_rate_idx])
424 for (i = 0; i < 10; i++) {
#define DIV_ROUND_UP(x, y)
cb_err
coreboot error codes
@ CB_ERR
Generic error code.
@ CB_SUCCESS
Call completed successfully.
#define printk(level,...)
int i2c_write_field(unsigned int bus, uint8_t chip, uint8_t reg, uint8_t data, uint8_t mask, uint8_t shift)
#define DP_BACKLIGHT_MODE_SET
#define DP_AUX_MAX_PAYLOAD_BYTES
#define DP_DISPLAY_CONTROL_REGISTER
bool dp_aux_request_is_write(enum aux_request request)
#define DP_BACKLIGHT_BRIGHTNESS_MSB
enum i2c_over_aux dp_get_aux_cmd(enum aux_request request, uint32_t remaining_after_this)
#define DP_BACKLIGHT_ENABLE
#define DP_BACKLIGHT_CONTROL_MODE_DPCD
static struct tpm_chip chip
static int i2c_writeb(unsigned int bus, uint8_t slave, uint8_t reg, uint8_t data)
Write a byte with one segment in one frame.
static int i2c_readb(unsigned int bus, uint8_t slave, uint8_t reg, uint8_t *data)
Read a byte with two segments in one frame.
int decode_edid(unsigned char *edid, int size, struct edid *out)
#define wait_ms(timeout_ms, condition)
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
static void sn65dsi86_bridge_set_dp_clock_range(uint8_t bus, uint8_t chip, struct edid *edid, uint32_t num_of_lanes)
#define BRIDGE_GETLOWERBYTE(x)
#define DP_LANE_COUNT_MASK
static void sn65dsi86_bridge_assr_config(uint8_t bus, uint8_t chip, int enable)
static void sn65dsi86_bridge_valid_dp_rates(uint8_t bus, uint8_t chip, bool rate_valid[])
@ SYMBOL_ERR_RATE_MEASUREMENT_PATTERN
@ HBR2_COMPLIANCE_EYE_PATTERN
@ SEMI_AUTO_LINK_TRAINING
@ REDRIVER_SEMI_AUTO_LINK_TRAINING
void sn65dsi86_backlight_enable(uint8_t bus, uint8_t chip)
static const unsigned int sn65dsi86_bridge_dp_rate_lut[]
#define DP_BRIDGE_DPCD_REV
static void sn65dsi86_bridge_link_training(uint8_t bus, uint8_t chip)
@ SN_CHA_VERTICAL_FRONT_PORCH_REG
@ SN_CHA_HORIZONTAL_FRONT_PORCH_REG
@ SN_CHA_VSYNC_PULSE_WIDTH_HIGH_REG
@ SN_CHA_HORIZONTAL_BACK_PORCH_REG
@ SN_CHA_ACTIVE_LINE_LENGTH_LOW_REG
@ SN_CHA_HSYNC_PULSE_WIDTH_HIGH_REG
@ SN_CHA_ACTIVE_LINE_LENGTH_HIGH_REG
@ SN_CHA_VERTICAL_DISPLAY_SIZE_LOW_REG
@ SN_CHA_VERTICAL_BACK_PORCH_REG
@ SN_CHA_VSYNC_PULSE_WIDTH_LOW_REG
@ SN_CHA_HSYNC_PULSE_WIDTH_LOW_REG
@ SN_CHA_VERTICAL_DISPLAY_SIZE_HIGH_REG
#define DP_SUPPORTED_LINK_RATES
static enum cb_err sn65dsi86_bridge_aux_request(uint8_t bus, uint8_t chip, unsigned int target_reg, unsigned int total_size, enum aux_request request, uint8_t *data)
#define DP_BRIDGE_CONFIGURATION_SET
void sn65dsi86_bridge_init(uint8_t bus, uint8_t chip, enum dp_pll_clk_src ref_clk)
void sn65dsi86_bridge_configure(uint8_t bus, uint8_t chip, struct edid *edid, uint32_t num_of_lanes, uint32_t dsi_bpp)
#define DP_MAX_SUPPORTED_RATES
static void sn65dsi86_bridge_set_dsi_clock_range(uint8_t bus, uint8_t chip, struct edid *edid, uint32_t num_of_lanes, uint32_t bpp)
static void sn65dsi86_bridge_set_bridge_active_timing(uint8_t bus, uint8_t chip, struct edid *edid)
enum cb_err sn65dsi86_bridge_read_edid(uint8_t bus, uint8_t chip, struct edid *out)
#define MIN_DSI_CLK_FREQ_MHZ
#define DP_MAX_LANE_COUNT
#define MAX_DSI_CLK_FREQ_MHZ
static int sn65dsi86_bridge_dp_lane_config(uint8_t bus, uint8_t chip)
#define BRIDGE_GETHIGHERBYTE(x)
unsigned long long uint64_t