Commit 44421e56543241b8e53914534d244d1fd89920a9
1 parent
2795cbf333
Exists in
smarc_8mm-imx_v2019.04_4.19.35_1.1.0
and in
1 other branch
MLK-17638 video: imx8m_hdmi: Checks HDMI FW before enabling video output
Checks whether the HDMI FW is running before initialize the HDMI display. So that for cases like mfgtool and imx-boot image without HDMI FW, the u-boot won't be blocked. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 273b45dd3cf8773462400857c8b48b70bcfe96bb) (cherry picked from commit 5527e5674c438cd7ef7735e2bdef37668d88676b)
Showing 3 changed files with 13 additions and 5 deletions Side-by-side Diff
arch/arm/mach-imx/imx8m/video_common.c
... | ... | @@ -652,6 +652,7 @@ |
652 | 652 | { |
653 | 653 | void *fb; |
654 | 654 | int encoding = 1; |
655 | + int ret; | |
655 | 656 | |
656 | 657 | debug("%s()\n", __func__); |
657 | 658 | |
... | ... | @@ -676,7 +677,11 @@ |
676 | 677 | |
677 | 678 | imx8m_create_color_bar((void *)((uint64_t) fb), &gmode); |
678 | 679 | |
679 | - imx8_hdmi_enable(encoding, &gmode); /* may change gmode */ | |
680 | + ret = imx8_hdmi_enable(encoding, &gmode); /* may change gmode */ | |
681 | + if (ret) { | |
682 | + printf("HDMI enable failed!\n"); | |
683 | + return NULL; | |
684 | + } | |
680 | 685 | |
681 | 686 | /* start dccs */ |
682 | 687 | imx8m_display_init((uint64_t) fb, encoding, &gmode); |
drivers/video/imx/imx8_hdmi.c
... | ... | @@ -166,9 +166,12 @@ |
166 | 166 | cdn_api_init(); |
167 | 167 | debug("CDN_API_Init completed\n"); |
168 | 168 | |
169 | - ret = cdn_api_checkalive_blocking(); | |
169 | + ret = cdn_api_checkalive(); | |
170 | 170 | debug("CDN_API_CheckAlive returned ret = %d\n", ret); |
171 | 171 | |
172 | + if (ret) | |
173 | + return -EPERM; | |
174 | + | |
172 | 175 | ret = cdn_api_general_test_echo_ext_blocking(echo_msg, |
173 | 176 | echo_resp, |
174 | 177 | sizeof(echo_msg), |
... | ... | @@ -244,7 +247,7 @@ |
244 | 247 | return 0; |
245 | 248 | } |
246 | 249 | |
247 | -void imx8_hdmi_enable(int encoding, | |
250 | +int imx8_hdmi_enable(int encoding, | |
248 | 251 | struct video_mode_settings *vms) |
249 | 252 | { |
250 | 253 | int vic = 0; |
... | ... | @@ -261,7 +264,7 @@ |
261 | 264 | vic = 0; /* 480p60 */ |
262 | 265 | |
263 | 266 | imx8_hdmi_set_vic_mode(vic, vms); |
264 | - imx8_hdmi_init(vic, encoding, g_color_depth, use_phy_pixel_clk); | |
267 | + return imx8_hdmi_init(vic, encoding, g_color_depth, use_phy_pixel_clk); | |
265 | 268 | } |
266 | 269 | |
267 | 270 | void imx8_hdmi_disable(void) |
include/imx8_hdmi.h
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | #ifndef __IMX8_HDMI_H__ |
8 | 8 | #define __IMX8_HDMI_H__ |
9 | 9 | |
10 | -void imx8_hdmi_enable(int encoding, struct video_mode_settings *vms); | |
10 | +int imx8_hdmi_enable(int encoding, struct video_mode_settings *vms); | |
11 | 11 | void imx8_hdmi_disable(void); |
12 | 12 | |
13 | 13 | #endif /* __IMX8_HDMI_H__*/ |