Skip to contentSkip to conversation

HDMI on Odroid-C4

DISCUSSION Vicente Bergas 2 participants 7 messages Aug 20, 2020 – Aug 31, 2020

lore
Share & tools
lore
#0 lore raw

Hi, i've got an Odroid-C4 and testing u-boot on it but cannot make HDMI work.
U-Boot version is 2020.10-rc2 and configuration is odroid-c4_defconfig.
From the serial port, the 'dm uclass' command reports req -1 for display, video and vidconsole uclasses. Am i missing something or is it supposed to work?

Regards,
Vicente.

#1 lore raw

Hi,

Quoted 4 lines · Vicente Bergas

Hi, i've got an Odroid-C4 and testing u-boot on it but cannot make HDMI work.
U-Boot version is 2020.10-rc2 and configuration is odroid-c4_defconfig.
From the serial port, the 'dm uclass' command reports req -1 for display, video and vidconsole uclasses. Am i missing something or is it supposed to work?

It' supposed to work, could you test with https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/ ?

Neil

Quoted 7 lines

Regards,
Vicente.

#2 lore raw
Quoted 9 lines · Neil Armstrong

Hi,

Quoted 4 lines · Vicente Bergas

Hi, i've got an Odroid-C4 and testing u-boot on it but cannot make HDMI work.
U-Boot version is 2020.10-rc2 and configuration is odroid-c4_defconfig.
From the serial port, the 'dm uclass' command reports req -1 for display, video and vidconsole uclasses. Am i missing something or is it supposed to work?

It' supposed to work, could you test with https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/ ?

Hi Neil,
just tested latest master branch with the aforementioned patch on top of it. It did not work either. When u-boot boots it reports "serial" as the only In/Out/Err means. Below is the boot log. Wich would be the next step in debugging this?

Regards,
Vicente.

SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:F;RCY:0;EMMC:800;NAND:81;SD?:0;SD:0;READ:0;0.0;CHK:0; bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

no sdio debug board detected L0:00000000
L1:00000703
L2:00008067
L3:15000020
S1:00000000
B2:20282000
B1:a0f83180

TE: 295352

BL2 Built : 20:29:41, Jun 18 2019. g12a ga659aac - luan.yuan@droid15-sz

Board ID = 1
Set cpu clk to 24M
Set clk81 to 24M
Use GP1_pll as DSU clk.
DSU clk: 1200 Mhz
CPU clk: 1200 MHz
Set clk81 to 166.6M
DDR driver_vesion: LPDDR4_PHY_V_0_1_15 build time: Jun 18 2019 20:29:37 board id: 1
Load FIP HDR from SD, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0 fw parse done
Load ddrfw from SD, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0 Load ddrfw from SD, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0 PIEI prepare done
fastboot data load
fastboot data verify
verify result: 255
Cfg max: 2, cur: 1. Board id: 255. Force loop cfg
DDR4 probe
ddr clk to 1320MHz
Load ddrfw from SD, src: 0x00014200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0001
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of Write leveling coarse delay
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from SD, src: 0x00020200, des: 0xfffd0000, size: 0x0000c000, part: 0 Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

R0_RxClkDly_Margin==106 ps 9
R0_TxDqDly_Margi==94 ps 8

R1_RxClkDly_Margin==0 ps 0
R1_TxDqDly_Margi==0 ps 0

dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0001

soc_vref_reg_value 0x 0000004d 0000004e 0000004f 0000004d 0000004d 00000050 0000004e 0000004c 0000004d 0000004e 0000004e 0000004d 0000004b 0000004d 00000050 0000004d 0000004d 0000004e 0000004d 0000004f 0000004e 0000004c 0000004d 0000004e 0000004d 0000004e 0000004e 0000004e 0000004c 0000004f 0000004d 0000004e dram_vref_reg_value 0x 00000022 2D training succeed
aml_ddr_fw_vesion: LPDDR4_PHY_V_0_1_15 build time: Jun 18 2019 20:29:43
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 2048MB
DMC_DDR_CTRL: 00700024DDR size: 3928MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 450
result report
boot times 0Enable ddr reg access
Load FIP HDR from SD, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0 Load BL3X from SD, src: 0x00078200, des: 0x01768000, size: 0x00098000, part: 0
bl2z: ptr: 05129330, size: 00001e40
0.0;M3 CHK:0;cm4_sp_mode 0
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12a_v1.1.3386-3b31431 2019-05-21 10:41:54 luan.yuan@droid15-sz] OPS=0x10
ring efuse init
2b 0c 10 00 01 10 10 00 00 09 36 30 43 57 50 50 [0.017354 Inits done] secure task start!
high task start!
low task start!
run into bl31

