diff options
-rw-r--r-- | doc/README.video | 8 | ||||
-rw-r--r-- | drivers/video/sunxi_display.c | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/doc/README.video b/doc/README.video index 2c55d6a..d0a3ad6 100644 --- a/doc/README.video +++ b/doc/README.video @@ -53,6 +53,12 @@ The sunxi u-boot driver supports the following video-mode options: 1: Enabled. Fallback to the lcd / vga / none in that order (if available) Defaults to hpd=1. +- hpd_delay=<int> - How long to wait for the hdmi HPD signal in milliseconds + When the monitor and the board power up at the same time, it may take some + time for the monitor to assert the HPD signal. This configures how long to + wait for the HPD signal before assuming no cable is connected. + Defaults to hpd_delay=500. + - edid=[0|1] - Enable use of DDC + EDID to get monitor info 0: Disabled. 1: Enabled. If valid EDID info was read from the monitor the EDID info will @@ -61,4 +67,4 @@ The sunxi u-boot driver supports the following video-mode options: For example to always use the hdmi connector, even if no cable is inserted, using edid info when available and otherwise initalizing it at 1024x768@60Hz, -use: video-mode=sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1 . +use: "setenv video-mode sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1". diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c index 536e1ca..8241492 100644 --- a/drivers/video/sunxi_display.c +++ b/drivers/video/sunxi_display.c @@ -56,13 +56,13 @@ static int await_completion(u32 *reg, u32 mask, u32 val) return 0; } -static int sunxi_hdmi_hpd_detect(void) +static int sunxi_hdmi_hpd_detect(int hpd_delay) { struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; struct sunxi_hdmi_reg * const hdmi = (struct sunxi_hdmi_reg *)SUNXI_HDMI_BASE; - unsigned long tmo = timer_get_us() + 300000; + unsigned long tmo = timer_get_us() + hpd_delay * 1000; /* Set pll3 to 300MHz */ clock_set_pll3(300000000); @@ -851,7 +851,7 @@ void *video_hw_init(void) struct ctfb_res_modes custom; const char *options; #ifdef CONFIG_VIDEO_HDMI - int ret, hpd, edid; + int ret, hpd, hpd_delay, edid; #endif char mon[16]; char *lcd_mode = CONFIG_VIDEO_LCD_MODE; @@ -867,6 +867,7 @@ void *video_hw_init(void) &sunxi_display.depth, &options); #ifdef CONFIG_VIDEO_HDMI hpd = video_get_option_int(options, "hpd", 1); + hpd_delay = video_get_option_int(options, "hpd_delay", 500); edid = video_get_option_int(options, "edid", 1); sunxi_display.monitor = sunxi_monitor_dvi; #elif defined CONFIG_VIDEO_VGA_VIA_LCD @@ -891,7 +892,7 @@ void *video_hw_init(void) if (sunxi_display.monitor == sunxi_monitor_dvi || sunxi_display.monitor == sunxi_monitor_hdmi) { /* Always call hdp_detect, as it also enables clocks, etc. */ - ret = sunxi_hdmi_hpd_detect(); + ret = sunxi_hdmi_hpd_detect(hpd_delay); if (ret) { printf("HDMI connected: "); if (edid && sunxi_hdmi_edid_get_mode(&custom) == 0) |