[BPI-R2] Hdmi in uboot and linux

Please try 1024x768@60 or 1024x768-32@60, see second link that I’ve provided for proper synthax

Not yet, I took overtime at work, so, probably next week.

Unfortunately both will result in this: _20180525_1024

In comparision to rpi the hsync-value is wrong…sorry loaded wrong kernel last time so the fb0 disappeared

[13:32] root@bpi-r2:~# cat /sys/class/graphics/fb0/modes                                                                                                          
U:1024x768p-0                                                                                                                                                     
[13:33] root@bpi-r2:~# fbset -fb /dev/fb0 -g 1024 768 1024 768 32

but no effect

It’s looks strange, horisontal frequency is overclocked. Probably it’s not supported mode. Is there anything useful in dmesg?

I’m not sure about r2, but I’ve tested fbset command on my desktop with Radeon card and it actually changes only terminal size (cols and rows) but not resolution.

not really: dmesg-hdmi.txt (58,2 KB)

also with -32: dmesg-hdmi-32.txt (58,2 KB)

is there a command i can try to set KMS without rebooting and forcing that monitor recognize the change?

also with nomodeset i’m having hsync of 67.x hz, found a documentation where hsync can be set in drm-code: https://www.kernel.org/doc/html/v4.8/gpu/drm-kms.html

activated drm-debug which i have found somewhere: dmesg-hdmi-32-debug.txt (9,3 KB)

IMG_20180525_150914_800 IMG_20180525_151119_640

@Ryder.Lee have you tested these resolutions too? can this be a driver-Problem?

720p seems also not work…at least on my TV. where is the hsync for these KMS-Modes defined? i guess these are wrong for some modes…

i looked through the patches but found no reference to hsync

