summaryrefslogtreecommitdiff
path: root/drivers/video/sunxi_display.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-12-28 09:13:21 +0100
committerHans de Goede <hdegoede@redhat.com>2015-01-14 14:56:39 +0100
commit7fad8a98020a0ead8b7bdd5f6b5eaf49b91658b5 (patch)
tree9be5434cca311768081bbbf62b53c3aceae6ae85 /drivers/video/sunxi_display.c
parentd9786d23808fcbc5dd3bd3913b036d42dd48653f (diff)
downloadu-boot-imx-7fad8a98020a0ead8b7bdd5f6b5eaf49b91658b5.zip
u-boot-imx-7fad8a98020a0ead8b7bdd5f6b5eaf49b91658b5.tar.gz
u-boot-imx-7fad8a98020a0ead8b7bdd5f6b5eaf49b91658b5.tar.bz2
sunxi: video: Add a hpd_delay parameter to configure hpd delay
In some extreme cases it may be necessary to wait 1.5 seconds or more for a hpd signal to show up (and be able to read edid info), but we do not want to penalize all headless boots with an extra second boot delay, so add a hpd_delay parameter which can be set through the video-mode env. variable. While at it raise the default from 300ms to 500ms as 300 may very well be too low in many cases. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'drivers/video/sunxi_display.c')
-rw-r--r--drivers/video/sunxi_display.c9
1 files changed, 5 insertions, 4 deletions
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)