jernej Posted November 10, 2016 Posted November 10, 2016 I managed to write H3 HDMI driver for mainline U-Boot. Source can be found here: https://github.com/jernejsk/u-boot You should also add CONFIG_VIDEO=y to defconfig for your board. It should work nicely for standard resolutions (720p, 1080p). Other resolutions might work, but some additional work needs to be done. Currently, this can be used for working with U-Boot (instead of serial console) or splash screen. 5
zador.blood.stained Posted November 10, 2016 Posted November 10, 2016 Had to do this also to force video driver compilation: diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 68443c9..b10f3a1 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -431,7 +431,7 @@ config AXP_GPIO config VIDEO bool "Enable graphical uboot console on HDMI, LCD or VGA" - depends on !MACH_SUN8I_A83T && !MACH_SUN8I_H3 && !MACH_SUN9I && !MACH_SUN50I + depends on !MACH_SUN8I_A83T && !MACH_SUN9I && !MACH_SUN50I default y ---help--- Say Y here to add support for using a cfb console on the HDMI, LCD and as a result I'm getting white screen with little noise of different colored pixels. I squashed your patches to one and compiled u-boot 2016.09.01 (Armbian default) HDMI connected: Setting up a 1920x1080 hdmi console (overscan 0x0) dotclock: 148500kHz = 148500kHz: (3MHz * 99) / 2 hdmi enabled In: serial Out: vga Err: vga Net: phy interface7 eth0: ethernet@1c30000 Hit any key to stop autoboot: 0
zador.blood.stained Posted November 10, 2016 Posted November 10, 2016 This above happened on Opi+2E (2GB RAM), I tested this on Opi PC (1GB RAM) and there it works fine.
jernej Posted November 10, 2016 Author Posted November 10, 2016 Thanks for testing! Probably framebuffer memory is reserved in wrong part of the RAM, shouldn't be hard to fix. I guess that latest U-Boot RC version has changes in Kconfig. Code in repo works as it is.
zador.blood.stained Posted November 10, 2016 Posted November 10, 2016 Probably the same issue (or something close) affects r3p0 mali driver on H3. IMO you can ask @ssvb, he should know what needs to be changed. I guess that latest U-Boot RC version has changes in Kconfig. Code in repo works as it is. Don't know. This piece is still in Kconfig in 2016.11-rc3 and IMO this condition should be removed.
jernej Posted November 10, 2016 Author Posted November 10, 2016 I pushed possible fix for non standard resolutions and also fixed that Kconfig setting. I will now investigate Plus2E issue. 1
jernej Posted November 10, 2016 Author Posted November 10, 2016 Probably the same issue (or something close) affects r3p0 mali driver on H3. IMO you can ask @ssvb, he should know what needs to be changed. Well, it could be that the issue is the same. I fixed my U-Boot driver. It seems that we shouldn't adjust addresses at all. Hm... I should test that also with One or Lite, but currently I don't have such board at hand. Do you? 1
zador.blood.stained Posted November 11, 2016 Posted November 11, 2016 I have both One and Lite, I'll test on one of these today.
zador.blood.stained Posted November 11, 2016 Posted November 11, 2016 Tested with all 3 possible DRAM sizes, works fine.
zador.blood.stained Posted November 11, 2016 Posted November 11, 2016 Well, it could be that the issue is the same. Apparently I just fixed Mali issue by setting PHYS_OFFSET cpu_usage_adjust to 0 2
jernej Posted November 11, 2016 Author Posted November 11, 2016 Can you please test also on 1280x1024 display? Please provide serial output of U-Boot.
zador.blood.stained Posted November 11, 2016 Posted November 11, 2016 Works for me U-Boot 2016.09.01-armbian (Nov 11 2016 - 15:23:04 +0300) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi Plus 2E I2C: ready DRAM: 2 GiB MMC: SUNXI SD/MMC: 0, SUNXI SD/MMC: 1 MMC: no card present *** Warning - MMC init failed, using default environment HDMI connected: Setting up a 1280x1024 hdmi console (overscan 0x0) dotclock: 108000kHz = 108000kHz: (24MHz * 9) / 1 / 2 HDMI PHY divider: 2 pixel_clk: 108000000 pixel_repeat: false x_res: 1280 y_res: 1024 hor_back_porch: 248 hor_front_porch: 48 hor_sync_time: 112 ver_back_porch: 38 ver_front_porch: 1 ver_sync_time: 3 hor_sync_polarity: true ver_sync_polarity: true b_interlace: false hdmi enabled In: serial Out: vga Err: vga Net: phy interface7 eth0: ethernet@1c30000 Hit any key to stop autoboot: 0 Edit: Works without HDMI cable attached too (I'm reading IRC logs) U-Boot 2016.09.01-armbian (Nov 11 2016 - 15:23:04 +0300) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi Plus 2E I2C: ready DRAM: 2 GiB MMC: SUNXI SD/MMC: 0, SUNXI SD/MMC: 1 MMC: no card present *** Warning - MMC init failed, using default environment In: serial Out: serial Err: serial Net: phy interface7 eth0: ethernet@1c30000 Hit any key to stop autoboot: 0 1
jernej Posted November 16, 2016 Author Posted November 16, 2016 I cleaned up driver a bit and another test would be welcomed. Uh, another reason why this driver can be used is boot selection menu, grub style, albeit more simpler. Dual boot (or more), in simpler terms.
zador.blood.stained Posted November 16, 2016 Posted November 16, 2016 I cleaned up driver a bit and another test would be welcomed. Quick test on OPi Plus2e and OPi PC. Framebuffer configuration (or something else) looks wrong to me both on 1080p and 1280x1024 - image is present only on bottom half of the screen and small tux logo stays at the center of the screen with both resolutions.
jernej Posted November 16, 2016 Author Posted November 16, 2016 Quick test on OPi Plus2e and OPi PC. Framebuffer configuration (or something else) looks wrong to me both on 1080p and 1280x1024 - image is present only on bottom half of the screen and small tux logo stays at the center of the screen with both resolutions. This sounds more like "splashpos=m,m" present in u-boot environment along with CONFIG_SPLASH_SCREEN_ALIGN enabled at compile time. Do you have by any chance Armbian splash patch enabled?
zador.blood.stained Posted November 16, 2016 Posted November 16, 2016 This sounds more like "splashpos=m,m" present in u-boot environment along with CONFIG_SPLASH_SCREEN_ALIGN enabled at compile time. Do you have by any chance Armbian splash patch enabled? Hm. Yes, Igor enabled splash patch after first version of this HDMI driver was added. So nevermind, it's not a bug but a feature. + "splashpos=m,m\0" \ + "splashimage=66000000\0" \ + "loadsplash=ext4load mmc 0 ${splashimage} /boot/boot.bmp || fatload mmc 0 ${splashimage} boot.bmp; bmp d ${splashimage}\0" \
jernej Posted November 28, 2016 Author Posted November 28, 2016 I make some additional changes like disabling HDCP. @igor, can you please test if latest commit fixes issue with 4K monitor?
Igor Posted November 29, 2016 Posted November 29, 2016 Nope, no changes. HDMI connected: Error need 32400kB for fb, but only 16384kB is reserved BTW: which commit - is it inside lib patches yet?
zador.blood.stained Posted November 29, 2016 Posted November 29, 2016 BTW: which commit - is it inside lib patches yet? No, you need to compile @jernej's branch from scratch
Igor Posted November 29, 2016 Posted November 29, 2016 Yap, no change for 4k monitors. U-Boot 2016.11-rc2-armbian (Nov 29 2016 - 11:45:31 +0100) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi PC Plus I2C: ready DRAM: 1 GiB MMC: SUNXI SD/MMC: 1, SUNXI SD/MMC: 0 *** Warning - bad CRC, using default environment HDMI connected: Error need 32400kB for fb, but only 16384kB is reserved In: serial Out: serial Err: serial Net: phy interface0 eth0: ethernet@1c30000 Hit any key to stop autoboot: 0 switch to partitions #0, OK mmc0(part 0) is current device Scanning mmc 0:1...
jernej Posted November 29, 2016 Author Posted November 29, 2016 Uh, sorry, I forgot to update max framebuffer size. Can you please test again my U-Boot branch? Simple FEL boot should suffice.
Igor Posted November 30, 2016 Posted November 30, 2016 It works now in UHD resolution, its a bit hard to read the tiny text, but doable. Logo is in the center, all fine. U-Boot SPL 2016.11-rc2-armbian (Nov 30 2016 - 06:11:14) DRAM: 1024 MiB Trying to boot from MMC2 U-Boot 2016.11-rc2-armbian (Nov 30 2016 - 06:11:14 +0100) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi PC Plus I2C: ready DRAM: 1 GiB MMC: SUNXI SD/MMC: 1, SUNXI SD/MMC: 0 *** Warning - bad CRC, using default environment HDMI connected: Setting up a 3840x2160 hdmi console (overscan 0x0) hdmi enabled In: serial Out: vga Err: vga Net: phy interface0 eth0: ethernet@1c30000
jernej Posted November 30, 2016 Author Posted November 30, 2016 It works now in UHD resolution, its a bit hard to read the tiny text, but doable. Logo is in the center, all fine. Excellent. Can you make a picture of it? In the evening I will make a bit more chatty U-Boot so we will hopefully see where the problem lies. After that I can try to fix BSP kernel.
Igor Posted November 30, 2016 Posted November 30, 2016 Excellent. Can you make a picture of it? In the evening I will make a bit more chatty U-Boot so we will hopefully see where the problem lies. After that I can try to fix BSP kernel. Picture / font is as it should be. I am just refereeing to the fact that font is small due to high screen resolution and since I am usually using Picture In Picture mode for 2nd source. This way I got 4k screen cca. @12 inch where u-boot font becomes super tiny small. I failed to made any usable picture, now I left office. I think the best way would be to limit u-boot screen size to 1080p and leave option to force higher with parameter. Such method can than be directly applied to sun4,5,6,7 ... 1
jernej Posted November 30, 2016 Author Posted November 30, 2016 Picture / font is as it should be. I am just refereeing to the fact that font is small due to high screen resolution and since I am usually using Picture In Picture mode for 2nd source. This way I got 4k screen cca. @12 inch where u-boot font becomes super tiny small. I failed to made any usable picture, now I left office. I think the best way would be to limit u-boot screen size to 1080p and leave option to force higher with parameter. Such method can than be directly applied to sun4,5,6,7 ... Nevermind the picture then. Well, while I certainly agree about 1080p limitation for older SoCs, because this is HW limitation, I disagree for newer ones. At least for mainline U-Boot. This functionality is also used for simplefb driver, where it is desirable to have native resolution. But you can always add your own patch a top of mainline.
zador.blood.stained Posted November 30, 2016 Posted November 30, 2016 @jernel Do you know how simplefb driver will interact with DRM driver if we add this patch (in the first message) on top of current branch which has DRM DE2 driver? Is there any way to make simplefb "preferred" over DRM?
jernej Posted November 30, 2016 Author Posted November 30, 2016 Do you know how simplefb driver will interact with DRM driver if we add this patch (in the first message) on top of current branch which has DRM DE2 driver? Is there any way to make simplefb "preferred" over DRM? Unfortunatelly, I don't have full insight in the DRM driver yet. From what I understand, full DRM drivers are preferred against simplefb, so in the process of DRM driver initialization simplefb driver gets disabled. So the only answer I can give you this time is that you can use U-Boot abbility to patch DT and disable DRM driver.
jernej Posted December 1, 2016 Author Posted December 1, 2016 @Igor, what is the status of the 4K on the legacy kernel? I could port same change as it was made for U-Boot.
Igor Posted December 1, 2016 Posted December 1, 2016 The only related problem is how to apply those changes to boards where 4k monitor is attached but are not capable of displaying 4k. H2 (and older AW) will be one of those I think? So far we have only one headless unit ...
Recommended Posts