imho hsync should be set via drm (https://01.org/linuxgraphics/gfx-docs/drm/API-drm-mode-hsync.html)…gets the hsync if set and calculated if not set…maybe we can use printk’s to display it while booting and maybe set it somehow (have not found out how…). i think there have to be a function (maybe drm_mode_probed_add) where we can submit a drm_display_mode ( https://01.org/linuxgraphics/gfx-docs/drm/API-struct-drm-display-mode.html )

maybe i can increase debug-level for this: https://github.com/frank-w/BPI-R2-4.14/blob/4.16-hdmi/drivers/gpu/drm/drm_drv.c (e.g. 0x07 optionally with log_buf_len=1M)

maybe this dir is used to define timings: https://github.com/frank-w/BPI-R2-4.14/tree/4.16-hdmi/Documentation/EDID (800x600 defines 40000hz=40kHz as far as i understand, other modes have no settings)

maybe i can try first with additional modes in video=param like described here https://cgit.freedesktop.org/nouveau/linux-2.6/tree/Documentation/fb/modedb.txt especially ‘M’ and ‘m’ modes

Did you remove theses two lines in dts?

assigned-clocks = <&topckgen CLK_TOP_HDMI_SEL>;

assigned-clock-parents = <&hdmi_phy>;

If so, could you test those resolutions in desktop environment?

I did: https://github.com/frank-w/BPI-R2-4.14/commit/af526fa3b11b6fcd2092626550cde0d1acb6404e

you can look in source on github…I will push all changes there…

You mean running xserver with these resolutions?

Yes, or something like that. I’ve tested 1080P60hz / 1280720p / 720480p before.

ok, will try it when i’m @ home,

have you tried (x)vga-resolutions (1024x768@60,800x600@60, 640x480@60)? if not can you try that and look on HSYNC?

can i add a printk to show calculated HSYNC in dmesg? where can i add it?

with “video=1280x720-32 drm.debug=0x7”

  • no virtual console visible (unsupported mode, my tv did not say more)
  • if i start xserver, it is displayed with 1080p (1920x1080)
  • mode listed from fbdev (only one): [16:58] root@bpi-r2:~# cat /sys/class/graphics/fb0/modes
    U:1280x720p-0
  • drm-log: drm-debug_1280x720-32.txt (25,8 KB)
  • same result without -32 and with @60 (no fbdev-console,xserver in 1080p)
  • i see purple screen on my TV which should be 720p (preloader/uboot)…so my TV supports 720p

720x480@60 seems to work, but screen is cutted (and no screen-justification from tv possible only mode 16:9 & 4:3 & zoom available), xserver here also again 1080p

_20180528_174111

[17:13] root@bpi-r2:~# cat /sys/class/graphics/fb0/modes                                                                                                                       
U:720x480p-0

drm-debug_720x480.txt (121,2 KB)

x-log_720x480.txt (50,4 KB)

i’ve found no /etc/X11/xorg.conf…it seems to be configured on-the-fly

btw. i tried this in uEnv.txt:

video=1280x720-32 drm.debug=0x7
bootopts=vmalloc=496M debug=7 initcall_debug=0 video=${video}

but it seems that ${…} in bootargs don’t get evaluated…anything i can realize that?

Hello, everyone!

My R2’s sd slot has been replaced, so I’m back in buisness!

I’ve made an attempt to port hdmi driver to 4.14 kernel it’s here. In currents state the kernel is able to be compiled, runs, and even detects hdmi, but there are errors. And hdmi don’t work.

4.14-hdmi (37,5 kB)

Looks like i’ve messed up with timers. At least for now all this timers and dts stuff is out of my league. So i need some help or advice from someone skilled, because all i can do looks like throwing darts at a phone book.

P.S. Looks like reboot doesn’t work too.

[ 2144.497906] reboot: Restarting system
[ 2145.501566] Reboot failed -- System halted
1 Like

Hi Frank,

I got both fbdev and Xorg working with “video=1280x720-32 drm.debug=0x7” parameters.

debug_1280x720-32.txt (26,0 kB)

Google Photos Google Photos

Also i’ve tested 1024x768 and 1280x1024 resolutions both are ok with fbdev and Xorg. And 1024x768 is @75Hz refresh rate. (I didn’t checked for 1280x1024)

Btw, looks like on my R2 preloader/uboot purple screens resolution is 1080p

Did you changed anything? Have you seen hsync anywhere?

Have you used 1024x768 over dvi or vga? I tested this and below only with vga-adapter (wich is working with rpi)

Nothing since my last pull request.

It’s 60kHz New photo by Alexander Ryabchenko

It’s hdmi. Recently i got hdmi to VGA adapter, but haven’t yet tested it.

Which timers do you mean? setup_timer => init_timer? The reversed way we’ve done for internal wifi-driver…maybe it helps you on porting

i have only my tv with hdmi-input…one monitor with dvi (1280x1024) and the one with vga (1024x768)

I mean clocks, in general: dts-files, clock drivers in ./drivers/clk/mediatek/* , unless i undestood this stuff, i would not to propertly regognize causes of these problems. For now i’m looking for info, so if someone know what to start from i’ll be very appreciative :slight_smile:

1.The hdmi port is seems to be detected and enabled, but there is no output signal, probably the problem is caused by wrong clock frequency.

  1. there are errors in dmesg like:

     [   41.691319] CPU: 0 PID: 980 Comm: mtk_wmtd Tainted: G           O    4.14.43-bpi-r2-hdmi #9
     [   41.691321] Hardware name: Mediatek Cortex-A7 (Device Tree)
     [   41.691325] task: ddbb3600 task.stack: dcc70000
     [   41.691338] PC is at regulator_set_mode+0x18/0xb4
     [   41.691346] LR is at mtk_wcn_consys_hw_reg_ctrl+0x118/0x68c
     [   41.691350] pc : [<c045f4bc>]    lr : [<c054ea78>]    psr: 60020013
     [   41.691353] sp : dcc71d70  ip : dcc71d98  fp : dcc71d94
     [   41.691356] r10: c1006da0  r9 : 00000001  r8 : 00000001
     [   41.691364] r7 : 00000000  r6 : c0f582f0  r5 : c1049ea8  r4 : c0f9e118
     [   41.691374] r3 : c0e9f3d8  r2 : 00000000  r1 : 00000008  r0 : 00000000
     [   41.691386] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
     [   41.691393] Control: 10c5387d  Table: 9cf1c06a  DAC: 00000051
     [   41.691400] Process mtk_wmtd (pid: 980, stack limit = 0xdcc70218)
     [   41.691409] Stack: (0xdcc71d70 to 0xdcc72000)
     [   41.691426] 1d60:                                     00000002 dcc71d8c dcc71dd4 c0f9e118
     [   41.691437] 1d80: c1049ea8 c0f582f0 dcc71dd4 dcc71d98 c054ea78 c045f4b0 0000007d c0f03ca0
     [   41.691445] 1da0: dcc71e14 de83cb40 00000000 c0f582f0 00000000 c10060ec 00000000 00000000
     [   41.691453] 1dc0: 00000001 c1006da0 dcc71dec dcc71dd8 c054f1a0 c054e96c c0f582dc c0f9e520
     [   41.691461] 1de0: dcc71e04 dcc71df0 c0550f58 c054f15c dcc71eb4 dcc71eb0 dcc71e14 dcc71e08
     [   41.691471] 1e00: c052d8ec c0550ec4 dcc71e24 dcc71e18 c052d9d8 c052d890 dcc71ea4 dcc71e28
     [   41.691496] 1e20: c0529f2c c052d9a0 c0ea3cc0 c0159f6c 00000000 c0148ffc ffffffff 00000001
     [   41.691511] 1e40: 00000000 00000000 c0148ffc c0112c18 c0f00018 ddbb3600 00000000 c0f07380
     [   41.691535] 1e60: dcf61c00 c0f07380 df5a2cc0 ddbb3600 00000000 dcf61c00 c0ea3cc0 ddbb3978
     [   41.691547] 1e80: 00000002 c0a4b830 c10060ec c0c2f508 c0c43bfc c0c31460 dcc71ee4 dcc71ea8
     [   41.691570] 1ea0: c052beec c0529eec 1e6ff000 c0c2f54c 00000000 00000000 dcc71eec c10060ec
     [   41.691585] 1ec0: 00000000 c100669c c1006da0 c0530b34 c1049e78 c10066b8 dcc71f14 dcc71ee8
     [   41.691605] 1ee0: c052c0e0 c052be74 c0530b34 c10066b8 dcc71f34 c1006da0 c1006674 c100669c
     [   41.691624] 1f00: dcc70000 c0530b34 dcc71f24 dcc71f18 c0529e54 c052c090 dcc71f34 dcc71f28
     [   41.691632] 1f20: c0529ea0 c0529e2c dcc71f74 dcc71f38 c0533200 c0529e80 c0c35480 c0c354ec
     [   41.691655] 1f40: c0c354a8 00000000 dcffe59c dcffe580 00000000 dcffe000 dcc70000 c1006674
     [   41.691670] 1f60: dcffe59c dcf23dd0 dcc71fac dcc71f78 c0147600 c053306c 00000000 c0533060
     [   41.691678] 1f80: dcc71fac dcffe000 c01474bc 00000000 00000000 00000000 00000000 00000000
     [   41.691697] 1fa0: 00000000 dcc71fb0 c0108e88 c01474c8 00000000 00000000 00000000 00000000
     [   41.691714] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
     [   41.691721] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
     [   41.691753] [<c045f4bc>] (regulator_set_mode) from [<c054ea78>] (mtk_wcn_consys_hw_reg_ctrl+0x118/0x68c)
     [   41.691768] [<c054ea78>] (mtk_wcn_consys_hw_reg_ctrl) from [<c054f1a0>] (mtk_wcn_consys_hw_pwr_on+0x50/0xc4)
     [   41.691779] [<c054f1a0>] (mtk_wcn_consys_hw_pwr_on) from [<c0550f58>] (wmt_plat_pwr_ctrl+0xa0/0x124)
     [   41.691792] [<c0550f58>] (wmt_plat_pwr_ctrl) from [<c052d8ec>] (wmt_ctrl_hw_pwr_on+0x68/0x88)
     [   41.691814] [<c052d8ec>] (wmt_ctrl_hw_pwr_on) from [<c052d9d8>] (wmt_ctrl+0x44/0xc0)
     [   41.691836] [<c052d9d8>] (wmt_ctrl) from [<c0529f2c>] (wmt_core_ctrl+0x4c/0xcc)
     [   41.691860] [<c0529f2c>] (wmt_core_ctrl) from [<c052beec>] (opfunc_pwr_on+0x84/0x21c)
     [   41.691875] [<c052beec>] (opfunc_pwr_on) from [<c052c0e0>] (opfunc_func_on+0x5c/0x348)
     [   41.691898] [<c052c0e0>] (opfunc_func_on) from [<c0529e54>] (wmt_core_opid_handler+0x34/0x54)
     [   41.691921] [<c0529e54>] (wmt_core_opid_handler) from [<c0529ea0>] (wmt_core_opid+0x2c/0x6c)
     [   41.691941] [<c0529ea0>] (wmt_core_opid) from [<c0533200>] (wmtd_thread+0x1a0/0x254)
     [   41.691961] [<c0533200>] (wmtd_thread) from [<c0147600>] (kthread+0x144/0x174)
     [   41.691983] [<c0147600>] (kthread) from [<c0108e88>] (ret_from_fork+0x14/0x2c)
     [   41.692004] Code: e24cb004 e24dd00c e52de004 e8bd4000 (e5904030) 
     [   41.692029] ---[ end trace b3b93c8cbd6e140d ]---
    
  2. R2 dont reboots on reboot command

    [ 2144.497906] reboot: Restarting system [ 2145.501566] Reboot failed – System halted

seems to be from wifi-driver… consys is the 4-in-1 chip for wifi,bt and other

try to disable the consys-part in defconfig…

CONFIG_MTK_COMBO=y
CONFIG_MTK_COMBO_CHIP_CONSYS_7623=y
CONFIG_MTK_COMBO_COMM=y
CONFIG_MTK_COMBO_WIFI=y
CONFIG_BT=y
CONFIG_MTK_COMBO_BT=y
CONFIG_MTK_COMBO_BT_HCI=y

i don’t know if the wifi-driver was working in 4.14 at time of creating the branch…

sure to remove that?

compatible = "mediatek,mt7623-pinctrl";

Can i set hsync manually anywhere? How? Or at least print calculated value…i have not seen it in drm-logs