Framebuffer Console?

Hi all!

I have tried to enabled the framebuffer console on the Hikey970 but so far I have not been able to get it working. The frame buffer device seems to be working since I can do dd if=/dev/urandom of=/dev/fb0 and see that random output on the screen. Has anyone been able to get that working?

I’m using the following defconfig file: https://github.com/freedrikp/linux/blob/73e2ca3837f655f21789162851cad90ad16d4e3a/arch/arm64/configs/hikey970_defconfig

Thanks!

For Linux Debain / Ubuntu you can try my kernel tree.
The config shouldn’t need changed but i do have NVME Enabled.

git clone https://github.com/Bigcountry907/linux.git -b hikey970-v4.9-Debain-Working

Make sure you use the branch. hikey970-v4.9-Debain-Working

Also this tree is configured to use EDID Helper and the resolution is set at 1920X1080.

You need to put 1920x1080.bin in /firmware/edid
On the hikey970 board.
Get the 1920x1080.bin from here.

Also you need to add this to the end of the grub.cfg commandline.
drm_kms_helper.edid_firmware=edid/1920x1080.bin video=HDMI-A-1:1920x1080@60e consoleblank=0

The grub.cfg is in 2 places and i edit both.
ON THE BOARD /boot/grub/grub.cfg

In boot-hikey970.uefi.img
You have to mount boot-hikey970.uefi.img and then edit grub.cfg in
/boot/grub/grub.cfg

Alternatively you can flash your boot partition with boot-hikey970.uefi.img from here.

The boot image above is for ubuntu 18.04 but should work ok on other installs as long as you have the kernel Image and DTB Named Correctly.

Image-hikey970-v4.9.gz <<-- Yes Use The Gzipped Image
kirin970-hikey970.dtb

To install the kernel modules do.
make INSTALL_MOD_PATH=/mypath/forthemodules/ modules_install

Copy the lib/modules from /mypath/forthemodules/ to the /lib/modules on the board.

Hi Freedrik

If you can dd to /dev/fb0 then you’re almost there.
Possibly there are no tty’s and thus the console cannot start.
Both the kernel config and the kernel commandline require the tty.
commandline needs ‘console=tty1’ and the PTY’s need to be enabled in the kernel.

Hope that helps.

Hi!

I was away from the Hikey970 board I was using for a couple of days. Hence, the late reply.

Adding console=tty1 to the kernel cmdline didn’t help. I don’t understand what changing the kernel tree would help? The framebuffer device seems to be working. Its just the console that isn’t being displayed. I doubt anything relating to the console is differeing between our kernel sources.

My command line is: console=tty1 console=ttyAMA6,115200n8 earlycon root=/dev/sdd12 rootwait rw efi=noruntime consoleblank=0 drm_kms_helper.edid_firmware=edid/1920x1080.bin video=HDMI-A-1:1920x1080@60e

Do you have any ideas of how I would go about debugging this?

Did you add the edid bin file to the hikey970 board?
Your best bet is going to be using this kernel tree to get video working.
Took me a month to get it right.

https://github.com/Bigcountry907/linux.git -b hikey970-Debain-Working

Using that kernel make sure you still copy the 1920x1080.bin to /firmware/edid on the board.

I will put together a zip package for the kernel. You test it and see if your video works. I am sure it will.

You can also clone the kernel tree right to the hikey970 and compile natively.
Then you can make modules_install and make install to be sure the kernel is installed right.

Just make sure that the kernel Image.gz is renamed to match the grub.cfg

Hi Fredrik,
two things: PTY’s are in the kernel config , no need to change the kernel tree. (lot’s of things are not enabled in your kernel.)

CONFIG_UNIX98_PTYS=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y

Having a framebuffer is one thing, having VT consoles is another and there aren’t any in your kernel config.

The thing I don’t understand is that everything is working great on my hikey970 with the kernel i referred to.

I can get a console over Uart on the Usb-C port with the ability to log in and run any commands i like.
On the other hand without logging into a ssh session simply by connecting the hdmi monitor and a usb mouse / keyboard after the hikey970 has fully booted up I get the login prompt on my HDMI monitor. Can type commands and run anything i like or run a desktop with light-dm or sddm.

So what am i missing ? My interpretation of this question is that freedrikp wants to have the hdmi display working properly. Or a console without using ssh. Maybe that is my misinterpretation.

Some things are turned off in my kernel. I intentionally turn off Bluetooth because I hate the Ldisk timeout error. Bluetooth don’t work right and lemaker know it but they choose not to do anything to fix it.

At one time I turned off the VT_Console cause it was causing me issues. Those are easy enough to turn back on. Do you have any other recommended kernel configs that i should turn on?

Sorry! Let me clarify. The HDMI display works and if I use any application that uses the framebuffer device I can see the output on the display so that is not where the problem lies.

I only pointed to the defconfig file so I’m sure there was a lot of options missing there. The CONFIG_UNIX98_PTYS was enabled but not the other three. I will try adding those as well.

This is interesting I added the following kernel options:

CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
CONFIG_VT_HW_CONSOLE_BINDING=y

And now the display doesn’t work…

Any clues in dmesg?

There must be some error or message that gives more insight.

So strange!

I tried you kernel tree with the config file you have saved (https://github.com/janrinze/linux/blob/hikey970-v4.9-jrp/config_debian_hikey970). That worked so now I’m going to try your config with my kernel source.

I don’t see anything obviously wrong in the dmesg, no errors or warnings. It tests different resolutions and it gets OK on several.

Your config also worked with my kernel tree so it must definetely be something different in the configs. I will try to diff them and see if I spot something different.

Now I have gotten it to work.

Seems I need at least one of the following:

CONFIG_DRM_LOAD_EDID_FIRMWARE=y
CONFIG_DRM_CMA_FBDEV_BUFFER_NUM=3
CONFIG_FIRMWARE_EDID=y

That gets the console working.