NOTICE:  BL31: v1.3(release):4fc40b1
NOTICE:  BL31: Built : 15:57:33, May 22 2019
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast

U-Boot 2020.10-rc2-00222-gd584648dad-dirty (Jan 01 1970 - 00:00:00 +0000) odroid-c4

Model: Hardkernel ODROID-C4
SoC:   Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2)
DRAM:  3.8 GiB
MMC:   sd@ffe05000: 0, mmc@ffe07000: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@ff3f0000
Hit any key to stop autoboot:  0 
#3 lore raw

Hi,

Quoted 9 lines · Vicente Bergas
Quoted 8 lines · Neil Armstrong

Hi,

Quoted 4 lines · Vicente Bergas

Hi, i've got an Odroid-C4 and testing u-boot on it but cannot make HDMI work.
U-Boot version is 2020.10-rc2 and configuration is odroid-c4_defconfig.
From the serial port, the 'dm uclass' command reports req -1 for display, video and vidconsole uclasses. Am i missing something or is it supposed to work?

Quoted 6 lines
Quoted 1 line

It' supposed to work, could you test with https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/ ?

Hi Neil,
just tested latest master branch with the aforementioned patch on top of it. It did not work either. When u-boot boots it reports "serial" as the only In/Out/Err means. Below is the boot log. Wich would be the next step in debugging this?

The simplest is to add "#define DEBUG" in include/common.h, boot and look for errors when the display is probing.

Neil

Quoted 125 lines

Regards,
 Vicente.

SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:F;RCY:0;EMMC:800;NAND:81;SD?:0;SD:0;READ:0;0.0;CHK:0; bl2_stage_init 0x01
bl2_stage_init 0x81
hw id: 0x0000 - pwm id 0x01
bl2_stage_init 0xc1
bl2_stage_init 0x02

no sdio debug board detected L0:00000000
L1:00000703
L2:00008067
L3:15000020
S1:00000000
B2:20282000
B1:a0f83180

TE: 295352

BL2 Built : 20:29:41, Jun 18 2019. g12a ga659aac - luan.yuan@droid15-sz

Board ID = 1
Set cpu clk to 24M
Set clk81 to 24M
Use GP1_pll as DSU clk.
DSU clk: 1200 Mhz
CPU clk: 1200 MHz
Set clk81 to 166.6M
DDR driver_vesion: LPDDR4_PHY_V_0_1_15 build time: Jun 18 2019 20:29:37 board id: 1
Load FIP HDR from SD, src: 0x00010200, des: 0xfffd0000, size: 0x00004000, part: 0 fw parse done
Load ddrfw from SD, src: 0x00060200, des: 0xfffd0000, size: 0x0000c000, part: 0 Load ddrfw from SD, src: 0x00038200, des: 0xfffd0000, size: 0x00004000, part: 0 PIEI prepare done
fastboot data load
fastboot data verify
verify result: 255
Cfg max: 2, cur: 1. Board id: 255. Force loop cfg
DDR4 probe
ddr clk to 1320MHz
Load ddrfw from SD, src: 0x00014200, des: 0xfffd0000, size: 0x0000c000, part: 0

dmc_version 0001
Check phy result
INFO : End of initialization
INFO : End of read enable training
INFO : End of fine write leveling
INFO : End of read dq deskew training
INFO : End of MPR read delay center optimization
INFO : End of Write leveling coarse delay
INFO : End of write delay center optimization
INFO : End of read delay center optimization
INFO : End of max read latency training
INFO : Training has run successfully!
1D training succeed
Load ddrfw from SD, src: 0x00020200, des: 0xfffd0000, size: 0x0000c000, part: 0 Check phy result
INFO : End of initialization
INFO : End of 2D read delay Voltage center optimization
INFO : End of 2D write delay Voltage center optimization
INFO : Training has run successfully!

R0_RxClkDly_Margin==106 ps 9
R0_TxDqDly_Margi==94 ps 8

R1_RxClkDly_Margin==0 ps 0
R1_TxDqDly_Margi==0 ps 0

dwc_ddrphy_apb_wr((0<<20)|(2<<16)|(0<<12)|(0xb0):0001
soc_vref_reg_value 0x 0000004d 0000004e 0000004f 0000004d 0000004d 00000050 0000004e 0000004c 0000004d 0000004e 0000004e 0000004d 0000004b 0000004d 00000050 0000004d 0000004d 0000004e 0000004d 0000004f 0000004e 0000004c 0000004d 0000004e 0000004d 0000004e 0000004e 0000004e 0000004c 0000004f 0000004d 0000004e dram_vref_reg_value 0x 00000022 2D training succeed
aml_ddr_fw_vesion: LPDDR4_PHY_V_0_1_15 build time: Jun 18 2019 20:29:43
auto size-- 65535DDR cs0 size: 2048MB
DDR cs1 size: 2048MB
DMC_DDR_CTRL: 00700024DDR size: 3928MB
cs0 DataBus test pass
cs1 DataBus test pass
cs0 AddrBus test pass
cs1 AddrBus test pass

non-sec scramble use zero key
ddr scramble enabled

100bdlr_step_size ps== 450
result report
boot times 0Enable ddr reg access
Load FIP HDR from SD, src: 0x00010200, des: 0x01700000, size: 0x00004000, part: 0 Load BL3X from SD, src: 0x00078200, des: 0x01768000, size: 0x00098000, part: 0
bl2z: ptr: 05129330, size: 00001e40
0.0;M3 CHK:0;cm4_sp_mode 0
MVN_1=0x00000000
MVN_2=0x00000000
[Image: g12a_v1.1.3386-3b31431 2019-05-21 10:41:54 luan.yuan@droid15-sz] OPS=0x10
ring efuse init
2b 0c 10 00 01 10 10 00 00 09 36 30 43 57 50 50 [0.017354 Inits done] secure task start!
high task start!
low task start!
run into bl31
NOTICE:  BL31: v1.3(release):4fc40b1
NOTICE:  BL31: Built : 15:57:33, May 22 2019
NOTICE:  BL31: G12A normal boot!
NOTICE:  BL31: BL33 decompress pass
ERROR:   Error initializing runtime service opteed_fast

U-Boot 2020.10-rc2-00222-gd584648dad-dirty (Jan 01 1970 - 00:00:00 +0000) odroid-c4

Model: Hardkernel ODROID-C4
SoC:   Amlogic Meson SM1 (Unknown) Revision 2b:c (10:2) DRAM:  3.8 GiB
MMC:   sd@ffe05000: 0, mmc@ffe07000: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@ff3f0000
Hit any key to stop autoboot:  0

#4 lore raw
Quoted 6 lines · Neil Armstrong

Hi,

Quoted 1 line · Vicente Bergas

On Monday, August 24, 2020 10:32:52 AM CEST, Neil Armstrong wrote: ...

The simplest is to add "#define DEBUG" in include/common.h, boot and look for errors when the display is probing.

Hi Neil,
thanks for that clue, it helped a lot. Given the errors reported i've been able to make HDMI work after working around two issues. Tested with u-boot v2020.10-rc3.

1.- The EDID read fails. It reports "Not a valid EDID" from common/edid.c:348, called from drivers/video/meson/meson_dw_hdmi.c:194 I've worked-around this using pre_buf from drivers/video/dw_hdmi.c and populating it the the actual EDID of my monitor. This is just a workaround, not a fix.

2.- The function meson_venc_hdmi_supported_mode from drivers/video/meson/meson_venc.c:697 is discarding all modes beyond 1920x1200 which include all the modes with detailed timing information of my monitor. I fixed this increasing the limits to 2560x1440. Another possible solution is to remove the limits. Another possible solution is to go for other resolutions that are supported but there are no detailed timing information in the EDID.

Finally a different issue was with the USB keyboard. To make it work it needs this change on top of
configs: odroid-c4: update for HDMI output background & USB keyboard

configs/odroid-c4_defconfig +0 -0
@@ -12,6 +12,8 @@

CONFIG_DEFAULT_DEVICE_TREE="meson-sm1-odroid-c4"
CONFIG_DEBUG_UART=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_CMD_BDI is not set
@@ -26,6 +28,7 @@
CONFIG_OF_CONTROL=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_MESON_GX=y
CONFIG_PHY_REALTEK=y

Regards,
Vicente.

Quoted 1 line

Neil

#5 lore raw
Quoted 13 lines · Vicente Bergas
Quoted 6 lines · Neil Armstrong

Hi,

Quoted 1 line · Vicente Bergas

On Monday, August 24, 2020 10:32:52 AM CEST, Neil Armstrong wrote: ...

The simplest is to add "#define DEBUG" in include/common.h, boot and look for errors when the display is probing.

Hi Neil,
thanks for that clue, it helped a lot. Given the errors reported i've been able to make HDMI work after working around two issues. Tested with u-boot v2020.10-rc3.

Quoted 5 lines

1.- The EDID read fails. It reports "Not a valid EDID" from common/edid.c:348, called from drivers/video/meson/meson_dw_hdmi.c:194 I've worked-around this using pre_buf from drivers/video/dw_hdmi.c and populating it the the actual EDID of my monitor. This is just a workaround, not a fix.

Point No.1 above is a false alarm. The EDID read works fine.

Quoted 36 lines

2.- The function meson_venc_hdmi_supported_mode from drivers/video/meson/meson_venc.c:697 is discarding all modes beyond 1920x1200 which include all the modes with detailed timing information of my monitor. I fixed this increasing the limits to 2560x1440. Another possible solution is to remove the limits. Another possible solution is to go for other resolutions that are supported but there are no detailed timing information in the EDID.

Finally a different issue was with the USB keyboard. To make it work it needs this change on top of
configs: odroid-c4: update for HDMI output background & USB keyboard

configs/odroid-c4_defconfig +0 -0
@@ -12,6 +12,8 @@

CONFIG_DEFAULT_DEVICE_TREE="meson-sm1-odroid-c4"
CONFIG_DEBUG_UART=y
CONFIG_OF_BOARD_SETUP=y

configs/odroid-c4_defconfig +2 -0
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"

CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_CMD_BDI is not set

configs/odroid-c4_defconfig +0 -0
@@ -26,6 +28,7 @@

CONFIG_OF_CONTROL=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_MESON_GX=y
CONFIG_PHY_REALTEK=y

Regards,
Vicente.

Quoted 1 line

Neil

#6 lore raw
In reply to Vicente Bergas

Hi,

Thanks for debugging.

Quoted 19 lines · Vicente Bergas
Quoted 6 lines · Neil Armstrong

Hi,

Quoted 1 line · Vicente Bergas

On Monday, August 24, 2020 10:32:52 AM CEST, Neil Armstrong wrote: ...

The simplest is to add "#define DEBUG" in include/common.h, boot and look for errors when the display is probing.

Hi Neil,
thanks for that clue, it helped a lot. Given the errors reported i've been able to make HDMI work after working around two issues. Tested with u-boot v2020.10-rc3.

1.- The EDID read fails. It reports "Not a valid EDID" from common/edid.c:348, called from drivers/video/meson/meson_dw_hdmi.c:194 I've worked-around this using pre_buf from drivers/video/dw_hdmi.c and populating it the the actual EDID of my monitor. This is just a workaround, not a fix.

Quoted 7 lines

2.- The function meson_venc_hdmi_supported_mode from drivers/video/meson/meson_venc.c:697 is discarding all modes beyond 1920x1200 which include all the modes with detailed timing information of my monitor. I fixed this increasing the limits to 2560x1440. Another possible solution is to remove the limits. Another possible solution is to go for other resolutions that are supported but there are no detailed timing information in the EDID.

The modes are limited to 1920x1200 because I'm not sure if higher resolutions would be correctly supported in DMT mode.

It's weird your monitor doesn't have at least a standard VESA mode in detailed timings ?

could you share the binary edid ?

Neil

Quoted 30 lines

Finally a different issue was with the USB keyboard. To make it work it needs this change on top of
configs: odroid-c4: update for HDMI output background & USB keyboard

configs/odroid-c4_defconfig +0 -0
@@ -12,6 +12,8 @@

CONFIG_DEFAULT_DEVICE_TREE="meson-sm1-odroid-c4"
CONFIG_DEBUG_UART=y
CONFIG_OF_BOARD_SETUP=y

configs/odroid-c4_defconfig +2 -0
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"

CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_CMD_BDI is not set

configs/odroid-c4_defconfig +0 -0
@@ -26,6 +28,7 @@

CONFIG_OF_CONTROL=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_MESON_GX=y
CONFIG_PHY_REALTEK=y

Regards,
 Vicente.

Quoted 1 line

Neil